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 |
|---|---|---|---|---|---|
jallohm/django | tests/template_tests/templatetags/custom.py | 152 | 5394 | import operator
import warnings
from django import template
from django.template.defaultfilters import stringfilter
from django.utils import six
from django.utils.html import escape, format_html
register = template.Library()
@register.filter
@stringfilter
def trim(value, num):
return value[:num]
@register.fil... | bsd-3-clause |
rasata/pypes | ui/pypesvds/plugins/splitoperator/splitoperator.py | 5 | 1061 | import logging
#import traceback
from pypes.component import Component
log = logging.getLogger(__name__)
class Split(Component):
__metatype__ = 'OPERATOR'
def __init__(self):
# initialize parent class
Component.__init__(self)
self.add_output('out2', 'Second Output Port')
log.... | apache-2.0 |
Mj258/weiboapi | srapyDemo/envs/Lib/site-packages/twisted/python/util.py | 2 | 31276 | # -*- test-case-name: twisted.python.test.test_util -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
from __future__ import division, absolute_import, print_function
import os, sys, errno, warnings
try:
import pwd, grp
except ImportError:
pwd = grp = None
try:
from os import set... | mit |
mfjb/scikit-learn | sklearn/covariance/tests/test_robust_covariance.py | 213 | 3359 | # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Virgile Fritsch <virgile.fritsch@inria.fr>
#
# License: BSD 3 clause
import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_alm... | bsd-3-clause |
andyh616/mne-python | examples/preprocessing/plot_run_ica.py | 13 | 1519 | # doc:slow-example
"""
================================
Compute ICA components on epochs
================================
ICA is fit to MEG raw data.
We assume that the non-stationary EOG artifacts have already been removed.
The sources matching the ECG are automatically found and displayed.
Subsequently, artefact det... | bsd-3-clause |
codeaudit/fuel | fuel/schemes.py | 21 | 10120 | from abc import ABCMeta, abstractmethod
from collections import Iterable
import numpy
from picklable_itertools import chain, repeat, imap, iter_
from picklable_itertools.extras import partition_all
from six import add_metaclass
from six.moves import xrange
from fuel import config
@add_metaclass(ABCMeta)
class Itera... | mit |
vitaly-krugl/nupic | src/nupic/swarming/hypersearch/object_json.py | 49 | 5091 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
zarboz/Evita-Jellybean | Documentation/target/tcm_mod_builder.py | 4981 | 41422 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
verma-varsha/zulip | zerver/tests/test_type_debug.py | 1 | 5027 | from __future__ import print_function
import sys
from unittest import TestCase
from six.moves import cStringIO as StringIO
from zerver.lib.type_debug import print_types
from typing import Any, Callable, Dict, Iterable, Tuple, TypeVar
T = TypeVar('T')
def add(x=0, y=0):
# type: (Any, Any) -> Any
return x + ... | apache-2.0 |
aravindvenkatesan/AgroLD-scripts | AgroLD_ETL/riceKBpipeline.py | 1 | 10862 | #!/usr/bin/env python
import glob
#from Bio.UniProt import GOA
import pprint
#from riceKB import * #southGreenParsers #oryzaBaseParser gafToRDF grameneParsers TairParser grameneParsers
#import riceKB
import os
import re
from riceKB import gafToRDF, grameneParsers, oryzaBaseParser, TairParser,\
southGreenParsers, ... | cc0-1.0 |
MTASZTAKI/ApertusVR | plugins/languageAPI/jsAPI/3rdParty/nodejs/10.1.0/source/tools/gyp/pylib/gyp/MSVSNew.py | 1835 | 12124 | # 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.
"""New implementation of Visual Studio project generation."""
import os
import random
import gyp.common
# hashlib is supplied as of Python 2.5 as the replacemen... | mit |
hkariti/ansible | lib/ansible/modules/network/nxos/nxos_bgp_neighbor_af.py | 5 | 27591 | #!/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 |
dvliman/jaikuengine | .google_appengine/lib/django-1.2/django/contrib/formtools/wizard.py | 44 | 10889 | """
FormWizard class -- implements a multi-page form, validating between each
step and storing the form's state as HTML hidden fields so that no state is
stored on the server side.
"""
import cPickle as pickle
from django import forms
from django.conf import settings
from django.http import Http404
from django.shortc... | apache-2.0 |
3dfxmadscientist/CBSS | addons/account/account_invoice.py | 2 | 97945 | # -*- 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 |
izakp/hokusai | hokusai/commands/deployment.py | 1 | 1832 | from hokusai.lib.command import command
from hokusai.lib.common import print_green
from hokusai.services.deployment import Deployment
from hokusai.services.command_runner import CommandRunner
from hokusai.services.ecr import ECR
from hokusai.lib.exceptions import HokusaiError
@command()
def update(context, tag, migrat... | mit |
pokelondon/pokeradio | web/pokeradio/api/migrations/0001_initial.py | 1 | 4669 | # -*- 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 'Token'
db.create_table(u'api_token', (
(u'id', self.gf('django.db.models.fields.... | gpl-3.0 |
tuxfux-hlp-notes/python-batches | archieves/batch-64/09-modules/myenv/lib/python2.7/site-packages/django/utils/daemonize.py | 169 | 2046 | import os
import sys
from . import six
buffering = int(six.PY3) # No unbuffered text I/O on Python 3 (#20815).
if os.name == 'posix':
def become_daemon(our_home_dir='.', out_log='/dev/null',
err_log='/dev/null', umask=0o022):
"Robustly turn into a UNIX daemon, running in our_... | gpl-3.0 |
idl3r/Ropper | ropperapp/disasm/gadget.py | 1 | 4099 | #!/usr/bin/env python2
# coding=utf-8
#
# Copyright 2014 Sascha Schirra
#
# This file is part of Ropper.
#
# Ropper 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 you... | gpl-2.0 |
JVillella/tensorflow | tensorflow/contrib/learn/python/learn/preprocessing/categorical_vocabulary.py | 63 | 4206 | # 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 |
mgoulish/qpid-dispatch | tests/system_tests_core_endpoint.py | 2 | 9837 | #
# 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... | apache-2.0 |
RO-ny9/python-for-android | python3-alpha/python3-src/PC/VS8.0/build_tkinter.py | 91 | 2196 | """Script to compile the dependencies of _tkinter
Copyright (c) 2007 by Christian Heimes <christian@cheimes.de>
Licensed to PSF under a Contributor Agreement.
"""
import os
import sys
here = os.path.abspath(os.path.dirname(__file__))
par = os.path.pardir
if 1:
TCL = "tcl8.4.16"
TK = "tk8.4.16"
TIX = "t... | apache-2.0 |
h4ck3rm1k3/pywikibot-core | pywikibot/version.py | 1 | 18622 | # -*- coding: utf-8 -*-
"""Module to determine the pywikibot version (tag, revision and date)."""
#
# (C) Merlijn 'valhallasw' van Deen, 2007-2014
# (C) xqt, 2010-2016
# (C) Pywikibot team, 2007-2016
#
# Distributed under the terms of the MIT license.
#
from __future__ import absolute_import, unicode_literals
__versi... | mit |
RedMike/pYendor | lib/fov.py | 1 | 11735 | # Author: Aaron MacDonald
# Date: June 14, 2007
#
# Description: An implementation of the precise permissive field
# of view algorithm for use in tile-based games.
# Based on the algorithm presented at
# http://roguebasin.rogue... | bsd-2-clause |
TakayukiSakai/tensorflow | tensorflow/python/ops/gradients.py | 2 | 28479 | # 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 |
tersmitten/ansible | contrib/inventory/rackhd.py | 52 | 3044 | #!/usr/bin/env 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 distri... | gpl-3.0 |
lightblu/ansible-modules-extras | system/selinux_permissive.py | 88 | 4067 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Michael Scherer <misc@zarb.org>
# inspired by code of github.com/dandiker/
#
# 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 Softwar... | gpl-3.0 |
onyxfish/journalism | agate/aggregations/percentiles.py | 4 | 2233 | #!/usr/bin/env python
import math
from agate.aggregations.base import Aggregation
from agate.aggregations.has_nulls import HasNulls
from agate.data_types import Number
from agate.exceptions import DataTypeError
from agate.utils import Quantiles
from agate.warns import warn_null_calculation
class Percentiles(Aggrega... | mit |
Vijaysai005/KProject | vijay/DBSCAN/clustering/db/generate_data.py | 1 | 5801 | # usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 20 13:15:05 2017
@author: Vijayasai S
"""
# Use python3
from haversine import distance
from datetime import datetime
from dateutil import tz
import my_dbscan as mydb
import alert_update as au
from pymongo import MongoClient
import pandas as pd
im... | gpl-3.0 |
dalegregory/odoo | addons/website_blog/__init__.py | 373 | 1036 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 |
google-research/google-research | darc/train_eval.py | 1 | 15970 | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 |
cattleprod/samsung-kernel-gt-i9100 | external/webkit/WebKitTools/pywebsocket/test/test_dispatch.py | 3 | 11046 | #!/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... | gpl-2.0 |
Nkleppan/CSE-360 | image_space_app/tests/tests.py | 1 | 4528 | import datetime
from django.test.client import Client
from django.utils import timezone
from django.test import TestCase
from signups.models import SignUp, Event
from django.test import LiveServerTestCase
from django.contrib.auth.models import User
from selenium import webdriver
c=Client()
class ImageSpaceTests(TestC... | gpl-2.0 |
BlackSmith/GreenTea | lib/gitconfig/config.py | 2 | 1122 | import os
from section import section
from shell import shell
class config(object):
filename = None
def __init__(self, filename):
self.filename = os.path.expanduser(filename)
def __getattr__(self, name):
return section(self, name) # called if self.key not exists
@property
def ... | gpl-2.0 |
alfa-addon/addon | plugin.video.alfa/lib/python_libtorrent/linux_aarch64_ucs2/1.1.0/__init__.py | 362 | 1240 | #-*- coding: utf-8 -*-
'''
python-libtorrent for Kodi (script.module.libtorrent)
Copyright (C) 2015-2016 DiMartino, srg70, RussakHH, aisman
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 t... | gpl-3.0 |
kalrey/swift | swift/obj/mem_server.py | 6 | 4317 | # Copyright (c) 2010-2013 OpenStack, 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 ... | apache-2.0 |
BT-fgarbely/odoo | addons/base_gengo/wizard/__init__.py | 434 | 1077 | # -*- 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 |
Etwigg/Examples | Group Project Website/venv/Lib/site-packages/pip/_vendor/requests/packages/chardet/escprober.py | 2936 | 3187 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... | mit |
rapilabs/django | django/utils/datetime_safe.py | 535 | 2836 | # Python's datetime strftime doesn't handle dates before 1900.
# These classes override date and datetime to support the formatting of a date
# through its full "proleptic Gregorian" date range.
#
# Based on code submitted to comp.lang.python by Andrew Dalke
#
# >>> datetime_safe.date(1850, 8, 2).strftime("%Y/%m/%d was... | bsd-3-clause |
upshot-nutrition/upshot-nutrition.github.io | node_modules/node-gyp/gyp/pylib/gyp/input_test.py | 1841 | 3207 | #!/usr/bin/env python
# Copyright 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... | mit |
JonGal/appengine-ml-demo | app/lib/oauth2client/contrib/gce.py | 39 | 5431 | # Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | apache-2.0 |
Usherwood/usherwood_ds | usherwood_ds/nlp/n_grams/processes.py | 1 | 3607 | #!/usr/bin/env python
"""Functions designed to help n_grams>usherwood_ds run but shouldnt ever need to be called directly by the user."""
import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.feature_extraction.text import TfidfVectorizer
__author__ = "Peter J Usherwood"
__pyth... | bsd-2-clause |
SUSE/lrbd | test/test_luns.py | 2 | 3550 |
from lrbd import Luns, Common, Runtime, entries
import unittest, mock
import re, tempfile
import logging
class LunsTestCase(unittest.TestCase):
def setUp(self):
Common.config = {
"iqns": [ "iqn.xyz" ],
"pools": [
{ "pool": "rbd",
"gateways": [
... | lgpl-2.1 |
blacklin/kbengine | kbe/src/lib/python/Lib/plat-freebsd7/IN.py | 344 | 12956 | # Generated by h2py from /usr/include/netinet/in.h
# Included from sys/cdefs.h
__GNUCLIKE_ASM = 3
__GNUCLIKE_ASM = 2
__GNUCLIKE___TYPEOF = 1
__GNUCLIKE___OFFSETOF = 1
__GNUCLIKE___SECTION = 1
__GNUCLIKE_ATTRIBUTE_MODE_DI = 1
__GNUCLIKE_CTOR_SECTION_HANDLING = 1
__GNUCLIKE_BUILTIN_CONSTANT_P = 1
__GNUCLIKE_BUILTIN_VARA... | lgpl-3.0 |
forairan/gagar | gagar/drawutils.py | 1 | 2510 | TWOPI = 6.28318530717958
BLACK = (0,0,0)
WHITE = (1,1,1)
GRAY = (.5,)*3
DARK_GRAY = (.2,)*3
LIGHT_GRAY = (.7,)*3
RED = (1,0,0)
GREEN = (0,1,0)
BLUE = (0,0,1)
YELLOW = (1,1,0)
TURQUOISE = (0,1,1)
FUCHSIA = (1,0,1)
ORANGE = (1,.5,0)
PURPLE = (.5,0,1)
LIGHT_GREEN = (.5,1,.5)
LIGHT_BLUE = (.5,.5,1)
def frange(start, en... | gpl-3.0 |
zsiciarz/django | django/test/client.py | 11 | 26926 | import json
import mimetypes
import os
import re
import sys
from copy import copy
from importlib import import_module
from io import BytesIO
from urllib.parse import unquote_to_bytes, urljoin, urlparse, urlsplit
from django.conf import settings
from django.core.handlers.base import BaseHandler
from django.core.handler... | bsd-3-clause |
afedchin/xbmctorrent | resources/site-packages/xbmcswift2/common.py | 34 | 3614 | '''
xbmcswift2.common
-----------------
This module contains some common helpful functions.
:copyright: (c) 2012 by Jonathan Beluch
:license: GPLv3, see LICENSE for more details.
'''
import urllib
import urllib2
try:
import cPickle as pickle
except ImportError:
import pickle
def xbmc_url... | gpl-3.0 |
maikelwever/glances | glances/plugins/glances_ip.py | 10 | 3785 | # -*- coding: utf-8 -*-
#
# This file is part of Glances.
#
# Copyright (C) 2015 Nicolargo <nicolas@nicolargo.com>
#
# Glances 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 Lic... | lgpl-3.0 |
dandxy89/rf_helicopter | Model/Q_Learning_Agent.py | 1 | 15899 | # Purpose: Agent uses the Q-Learning Algorithm to Interact with the Environment
#
# Info: Class that Implements the Q-Learning Algorithm
#
# Developed as part of the Software Agents Course at City University
#
# Dev: Dan Dixey and Enrico Lopedoto
#
#
import logging
import os
import pickle
from random import choic... | mit |
Juzley/grpc | src/python/src/grpc/framework/face/testing/base_util.py | 5 | 3776 | # Copyright 2015, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
nikolas/edx-platform | openedx/core/lib/tests/test_cache_utils.py | 144 | 2107 | """
Tests for cache_utils.py
"""
import ddt
from mock import MagicMock
from unittest import TestCase
from openedx.core.lib.cache_utils import memoize_in_request_cache
@ddt.ddt
class TestMemoizeInRequestCache(TestCase):
"""
Test the memoize_in_request_cache helper function.
"""
class TestCache(object)... | agpl-3.0 |
justyns/home-assistant | homeassistant/components/thermostat/demo.py | 3 | 2491 | """
Demo platform that offers a fake thermostat.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/demo/
"""
from homeassistant.components.thermostat import ThermostatDevice
from homeassistant.const import TEMP_CELCIUS, TEMP_FAHRENHEIT
def setup_platform(has... | mit |
michelts/lettuce | tests/integration/lib/Django-1.2.5/tests/regressiontests/cache/tests.py | 38 | 28208 | # -*- coding: utf-8 -*-
# Unit tests for cache framework
# Uses whatever cache backend is set in the test settings file.
import os
import tempfile
import time
import unittest
import warnings
from django.conf import settings
from django.core import management
from django.core.cache import get_cache
from django.core.c... | gpl-3.0 |
procangroup/edx-platform | common/test/acceptance/fixtures/config.py | 14 | 3153 | """
Fixture to manipulate configuration models.
"""
import json
import re
import requests
from lazy import lazy
from common.test.acceptance.fixtures import LMS_BASE_URL, STUDIO_BASE_URL
class ConfigModelFixtureError(Exception):
"""
Error occurred while configuring the stub XQueue.
"""
pass
class C... | agpl-3.0 |
mavit/ansible | test/units/modules/network/nos/nos_module.py | 27 | 2501 | # (c) 2018 Extreme Networks 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.
#
# Ansib... | gpl-3.0 |
FabienPean/sofa | applications/plugins/SofaPython/python/SofaPython/DAGValidation.py | 11 | 3766 | import sys
import Sofa
import Tools
def MechanicalObjectVisitor(node):
## listing mechanical states, bottom-up from node
ancestors = []
visited = []
for p in node.getParents():
path = p.getPathName()
if not path in visited:
state = p.getMechanicalState(... | lgpl-2.1 |
solintegra/addons | purchase_landed_cost/models/stock_picking.py | 18 | 1336 | # -*- encoding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in root directory
##############################################################################
from openerp import models, api
class StockPicking(mode... | agpl-3.0 |
AnhellO/DAS_Sistemas | Ago-Dic-2019/Ricardo_Romero_Medina/Ordinario/buscarLocacion.py | 1 | 1341 | import requests
import ubicacion
import database
class obtener_Locacion():
r = requests.get('https://rickandmortyapi.com/api/location/')
texto = r.json()
paginas = texto['info']['pages']
db = database.basedatos()
db.crear_tabla_locaciones()
for i in range(1,paginas+1):
r = requests.get... | mit |
indirectlylit/kolibri | kolibri/deployment/default/settings/base.py | 2 | 11441 | # -*- coding: utf-8 -*-
"""
Django settings for kolibri project.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
from __future__ import absolute_import
from __fut... | mit |
kamalx/edx-platform | common/lib/xmodule/xmodule/tests/test_word_cloud.py | 166 | 1792 | # -*- coding: utf-8 -*-
"""Test for Word cloud Xmodule functional logic."""
from webob.multidict import MultiDict
from xmodule.word_cloud_module import WordCloudDescriptor
from . import LogicTest
class WordCloudModuleTest(LogicTest):
"""Logic tests for Word Cloud Xmodule."""
descriptor_class = WordCloudDescr... | agpl-3.0 |
xinjiguaike/edx-platform | lms/djangoapps/verify_student/admin.py | 48 | 1958 | from ratelimitbackend import admin
from verify_student.models import (
SoftwareSecurePhotoVerification,
VerificationStatus,
SkippedReverification,
)
class SoftwareSecurePhotoVerificationAdmin(admin.ModelAdmin):
"""
Admin for the SoftwareSecurePhotoVerification table.
"""
list_display = ('i... | agpl-3.0 |
YangSongzhou/django | django/conf/locale/nb/formats.py | 504 | 1766 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i'
DATET... | bsd-3-clause |
westinedu/wrgroups | django/db/backends/__init__.py | 77 | 31617 | import decimal
try:
import thread
except ImportError:
import dummy_thread as thread
from threading import local
from django.conf import settings
from django.db import DEFAULT_DB_ALIAS
from django.db.backends import util
from django.db.transaction import TransactionManagementError
from django.utils import datet... | bsd-3-clause |
PolicyStat/django | django/utils/translation/__init__.py | 118 | 7000 | """
Internationalization support.
"""
from __future__ import unicode_literals
import re
from django.utils.decorators import ContextDecorator
from django.utils.encoding import force_text
from django.utils.functional import lazy
from django.utils import six
__all__ = [
'activate', 'deactivate', 'override', 'deactiv... | bsd-3-clause |
MLAB-project/MLAB-I2c-modules | src/pymlab/sensors/lts.py | 2 | 1908 | #!/usr/bin/python
# Python library for LTS01A MLAB module with MAX31725 i2c Local Temperature Sensor
#
# print "LTS01A status", bin(get_config(I2C_bus_number, LTS01A_address))
# Return statust register value
# print "LTS01A temp", get_temp(I2C_bus_number, LTS01A_address)
# return temperature.
import struct
import l... | gpl-3.0 |
amirrpp/django-oscar | src/oscar/apps/offer/migrations/0001_initial.py | 52 | 15207 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import oscar.models.fields.autoslugfield
from decimal import Decimal
import oscar.models.fields
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
('catalogue', ... | bsd-3-clause |
habibiefaried/ryu | ryu/tests/unit/ofproto/test_oxm.py | 29 | 5609 | # Copyright (C) 2015 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2015 YAMAMOTO Takashi <yamamoto at valinux co jp>
#
# 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:... | apache-2.0 |
Mte90/remo | remo/reports/views.py | 1 | 10633 | from django.conf import settings
from django.contrib import messages
from django.contrib.auth.models import User
from django.core.paginator import EmptyPage, InvalidPage, Paginator
from django.core.urlresolvers import reverse
from django.db.models import Q
from django.http import Http404
from django.shortcuts import ge... | bsd-3-clause |
kybriainfotech/iSocioCRM | addons/account_analytic_plans/wizard/account_crossovered_analytic.py | 341 | 2972 | # -*- 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 |
anbangleo/NlsdeWeb | Python-3.6.0/Lib/idlelib/idle_test/test_paragraph.py | 7 | 14314 | # Test the functions and main class method of paragraph.py
import unittest
from idlelib import paragraph as fp
from idlelib.editor import EditorWindow
from tkinter import Tk, Text
from test.support import requires
class Is_Get_Test(unittest.TestCase):
"""Test the is_ and get_ functions"""
test_comment = '# Th... | mit |
Raul3212/Compiladores | Analisador Lexico/automato_jav.py | 2 | 15978 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from definicoes import *
from automato import *
def automatoJav():
afd = AFD(84)
#Definindo Rotulos e estados finais
afd.setTokenEstado(1, "ID")
afd.setTokenEstado(2, "IF")
afd.setTokenEstado(3, "ID")
afd.setTokenEstado(4, "ID")
afd.setTokenE... | gpl-3.0 |
lzjever/django-guardian | guardian/tests/custompkmodel_test.py | 12 | 1154 |
from django.contrib.contenttypes.models import ContentType
from django.test import TestCase
from guardian.shortcuts import assign, remove_perm
from guardian.models import User, Group, Permission, AnonymousUser
class CustomPKModelTest(TestCase):
"""
Tests agains custom model with primary key other than *standa... | bsd-2-clause |
fqez/JdeRobot | src/drivers/MAVLinkServer/MAVProxy/modules/mavproxy_misseditor/me_event.py | 14 | 1762 | #!/usr/bin/env python
'''
Event class and enums for Mission Editor
Michael Day
June 2014
'''
#MissionEditorEvents come FROM the GUI (with a few exceptions where the Mission Editor Module sends a message to itself, e.g., MEE_TIME_TO_QUIT)
#MissionEditorGUIEvents go TO the GUI
#enum for MissionEditorEvent types
MEE_READ_... | gpl-3.0 |
WillisXChen/django-oscar | oscar/lib/python2.7/site-packages/unidecode/x094.py | 252 | 4661 | data = (
'Kui ', # 0x00
'Si ', # 0x01
'Liu ', # 0x02
'Nao ', # 0x03
'Heng ', # 0x04
'Pie ', # 0x05
'Sui ', # 0x06
'Fan ', # 0x07
'Qiao ', # 0x08
'Quan ', # 0x09
'Yang ', # 0x0a
'Tang ', # 0x0b
'Xiang ', # 0x0c
'Jue ', # 0x0d
'Jiao ', # 0x0e
'Zun ', # 0x0f
'Liao ', # 0x... | bsd-3-clause |
cwlseu/ChineseSA | source/thirdpart/jieba/posseg/__init__.py | 8 | 9015 | from __future__ import absolute_import, unicode_literals
import os
import re
import sys
import jieba
import pickle
from .._compat import *
from .viterbi import viterbi
PROB_START_P = "prob_start.p"
PROB_TRANS_P = "prob_trans.p"
PROB_EMIT_P = "prob_emit.p"
CHAR_STATE_TAB_P = "char_state_tab.p"
re_han_detail = re.compi... | apache-2.0 |
grangier/django-11599 | django/contrib/admin/templatetags/admin_list.py | 4 | 15057 | from django.conf import settings
from django.contrib.admin.views.main import ALL_VAR, EMPTY_CHANGELIST_VALUE
from django.contrib.admin.views.main import ORDER_VAR, ORDER_TYPE_VAR, PAGE_VAR, SEARCH_VAR
from django.core.exceptions import ObjectDoesNotExist
from django.db import models
from django.utils import dateformat
... | bsd-3-clause |
ppizarror/Ned-For-Spod | bin/external/pil/OleFileIO.py | 1 | 15390 | #
# THIS IS WORK IN PROGRESS
#
# The Python Imaging Library
# $Id$
#
# stuff to deal with OLE2 Structured Storage files. this module is
# used by PIL to read Image Composer and FlashPix files, but can also
# be used to read other files of this type.
#
# History:
# 1997-01-20 fl Created
# 1997-01-22 fl Fixed 64-bit... | gpl-2.0 |
jlmucb/cloudproxy | src/third_party/googlemock/gtest/test/gtest_break_on_failure_unittest.py | 2140 | 7339 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | apache-2.0 |
igsr/igsr_analysis | PyHive/Factories/SplitVCFintoChros.py | 1 | 2227 | import eHive
import os
import sys
from VCF.VCFfilter.BCFTools import BCFTools
class SplitVCFintoChros(eHive.BaseRunnable):
"""Split a VCF into the chromosomes present in a Fasta index"""
def __str_to_bool(self, s):
if s == 'True':
return True
elif s == 'False':
return F... | apache-2.0 |
gregn610/workalendar | workalendar/usa.py | 1 | 33148 | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
from datetime import date, timedelta
from workalendar.core import WesternCalendar, ChristianMixin, Calendar
from workalendar.core import SUN, MON, TUE, WED, THU, FRI, SAT
NONE, NEAREST_... | mit |
ccmbioinfo/mugqic_pipelines | bfx/differential_expression.py | 1 | 3243 | #!/usr/bin/env python
################################################################################
# Copyright (C) 2014, 2015 GenAP, McGill University and Genome Quebec Innovation Centre
#
# This file is part of MUGQIC Pipelines.
#
# MUGQIC Pipelines is free software: you can redistribute it and/or modify
# it und... | lgpl-3.0 |
dennis-sheil/commandergenius | project/jni/python/src/Lib/email/quoprimime.py | 54 | 10839 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Ben Gertzfield
# Contact: email-sig@python.org
"""Quoted-printable content transfer encoding per RFCs 2045-2047.
This module handles the content transfer encoding method defined in RFC 2045
to encode US ASCII-like 8-bit data called `quoted-printable'. It... | lgpl-2.1 |
cruzegoodin/TSC-ShippingDetails | venv/lib/python2.7/site-packages/pip/baseparser.py | 149 | 9643 | """Base option parser setup"""
from __future__ import absolute_import
import sys
import optparse
import os
import re
import textwrap
from distutils.util import strtobool
from pip._vendor.six import string_types
from pip._vendor.six.moves import configparser
from pip.locations import (
legacy_config_file, config_b... | bsd-3-clause |
mogoweb/webkit_for_android5.1 | webkit/Tools/QueueStatusServer/handlers/patchstatus.py | 146 | 1974 | # Copyright (C) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the... | apache-2.0 |
nazo/ansible | lib/ansible/modules/network/aos/aos_rack_type.py | 42 | 7616 | #!/usr/bin/python
#
# (c) 2017 Apstra Inc, <community@apstra.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 opt... | gpl-3.0 |
cbrucks/keystone_ldap | keystone/config.py | 1 | 5361 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack 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 requ... | apache-2.0 |
pasiegel/SickGear | lib/hachoir_core/field/float.py | 90 | 3547 | from lib.hachoir_core.field import Bit, Bits, FieldSet
from lib.hachoir_core.endian import BIG_ENDIAN, LITTLE_ENDIAN
import struct
# Make sure that we use right struct types
assert struct.calcsize("f") == 4
assert struct.calcsize("d") == 8
assert struct.unpack("<d", "\x1f\x85\xebQ\xb8\x1e\t@")[0] == 3.14
assert struct... | gpl-3.0 |
40223236/w16b_test | static/Brython3.1.1-20150328-091302/Lib/xml/sax/__init__.py | 637 | 3505 | """Simple API for XML (SAX) implementation for Python.
This module provides an implementation of the SAX 2 interface;
information about the Java version of the interface can be found at
http://www.megginson.com/SAX/. The Python version of the interface is
documented at <...>.
This package contains the following modu... | agpl-3.0 |
brandon-rhodes/numpy | numpy/core/records.py | 10 | 28847 | """
Record Arrays
=============
Record arrays expose the fields of structured arrays as properties.
Most commonly, ndarrays contain elements of a single type, e.g. floats,
integers, bools etc. However, it is possible for elements to be combinations
of these using structured types, such as::
>>> a = np.array([(1, 2... | bsd-3-clause |
QualiSystems/shellfoundry | tests/test_utilities/test_datamodel_merger.py | 1 | 12597 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import codecs
import os
import unittest
import xml.etree.ElementTree as etree
from shellfoundry.utilities.shell_datamodel_merger import ShellDataModelMerger
from tests import TEST_DIR
class TestDataModelMerger(unittest.TestCase):
def test_works_with_utf_files(self):
... | apache-2.0 |
feelobot/compose | compose/config.py | 9 | 16232 | import logging
import os
import sys
import yaml
from collections import namedtuple
import six
from compose.cli.utils import find_candidates_in_parent_dirs
DOCKER_CONFIG_KEYS = [
'cap_add',
'cap_drop',
'cpu_shares',
'cpuset',
'command',
'detach',
'devices',
'dns',
'dns_search',
... | apache-2.0 |
sgraham/nope | build/android/pylib/utils/timeout_retry.py | 52 | 5301 | # 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.
"""A utility to run functions with timeouts and retries."""
# pylint: disable=W0702
import logging
import threading
import time
import traceback
from pylib... | bsd-3-clause |
pythonprobr/pythonpro-website | pythonpro/memberkit/management/commands/create_subscriptions_for_roles.py | 1 | 1424 | from django.contrib.auth import get_user_model
from django.core.management.base import BaseCommand
from pythonpro.memberkit.models import Subscription
class Command(BaseCommand):
help = 'Cria Assinatura para usuários sem pagamentos'
def add_arguments(self, parser):
pass
def handle(self, *args, ... | agpl-3.0 |
nvoron23/scikit-learn | sklearn/preprocessing/_function_transformer.py | 163 | 2407 | from ..base import BaseEstimator, TransformerMixin
from ..utils import check_array
def _identity(X):
"""The identity function.
"""
return X
class FunctionTransformer(BaseEstimator, TransformerMixin):
"""Constructs a transformer from an arbitrary callable.
A FunctionTransformer forwards its X (a... | bsd-3-clause |
beni55/networkx | networkx/readwrite/graphml.py | 10 | 21265 | """
*******
GraphML
*******
Read and write graphs in GraphML format.
This implementation does not support mixed graphs (directed and unidirected
edges together), hyperedges, nested graphs, or ports.
"GraphML is a comprehensive and easy-to-use file format for graphs. It
consists of a language core to describe the stru... | bsd-3-clause |
isandlaTech/cohorte-3rdparty | unidecode/src/main/python/unidecode/x00b.py | 252 | 4132 | data = (
'[?]', # 0x00
'N', # 0x01
'N', # 0x02
'H', # 0x03
'[?]', # 0x04
'a', # 0x05
'aa', # 0x06
'i', # 0x07
'ii', # 0x08
'u', # 0x09
'uu', # 0x0a
'R', # 0x0b
'L', # 0x0c
'[?]', # 0x0d
'[?]', # 0x0e
'e', # 0x0f
'ai', # 0x10
'[?]', # 0x11
'[?]', # 0x12
'o', # ... | apache-2.0 |
angstwad/ansible | lib/ansible/module_utils/netcmd.py | 3 | 6931 | # 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 |
oscar810429/mysql-5.6_facebook | xtrabackup/test/python/testtools/content.py | 43 | 8747 | # Copyright (c) 2009-2011 testtools developers. See LICENSE for details.
"""Content - a MIME-like Content object."""
__all__ = [
'attach_file',
'Content',
'content_from_file',
'content_from_stream',
'text_content',
'TracebackContent',
]
import codecs
import os
from testtools import try_i... | gpl-2.0 |
linmingren/ShadowsocksFork | shadowsocks/common.py | 945 | 8921 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013-2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | apache-2.0 |
leekchan/django_test | django/contrib/formtools/tests/wizard/test_forms.py | 35 | 8944 | from __future__ import unicode_literals
from importlib import import_module
from django import forms, http
from django.conf import settings
from django.db import models
from django.test import TestCase
from django.template.response import TemplateResponse
from django.contrib.auth.models import User
from django.cont... | bsd-3-clause |
GtTmy/pyeda | pyeda/parsing/test/test_pla.py | 5 | 1219 | """
Test PLA parsing functions
"""
from nose.tools import assert_raises
from pyeda.boolalg.espresso import FTYPE, DTYPE, RTYPE
from pyeda.parsing.pla import Error, parse
BASIC = """
# Filename: basic.pla
.i 4
.o 2
.ilb x y z
.ob f g
.p 3
.type fr
0001 00
0010 01
0100 10
1000 11
.e
"""
def test_errors():
# Gen... | bsd-2-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.