repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
davidyezsetz/kuma | kuma/humans/models.py | 5 | 2264 | from __future__ import with_statement
import json
import os
import subprocess
import urllib
from django.conf import settings
GITHUB_REPOS = "https://api.github.com/repos/mozilla/kuma/contributors"
class Human(object):
def __init__(self):
self.name = None
self.website = None
class HumansTXT(ob... | mpl-2.0 |
nzer0/keras | tests/auto/test_loss_weighting.py | 39 | 6595 | from __future__ import absolute_import
from __future__ import print_function
import numpy as np
np.random.seed(1336) # for reproducibility
from keras.datasets import mnist
from keras.models import Sequential, Graph
from keras.layers.core import Dense, Activation
from keras.utils import np_utils
import unittest
nb_c... | mit |
KeyWeeUsr/plyer | plyer/platforms/macosx/cpu.py | 2 | 1224 | '''
Module of MacOS API for plyer.cpu.
'''
from subprocess import Popen, PIPE
from plyer.facades import CPU
from plyer.utils import whereis_exe
class OSXCPU(CPU):
'''
Implementation of MacOS CPU API.
'''
@staticmethod
def _sockets():
return
def _physical(self):
# cores
... | mit |
beiko-lab/gengis | bin/Lib/lib2to3/fixes/fix_set_literal.py | 61 | 1752 | """
Optional fixer to transform set() calls to set literals.
"""
# Author: Benjamin Peterson
from lib2to3 import fixer_base, pytree
from lib2to3.fixer_util import token, syms
class FixSetLiteral(fixer_base.BaseFix):
BM_compatible = True
explicit = True
PATTERN = """power< 'set' traile... | gpl-3.0 |
dhcrzf/zulip | analytics/management/commands/analyze_mit.py | 15 | 3663 | import datetime
import logging
import time
from typing import Any, Dict
from django.core.management.base import BaseCommand, CommandParser
from zerver.lib.timestamp import timestamp_to_datetime
from zerver.models import Message, Recipient
def compute_stats(log_level: int) -> None:
logger = logging.getLogger()
... | apache-2.0 |
prds21/repository-barrialTV | lib/mechanize/__init__.py | 133 | 5098 | __all__ = [
'AbstractBasicAuthHandler',
'AbstractDigestAuthHandler',
'BaseHandler',
'Browser',
'BrowserStateError',
'CacheFTPHandler',
'ContentTooShortError',
'Cookie',
'CookieJar',
'CookiePolicy',
'DefaultCookiePolicy',
'DefaultFactory',
'FTPHandler',
'Factory',
... | gpl-2.0 |
mancoast/CPythonPyc_test | cpython/272_test_operator.py | 116 | 21466 | import operator
import unittest
from test import test_support
class Seq1:
def __init__(self, lst):
self.lst = lst
def __len__(self):
return len(self.lst)
def __getitem__(self, i):
return self.lst[i]
def __add__(self, other):
return self.lst + other.lst
def __mul__(s... | gpl-3.0 |
qmagico/sampleappqm | src/django/contrib/contenttypes/generic.py | 86 | 20290 | """
Classes allowing "generic" relations through ContentType and object-id fields.
"""
from collections import defaultdict
from functools import partial
from operator import attrgetter
from django.core.exceptions import ObjectDoesNotExist
from django.db import connection
from django.db.models import signals
from djan... | mit |
analogue/pyramid_swagger | tests/acceptance/yaml_test.py | 1 | 6148 | # -*- coding: utf-8 -*-
import base64
import pytest
from webtest import TestApp
from .app import main
from pyramid_swagger.tween import SwaggerFormat
@pytest.fixture
def settings():
dir_path = 'tests/sample_schemas/yaml_app/'
return {
'pyramid_swagger.schema_file': 'swagger.yaml',
'pyramid_s... | bsd-3-clause |
nicoTrombon/DjangoPolls | env/Lib/site-packages/django/conf/locale/de_CH/formats.py | 115 | 1445 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
from __future__ import unicode_literals
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATE... | bsd-3-clause |
jeanqasaur/jeeves | demo/cms/conf/forms.py | 10 | 5562 | from django.forms import Form, ModelForm, CharField, FileField, Textarea, ModelForm, HiddenInput, MultipleChoiceField, CheckboxSelectMultiple, BooleanField, ChoiceField
from models import Paper, PaperVersion, UserProfile, Review, ReviewAssignment, Comment, UserPCConflict
from django.contrib.auth.models import User
imp... | mit |
sundream/gamesrv | daobiao/pyexcelerator-0.6.4.1/pyExcelerator/Bitmap.py | 25 | 12183 | #!/usr/bin/env python
# -*- coding: windows-1251 -*-
# Copyright (C) 2005 Roman V. Kiseliov
# Portions are Copyright (c) 2004 Evgeny Filatov <fufff@users.sourceforge.net>
# Portions are Copyright (c) 2002-2004 John McNamara (Perl Spreadsheet::WriteExcel)
# All rights reserved.
#
# Redistribution and use in s... | gpl-2.0 |
arnavd96/Cinemiezer | myvenv/lib/python3.4/site-packages/boto/cloudsearch/search.py | 153 | 13775 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# 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... | mit |
jonparrott/gcloud-python | redis/noxfile.py | 2 | 2478 | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
virgree/odoo | addons/account/wizard/account_open_closed_fiscalyear.py | 237 | 2537 | # -*- 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 |
dyoung418/tensorflow | tensorflow/python/kernel_tests/gradient_correctness_test.py | 118 | 1669 | # 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 |
tseaver/google-cloud-python | bigtable/google/cloud/bigtable_admin_v2/types.py | 2 | 2211 | # -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
twilde/arm | src/util/log.py | 2 | 6731 | """
Tracks application events, both directing them to attached listeners and
keeping a record of them. A limited space is provided for old events, keeping
and trimming them on a per-runlevel basis (ie, too many DEBUG events will only
result in entries from that runlevel being dropped). All functions are thread
safe.
""... | gpl-3.0 |
Chilledheart/chromium | tools/telemetry/third_party/gsutilz/third_party/boto/boto/__init__.py | 87 | 41904 | # Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010-2011, Eucalyptus Systems, Inc.
# Copyright (c) 2011, Nexenta Systems Inc.
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# Copyright (c) 2010, Google, Inc.
# All rights reserved.
#
# Permission is hereby granted, free of charge, ... | bsd-3-clause |
PROSIC/PROSIC | prosic/TernaryClassification.py | 1 | 2691 | #!/usr/bin/env python
from __future__ import print_function, division
import matplotlib.pyplot as plt
import numpy as np
__author__ = "Louis Dijkstra"
"""
Contains the functionality needed to plot the results of a ternary classification task,
e.g., somatic/germline/not present or absent/heterozygous/homozygous.
"""... | gpl-3.0 |
TRox1972/youtube-dl | youtube_dl/extractor/folketinget.py | 71 | 2643 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_parse_qs
from ..utils import (
int_or_none,
parse_duration,
parse_iso8601,
xpath_text,
)
class FolketingetIE(InfoExtractor):
IE_DESC = 'Folketinget (ft.dk; Danish parliament)'
... | unlicense |
geoffviola/googletest | scripts/gen_gtest_pred_impl.py | 2538 | 21986 | #!/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... | bsd-3-clause |
OAButton/OAButton_old | oabutton/apps/template_email/__init__.py | 1 | 2102 | from django.contrib.auth.models import User
from django.core.mail import EmailMultiAlternatives
from django.template import loader, Context
class TemplateEmail(EmailMultiAlternatives):
"""
Makes it a little easier to send HTML+plaintxt emails using templates
"""
template = None
context = {}
ht... | mit |
qpython-android/QPython3-core | pybuild/packages/libxml2.py | 1 | 1390 | from ..source import GitSource
from ..package import Package
from ..patch import LocalPatch
from ..util import target_arch
class Libxml2(Package):
source = GitSource('https://github.com/QPYPI/libxml2.git', alias='libxml2', branch='qpyc-2.9.8')
patches = [
#LocalPatch('0001-Fix-libtoolize-s-issue-in-aut... | apache-2.0 |
mensler/ansible | test/units/modules/cloud/amazon/test_cloudformation.py | 89 | 3685 | # (c) 2017 Red Hat 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
# (at your option) any later version.
#
# Ansible is dis... | gpl-3.0 |
niteoweb/libcloud | libcloud/common/zonomi.py | 22 | 4446 | # 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 use ... | apache-2.0 |
datalogics-robb/scons | src/engine/SCons/Tool/m4.py | 2 | 2157 | """SCons.Tool.m4
Tool-specific initialization for m4.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of t... | mit |
ChiliCoin/ChiliCoin | qa/rpc-tests/bip68-112-113-p2p.py | 9 | 27275 | #!/usr/bin/env python3
# Copyright (c) 2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from test_... | mit |
boyuegame/kbengine | kbe/src/lib/python/Lib/multiprocessing/semaphore_tracker.py | 100 | 4820 | #
# On Unix we run a server process which keeps track of unlinked
# semaphores. The server ignores SIGINT and SIGTERM and reads from a
# pipe. Every other process of the program has a copy of the writable
# end of the pipe, so we get EOF when all other processes have exited.
# Then the server process unlinks any remai... | lgpl-3.0 |
glneo/gnuradio | gr-digital/python/digital/qa_clock_recovery_mm.py | 45 | 5378 | #!/usr/bin/env python
#
# Copyright 2011-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 your optio... | gpl-3.0 |
xrmx/uwsgi-sloth | uwsgi_sloth/structures.py | 2 | 1298 | # -*- coding: utf-8 -*-
"""Useful data structures"""
class ValuesAggregation(object):
"""For response time analyze"""
def __init__(self, values=[]):
self.min = None
self.max = None
self.total = 0
self.count = 0
# Init with values
for value in values:
... | apache-2.0 |
aparaatti/definator | src/tests/test_terms_controller_int.py | 1 | 3648 | # -*- coding: utf-8 -*-
#
# This file is a part of Definator (https://github.com/aparaatti/definator)
# and it is licensed under the GPLv3 (http://www.gnu.org/licenses/gpl-3.0.txt).
#
from pathlib import Path
import os
import unittest
import shutil
import tempfile
import src.terms_controller
import src.data.term
# To ... | gpl-3.0 |
danbar/fglib | fglib/tests/test_graphs.py | 1 | 1039 | import unittest
import networkx as nx
from networkx.algorithms import bipartite
from .. import graphs, nodes, rv
class TestFactorGraph(unittest.TestCase):
def test_convert_graph_to_factor_garph(self):
variable_nodes = ['x1', 'x2', 'x3', 'x4']
factor_nodes = ['fa', 'fb', 'fc']
g = nx.Gr... | mit |
yinquan529/platform-external-chromium_org | ppapi/generators/idl_namespace.py | 127 | 7357 | #!/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.
"""
IDLNamespace for PPAPI
This file defines the behavior of the AST namespace which allows for resolving
a symbol as one or more ... | bsd-3-clause |
alexandrebarachant/mne-python | mne/decoding/time_gen.py | 1 | 64983 | # Authors: Jean-Remi King <jeanremi.king@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Clement Moutard <clement.moutard@gmail.com>
#
# License: BSD (3-clause)
import numpy as np
import copy
from .base import _set_cv
f... | bsd-3-clause |
telwertowski/QGIS | tests/src/python/test_db_manager_postgis.py | 9 | 11688 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for the DBManager GPKG plugin
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later versi... | gpl-2.0 |
rhyswhitley/phendulum | src/model_plotting.py | 1 | 7543 | #!/usr/bin/env python
import datetime, time, re
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
from matplotlib import gridspec
# load own modules
import spring_dynamics as _sd
__author__ = 'Rhys Whitley, Douglas Kelley, Martin De Kauwe'
__email__ = 'rhys.whitle... | apache-2.0 |
nvoron23/hue | desktop/core/ext-py/Babel-0.9.6/babel/tests/core.py | 61 | 1726 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software cons... | apache-2.0 |
hoatle/odoo | addons/base_setup/__init__.py | 439 | 1087 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | agpl-3.0 |
maciekcc/tensorflow | tensorflow/contrib/keras/python/keras/layers/recurrent.py | 17 | 49954 | # 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 |
fadushin/esp8266 | micropython/attic/server.py | 1 | 2662 | #!/usr/bin/env python
'''
Copyright (c) dushin.net 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 conditio... | bsd-2-clause |
mohierf/shinken | test/test_service_with_print_as_name.py | 18 | 1273 | #!/usr/bin/env python
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
#
# This file is part of Shinken.
#
# Shinken 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 F... | agpl-3.0 |
ehirt/odoo | addons/marketing_campaign/marketing_campaign.py | 51 | 41800 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2013 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of th... | agpl-3.0 |
ospaceteam/outerspace | server/lib/ige/ospace/Rules/Techs.py | 2 | 21080 | #
# Copyright 2001 - 2016 Ludek Smid [http://www.ospace.net/]
#
# This file is part of Outer Space.
#
# Outer Space 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
# (... | gpl-2.0 |
CEAMSO/openfonacide | openfonacide/migrations/0041_auto_20150513_0238.py | 3 | 4078 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('openfonacide', '0040_auto_20150424_2214'),
]
operations = [
migrations.CreateModel(
name='Adjudicacion',
... | lgpl-3.0 |
kaiix/depot_tools | third_party/gsutil/gslib/addlhelp/wildcards.py | 51 | 6581 | # Copyright 2012 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... | bsd-3-clause |
ScreamingUdder/mantid | Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/SANS/SANSLoad.py | 1 | 23158 | # pylint: disable=invalid-name
""" SANSLoad algorithm which handles loading SANS files"""
from __future__ import (absolute_import, division, print_function)
from mantid.kernel import (Direction, PropertyManagerProperty, FloatArrayProperty,
EnabledWhenProperty, PropertyCriterion)
from mantid... | gpl-3.0 |
pklaus/pyoscope | oscope.py | 3 | 7104 | #!/usr/bin/env python
# encoding: utf-8
#===========================================================
#
# This file is part of PyOscope
#
# oscope.py
# 06-Sept-2011
#
# Copyright (c) 2011 Michael Hadmack (michael.hadmack@gmail.com)
# This code is distributed under the MIT license
#
# derived from PyUSBtmc, Copyright (c)... | mit |
doged/electrum-doged-i2p | gui/qt/qrcodewidget.py | 4 | 3729 | from PyQt4.QtGui import *
from PyQt4.QtCore import *
import PyQt4.QtCore as QtCore
import PyQt4.QtGui as QtGui
import os
import qrcode
import electrum_doged
from electrum_doged import bmp
from electrum_doged.i18n import _
class QRCodeWidget(QWidget):
def __init__(self, data = None, fixedSize=False):
QW... | gpl-3.0 |
kosz85/django | tests/conditional_processing/views.py | 153 | 1296 | from django.http import HttpResponse
from django.views.decorators.http import condition, etag, last_modified
from .tests import ETAG, FULL_RESPONSE, LAST_MODIFIED, WEAK_ETAG
@condition(lambda r: ETAG, lambda r: LAST_MODIFIED)
def index(request):
return HttpResponse(FULL_RESPONSE)
@condition(last_modified_func=... | bsd-3-clause |
deepakar/NDN_content_poisoning | PyNDN/nre.py | 15 | 22562 | # -*- Mode:python; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
#
# Copyright (c) 2013, Regents of the University of California
# Yingdi Yu, Alexander Afanasyev
#
# BSD license, See the doc/LICENSE file for more information
#
# Author: Yingdi Yu <yingdi@cs.ucla.edu>
# Alexander Afanasyev ... | gpl-3.0 |
vicky2135/lucious | lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py | 2040 | 8935 | # 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_iden... | bsd-3-clause |
nealtodd/django | tests/template_tests/syntax_tests/test_regroup.py | 367 | 3984 | from datetime import date
from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class RegroupTagTests(SimpleTestCase):
@setup({'regroup01': ''
'{% regroup data by bar as grouped %}'
'{% for group in gro... | bsd-3-clause |
jayzeng/pyes | performance/utils.py | 6 | 1454 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
import os
from django.contrib.webdesign.lorem_ipsum import words as li_words
import shelve
import codecs
def get_names():
"""
Return a list of names.
"""
return [n.strip() for n in codecs.open(os.path.join("data", "names.txt"),"rb",'utf8').re... | bsd-3-clause |
jaywreddy/django | django/core/servers/basehttp.py | 274 | 7319 | """
HTTP server that implements the Python WSGI protocol (PEP 333, rev 1.21).
Based on wsgiref.simple_server which is part of the standard library since 2.5.
This is a simple server for use in testing or debugging Django apps. It hasn't
been reviewed for security issues. DON'T USE IT FOR PRODUCTION USE!
"""
from __f... | bsd-3-clause |
sgerhart/ansible | lib/ansible/modules/cloud/cloudstack/cs_vmsnapshot.py | 93 | 8249 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 Lice... | mit |
cselis86/edx-platform | openedx/core/djangoapps/content/course_structures/management/commands/generate_course_structure.py | 91 | 1980 | import logging
from optparse import make_option
from django.core.management.base import BaseCommand
from opaque_keys.edx.keys import CourseKey
from xmodule.modulestore.django import modulestore
from openedx.core.djangoapps.content.course_structures.tasks import update_course_structure
log = logging.getLogger(__name... | agpl-3.0 |
django-wodnas/django-filebrowser-no-grappelli | filebrowser/base.py | 4 | 5514 | # coding: utf-8
# imports
import os, re, datetime
from time import gmtime, strftime
# django imports
from django.conf import settings
# filebrowser imports
from filebrowser.settings import *
from filebrowser.functions import get_file_type, url_join, is_selectable, get_version_path
from django.utils.encoding import f... | bsd-3-clause |
CoDEmanX/ArangoDB | 3rdParty/V8-4.3.61/third_party/python_26/Lib/lib2to3/fixes/fix_execfile.py | 49 | 1974 | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer for execfile.
This converts usages of the execfile function into calls to the built-in
exec() function.
"""
from .. import fixer_base
from ..fixer_util import (Comma, Name, Call, LParen, RParen, Dot, Node,
... | apache-2.0 |
leoliujie/odoo | addons/lunch/lunch.py | 344 | 23407 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
FiwareULPGC/fiware-api-blueprint-renderer | setup.py | 2 | 1699 | from setuptools import setup
import setuptools
import os
from os import mkdir, umask
from shutil import rmtree
import errno
def get_packages(package):
"""Return root package and all sub-packages."""
return [dirpath
for dirpath, dirnames, filenames in os.walk(package)
if os.path.exists(... | mit |
alex/pip | pip/_vendor/ipaddress.py | 198 | 79659 | # Copyright 2007 Google Inc.
# Licensed to PSF under a Contributor Agreement.
"""A fast, lightweight IPv4/IPv6 manipulation library in Python.
This library is used to create/poke/manipulate IPv4 and IPv6 addresses
and networks.
"""
from __future__ import unicode_literals
import itertools
import struct
__version... | mit |
kawalpemilu/kawalpemilu2014 | internal-backend/http-server/gyp/test/subdirectory/gyptest-SYMROOT-all.py | 399 | 1269 | #!/usr/bin/env 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.
"""
Verifies building a target and a subsidiary dependent target from a
.gyp file in a subdirectory, without specifying an explicit output b... | agpl-3.0 |
manthansharma/kivy | examples/canvas/texture.py | 21 | 4187 | '''
Texture Wrapping and Coordinates Example
========================================
This example changes texture properties and the properties
of its containing rectangle. You should see some a multicolored
texture with sliders to the left and below and buttons at the
bottom of the screen. The image texture_example_... | mit |
deltreey/ansible | lib/ansible/module_utils/cloudstack.py | 118 | 13221 | # -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the aut... | gpl-3.0 |
hujiajie/chromium-crosswalk | tools/memory_inspector/memory_inspector/core/native_heap_unittest.py | 89 | 6402 | # Copyright 2014 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.
"""
The test scenario is as follows:
VA space: |0 |4k |8k |12k |16k |20k ... |64k |65k |66k
Mmaps: [ anon 1 ][anon 2] [a... | bsd-3-clause |
brianramos/empires-tv | lib/werkzeug/test.py | 39 | 34127 | # -*- coding: utf-8 -*-
"""
werkzeug.test
~~~~~~~~~~~~~
This module implements a client to WSGI applications for testing.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import sys
import mimetypes
from time import time
from... | gpl-3.0 |
ACOKing/ArcherVMPeridot | nodechip/node_modules/npm/node_modules/node-gyp/gyp/buildbot/buildbot_run.py | 497 | 5998 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Argument-less script to select what to run on the buildbots."""
import os
import shutil
import subprocess
import sys
if sys.platform ... | mit |
ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/python2.7/multiprocessing/synchronize.py | 96 | 10653 | #
# Module implementing synchronization primitives
#
# multiprocessing/synchronize.py
#
# Copyright (c) 2006-2008, R Oudkerk
# 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. Redistribution... | gpl-2.0 |
jumping/Diamond | src/collectors/ossec/ossec.py | 25 | 2344 | # coding=utf-8
"""
Shells out to get ossec statistics, which may or may not require sudo access.
Metrics:
- agents.active
- agents.never_connected
- agents.disconnected
- agents.active_local
#### Dependencies
* /var/ossec/bin/agent_control
"""
import diamond.collector
from diamond.collector import str_to_bool
im... | mit |
rekhajoshm/kafka | kafka-patch-review.py | 18 | 5765 | #!/usr/bin/env python
import argparse
import sys
import os
import time
import datetime
import tempfile
import commands
from jira.client import JIRA
def get_jira_config():
# read the config file
home=jira_home=os.getenv('HOME')
home=home.rstrip('/')
jira_config = dict(line.strip().split('=') for line in open(h... | apache-2.0 |
modalexii/Small-WebApps | wsgi/moinmoin/auroranet.py | 1 | 15310 | # -*- coding: iso-8859-1 -*-
"""
MoinMoin - modern theme
@copyright: 2003-2005 Nir Soffer, Thomas Waldmann
@license: GNU GPL, see COPYING for details.
"""
from MoinMoin.theme import ThemeBase
from MoinMoin import wikiutil
from MoinMoin.Page import Page
class Theme(ThemeBase):
name = "auroranet"
... | gpl-3.0 |
MarkoVogle3/Marko | cpp/coord/create.py | 46 | 1325 | #!/usr/bin/python3
#this script is a helper to create new coordinate system structs
#
#while there is no need to use it in any stage of development or building,
#it greatly simplifies the creation of new coordinate system/vector types.
#it has been developed in lieu of the erroneous manifold copy-pasting and
#adjustin... | gpl-3.0 |
alexcuellar/odoo | addons/product/tests/test_pricelist.py | 280 | 6748 | from openerp.tests.common import TransactionCase
class TestPricelist(TransactionCase):
"""Tests for unit of measure conversion"""
def setUp(self):
super(TestPricelist, self).setUp()
cr, uid, context = self.cr, self.uid, {}
self.ir_model_data = self.registry('ir.model.data')
sel... | agpl-3.0 |
gkatsikas/onos | tools/test/scenarios/bin/create-intent.py | 32 | 1192 | #! /usr/bin/env python
import requests
from requests.auth import HTTPBasicAuth
import sys
if len(sys.argv) != 7:
print "usage: create-intent onos-node name ingressDevice ingressPort egressDevice egressPort"
sys.exit(1)
node = sys.argv[1]
name = sys.argv[2]
ingress = sys.argv[3]
ingressPort = sys.argv[4]
e... | apache-2.0 |
tejasnikumbh/AllSAT | lib/python2.7/site-packages/numpy/testing/tests/test_decorators.py | 67 | 4134 | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import *
from numpy.testing.noseclasses import KnownFailureTest
import nose
def test_slow():
@dec.slow
def slow_func(x, y, z):
pass
assert_(slow_func.slow)
def test_setastest():
@dec.setast... | mit |
janocat/odoo | addons/mrp/wizard/change_production_qty.py | 245 | 4852 | # -*- 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 |
anandpdoshi/erpnext | erpnext/patches/v7_0/create_warehouse_nestedset.py | 2 | 4678 | import frappe
from frappe import _
from frappe.utils import cint
from frappe.utils.nestedset import rebuild_tree
def execute():
"""
Patch Reference:
1. check whether warehouse is associated to company or not
2. if warehouse is associated with company
a. create warehouse group for company
b. set warehouse g... | agpl-3.0 |
sinjar666/fbthrift | thrift/compiler/py/generate/t_cpp_generator.py | 1 | 212896 | #!/usr/local/bin/python2.6 -tt
#
# 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 (... | apache-2.0 |
Omegaphora/external_chromium_org | chrome/test/chromedriver/embed_version_in_cpp.py | 69 | 1114 | #!/usr/bin/env python
# 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.
"""Embeds Chrome user data files in C++ code."""
import optparse
import os
import sys
import chrome_paths
import cpp_source
sys.path... | bsd-3-clause |
semonte/intellij-community | python/helpers/python-skeletons/subprocess.py | 62 | 4287 | """Skeleton for 'subprocess' stdlib module."""
def call(args, bufsize=0, executable=None, stdin=None, stdout=None, stderr=None,
preexec_fn=None, close_fds=False, shell=False, cwd=None, env=None,
universal_newlines=False, startupinfo=None, creationflags=0,
timeout=None, restore_signals=True,... | apache-2.0 |
mitya57/django | django/contrib/gis/gdal/prototypes/srs.py | 88 | 3540 | from ctypes import POINTER, c_char_p, c_int, c_void_p
from django.contrib.gis.gdal.libgdal import lgdal, std_call
from django.contrib.gis.gdal.prototypes.generation import (
const_string_output, double_output, int_output, srs_output, string_output,
void_output,
)
# Shortcut generation for routines with known... | bsd-3-clause |
ben-hopps/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/projections/__init__.py | 69 | 2179 | from geo import AitoffAxes, HammerAxes, LambertAxes
from polar import PolarAxes
from matplotlib import axes
class ProjectionRegistry(object):
"""
Manages the set of projections available to the system.
"""
def __init__(self):
self._all_projection_types = {}
def register(self, *projections)... | agpl-3.0 |
s40523129/2017Springwcm_hw | plugin/tipue_search/tipue_search.py | 251 | 3821 | # -*- coding: utf-8 -*-
"""
Tipue Search
============
A Pelican plugin to serialize generated HTML to JSON
that can be used by jQuery plugin - Tipue Search.
Copyright (c) Talha Mansoor
"""
from __future__ import unicode_literals
import os.path
import json
from bs4 import BeautifulSoup
from codecs import open
try:
... | agpl-3.0 |
hazrpg/calibre | src/calibre/gui2/store/stores/feedbooks_plugin.py | 22 | 1067 | # -*- coding: utf-8 -*-
from __future__ import (unicode_literals, division, absolute_import, print_function)
store_version = 1 # Needed for dynamic plugin loading
__license__ = 'GPL 3'
__copyright__ = '2011, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
from calibre.gui2.store.basic_con... | gpl-3.0 |
ted-gould/nova | nova/scheduler/filters/core_filter.py | 15 | 3845 | # Copyright (c) 2011 OpenStack Foundation
# Copyright (c) 2012 Justin Santa Barbara
#
# 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.ap... | apache-2.0 |
lehoanganh/kcsdb | chef-repo/.chef/murder-kcsd/dist/BitTornado/BT1/NatCheck.py | 5 | 2731 | # Written by Bram Cohen
# see LICENSE.txt for license information
from cStringIO import StringIO
from socket import error as socketerror
from traceback import print_exc
try:
True
except:
True = 1
False = 0
protocol_name = 'BitTorrent protocol'
# header, reserved, download id, my id, [length, message]
cl... | apache-2.0 |
shuiqingliu/android_kernel_lenovo_stuttgart | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program i... | gpl-2.0 |
zstackio/zstack-woodpecker | integrationtest/vm/simulator/ha/test_set_ha_for_stopped_vm.py | 2 | 3204 | '''
New Test For set HA after stopped VM test
@author: Quarkonics
'''
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.operations.vm_operations as vm_ops
import zstackwoodpecker.operations.volume_operat... | apache-2.0 |
kou/arrow | python/pyarrow/compute.py | 3 | 18457 | # 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 |
dmnfarrell/peat | pKa/Design_plots.py | 1 | 21944 | #!/usr/bin/env python
#
# pKa - various programs and scripts for pKa value analysis, calculation and redesign
# Copyright (C) 2010 Jens Erik Nielsen
#
# 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 Foundat... | mit |
louyihua/edx-platform | lms/djangoapps/certificates/migrations/0001_initial.py | 17 | 12608 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import certificates.models
import model_utils.fields
import xmodule_django.models
import django_extensions.db.fields
import django_extensions.db.fields.json
import django.db.models.deletion
import django.utils.time... | agpl-3.0 |
ahmetabdi/SickRage | lib/requests/packages/chardet/big5freq.py | 3133 | 82594 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | gpl-3.0 |
slipstream/SlipStreamServer | rpm/src/main/migrations/022_migrate_module_to_cimi.py | 1 | 24667 | #!/usr/bin/env python
"""
SlipStream Client
=====
Copyright (C) 2018 SixSq Sarl (sixsq.com)
=====
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-... | apache-2.0 |
SnappleCap/oh-mainline | vendor/packages/oauthlib/oauthlib/oauth2/rfc6749/endpoints/pre_configured.py | 71 | 11201 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749
~~~~~~~~~~~~~~~~~~~~~~~
This module is an implementation of various logic needed
for consuming and providing OAuth 2.0 RFC6749.
"""
from __future__ import absolute_import, unicode_literals
from ..tokens import BearerToken
from ..grant_types import AuthorizationCodeG... | agpl-3.0 |
bgxavier/neutron | neutron/plugins/vmware/plugin.py | 11 | 1030 | # Copyright 2014 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 |
npiganeau/odoo | addons/hw_posbox_homepage/controllers/main.py | 72 | 2015 | # -*- coding: utf-8 -*-
import logging
import os
import time
from os import listdir
import openerp
from openerp import http
from openerp.http import request
from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
index_template = """
<!DOCTYPE HTML>
<html>
<head>
<title>Odoo's PosBox<... | agpl-3.0 |
ceph/autotest | cli/host_unittest.py | 3 | 72147 | #!/usr/bin/python
#
# Copyright 2008 Google Inc. All Rights Reserved.
"""Test for host."""
import unittest, os, sys
import common
from autotest_lib.cli import cli_mock, host
class host_ut(cli_mock.cli_unittest):
def test_parse_lock_options_both_set(self):
hh = host.host()
class opt(object):
... | gpl-2.0 |
singingwolfboy/pa11ycrawler | pa11ycrawler/html.py | 1 | 4427 | """
This script transforms JSON from the pa11ycrawler into a beautiful HTML
report.
"""
import re
import argparse
import json
import logging
import collections
from path import Path
from jinja2 import Environment, PackageLoader
from pa11ycrawler.util import pa11y_counts
log = logging.getLogger(__name__)
PARENT_DIR = ... | apache-2.0 |
gregdek/ansible | contrib/inventory/spacewalk.py | 42 | 8719 | #!/usr/bin/env python
"""
Spacewalk external inventory script
=================================
Ansible has a feature where instead of reading from /etc/ansible/hosts
as a text file, it can query external programs to obtain the list
of hosts, groups the hosts are in, and even variables to assign to each host.
To use... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.