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 |
|---|---|---|---|---|---|
alexgorban/models | official/vision/image_classification/resnet_model.py | 1 | 12450 | # 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 |
anoopcs9/samba | python/samba/web_server/__init__.py | 45 | 2675 | # -*- coding: utf-8 -*-
#
# Unix SMB/CIFS implementation.
# Copyright © Jelmer Vernooij <jelmer@samba.org> 2008
#
# Implementation of SWAT that uses WSGI
#
# 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 Fo... | gpl-3.0 |
hfp/tensorflow-xsmm | tensorflow/contrib/tpu/python/tpu/device_assignment.py | 7 | 12535 | # 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 |
blaggacao/OpenUpgrade | addons/l10n_pa/__openerp__.py | 260 | 1737 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 Cubic ERP - Teradata SAC (<http://cubicerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the... | agpl-3.0 |
teltek/edx-platform | common/test/acceptance/pages/studio/overview.py | 4 | 40752 | """
Course Outline page in Studio.
"""
import datetime
from bok_choy.javascript import js_defined, wait_for_js
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise
from selenium.webdriver import ActionChains
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.suppor... | agpl-3.0 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/snowballstemmer/romanian_stemmer.py | 19 | 30431 | # self file was generated automatically by the Snowball to Python interpreter
from .basestemmer import BaseStemmer
from .among import Among
class RomanianStemmer(BaseStemmer):
'''
self class was automatically generated by a Snowball to Python interpreter
It implements the stemming algorithm defined by a ... | gpl-3.0 |
jeanlinux/calibre | src/calibre/ebooks/rtf2xml/table.py | 24 | 20865 | #########################################################################
# #
# #
# copyright 2002 Paul Henry Tremblay #
# ... | gpl-3.0 |
foursquare/pants | contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_thrift_gen_integration.py | 1 | 5014 | # coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import os
from contextlib import contextmanager
from textwrap import dedent
from pants.b... | apache-2.0 |
vijaylbais/boto | boto/vpc/routetable.py | 61 | 4033 | # Copyright (c) 2009-2010 Mitch Garnaat http://garnaat.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, modi... | mit |
hsgr/sunobs | sunobs/settings.py | 4 | 2229 | TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.auth.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.media',
'django.core.context_processors.static',
'django.core.context_processors.tz',
'django.contrib.... | agpl-3.0 |
iguzu/gae-django | django/contrib/comments/forms.py | 10 | 7902 | import time
import datetime
from django import forms
from django.forms.util import ErrorDict
from django.conf import settings
from django.contrib.contenttypes.models import ContentType
from models import Comment
from django.utils.encoding import force_unicode
from django.utils.hashcompat import sha_constructor
from dj... | bsd-3-clause |
francesco-mannella/dmp-esn | parametric/parametric_dmp/bin/tr_datasets/e_cursive_curves_angles_start_none/results/plot.py | 18 | 1043 | #!/usr/bin/env python
import glob
import numpy as np
import matplotlib.pyplot as plt
import os
import sys
pathname = os.path.dirname(sys.argv[0])
if pathname:
os.chdir(pathname)
n_dim = None
trains = []
for fname in glob.glob("tl*"):
t = np.loadtxt(fname)
trains.append(t)
tests = []
for fname in glob... | gpl-2.0 |
fabioz/Pydev | plugins/org.python.pydev.jython/Lib/MimeWriter.py | 315 | 6482 | """Generic MIME writer.
This module defines the class MimeWriter. The MimeWriter class implements
a basic formatter for creating MIME multi-part files. It doesn't seek around
the output file nor does it use large amounts of buffer space. You must write
the parts out in the order that they should occur in the final f... | epl-1.0 |
edgarRd/incubator-airflow | tests/sensors/test_base_sensor.py | 10 | 5164 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
v-iam/azure-sdk-for-python | azure-servicefabric/azure/servicefabric/models/node_transition_progress.py | 2 | 1433 | # 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 ... | mit |
setten/pymatgen | pymatgen/io/abinit/db.py | 8 | 4991 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
"""
Objects and helper function used to store the results in a MongoDb database
"""
from __future__ import division, print_function, unicode_literals
import collections
import copy
from .utils import as_bool
... | mit |
instacart/ahab | examples/nathook.py | 1 | 4880 | #!/usr/bin/env python
# coding: utf-8
# © 2015 Instacart
# Published as part of http://tech.instacart.com/ahab/
from contextlib import contextmanager
import logging
from pprint import pformat
from random import randint
import subprocess
from ahab import Ahab
import iptc
log = logging.getLogger()
def main():
lo... | isc |
jaspreetw/tempest | tempest/api/compute/admin/test_live_migration.py | 3 | 6694 | # Copyright 2012 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 requ... | apache-2.0 |
BlackPole/bp-enigma2 | lib/python/Components/Converter/EventName.py | 3 | 2313 | from Components.Converter.Converter import Converter
from Components.Element import cached
from enigma import eEPGCache
class EventName(Converter, object):
NAME = 0
SHORT_DESCRIPTION = 1
EXTENDED_DESCRIPTION = 2
FULL_DESCRIPTION = 3
ID = 4
NEXT_NAME = 5
NEXT_DESCRIPTION = 6
def __init__(self, type):
... | gpl-2.0 |
cedk/odoo | openerp/addons/base/tests/test_mail_examples.py | 302 | 57129 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
MISC_HTML_SOURCE = """
<font size="2" style="color: rgb(31, 31, 31); font-family: monospace; font-variant: normal; line-height: normal; ">test1</font>
<div style="color: rgb(31, 31, 31); font-family: monospace; font-variant: normal; line-height: normal; font-size: 12px; fo... | agpl-3.0 |
IODisrupt/OmegaBot | cogs/image.py | 1 | 4412 | import discord
from discord.ext import commands
from random import randint
import aiohttp
import random
class Image:
"""Image related commands."""
def __init__(self, bot):
self.bot = bot
#Reserved for further ... stuff
"""Commands section"""
@commands.command(no_pm=True)
async de... | gpl-3.0 |
hwu25/AppPkg | Applications/Python/Python-2.7.2/Lib/test/test_shlex.py | 13 | 5491 | # -*- coding: iso-8859-1 -*-
import unittest
import shlex
from test import test_support
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
# The original test data set was from shellwords, by Hartmut Goebel.
data = r"""x|x|
foo bar|foo|bar|
foo bar|foo|ba... | bsd-2-clause |
SophieBartmann/Faust-Bot | FaustBot/Modules/JokeObserver.py | 1 | 6933 | import random
import time
from FaustBot.Communication import Connection
from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype
jokes = [['Was ist orange und geht über die Berge?'
,'Eine Wanderine.']
,['Was ist orange und schaut durchs Schlüsselloch?'
,'Eine Spannderine.']
,['Was ist violett und... | gpl-3.0 |
jendap/tensorflow | tensorflow/__init__.py | 29 | 1685 | # Copyright 2015 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 |
gangadhar-kadam/verve_erp | erpnext/controllers/stock_controller.py | 6 | 11036 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe.utils import cint, flt, cstr
from frappe import msgprint, _
import frappe.defaults
from erpnext.controllers.accounts_controll... | agpl-3.0 |
buuck/root | interpreter/llvm/src/tools/clang/utils/ABITest/Enumeration.py | 110 | 7814 | """Utilities for enumeration of finite and countably infinite sets.
"""
###
# Countable iteration
# Simplifies some calculations
class Aleph0(int):
_singleton = None
def __new__(type):
if type._singleton is None:
type._singleton = int.__new__(type)
return type._singleton
def __r... | lgpl-2.1 |
guker/GroundHog | groundhog/layers/rconv_layers.py | 19 | 11513 | """
Recursive Convolutional layers.
TODO: write more documentation
"""
__docformat__ = 'restructedtext en'
__authors__ = ("KyungHyun Cho ")
__contact__ = "Kyunghyun Cho <kyunghyun.cho@umontreal.ca>"
import numpy
import copy
import theano
import theano.tensor as TT
from theano.sandbox.rng_mrg import MRG_RandomStreams... | bsd-3-clause |
dudepare/django | tests/template_tests/filter_tests/test_autoescape.py | 513 | 1342 | from django.test import SimpleTestCase
from ..utils import SafeClass, UnsafeClass, setup
class AutoescapeStringfilterTests(SimpleTestCase):
"""
Filters decorated with stringfilter still respect is_safe.
"""
@setup({'autoescape-stringfilter01': '{{ unsafe|capfirst }}'})
def test_autoescape_string... | bsd-3-clause |
yamahata/neutron | neutron/neutron_plugin_base_v2.py | 6 | 13983 | # Copyright 2011 VMware, 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 ... | apache-2.0 |
agx/git-buildpackage | tests/component/__init__.py | 1 | 9974 | # vim: set fileencoding=utf-8 :
#
# (C) 2012 Intel Corporation <markus.lehtonen@linux.intel.com>
# 2013,2017 Guido Günther <agx@sigxcpu.org>
#
# 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 Fo... | gpl-2.0 |
LaoZhongGu/kbengine | kbe/src/lib/python/Lib/ctypes/macholib/dylib.py | 320 | 1828 | """
Generic dylib path manipulation
"""
import re
__all__ = ['dylib_info']
DYLIB_RE = re.compile(r"""(?x)
(?P<location>^.*)(?:^|/)
(?P<name>
(?P<shortname>\w+?)
(?:\.(?P<version>[^._]+))?
(?:_(?P<suffix>[^._]+))?
\.dylib$
)
""")
def dylib_info(filename):
"""
A dylib name can take one of the ... | lgpl-3.0 |
mitodl/ansible | examples/scripts/yaml_to_ini.py | 175 | 7609 | # (c) 2012, 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) any lat... | gpl-3.0 |
johnkingsley/aprinter | config_system/utils/nix_utils.py | 1 | 2105 | # Copyright (c) 2015 Ambroz Bizjak
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... | bsd-2-clause |
PepperPD/edx-pepper-platform | cms/djangoapps/contentstore/features/component.py | 7 | 4905 | #pylint: disable=C0111
#pylint: disable=W0621
from lettuce import world, step
from nose.tools import assert_true # pylint: disable=E0611
DATA_LOCATION = 'i4x://edx/templates'
@step(u'I am editing a new unit')
def add_unit(step):
css_selectors = ['a.new-courseware-section-button', 'input.new-section-name-save',... | agpl-3.0 |
bkrukowski/phantomjs | src/breakpad/src/tools/gyp/pylib/gyp/generator/make.py | 137 | 42339 | #!/usr/bin/python
# Copyright (c) 2009 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.
# Notes:
#
# This is all roughly based on the Makefile system used by the Linux
# kernel, but is a non-recursive make -- we put the entire depen... | bsd-3-clause |
ahmadshahwan/cohorte-runtime | python/src/lib/python/unidecode/x00a.py | 252 | 4121 | data = (
'[?]', # 0x00
'[?]', # 0x01
'N', # 0x02
'[?]', # 0x03
'[?]', # 0x04
'a', # 0x05
'aa', # 0x06
'i', # 0x07
'ii', # 0x08
'u', # 0x09
'uu', # 0x0a
'[?]', # 0x0b
'[?]', # 0x0c
'[?]', # 0x0d
'[?]', # 0x0e
'ee', # 0x0f
'ai', # 0x10
'[?]', # 0x11
'[?]', # 0x12
'... | apache-2.0 |
yang1fan2/nematus | test/config.py | 1 | 1647 | import numpy
import os
import sys
SRC = "de"
TGT = "en"
DATA_DIR = "data/"
from nematus.nmt import train
if __name__ == '__main__':
validerr = train(saveto='models/model.npz',
reload_=False,
dim_word=256,
dim=256,
n_words=20000,
... | bsd-3-clause |
flowersteam/SESM | SESM/pykinect.py | 2 | 3387 | import zmq
import numpy
import threading
from collections import namedtuple
Point2D = namedtuple('Point2D', ('x', 'y'))
Point3D = namedtuple('Point3D', ('x', 'y', 'z'))
Quaternion = namedtuple('Quaternion', ('x', 'y', 'z', 'w'))
torso_joints = ('hip_center', 'spine', 'shoulder_center', 'head')
left_arm_joints = ('sh... | gpl-3.0 |
gautam1858/tensorflow | tensorflow/contrib/tensorrt/test/rank_two_test.py | 2 | 3365 | # 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 |
olsaki/ansible-modules-extras | network/f5/bigip_monitor_tcp.py | 8 | 17582 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, serge van Ginderachter <serge@vanginderachter.be>
#
# 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 vers... | gpl-3.0 |
artur-shaik/qutebrowser | tests/integration/test_webserver.py | 1 | 2504 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 Softwa... | gpl-3.0 |
jbarkschat/Yu-gi-oh_pack_generator | Yu-gi-oh_pack_generator_alpha.py | 1 | 13809 | import urllib.request
from bs4 import BeautifulSoup
from PIL import Image
from tkinter import Tk, Label, Button
import requests
import pprint
import secrets
import os
class RarityUnknown(Exception):
"""Raised in this program when an unhandled rarity is encountered"""
pp = pprint.PrettyPrinter(indent=4... | gpl-3.0 |
morganherlocker/openaddresses | scripts/es/gml_to_csv.py | 40 | 6149 | import subprocess, sys, os, tempfile, shutil, re
import xml.sax
import unicodecsv as csv
lookup = {}
class CSVBuilder(xml.sax.ContentHandler):
def __init__(self, directory, lookup):
self.lookup = lookup.lookup
self.writers = {}
self.object = {}
self.out_dir = directory
... | bsd-3-clause |
felmoltor/NVDparser | nvdparser.py | 2 | 15511 | #!/usr/bin/python
# Author: Felipe Molina (@felmoltor)
# Date: 05/2015
# Summary: Download nvd.nist.gov XML files containing CVE details.
# Parse it and saves in sqlite3 db
# LICENSE: GPLv2
from mechanize import *
from lxml import etree
import os
import datetime
import time
import gzip
import sqlite3
i... | gpl-2.0 |
TRox1972/youtube-dl | youtube_dl/extractor/golem.py | 186 | 2181 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
)
from ..utils import (
determine_ext,
)
class GolemIE(InfoExtractor):
_VALID_URL = r'^https?://video\.golem\.de/.+?/(?P<id>.+?)/'
_TEST = {
'url': 'http://video.g... | unlicense |
wireservice/agate | setup.py | 1 | 1797 | #!/usr/bin/env python
from setuptools import setup
install_requires = [
'six>=1.9.0',
'pytimeparse>=1.1.5',
'parsedatetime>=2.1',
'Babel>=2.0',
'isodate>=0.5.4',
'python-slugify>=1.2.1',
'leather>=0.3.2',
'PyICU>=2.4.2',
]
setup(
name='agate',
version='1.6.2',
description=... | mit |
SnappleCap/oh-mainline | vendor/packages/twisted/twisted/spread/pb.py | 18 | 47191 | # -*- test-case-name: twisted.test.test_pb -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Perspective Broker
\"This isn\'t a professional opinion, but it's probably got enough
internet to kill you.\" --glyph
Introduction
============
This is a broker for proxies for and copies of ob... | agpl-3.0 |
aviciimaxwell/odoo | addons/mrp_byproduct/__openerp__.py | 259 | 1819 | # -*- 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 |
areitz/pants | contrib/go/src/python/pants/contrib/go/tasks/go_test.py | 10 | 2311 | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.base.exce... | apache-2.0 |
rusty1s/embedded_gcnn | cifar_graph.py | 1 | 3650 | from lib.datasets import Cifar10 as Data
from lib.model import Model as BaseModel, generate_placeholders, train
from lib.segmentation import extract_features_fixed
# from lib.segmentation import slic_fixed
from lib.segmentation import quickshift_fixed
from lib.pipeline import preprocess_pipeline_fixed
from lib.layer im... | mit |
centricular/cerbero | cerbero/commands/runit.py | 9 | 1586 | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | lgpl-2.1 |
khagler/boto | boto/glacier/writer.py | 153 | 9668 | # -*- coding: utf-8 -*-
# Copyright (c) 2012 Thomas Parslow http://almostobsolete.net/
# Copyright (c) 2012 Robie Basak <robie@justgohome.co.uk>
# Tree hash implementation from Aaron Brady bradya@gmail.com
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated... | mit |
danielvdende/incubator-airflow | airflow/contrib/sensors/cassandra_table_sensor.py | 8 | 2323 | # -*- coding: utf-8 -*-
#
# 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
#... | apache-2.0 |
rossburton/yocto-autobuilder | lib/python2.7/site-packages/Twisted-12.2.0-py2.7-linux-x86_64.egg/twisted/manhole/test/test_explorer.py | 42 | 2513 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.manhole.explorer}.
"""
from twisted.trial import unittest
from twisted.manhole.explorer import (
CRUFT_WatchyThingie,
ExplorerImmutable,
Pool,
_WatchMonkey,
)
class Foo:
"""
Test helper.
"... | gpl-2.0 |
thuydang/ocrfeeder | src/ocrfeeder/feeder/imageManipulation.py | 1 | 8701 | # -*- coding: utf-8 -*-
###########################################################################
# OCRFeeder - The complete OCR suite
# Copyright (C) 2009 Joaquim Rocha
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publ... | gpl-3.0 |
neumerance/deploy | .venv/lib/python2.7/site-packages/django/contrib/gis/utils/srs.py | 210 | 3235 | from django.contrib.gis.gdal import SpatialReference
def add_srs_entry(srs, auth_name='EPSG', auth_srid=None, ref_sys_name=None,
database=None):
"""
This function takes a GDAL SpatialReference system and adds its information
to the `spatial_ref_sys` table of the spatial backend. Doing th... | apache-2.0 |
idea4bsd/idea4bsd | plugins/hg4idea/testData/bin/hgext/color.py | 90 | 19590 | # color.py color output for the status and qseries commands
#
# Copyright (C) 2007 Kevin Christen <kevin.christen@gmail.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
'''colorize output from some commands
This extension mod... | apache-2.0 |
andela-ifageyinbo/django | django/dispatch/dispatcher.py | 171 | 11711 | import sys
import threading
import warnings
import weakref
from django.utils import six
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.inspect import func_accepts_kwargs
from django.utils.six.moves import range
if six.PY2:
from .weakref_backports import WeakMethod
else:
from w... | bsd-3-clause |
DNFcode/edx-platform | cms/djangoapps/contentstore/features/course-settings.py | 50 | 7238 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import world, step
from terrain.steps import reload_the_page
from selenium.webdriver.common.keys import Keys
from common import type_in_codemirror, upload_file
from django.conf import settings
from nose.tools import assert_true, a... | agpl-3.0 |
isotoma/buildbot_travis | buildbot_travis/tests/test_git.py | 2 | 1266 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from twisted.trial import unittest
from buildbot_travis.vcs import git
class GitUrlParser(unittest.TestCase):
def test_simple(self):
url = "git://github.com/tardyp/buildbot_travis"
parsed... | apache-2.0 |
TrainingB/Clembot | clembot/exts/gyms/citymanager.py | 1 | 4523 | from discord.ext import commands
from clembot.core.logs import init_loggers
from clembot.exts.utils.utilities import Utilities
from clembot.core import checks
from clembot.exts.config.channelconfigmanager import ChannelConfigCache
class CityManager(commands.Cog):
def __init__(self, bot):
self.bot = bot
... | gpl-3.0 |
einaru/luma | luma/plugins/search/SearchResult.py | 3 | 15190 | # -*- coding: utf-8 -*-
#
# plugins.search.SearchResult
#
# Copyright (c) 2011
# Einar Uvsløkk, <einar.uvslokk@linux.com>
#
# 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 o... | gpl-2.0 |
drincruz/luigi | test/test_ssh.py | 95 | 1796 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
fly19890211/edx-platform | common/test/acceptance/tests/lms/test_lms_split_test_courseware_search.py | 58 | 6906 | """
Test courseware search
"""
import os
import json
from ..helpers import remove_file
from ...pages.common.logout import LogoutPage
from ...pages.studio.overview import CourseOutlinePage
from ...pages.lms.courseware_search import CoursewareSearchPage
from ...pages.lms.course_nav import CourseNavPage
from ...fixtures.... | agpl-3.0 |
vicky2135/lucious | oscar/lib/python2.7/site-packages/django/core/management/commands/inspectdb.py | 56 | 12874 | from __future__ import unicode_literals
import keyword
import re
from collections import OrderedDict
from django.core.management.base import BaseCommand, CommandError
from django.db import DEFAULT_DB_ALIAS, connections
from django.utils.encoding import force_text
class Command(BaseCommand):
help = "Introspects ... | bsd-3-clause |
PabloCastellano/nodeshot | nodeshot/networking/net/models/choices.py | 8 | 4580 | from django.utils.translation import ugettext_lazy as _
from nodeshot.core.base.utils import choicify
ROUTING_PROTOCOLS = (
('olsr', 'OLSR'),
('batman', 'B.A.T.M.A.N.'),
('batman-adv', 'B.A.T.M.A.N. advanced'),
('bmx', 'BMX (Batman Experimental)'),
('babel', 'Babel'),
('802.11s', 'Open 802.11s... | gpl-3.0 |
shaananc/security-proj2 | bindings/python/topsort.py | 218 | 13288 | # topsort - dependency (topological) sorting and cycle finding functions
# Copyright (C) 2007 RADLogic
#
# 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;
# version 2.1 of the License.
# ... | gpl-2.0 |
rinatkosny/onedrive-d-old | onedrive_d/od_sqlite.py | 7 | 10052 | #!/usr/bin/python3
"""
Database manipulator classes for onedrive-d.
"""
import os
import threading
import sqlite3
from . import od_glob
class TaskManager:
"""
Task manager abstracts the task queue implemented in SQLite to better
control concurrency.
task status: 0 (added), 1 (fetched), 2 (done, deletable)
ta... | lgpl-3.0 |
Savaged-Zen/Savaged-Zen-Speedy | tools/perf/scripts/python/check-perf-trace.py | 948 | 2501 | # perf trace event handlers, generated by perf trace -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. Ba... | gpl-2.0 |
arnavd96/Cinemiezer | myvenv/lib/python3.4/site-packages/django/contrib/gis/db/backends/mysql/introspection.py | 700 | 1771 | from MySQLdb.constants import FIELD_TYPE
from django.contrib.gis.gdal import OGRGeomType
from django.db.backends.mysql.introspection import DatabaseIntrospection
class MySQLIntrospection(DatabaseIntrospection):
# Updating the data_types_reverse dictionary with the appropriate
# type for Geometry fields.
... | mit |
schwarz/youtube-dl | youtube_dl/extractor/dreisat.py | 107 | 3259 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
unified_strdate,
)
class DreiSatIE(InfoExtractor):
IE_NAME = '3sat'
_VALID_URL = r'(?:http://)?(?:www\.)?3sat\.de/mediathek/(?:index\.php|mediathek\.php)?\?(?:(?:mode|display)=[^... | unlicense |
sysbot/cloudenvy | cloudenvy/main.py | 1 | 3204 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
import argparse
import logging
import pkgutil
import string
from cloudenvy.config import EnvyConfig
import cloudenvy.commands
#TODO(bcwaldon): replace this with entry points!
def _load_commands():
"""Iterate through modules in command and import suspected command cla... | apache-2.0 |
vine/uwsgi | examples/welcome3.py | 6 | 1074 | import uwsgi
import os
def xsendfile(e, sr):
sr('200 OK', [('Content-Type', 'image/png'), ('X-Sendfile', os.path.abspath('logo_uWSGI.png'))])
return b''
def serve_logo(e, sr):
sr('200 OK', [('Content-Type', 'image/png')])
return uwsgi.sendfile('logo_uWSGI.png')
def serve_config(e, sr):
sr('200 OK... | gpl-2.0 |
zanderle/django | django/contrib/gis/gdal/raster/source.py | 297 | 13274 | import json
import os
from ctypes import addressof, byref, c_double, c_void_p
from django.contrib.gis.gdal.base import GDALBase
from django.contrib.gis.gdal.driver import Driver
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import raster as capi
from django.contrib.gis... | bsd-3-clause |
CitizenB/ansible | lib/ansible/plugins/connection/libvirt_lxc.py | 7 | 6851 | # Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Based on chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com>
# (c) 2013, Michael Scherer <misc@zarb.org>
# (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute i... | gpl-3.0 |
divio/django | tests/null_fk/tests.py | 352 | 2982 | from __future__ import unicode_literals
from django.db.models import Q
from django.test import TestCase
from .models import (
Comment, Forum, Item, Post, PropertyValue, SystemDetails, SystemInfo,
)
class NullFkTests(TestCase):
def test_null_fk(self):
d = SystemDetails.objects.create(details='First ... | bsd-3-clause |
ehashman/oh-mainline | vendor/packages/python-social-auth/social/apps/pyramid_app/views.py | 75 | 1091 | from pyramid.view import view_config
from social.utils import module_member
from social.actions import do_auth, do_complete, do_disconnect
from social.apps.pyramid_app.utils import psa, login_required
@view_config(route_name='social.auth', request_method='GET')
@psa('social.complete')
def auth(request):
return d... | agpl-3.0 |
mattcaldwell/pip | tests/lib/venv.py | 5 | 2574 | from __future__ import absolute_import
import os
import sys
import subprocess
import virtualenv as _virtualenv
from .path import Path
# On Python < 3.3 we don't have subprocess.DEVNULL
try:
DEVNULL = subprocess.DEVNULL
except AttributeError:
DEVNULL = open(os.devnull, "wb")
class VirtualEnvironment(objec... | mit |
jiegec/gnuradio | gr-atsc/python/atsc/qa_atsc.py | 55 | 7019 | #!/usr/bin/env python
#
# Copyright 2004,2006,2007,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at ... | gpl-3.0 |
pychess/pychess | setup.py | 1 | 12398 | # -*- coding: UTF-8 -*-
from glob import glob
from os import listdir
from os.path import isdir, isfile
import os
import site
import sys
import subprocess
this_dir = os.path.dirname(os.path.abspath(__file__))
sys.path = [os.path.join(this_dir, "lib")] + sys.path
msi = False
if sys.argv[-1] == "bdist_msi":
try:
... | gpl-3.0 |
fossoult/odoo | addons/account_followup/account_followup.py | 49 | 28947 | # -*- 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 |
JackDanger/airflow | airflow/jobs.py | 11 | 24429 | from builtins import str
from past.builtins import basestring
from collections import defaultdict
from datetime import datetime
import getpass
import logging
import signal
import socket
import subprocess
import sys
from time import sleep
from sqlalchemy import Column, Integer, String, DateTime, func, Index
from sqlalc... | apache-2.0 |
froststars/aws-cfn-templates | solutions/CWLogs2S3/ExportCloudWatchLogsToS3Template.py | 1 | 8006 | # -*- encoding: utf-8 -*-
__author__ = 'kotaimen'
__date__ = '04/06/2017'
from troposphere import Base64, FindInMap, GetAtt, Join, Select, Sub
from troposphere import ImportValue, Export
from troposphere import Condition, And, Equals, If, Not, Or
from troposphere import Template, Parameter, Ref, Tags, Output
from tro... | mit |
kasioumis/invenio | invenio/modules/search/searchext/services/LHCBeamStatusService.py | 15 | 2564 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2012 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... | gpl-2.0 |
mattstibbs/blockbuster-server | blockbuster/bb_dbconnector_base.py | 1 | 4377 | class DBConnector:
def __init__(self):
pass
def db_status_check(self):
raise NotImplementedError()
def db_stats_check(self):
raise NotImplementedError()
def db_version_check(self):
raise NotImplementedError()
def checkifregexists(self):
raise NotImplement... | mit |
backmari/moose | python/chigger/base/ChiggerFilterSourceBase.py | 6 | 5979 | #pylint: disable=missing-docstring
#################################################################
# DO NOT MODIFY THIS HEADER #
# MOOSE - Multiphysics Object Oriented Simulation Environment #
# #
# (c) 2010... | lgpl-2.1 |
dhruvsrivastava/OJ | python/lib/python2.7/site-packages/pip/req/req_file.py | 239 | 9670 | """
Requirements file parsing
"""
from __future__ import absolute_import
import os
import re
import shlex
import optparse
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.six.moves import filterfalse
import pip
from pip.download import get_file_content
from pip.req.req_install import ... | bsd-3-clause |
wangyou/XX-Net | code/default/python27/1.0/lib/encodings/iso8859_10.py | 593 | 13845 | """ Python Character Mapping Codec iso8859_10 generated from 'MAPPINGS/ISO8859/8859-10.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... | bsd-2-clause |
doug-fish/horizon | openstack_dashboard/test/test_data/cinder_data.py | 21 | 13932 | # Copyright 2012 Nebula, 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 agree... | apache-2.0 |
jeromeLB/client175 | cherrypy/process/win32.py | 17 | 5875 | """Windows service. Requires pywin32."""
import os
import thread
import win32api
import win32con
import win32event
import win32service
import win32serviceutil
from cherrypy.process import wspbus, plugins
class ConsoleCtrlHandler(plugins.SimplePlugin):
"""A WSPBus plugin for handling Win32 console events (like C... | gpl-3.0 |
whitehorse-io/encarnia | pyenv/lib/python2.7/site-packages/twisted/spread/test/test_jelly.py | 13 | 19990 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Test cases for L{jelly} object serialization.
"""
from __future__ import absolute_import, division
import datetime
import decimal
from twisted.python.compat import unicode
from twisted.spread import jelly, pb
from twisted.trial import unitt... | mit |
Kesmon/VolumCalc | calc.py | 1 | 2474 | # Volum kalkulator
# made by Kristian Sundal/(Kesmon/)
# Release 1.0
pi=3.14159265359
start = '\n\nVelg mellom\n"kjegle","pyramide","tpyramide","sylinder","kule","prisme" eller "tprisme"\n"avslutt" for å avslutte'
trekant = 'Vil du ha trekant versjonen? "ja/nei"'
fase=''
print(start)
fase = input('> ')
while fase ... | unlicense |
chirilo/mozillians | vendor-local/lib/python/djcelery/tests/test_loaders.py | 11 | 1436 | from __future__ import absolute_import
from celery import loaders
from djcelery import loaders as djloaders
from djcelery.tests.utils import unittest
class TestDjangoLoader(unittest.TestCase):
def setUp(self):
self.loader = djloaders.DjangoLoader()
def test_get_loader_cls(self):
self.asse... | bsd-3-clause |
jezdez/kuma | vendor/packages/jsonpickle/handlers.py | 22 | 8846 | # -*- coding: utf-8 -*-
"""
Custom handlers may be created to handle other objects. Each custom handler
must derive from :class:`jsonpickle.handlers.BaseHandler` and
implement ``flatten`` and ``restore``.
A handler can be bound to other types by calling :func:`jsonpickle.handlers.register`.
:class:`jsonpickle.custom... | mpl-2.0 |
AGG2017/diaphora | pygments/lexers/_postgres_builtins.py | 48 | 11210 | # -*- coding: utf-8 -*-
"""
pygments.lexers._postgres_builtins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Self-updating data files for PostgreSQL lexer.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
# Autogenerated: please edit them if you... | gpl-2.0 |
charlesbrandt/medley | player/shared.py | 1 | 2332 | """
all_contents is the global place to store all content objects
if a requested content source is already loaded,
use it instead of loading a new one
#TODO:
#consider a simpler global variable / object for all_contents
#rather than passing around everywhere...
#could then be imported by any ot... | mit |
Ayub-Khan/edx-platform | lms/djangoapps/course_structure_api/v0/views.py | 12 | 27921 | """ API implementation for course-oriented interactions. """
from collections import namedtuple
import json
import logging
from django.conf import settings
from django.http import Http404
from rest_framework.authentication import SessionAuthentication
from rest_framework_oauth.authentication import OAuth2Authenticati... | agpl-3.0 |
katsikas/gnuradio | gr-vocoder/python/qa_g723_24_vocoder.py | 10 | 1231 | #!/usr/bin/env python
#
# Copyright 2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your option)
# ... | gpl-3.0 |
ran5515/DeepDecision | tensorflow/contrib/ndlstm/python/__init__.py | 135 | 1103 | # 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 applicable ... | apache-2.0 |
DiegoQueiroz/scriptLattes | scriptLattes/producoesUnitarias/idioma.py | 3 | 1490 | #!/usr/bin/python
# encoding: utf-8
# filename: idioma.py
#
# scriptLattes V8
# Copyright 2005-2013: Jesús P. Mena-Chalco e Roberto M. Cesar-Jr.
# http://scriptlattes.sourceforge.net/
#
#
# Este programa é um software livre; você pode redistribui-lo e/ou
# modifica-lo dentro dos termos da Licença Pública Geral GN... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.