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 |
|---|---|---|---|---|---|
jounex/hue | desktop/core/ext-py/Django-1.6.10/tests/tablespaces/models.py | 150 | 1819 | from django.db import models
# Since the test database doesn't have tablespaces, it's impossible for Django
# to create the tables for models where db_tablespace is set. To avoid this
# problem, we mark the models as unmanaged, and temporarily revert them to
# managed during each test. We also set them to use the same... | apache-2.0 |
seanli9jan/tensorflow | tensorflow/python/tools/freeze_graph.py | 12 | 18668 | # 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 |
ChadKillingsworth/closure-library | closure/bin/scopify.py | 329 | 6785 | #!/usr/bin/python
#
# 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
#
# ... | apache-2.0 |
jelugbo/ddi | lms/djangoapps/shoppingcart/migrations/0011_auto__add_invoice__add_field_courseregistrationcode_invoice.py | 13 | 14604 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Invoice'
db.create_table('shoppingcart_invoice', (
('id', self.gf('django.db.mod... | agpl-3.0 |
durandj/ynot-django | ynot/django/themes/templatetags/breadcrumbs.py | 1 | 2421 | from django import template as django_template
from django.template import defaulttags as django_defaulttags
from django.utils import encoding as django_encoding
# pylint: disable=invalid-name, too-few-public-methods
register = django_template.Library()
# pylint: disable=unused-argument
@register.tag
def... | mit |
chrismeyersfsu/ansible-modules-core | network/iosxr/iosxr_facts.py | 19 | 13332 | #!/usr/bin/python
#
# 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 distribut... | gpl-3.0 |
dimkal/mne-python | tutorials/plot_cluster_stats_spatio_temporal_2samp.py | 15 | 4321 | """
.. _tut_stats_cluster_source_2samp:
=========================================================================
2 samples permutation test on source data with spatio-temporal clustering
=========================================================================
Tests if the source space data are significantly differe... | bsd-3-clause |
cle1109/scot | doc/sphinxext/inheritance_diagram.py | 4 | 13650 | """
Defines a docutils directive for inserting inheritance diagrams.
Provide the directive with one or more classes or modules (separated
by whitespace). For modules, all of the classes in that module will
be used.
Example::
Given the following classes:
class A: pass
class B(A): pass
class C(A): pass
... | mit |
sahmed95/sympy | sympy/physics/mechanics/tests/test_kane2.py | 58 | 18815 | from sympy.core.compatibility import range
from sympy import cos, Matrix, simplify, sin, solve, tan, pi
from sympy import symbols, trigsimp, zeros
from sympy.physics.mechanics import (cross, dot, dynamicsymbols, KanesMethod,
inertia, inertia_of_point_mass,
... | bsd-3-clause |
kongseokhwan/kulcloud-iitp-neutron | neutron/db/migration/alembic_migrations/versions/1421183d533f_nsx_dhcp_metadata.py | 15 | 1701 | # 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 |
Tranzystorek/servo | tests/wpt/harness/wptrunner/update/state.py | 196 | 4417 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import cPickle as pickle
here = os.path.abspath(os.path.split(__file__)[0])
class State(object):
filenam... | mpl-2.0 |
Septima/qgis-wedgebuffer | src/WedgeBuffer/test/test_translations.py | 116 | 1741 | # coding=utf-8
"""Safe Translations Test.
.. 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 version.
"""
from ut... | gpl-2.0 |
edx/edx-enterprise | enterprise/migrations/0111_pendingenterprisecustomeradminuser.py | 1 | 3009 | # Generated by Django 2.2.15 on 2020-09-09 14:31
import simple_history.models
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.db import migrations, models
import model_utils.fields
class Migration(migrations.Migration):
dependencies = [
migrat... | agpl-3.0 |
openatv/enigma2 | tools/svg2skin.py | 98 | 2458 | #!/usr/bin/python
# don't expect too much.
# this is a really simple&stupid svg parser, which will use rectangles
# and text fields to produce <widget> snippets for a skin.
# use object "id" fields for source names if you want.
# extracting font information is buggy.
# if you want text fields, please use flow text regi... | gpl-2.0 |
hnakamur/ansible | v1/ansible/runner/lookup_plugins/url.py | 86 | 1588 | # (c) 2015, Brian Coca <bcoca@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 version.... | gpl-3.0 |
KaranToor/MA450 | google-cloud-sdk/lib/googlecloudsdk/third_party/appengine/api/yaml_builder.py | 7 | 14943 | #
# Copyright 2007 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 ... | apache-2.0 |
eino-makitalo/odoo | addons/account/wizard/account_period_close.py | 341 | 2646 | # -*- 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 |
Sorsly/subtle | google-cloud-sdk/lib/third_party/docker/docker/utils/types.py | 43 | 2304 | import six
class LogConfigTypesEnum(object):
_values = (
'json-file',
'syslog',
'journald',
'gelf',
'fluentd',
'none'
)
JSON, SYSLOG, JOURNALD, GELF, FLUENTD, NONE = _values
class DictType(dict):
def __init__(self, init):
for k, v in six.iterit... | mit |
blueshed/blueshed-micro | blueshed/micro/utils/executor.py | 1 | 2437 | from blueshed.micro.utils import resources
from tornado.concurrent import Future
from tornado.ioloop import IOLoop
from tornado.autoreload import add_reload_hook
from functools import wraps
import logging
import os
import inspect
from concurrent.futures.process import ProcessPoolExecutor
LOGGER = logging.getLogger(__... | mit |
mischief/systemd | .ycm_extra_conf.py | 129 | 1551 | import itertools
import os
import subprocess
def GetFlagsFromMakefile(varname):
return subprocess.check_output([
"make", "-s", "print-%s" % varname]).decode().split()
def Flatten(lists):
return list(itertools.chain.from_iterable(lists))
def DirectoryOfThisScript():
return os.path.dirname(os.path.abspat... | gpl-2.0 |
edry/edx-platform | common/djangoapps/third_party_auth/tests/test_views.py | 42 | 5678 | """
Test the views served by third_party_auth.
"""
# pylint: disable=no-member
import ddt
from lxml import etree
from onelogin.saml2.errors import OneLogin_Saml2_Error
import unittest
from .testutil import AUTH_FEATURE_ENABLED, SAMLTestCase
# Define some XML namespaces:
from third_party_auth.tasks import SAML_XML_NS
X... | agpl-3.0 |
beacloudgenius/edx-platform | lms/envs/static.py | 100 | 2249 | """
This config file runs the simplest dev environment using sqlite, and db-based
sessions. Assumes structure:
/envroot/
/db # This is where it'll write the database file
/edx-platform # The location of this repo
/log # Where we're going to write log files
"""
# We intentionally define lot... | agpl-3.0 |
apexkid/Wikiapiary | migrations/0009.create-statistics-weekly.py | 3 | 1389 | """
This is a weekly aggregation table to collect raw statistics data
into weekly summary information.
This migration implements part of the manually created Apiary DB
that WikiApiary launched with.
"""
from yoyo import step
step(
"CREATE TABLE `statistics_weekly` ( \
`website_id` int(11) NOT NULL, \
... | gpl-2.0 |
espressofiend/NCIL-SOC-2015 | PsychoPy/stroop_lastrun.py | 1 | 14481 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
This experiment was created using PsychoPy2 Experiment Builder (v1.82.00), Mon Jun 22 22:53:33 2015
If you publish work using this script please cite the relevant PsychoPy publications
Peirce, JW (2007) PsychoPy - Psychophysics software in Python. Journal of Neurosci... | mit |
XPRIZE/GLEXP-Team-SlideSpeech | appengine-try-python-flask-master/lib/werkzeug/debug/repr.py | 313 | 9350 | # -*- coding: utf-8 -*-
"""
werkzeug.debug.repr
~~~~~~~~~~~~~~~~~~~
This module implements object representations for debugging purposes.
Unlike the default repr these reprs expose a lot more information and
produce HTML instead of ASCII.
Together with the CSS and JavaScript files of the debug... | apache-2.0 |
dsturnbull/thrift | test/py.tornado/test_suite.py | 10 | 6355 | #!/usr/bin/env python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | apache-2.0 |
mollstam/UnrealPy | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/tests/files/tests.py | 24 | 9641 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import gzip
import os
import tempfile
import unittest
import zlib
from io import BytesIO, StringIO
from django.core.files import File
from django.core.files.base import ContentFile
from django.core.files.move import file_move_safe
from django.core.files.... | mit |
google-research/graph-attribution | tests/test_graphnet_techniques.py | 1 | 4088 | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
Big-B702/python-for-android | python-modules/twisted/twisted/conch/interfaces.py | 61 | 12993 | # Copyright (c) 2007-2008 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
This module contains interfaces defined for the L{twisted.conch} package.
"""
from zope.interface import Interface, Attribute
class IConchUser(Interface):
"""
A user who has been authenticated to Cred through Conch. This i... | apache-2.0 |
SauloAislan/ironic | ironic/common/keystone.py | 1 | 4019 | # coding=utf-8
#
# 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 agreed to in writing, software
# di... | apache-2.0 |
BT-fgarbely/odoo | addons/l10n_fr/wizard/__init__.py | 424 | 1462 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2008 JAILLET Simon - CrysaLEAD - www.crysalead.fr
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
#... | agpl-3.0 |
srajag/nova | nova/tests/api/openstack/compute/test_extensions.py | 12 | 29594 | # Copyright (c) 2011 X.commerce, a business unit of eBay Inc.
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# ... | apache-2.0 |
azukov/py-orbit | py/orbit/errors/__init__.py | 2 | 1880 | ## \namespace orbit::errors
## \brief The classes and functions for errors
##
## Classes:
## ErrorNode - error node for TEAPOT lattices
##
## Functions:
## addErrorNode - function to add one error
## node to the lattice
from orbit.errors.ErrorNode import coorddisplacement
from orbit.errors.ErrorNo... | mit |
lavvy/osmc | package/mediacenter-skin-osmc/files/usr/share/kodi/addons/script.module.unidecode/lib/unidecode/x0ca.py | 253 | 5007 | data = (
'jjael', # 0x00
'jjaelg', # 0x01
'jjaelm', # 0x02
'jjaelb', # 0x03
'jjaels', # 0x04
'jjaelt', # 0x05
'jjaelp', # 0x06
'jjaelh', # 0x07
'jjaem', # 0x08
'jjaeb', # 0x09
'jjaebs', # 0x0a
'jjaes', # 0x0b
'jjaess', # 0x0c
'jjaeng', # 0x0d
'jjaej', # 0x0e
'jjaec', # 0x... | gpl-2.0 |
googleapis/googleapis-gen | google/cloud/dialogflow/cx/v3beta1/dialogflow-cx-v3beta1-py/docs/conf.py | 2 | 12524 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
azverkan/scons | src/engine/SCons/Tool/RCS.py | 5 | 2246 | """SCons.Tool.RCS.py
Tool-specific initialization for RCS.
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 o... | mit |
andymckay/django | tests/regressiontests/templates/nodelist.py | 28 | 2558 | from django.template import VariableNode, Context
from django.template.loader import get_template_from_string
from django.utils.unittest import TestCase
from django.test.utils import override_settings
class NodelistTest(TestCase):
def test_for(self):
source = '{% for i in 1 %}{{ a }}{% endfor %}'
... | bsd-3-clause |
windskyer/nova | nova/virt/libvirt/volume/hgst.py | 33 | 2109 | # Copyright 2015 HGST
# 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 applicab... | gpl-2.0 |
lanselin/pysal | pysal/contrib/spint/tests/test_vec_SA.py | 5 | 2040 | """
Tests for analysis of spatial autocorrelation within vectors
"""
__author__ = 'Taylor Oshan tayoshan@gmail.com'
import unittest
import numpy as np
np.random.seed(1)
import pysal
from pysal.contrib.spint.vec_SA import VecMoran
from pysal.weights import DistanceBand
class TestVecMoran(unittest.TestCase):
"""T... | bsd-3-clause |
gundalow/ansible | lib/ansible/module_utils/urls.py | 19 | 77426 | # 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 author of the module, and may assign their own license
# to the complete wo... | gpl-3.0 |
divmain/GitSavvy | tests/mockito/verification.py | 2 | 5295 | # Copyright (c) 2008-2016 Szczepan Faber, Serhiy Oplakanets, Herr Kaste
#
# 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... | mit |
gnoack/ukechord | chordpro.py | 1 | 4308 | """Read ChordPro files and output them through a PDFWriter object"""
import re
import song
import uke
class ChordProError(Exception):
"""Error in a ChordPro input."""
pass
def _analyze_chordpro_textline(line):
"""Analyze the text and chords in a line of text.
Args:
line: The line of text, with chords... | apache-2.0 |
remind101/stacker_blueprints | stacker_blueprints/policies.py | 1 | 6595 | from awacs.aws import (
Action,
Allow,
Policy,
Principal,
Statement,
)
from troposphere import (
Sub,
Join,
Region,
AccountId,
AWSHelperFn
)
from awacs import (
sts,
s3,
logs,
ec2,
dynamodb,
cloudwatch,
)
def make_simple_assume_statement(*principals):
... | bsd-2-clause |
alexlee-gk/visual_dynamics | visual_dynamics/envs/quad_panda3d_env.py | 1 | 2967 | import numpy as np
import citysim3d.envs
from visual_dynamics.envs import Panda3dEnv
from visual_dynamics.spaces import Space, BoxSpace, TranslationAxisAngleSpace
from visual_dynamics.utils.config import ConfigObject
class SimpleQuadPanda3dEnv(citysim3d.envs.SimpleQuadPanda3dEnv, Panda3dEnv):
def _get_config(sel... | mit |
vsajip/django | django/forms/util.py | 5 | 3642 | from __future__ import unicode_literals
from django.conf import settings
from django.utils.html import format_html, format_html_join
from django.utils.encoding import StrAndUnicode, force_unicode
from django.utils.safestring import mark_safe
from django.utils import timezone
from django.utils.translation import ugette... | bsd-3-clause |
willingc/oh-mainline | vendor/packages/twisted/doc/mail/examples/smtpclient_tls.py | 22 | 4733 |
"""
Demonstrate sending mail via SMTP while employing TLS and performing
authentication.
"""
import sys
from OpenSSL.SSL import SSLv3_METHOD
from twisted.mail.smtp import ESMTPSenderFactory
from twisted.python.usage import Options, UsageError
from twisted.internet.ssl import ClientContextFactory
from twisted.intern... | agpl-3.0 |
samdoran/ansible | lib/ansible/plugins/__init__.py | 15 | 19872 | # (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>
#
# 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 Pub... | gpl-3.0 |
endlessm/chromium-browser | third_party/pyelftools/elftools/construct/core.py | 24 | 44500 | from struct import Struct as Packer
from .lib.py3compat import BytesIO, advance_iterator, bchr
from .lib import Container, ListContainer, LazyContainer
#===============================================================================
# exceptions
#======================================================================... | bsd-3-clause |
osborne6/luminotes | view/Page_navigation.py | 1 | 1736 | from Tags import P, Span, A, Strong
class Page_navigation( P ):
def __init__( self, page_path, displayed_item_count, total_item_count, start, items_per_page, return_text = None ):
if start is None or items_per_page is None:
P.__init__( self )
return
if displayed_item_count == 1 and displayed_ite... | gpl-3.0 |
tambetm/gymexperiments | a2c_atari.py | 1 | 10250 | import argparse
import os
import multiprocessing
from multiprocessing import Process, Queue, Array
import pickle
import gym
from gym.spaces import Box, Discrete
from keras.models import Model
from keras.layers import Input, TimeDistributed, Convolution2D, Flatten, LSTM, Dense
from keras.objectives import categorical... | mit |
matrixise/odoo | addons/l10n_in/__openerp__.py | 83 | 2248 | # -*- 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 |
shingo103/Kuku | test/gtest-1.7.0/scripts/fuse_gtest_files.py | 2577 | 8813 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | mit |
marcuskelly/recover | Lib/encodings/iso8859_10.py | 272 | 13589 | """ 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 |
SymbiFlow/symbiflow-arch-defs | utils/lib/parse_route.py | 1 | 1541 | """ Library for parsing route output from VPR route files. """
from collections import namedtuple
Node = namedtuple('Node', 'inode x_low y_low x_high y_high ptc')
def format_name(s):
""" Converts VPR parenthesized name to just name. """
assert s[0] == '('
assert s[-1] == ')'
return s[1:-1]
def form... | isc |
erwilan/ansible | lib/ansible/modules/network/f5/bigip_pool.py | 41 | 20012 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, Matt Hite <mhite@hotmail.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... | gpl-3.0 |
yongshengwang/hue | build/env/lib/python2.7/site-packages/Django-1.6.10-py2.7.egg/django/contrib/sites/tests.py | 124 | 3406 | from __future__ import unicode_literals
from django.conf import settings
from django.contrib.sites.models import Site, RequestSite, get_current_site
from django.core.exceptions import ObjectDoesNotExist, ValidationError
from django.http import HttpRequest
from django.test import TestCase
from django.test.utils import ... | apache-2.0 |
dcroc16/skunk_works | google_appengine/lib/django-1.4/django/dispatch/dispatcher.py | 315 | 9292 | import weakref
import threading
from django.dispatch import saferef
WEAKREF_TYPES = (weakref.ReferenceType, saferef.BoundMethodWeakref)
def _make_id(target):
if hasattr(target, 'im_func'):
return (id(target.im_self), id(target.im_func))
return id(target)
class Signal(object):
"""
Base class ... | mit |
sankar-p/opt-hotplug | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py | 4653 | 3596 | # EventClass.py
#
# This is a library defining some events types classes, which could
# be used by other scripts to analyzing the perf samples.
#
# Currently there are just a few classes defined for examples,
# PerfEvent is the base class for all perf event sample, PebsEvent
# is a HW base Intel x86 PEBS event, and use... | gpl-2.0 |
alkadis/vcv | scripts/make_user_admin.py | 6 | 1128 | #!/usr/bin/env python
"""
Extract email adresses from adhocracy. Emails from deleted users won't be
exported.
"""
from datetime import datetime
from sqlalchemy import and_, or_
from adhocracy.model import Group, Membership, meta, User
# boilerplate code. copy that
import os
import sys
sys.path.insert(0, os.path.abs... | agpl-3.0 |
graphite/TeX4Web-INVENIO | modules/elmsubmit/lib/elmsubmit_generate_marc.py | 35 | 6779 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2006, 2007, 2008, 2010, 2011 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
## Licens... | gpl-2.0 |
inventree/InvenTree | InvenTree/company/migrations/0001_initial.py | 2 | 4647 | # Generated by Django 2.2 on 2019-05-20 12:04
import company.models
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
... | mit |
odoo-turkiye/odoo | openerp/addons/test_access_rights/tests/test_ir_rules.py | 299 | 1220 | import openerp.exceptions
from openerp.tests.common import TransactionCase
class TestRules(TransactionCase):
def setUp(self):
super(TestRules, self).setUp()
self.id1 = self.env['test_access_right.some_obj']\
.create({'val': 1}).id
self.id2 = self.env['test_access_right.some_obj... | agpl-3.0 |
demisto/content | Packs/Silverfort/Integrations/Silverfort/Silverfort_test.py | 1 | 5886 | import pytest
from unittest.mock import patch
from Silverfort import get_user_entity_risk_command, get_resource_entity_risk_command,\
update_user_entity_risk_command, update_resource_entity_risk_command
API_KEY = "APIKEY"
@pytest.fixture(autouse=True)
def upn():
return 'sfuser@silverfort.io'
@pytest.fixture... | mit |
magacoin/magacoin | contrib/devtools/clang-format.py | 161 | 2130 | #!/usr/bin/env python
'''
Wrapper script for clang-format
Copyright (c) 2015 MarcoFalke
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.
'''
import os
import sys
import subprocess
tested... | mit |
NaohiroTamura/python-ironicclient | ironicclient/v1/chassis.py | 1 | 6569 | # -*- coding: utf-8 -*-
#
# 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 require... | apache-2.0 |
ptemplier/ansible | lib/ansible/modules/cloud/centurylink/clc_group.py | 26 | 16745 | #!/usr/bin/python
#
# Copyright (c) 2015 CenturyLink
# 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': ['previ... | gpl-3.0 |
marcusramberg/dotfiles | link/hammerspoon/hs/node_modules/node-gyp/gyp/pylib/gyp/input.py | 713 | 115880 | # 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.
from compiler.ast import Const
from compiler.ast import Dict
from compiler.ast import Discard
from compiler.ast import List
from compiler.ast import Module
from co... | mit |
1905410/Misago | misago/threads/views/admin/attachments.py | 1 | 3500 | from django.contrib import messages
from django.core.urlresolvers import reverse
from django.db import transaction
from django.db.models import Count
from django.shortcuts import redirect
from django.utils.translation import ugettext_lazy as _
from misago.admin.views import generic
from ...forms import SearchAttachme... | gpl-2.0 |
unreal666/outwiker | plugins/source/source/pygments/styles/stata_light.py | 4 | 1274 | # -*- coding: utf-8 -*-
"""
pygments.styles.stata_light
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Light Style inspired by Stata's do-file editor. Note this is not
meant to be a complete style, just for Stata's file formats.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, se... | gpl-3.0 |
mbernasocchi/inasafe | safe/metadata35/test/test_metadata.py | 6 | 2206 | # coding=utf-8
"""
InaSAFE Disaster risk assessment tool developed by AusAid -
**Exception Classes.**
Custom exception classes for the IS application.
Contact : ole.moller.nielsen@gmail.com
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Publi... | gpl-3.0 |
pombredanne/blivet-1 | tests/devicelibs_test/edd_test.py | 1 | 9403 | import mock
class EddTestCase(mock.TestCase):
def setUp(self):
self.setupModules(
['_isys', 'logging', 'pyanaconda.anaconda_log', 'block'])
def tearDown(self):
self.tearDownModules()
def test_biosdev_to_edd_dir(self):
from blivet.devicelibs import edd
path = ed... | gpl-2.0 |
bbc/kamaelia | Sketches/MPS/BugReports/FixTests/Kamaelia/Kamaelia/Device/DVB/Parse/ParseEventInformationTable.py | 3 | 25358 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, ... | apache-2.0 |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/host/lib/python3.4/multiprocessing/reduction.py | 94 | 8108 | #
# Module which deals with pickling of objects.
#
# multiprocessing/reduction.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
import copyreg
import functools
import io
import os
import pickle
import socket
import sys
from . import context
__all__ = ['send_handle', 'recv_... | gpl-2.0 |
googleapis/python-pubsublite | google/cloud/pubsublite_v1/services/cursor_service/transports/__init__.py | 1 | 1185 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 |
great-expectations/great_expectations | tests/dataset/test_sparkdfdataset.py | 1 | 14191 | import importlib.util
import json
from unittest import mock
import pandas as pd
import pytest
from great_expectations.dataset.sparkdf_dataset import SparkDFDataset
from great_expectations.util import is_library_loadable
def test_sparkdfdataset_persist(spark_session):
df = pd.DataFrame({"a": [1, 2, 3]})
sdf ... | apache-2.0 |
DickJC123/mxnet | example/distributed_training/cifar10_kvstore_hvd.py | 9 | 7670 | #!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | apache-2.0 |
hnakamur/ansible | lib/ansible/plugins/callback/context_demo.py | 144 | 1447 | # (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 |
Marcelpv96/SITWprac2017 | sportsBetting/migrations/0018_auto_20170515_1009.py | 1 | 1050 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-05-15 10:09
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_depende... | gpl-3.0 |
BeDjango/intef-openedx | openedx/core/djangoapps/credit/api/provider.py | 24 | 15608 | """
API for initiating and tracking requests for credit from a provider.
"""
import datetime
import logging
import uuid
import pytz
from django.db import transaction
from lms.djangoapps.django_comment_client.utils import JsonResponse
from openedx.core.djangoapps.credit.exceptions import (
UserIsNotEligible,
... | agpl-3.0 |
nouiz/pylearn2 | pylearn2/termination_criteria/tests/test_init.py | 32 | 3511 | """
Tests for pylearn2.termination_criteria.__init__ functions and classes.
"""
from pylearn2.termination_criteria import EpochCounter
from pylearn2.datasets.dense_design_matrix import DenseDesignMatrix
from pylearn2.models.mlp import MLP, Softmax
from pylearn2.monitor import push_monitor
from pylearn2.train import T... | bsd-3-clause |
leviroth/praw | praw/reddit.py | 1 | 20843 | """Provide the Reddit class."""
import configparser
import os
from itertools import islice
try:
from update_checker import update_check
UPDATE_CHECKER_MISSING = False
except ImportError: # pragma: no cover
UPDATE_CHECKER_MISSING = True
from prawcore import (
Authorizer,
DeviceIDAuthorizer,
... | bsd-2-clause |
lzw120/django | build/lib/django/contrib/gis/gdal/prototypes/srs.py | 97 | 3372 | from ctypes import c_char_p, c_int, c_void_p, POINTER
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 paramet... | bsd-3-clause |
kostimarko/portfolio-v2 | node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/styles/colorful.py | 364 | 2778 | # -*- coding: utf-8 -*-
"""
pygments.styles.colorful
~~~~~~~~~~~~~~~~~~~~~~~~
A colorful style, inspired by CodeRay.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, ... | mit |
Softmotions/edx-platform | cms/djangoapps/contentstore/management/commands/fix_not_found.py | 108 | 1110 | """
Script for fixing the item not found errors in a course
"""
from django.core.management.base import BaseCommand, CommandError
from opaque_keys.edx.keys import CourseKey
from xmodule.modulestore.django import modulestore
from xmodule.modulestore import ModuleStoreEnum
# To run from command line: ./manage.py cms fix... | agpl-3.0 |
forumber/Temiz_Kernel_G3 | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... | gpl-2.0 |
Dr-Drive/hycohanz | examples/create_sphere.py | 1 | 1265 | import hycohanz as hfss
raw_input('Press "Enter" to connect to HFSS.>')
[oAnsoftApp, oDesktop] = hfss.setup_interface()
raw_input('Press "Enter" to create a new project.>')
oProject = hfss.new_project(oDesktop)
raw_input('Press "Enter" to insert a new DrivenModal design named HFSSDesign1.>')
oDesign =... | bsd-2-clause |
oceanobservatories/mi-instrument | mi/core/instrument/instrument_driver.py | 3 | 51213 | #!/usr/bin/env python
"""
@package ion.services.mi.instrument_driver Instrument driver structures
@file ion/services/mi/instrument_driver.py
@author Edward Hunter
@brief Instrument driver classes that provide structure towards interaction
with individual instruments in the system.
"""
import json
import random
import... | bsd-2-clause |
bnprk/django-oscar | src/oscar/apps/basket/abstract_models.py | 22 | 28676 | from decimal import Decimal as D
import zlib
from django.db import models
from django.db.models import Sum
from django.conf import settings
from django.utils.encoding import python_2_unicode_compatible, smart_text
from django.utils.timezone import now
from django.utils.translation import ugettext_lazy as _
from django... | bsd-3-clause |
pavelchristof/gomoku-ai | tensorflow/contrib/distributions/python/kernel_tests/bijectors/sigmoid_centered_test.py | 76 | 2003 | # 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 |
ocefpaf/paegan | tests/cdm/dsg/collections/base/test_profile_collection.py | 2 | 2207 | # -*- coding: utf-8 -*-
import random
import unittest
from datetime import datetime, timedelta
from shapely.geometry import Point as sPoint
from paegan.cdm.dsg.member import Member
from paegan.cdm.dsg.features.base.point import Point
from paegan.cdm.dsg.features.base.profile import Profile
from paegan.cdm.dsg.collect... | gpl-3.0 |
mrkarthik07/libforensics | unittests/tests/dtypes/dal.py | 13 | 6774 | # Copyright 2010 Michael Murr
#
# This file is part of LibForensics.
#
# LibForensics 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 3 of the License, or
# (at your option) any later ver... | gpl-3.0 |
djb1815/Essex-MuSoc | musoc_web/schedule/views.py | 1 | 1465 | from django.shortcuts import render, redirect
from django.db import transaction
from django.contrib.auth.decorators import login_required
from .forms import ProfileNameForm, ProfileDetailForm
from django.contrib import messages
# Create your views here.
def index(request):
# Add variables in the custom_variables... | mit |
Opshun/API | venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/sbcsgroupprober.py | 2936 | 3291 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
ionutcipriananescu/python | Yixiaohan/0000/avatar_add_number.py | 40 | 1076 | #!/usr /bin/env python
# -*- coding: utf-8 -*-
"""
将你的 QQ 头像(或者微博头像)右上角加上红色的数字,类似于微信未读信息数量那种提示效果。
Pillow:Python Imaging Library
PIL.ImageDraw.Draw.text(xy, text, fill=None, font=None, anchor=None)
"""
from PIL import Image, ImageDraw, ImageFont
original_avatar = 'weChat_avatar.png'
saved_avatar = 'new_avatar.png'
wi... | mit |
usakhelo/FreeCAD | src/Mod/Fem/PyGui/_CommandFemResultShow.py | 2 | 2797 | # ***************************************************************************
# * *
# * Copyright (c) 2013-2015 - Juergen Riegel <FreeCAD@juergen-riegel.net> *
# * *
# * Th... | lgpl-2.1 |
trezorg/django | django/contrib/localflavor/it/it_province.py | 406 | 2740 | # -*- coding: utf-8 -*
PROVINCE_CHOICES = (
('AG', 'Agrigento'),
('AL', 'Alessandria'),
('AN', 'Ancona'),
('AO', 'Aosta'),
('AR', 'Arezzo'),
('AP', 'Ascoli Piceno'),
('AT', 'Asti'),
('AV', 'Avellino'),
('BA', 'Bari'),
('BT', 'Barletta-Andria-Trani'), # active starting from 2009
... | bsd-3-clause |
DavidAndreev/indico | indico/MaKaC/webinterface/pages/static.py | 2 | 2989 | # This file is part of Indico.
# Copyright (C) 2002 - 2016 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | gpl-3.0 |
cloughrm/Flask-Angular-Template | backend/pastry/resources/v1/users.py | 1 | 1720 | from pastry.db import mongo
from pastry.models import User
from pastry.resources.auth import login_required
from pastry.resources import validators, httpcodes
from bson.objectid import ObjectId
from flask import request
from flask.ext.restful import Resource, reqparse
class UsersResource(Resource):
@login_requi... | mit |
peerster/CouchPotatoServer | libs/pyutil/verlib.py | 106 | 12275 | # -*- coding: utf-8 -*-
"""
"Rational" version definition and parsing for DistutilsVersionFight
discussion at PyCon 2009.
This was written by Tarek Ziadé.
Zooko copied it from http://bitbucket.org/tarek/distutilsversion/ on 2010-07-29.
"""
import re
class IrrationalVersionError(Exception):
"""This is an irrati... | gpl-3.0 |
jaxxstorm/fullerite | src/diamond/collectors/jolokia/jolokia.py | 21 | 7813 | # coding=utf-8
"""
Collects JMX metrics from the Jolokia Agent. Jolokia is an HTTP bridge that
provides access to JMX MBeans without the need to write Java code. See the
[Reference Guide](http://www.jolokia.org/reference/html/index.html) for more
information.
By default, all MBeans will be queried for metrics. All n... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.