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
sl4shme/pplloopp
images/shaddock/mistral/configparse.py
1
2038
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2014 Thibaut Lapierre <root@epheo.eu>. 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
globocom/database-as-a-service
dbaas/drivers/tests/test_driver_pymongo.py
1
9370
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import os from mock import patch, MagicMock from drivers import DriverFactory from physical.tests import factory as factory_physical from logical.tests import factory as factory_logical from logical.models import Database from drivers.mon...
bsd-3-clause
aliyun/aliyun-oss-python-sdk
tests/test_utils.py
1
14543
# -*- coding: utf-8 -*- import unittest import oss2 from oss2.exceptions import make_exception import os import sys import tempfile import requests import datetime import locale import io from functools import partial from .common import * import logging try: xrange except NameError: xrange = range is_p...
mit
yosshy/nova
nova/virt/libvirt/firewall.py
56
15129
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in complianc...
apache-2.0
schettino72/nikola
nikola/data/themes/base/messages/messages_ar.py
6
1534
# -*- encoding:utf-8 -*- from __future__ import unicode_literals MESSAGES = { "%d min remaining to read": "", "(active)": "", "Also available in:": "أيضا متوفر في:", "Archive": "الأرشيف", "Categories": "فئات", "Comments": "التّعليقات", "LANGUAGE": "العربيّة", "Languages:": "اللغات", ...
mit
rcomer/iris
lib/iris/tests/unit/fileformats/cf/test_CFReader.py
1
14385
# Copyright Iris contributors # # This file is part of Iris and is released under the LGPL license. # See COPYING and COPYING.LESSER in the root of the repository for full # licensing details. """ Unit tests for the `iris.fileformats.cf.CFReader` class. """ # Import iris.tests first so that some things can be initial...
lgpl-3.0
xutian/avocado-vt
scripts/github/unassigned_issues.py
8
1518
#!/usr/bin/env python from __future__ import print_function import getpass from github import Github from github_issues import GithubIssues from six.moves import input gh = Github(login_or_token=input("Enter github username: "), password=getpass.getpass('Enter github password: '), user_agen...
gpl-2.0
liberorbis/libernext
env/lib/python2.7/site-packages/IPython/core/tests/test_inputsplitter.py
7
20924
# -*- coding: utf-8 -*- """Tests for the inputsplitter module. Authors ------- * Fernando Perez * Robert Kern """ from __future__ import print_function #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 The IPython Development Team # # Distributed under the term...
gpl-2.0
kmolab/kmolab.github.io
data/Brython-3.3.4/Lib/test/test_ast.py
26
44538
import os import sys import unittest import ast import weakref from test import support def to_tuple(t): if t is None or isinstance(t, (str, int, complex)): return t elif isinstance(t, list): return [to_tuple(e) for e in t] result = [t.__class__.__name__] if hasattr(t, 'lineno') and ha...
agpl-3.0
drxaero/calibre
src/calibre/gui2/custom_column_widgets.py
9
39631
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai __license__ = 'GPL v3' __copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' from functools import partial from PyQt5.Qt import (QComboBox, QLabel, QSpinBox, QDoubleSpinBox, QDateTimeEdit, Q...
gpl-3.0
Impavidity/kim_cnn
model.py
1
2614
import torch import torch.nn as nn import torch.nn.functional as F class KimCNN(nn.Module): def __init__(self, config): super(KimCNN, self).__init__() output_channel = config.output_channel target_class = config.target_class words_num = config.words_num words_dim = config.w...
mit
sony/nnabla
python/src/nnabla/backward_function/greater_equal_scalar.py
1
1032
# Copyright 2019,2020,2021 Sony Corporation. # # 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...
apache-2.0
longman694/youtube-dl
youtube_dl/extractor/stanfordoc.py
34
3528
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, orderedSet, unescapeHTML, ) class StanfordOpenClassroomIE(InfoExtractor): IE_NAME = 'stanfordoc' IE_DESC = 'Stanford Open ClassRoom' _VALID_URL = r'https?://openclassroom...
unlicense
techtonik/devassistant
test/test_yaml_assistant.py
6
10091
import os from flexmock import flexmock import pytest from devassistant import exceptions from devassistant import settings from devassistant import yaml_assistant from devassistant import snippet from devassistant.yaml_snippet_loader import YamlSnippetLoader # hook app testing logging from test.logger import Loggin...
gpl-2.0
bbbenja/SickRage
lib/unidecode/x061.py
252
4662
data = ( 'Qiao ', # 0x00 'Chou ', # 0x01 'Bei ', # 0x02 'Xuan ', # 0x03 'Wei ', # 0x04 'Ge ', # 0x05 'Qian ', # 0x06 'Wei ', # 0x07 'Yu ', # 0x08 'Yu ', # 0x09 'Bi ', # 0x0a 'Xuan ', # 0x0b 'Huan ', # 0x0c 'Min ', # 0x0d 'Bi ', # 0x0e 'Yi ', # 0x0f 'Mian ', # 0x10 'Yon...
gpl-3.0
tboyce021/home-assistant
homeassistant/components/alexa/handlers.py
3
50582
"""Alexa message handlers.""" import logging import math from homeassistant import core as ha from homeassistant.components import ( camera, cover, fan, group, input_number, light, media_player, timer, vacuum, ) from homeassistant.components.climate import const as climate from home...
apache-2.0
Dzess/ALFIRT
alfirt.runner/src/readers/tests/TagReaderX3DUnitTests.py
1
4002
''' Created on Jun 9, 2011 @author: Piotr ''' import unittest import os from readers.TagReaderX3D import TagReaderX3D class TagReaderX3DUnitTests(unittest.TestCase): def setUp(self): # Setting up the X3D string with ALFIRT namespace tags x3dString = """<?xml version="1.0" encoding="UTF-8"?> <!...
mit
aral/isvat
django/contrib/gis/tests/geoapp/tests.py
96
36876
from __future__ import absolute_import import re from django.db import connection from django.db.utils import DatabaseError from django.contrib.gis import gdal from django.contrib.gis.geos import (fromstr, GEOSGeometry, Point, LineString, LinearRing, Polygon, GeometryCollection) from django.contrib.gis.tests.util...
mit
cloud-fan/spark
python/pyspark/pandas/internal.py
1
68330
# # 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 us...
apache-2.0
Russell-IO/ansible
lib/ansible/plugins/action/gather_facts.py
1
1434
# Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import (absolute_import, division, print_function) __metaclass__ = type from collections import MutableMapping from ansible import constants as C from ansible.plugins.acti...
gpl-3.0
sahiljain/catapult
third_party/google-endpoints/cachetools/cache.py
8
2586
from .abc import DefaultMapping class _DefaultSize(object): def __getitem__(self, _): return 1 def __setitem__(self, _, value): assert value == 1 def pop(self, _): return 1 class Cache(DefaultMapping): """Mutable mapping to serve as a simple cache or cache base class.""" ...
bsd-3-clause
mfraezz/osf.io
osf/management/commands/restore_deleted_root_folders.py
8
1583
# -*- coding: utf-8 -*- import logging import datetime from bulk_update.helper import bulk_update from django.core.management.base import BaseCommand from osf.models import BaseFileNode logger = logging.getLogger(__name__) def restore_deleted_root_folders(dry_run=False): deleted_roots = BaseFileNode.objects.fil...
apache-2.0
h1ds/h1ds
h1ds/h1ds/migrations/0010_auto__chg_field_nodepath_parent.py
1
11299
# -*- 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): # Changing field 'NodePath.parent' db.alter_column(u'h1ds_nodepath', 'parent_id', self.gf('django.db.models...
mit
schumi2004/NOT_UPDATED_Sick-Beard-Dutch
lib/unidecode/x011.py
252
4135
data = ( 'g', # 0x00 'gg', # 0x01 'n', # 0x02 'd', # 0x03 'dd', # 0x04 'r', # 0x05 'm', # 0x06 'b', # 0x07 'bb', # 0x08 's', # 0x09 'ss', # 0x0a '', # 0x0b 'j', # 0x0c 'jj', # 0x0d 'c', # 0x0e 'k', # 0x0f 't', # 0x10 'p', # 0x11 'h', # 0x12 'ng', # 0x13 'nn', ...
gpl-3.0
maciekcc/tensorflow
tensorflow/contrib/linalg/python/ops/linear_operator_tril.py
31
7639
# 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
simbs/edx-platform
openedx/core/lib/api/fields.py
48
1494
"""Fields useful for edX API implementations.""" from rest_framework.serializers import Field class ExpandableField(Field): """Field that can dynamically use a more detailed serializer based on a user-provided "expand" parameter. Kwargs: collapsed_serializer (Serializer): the serializer to use for a no...
agpl-3.0
jitendra29/servo
tests/wpt/harness/wptrunner/browsers/webdriver.py
194
4219
# 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 errno import socket import time import traceback import urlparse import mozprocess from .base import get_free_p...
mpl-2.0
campbe13/openhatch
vendor/packages/amqp/funtests/test_basic_message.py
22
3803
#!/usr/bin/env python """ Test the amqp.basic_message module. """ # Copyright (C) 2007-2008 Barry Pederson <bp@barryp.org> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # vers...
agpl-3.0
pansapiens/mytardis
tardis/tardis_portal/templatetags/capture.py
4
2417
# Copyright (c) 2008-2009, Nathan Borror # 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 ...
bsd-3-clause
jaredweiss/nupic
external/linux32/lib/python2.6/site-packages/matplotlib/numerix/_nc_imports.py
70
1220
from Numeric import array, ravel, reshape, shape, alltrue, sometrue from Numeric import Int8, UInt8, Int16, UInt16, Int32, UInt32, \ Float32, Float64, Complex32, Complex64, Float, Int, Complex from numpy import isnan as _isnan class _TypeNamespace: """Numeric compatible type aliases for use with extension fun...
gpl-3.0
yongshengwang/hue
desktop/core/ext-py/pycrypto-2.6.1/build/lib.linux-x86_64-2.7/Crypto/Random/OSRNG/rng_base.py
127
2875
# # Random/OSRNG/rng_base.py : Base class for OSRNG # # Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net> # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not availa...
apache-2.0
SCPR/firetracker
calfire_tracker/utilities.py
1
3930
from django.conf import settings from django.db import models from django.utils.encoding import smart_str from django.utils import timezone from django.template.defaultfilters import slugify from geopy import geocoders import pytz import time import datetime import requests import logging logger = logging.getLogger("f...
gpl-2.0
AlexEKoren/grumpy
compiler/stmt_test.py
1
14166
# coding=utf-8 # Copyright 2016 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 app...
apache-2.0
h2oloopan/easymerge
EasyMerge/tests/beets/ui/migrate.py
1
13881
# This file is part of beets. # Copyright 2013, Adrian Sampson. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, ...
mit
eg-zhang/h2o-2
py/testdir_multi_jvm/test_parse_rand_utf8.py
9
5241
import unittest, random, sys, time, os sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_import as h2i, h2o_exec as h2e import codecs print "apparently need to have at least one normal character otherwise the parse doesn't work right" print "just doing single char here" # semicolon ..h2o apparently c...
apache-2.0
OddEssay/ansible
lib/ansible/utils/hashing.py
202
3125
# (c) 2012-2014, 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) an...
gpl-3.0
tectronics/prometeo-erp
core/menus/management/__init__.py
3
2089
#!/usr/bin/env python # -*- coding: utf-8 -*- """This file is part of the prometeo project. This program 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...
lgpl-3.0
mazaclub/mazabot-core
plugins/Utilities/plugin.py
2
5252
### # Copyright (c) 2002-2004, Jeremiah Fincher # Copyright (c) 2010, James Vega # 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 copyri...
bsd-3-clause
lepricon49/CouchPotatoServer
libs/apscheduler/events.py
144
2529
__all__ = ('EVENT_SCHEDULER_START', 'EVENT_SCHEDULER_SHUTDOWN', 'EVENT_JOBSTORE_ADDED', 'EVENT_JOBSTORE_REMOVED', 'EVENT_JOBSTORE_JOB_ADDED', 'EVENT_JOBSTORE_JOB_REMOVED', 'EVENT_JOB_EXECUTED', 'EVENT_JOB_ERROR', 'EVENT_JOB_MISSED', 'EVENT_ALL', 'SchedulerEvent', 'JobStoreEve...
gpl-3.0
tinyms/ArchiveX
tinyms/controller/setting.py
1
3046
__author__ = 'tinyms' #coding=UTF8 from sqlalchemy import func from tinyms.core.common import Utils from tinyms.core.web import IAuthRequest from tinyms.core.entity import Account from tinyms.core.orm import SessionFactory from tinyms.core.annotation import ObjectPool, route, setting, api from tinyms.core.setting imp...
bsd-3-clause
kerckasha/ACE3
tools/search_undefinedFunctions.py
33
4555
#!/usr/bin/env python3 import fnmatch import os import re import ntpath import sys import argparse import ctypes #from http://stackoverflow.com/a/3429034 #Get required functions, strcpy.. strcpy = ctypes.cdll.msvcrt.strcpy ocb = ctypes.windll.user32.OpenClipboard #Basic Clipboard functions ecb = ctypes.windll.us...
gpl-2.0
untitaker/beets
beetsplug/rewrite.py
25
2886
# This file is part of beets. # Copyright 2015, Adrian Sampson. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, ...
mit
FireBladeNooT/Medusa_1_6
lib/sqlalchemy/orm/descriptor_props.py
38
25141
# orm/descriptor_props.py # Copyright (C) 2005-2016 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Descriptor properties are more "auxiliary" properties that exist as confi...
gpl-3.0
simonwydooghe/ansible
lib/ansible/modules/network/iosxr/iosxr_lacp.py
20
6190
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2019 Red Hat # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ############################################# # WARNING # ############################################# # # This file is au...
gpl-3.0
leonty/ansible-modules-core
utilities/helper/fireball.py
132
8066
#!/usr/bin/python # -*- coding: utf-8 -*- # (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...
gpl-3.0
vjraitila/alfred-issues
src/requests/packages/urllib3/connection.py
511
11617
from __future__ import absolute_import import datetime import logging import os import sys import socket from socket import error as SocketError, timeout as SocketTimeout import warnings from .packages import six try: # Python 3 from http.client import HTTPConnection as _HTTPConnection from http.client import...
mit
miipl-naveen/optibizz
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
DIRACGrid/DIRAC
src/DIRAC/Core/Workflow/test/WFSamples.py
2
8668
""" This is a comment """ from __future__ import print_function from __future__ import absolute_import from __future__ import division __RCSID__ = "$Id$" # $Source: /tmp/libdirac/tmp.stZoy15380/dirac/DIRAC3/DIRAC/Core/Workflow/test/WFSamples.py,v $ from DIRAC.Core.Workflow.Parameter import * from DIRAC.Core.Work...
gpl-3.0
thirdwing/mxnet
python/mxnet/gluon/model_zoo/vision/vgg.py
10
8490
# 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
Novasoft-India/OperERP-AM-Motors
openerp/addons/l10n_it/__init__.py
447
1161
############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 # OpenERP Italian Community (<http://www.openerp-italia.org>) # Servabit srl # Agile Business Group sagl # Domsense srl # Albatos srl # # Copyright (C)...
agpl-3.0
phobson/statsmodels
statsmodels/tools/tests/test_tools.py
1
20793
""" Test functions for models.tools """ from statsmodels.compat.python import lrange, range import numpy as np from numpy.random import standard_normal from numpy.testing import (assert_equal, assert_array_equal, assert_almost_equal, assert_string_equal, TestCase) from nose.tools import (asse...
bsd-3-clause
MOA-2011/enigma2
lib/python/Plugins/SystemPlugins/CableScan/plugin.py
13
7714
from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Plugins.Plugin import PluginDescriptor from Components.Label import Label from Components.ActionMap import ActionMap from Components.NimManager import nimmanager from Components.MenuList import MenuList from Components.config import confi...
gpl-2.0
atmark-techno/atmark-dist
user/udev/udev-175/udev-175/test/rule-syntax-check.py
5
2331
#!/usr/bin/python # Simple udev rules syntax checker # # (C) 2010 Canonical Ltd. # Author: Martin Pitt <martin.pitt@ubuntu.com> # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2...
gpl-2.0
iw3hxn/LibrERP
hr_sim/report/__init__.py
3
1134
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2011-TODAY DeneroTeam. (<http://www.deneroteam.com>) # Copyright (C) 2011-TODAY Didotech Inc. (<http://www.didotech.com>) # All Rights Reserved # # This program is free software: you ...
agpl-3.0
GoelDeepak/dcos
packages/cockroach/extra/register.py
3
19215
#!/usr/bin/env python """Start CockroachDB. CockroachDB clusters need to be bootstrapped. This is done by starting the very first node without the --join=<ip1,ip2,...,ipN> parameter. Once bootstrapped, no node must ever be started without the --join parameter again, doing so would initialize a new cluster causing th...
apache-2.0
Jonekee/nw.js
tools/file_util.py
77
4471
# Copyright (c) 2011 The Chromium Embedded Framework Authors. All rights # reserved. Use of this source code is governed by a BSD-style license that # can be found in the LICENSE file. from glob import iglob import os import shutil import sys import time def read_file(name, normalize = True): """ Read a file. """...
mit
IonAgorria/SysWatcher
modules/smart.py
1
2212
import logging from subprocess import run, PIPE from module import Module from utils import break_lines, show_message __author__ = 'Ion Agorria' class Smart(Module): name = "SMART" def __init__(self, modules): super().__init__(modules) self.update_notified = [] def run(self): ""...
gpl-3.0
lmr/autotest
scheduler/status_server.py
4
3987
import BaseHTTPServer import cgi import threading import urllib import fcntl import logging try: import autotest.common as common except ImportError: import common from autotest.scheduler import drone_manager, scheduler_config _PORT = 13467 _HEADER = """ <html> <head><title>Scheduler status</title></head> <bo...
gpl-2.0
adeel/ahmadiwiki
maintenance/cssjanus/csslex.py
172
3719
#!/usr/bin/python # # Copyright 2007 Google Inc. All Rights Reserved. """CSS Lexical Grammar rules. CSS lexical grammar from http://www.w3.org/TR/CSS21/grammar.html """ __author__ = ['elsigh@google.com (Lindsey Simon)', 'msamuel@google.com (Mike Samuel)'] # public symbols __all__ = [ "NEWLINE", "HEX",...
gpl-2.0
jonasjberg/autonameow
autonameow/vendor/guessit/rules/properties/video_codec.py
19
2897
#!/usr/bin/env python # -*- coding: utf-8 -*- """ video_codec and video_profile property """ from rebulk.remodule import re from rebulk import Rebulk, Rule, RemoveMatch from guessit.rules.common.validators import seps_after, seps_before from ..common import dash from ..common.validators import seps_surround def vid...
gpl-2.0
nhuntwalker/astroML
book_figures/chapter1/fig_moving_objects.py
3
1911
""" SDSS Moving Object Data ----------------------- Figure 1.8. The orbital semimajor axis vs. the orbital inclination angle diagram for the first 10,000 catalog entries from the SDSS Moving Object Catalog (after applying several quality cuts). The gaps at approximately 2.5, 2.8, and 3.3 AU are called the Kirkwood gap...
bsd-2-clause
HBehrens/feedsanitizer
djangoappengine/management/commands/deploy.py
20
2507
#!/usr/bin/python2.4 # # Copyright 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
mit
jcnix/shade
social/auth.py
1
2295
from django.contrib import auth from django.contrib.auth.models import User from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render, render_to_response from django.template import RequestContext import forms as myforms def login(request): if not request.user.is_authenticated(...
gpl-3.0
CoachCoen/games
settings.py
1
2112
from vector import Vector class Config: """ Configuration - mostly the (relative) position of various screen elements """ # TODO: Work this out dynamically tabletop_size = Vector(1368, 768) scaling_factor = 1 card_size = Vector(100, 120) card_spacing = 10 column_width = card_si...
mit
pierrelux/mathnotes
mathnotes/views/auth.py
1
1936
from flask_oauthlib.client import OAuth from mathnotes.models import db, ZoteroAuthorization from flask import Flask, redirect, url_for, render_template, jsonify, Response, current_app, Blueprint, request from flask.ext.login import login_required, current_user oauth = OAuth() auth = Blueprint('auth', __name__, url_p...
bsd-3-clause
DougFirErickson/qgisSpaceSyntaxToolkit
esstoolkit/external/networkx/algorithms/link_prediction.py
40
16527
""" Link prediction algorithms. """ from __future__ import division import math import networkx as nx from networkx.utils.decorators import * __all__ = ['resource_allocation_index', 'jaccard_coefficient', 'adamic_adar_index', 'preferential_attachment', 'cn_soundarajan_hop...
gpl-3.0
yongshengwang/builthue
desktop/core/ext-py/Django-1.4.5/tests/modeltests/select_related/models.py
133
1643
""" 41. Tests for select_related() ``select_related()`` follows all relationships and pre-caches any foreign key values so that complex trees can be fetched in a single query. However, this isn't always a good idea, so the ``depth`` argument control how many "levels" the select-related behavior will traverse. """ fro...
apache-2.0
gilt/incubator-airflow
airflow/migrations/versions/947454bf1dff_add_ti_job_id_index.py
19
1041
# -*- 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 ...
apache-2.0
plotly/plotly.py
packages/python/plotly/plotly/graph_objs/bar/unselected/_textfont.py
2
5177
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType import copy as _copy class Textfont(_BaseTraceHierarchyType): # class properties # -------------------- _parent_path_str = "bar.unselected" _path_str = "bar.unselected.textfont" _valid_props = {"color"} # colo...
mit
quark-pat/CLIP
packages/scap-security-guide/scap-security-guide/RHEL6/input/checks/templates/create_permission_checks.py
3
3156
#!/usr/bin/python # # create_permission_checks.py # generate template-based checks for file permissions/ownership # # NOTE: The file 'template_permissions' should be located in the same working directory as this script. The # template contains tags that *must* be replaced successfully in order for the checks to work. ...
apache-2.0
malaterre/dicom-private-dicts
re/pms/dump1.py
1
3032
#!/usr/bin/env python """ dump 1 """ import sys, json from struct import * array=[] def doit(f): chunk = f.read(0x2) l0 = unpack('>H', chunk) assert l0[0] == 50 chunk = f.read(l0[0]) s = unpack('>%ds' % l0[0], chunk) chunk = f.read(0x1) l2 = unpack('>B', chunk) #assert l2[0] == 0 ...
bsd-3-clause
kawamon/hue
desktop/core/ext-py/cx_Oracle-6.4.1/samples/ReturnUnicode.py
2
1307
#------------------------------------------------------------------------------ # Copyright 2016, 2017, Oracle and/or its affiliates. All rights reserved. # # Portions Copyright 2007-2015, Anthony Tuininga. All rights reserved. # # Portions Copyright 2001-2007, Computronix (Canada) Ltd., Edmonton, Alberta, # Canada. Al...
apache-2.0
parksandwildlife/wastd
taxonomy/migrations/0003_auto_20181022_1156.py
1
3205
# Generated by Django 2.0.8 on 2018-10-22 03:56 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('taxonomy', '0002_auto_20180926_1147'), ] operations = [ migrations.AlterField( model_name='hbvfamily', name='class_n...
mit
jamespcole/home-assistant
homeassistant/components/openuv/binary_sensor.py
1
3751
"""Support for OpenUV binary sensors.""" import logging from homeassistant.components.binary_sensor import BinarySensorDevice from homeassistant.core import callback from homeassistant.helpers.dispatcher import async_dispatcher_connect from homeassistant.util.dt import as_local, parse_datetime, utcnow from . import (...
apache-2.0
richardcs/ansible
lib/ansible/modules/network/f5/bigip_node.py
8
40098
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2016, F5 Networks Inc. # 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', ...
gpl-3.0
wolverineav/horizon
horizon/test/test_dashboards/dogs/puppies/views.py
89
1077
# 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 # d...
apache-2.0
40223101/2015cda_g1
static/Brython3.1.1-20150328-091302/Lib/base64.py
733
13975
#! /usr/bin/env python3 """RFC 3548: Base16, Base32, Base64 Data Encodings""" # Modified 04-Oct-1995 by Jack Jansen to use binascii module # Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support # Modified 22-May-2007 by Guido van Rossum to use bytes everywhere import re import struct import binascii _...
gpl-3.0
NEricN/RobotCSimulator
Python/App/Lib/subprocess.py
33
59485
# subprocess - Subprocesses with accessible I/O streams # # For more information about this module, see PEP 324. # # Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se> # # Licensed to PSF under a Contributor Agreement. # See http://www.python.org/2.4/license for licensing details. r"""subprocess - Subpr...
apache-2.0
gcode-mirror/audacity
lib-src/lv2/lv2/plugins/eg04-sampler.lv2/waflib/Tools/c_aliases.py
330
1334
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file import os,sys,re from waflib import Utils,Build from waflib.Configure import conf def get_extensions(lst): ret=[] for x in Utils.to_list(lst): try: if not isinstance(x,...
gpl-2.0
gokmen/Rasta
rasta_lib/model.py
1
1631
#!/usr/bin/python # -*- coding: utf-8 -*- ''' Rasta RST Editor 2010 - Gökmen Göksel <gokmeng:gmail.com> ''' # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as Published by the Free # Software Foundation; either version 2 of the License,...
gpl-2.0
mdavoodi/konkourse-python
messages/views.py
1
2496
# Create your views here. from django.http import HttpResponse from django.template import loader from django.template.context import Context from django.template import RequestContext from django.shortcuts import redirect from django.shortcuts import render from conversation.models import ConvoWall, ConversationPost ...
mit
HuaweiSwitch/ansible
lib/ansible/modules/network/lenovo/cnos_interface.py
30
26955
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Lenovo, 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 # ...
gpl-3.0
matthiascy/panda3d
direct/src/wxwidgets/WxSlider.py
11
3594
""" WxSlider Class: Extended wx.Slider supporting floating point values you should call Enable() after binding any event with this control """ __all__ = ['WxSlider'] import wx class WxSlider(wx.Slider): def __init__(self, parent, id, value, minValue, maxValue,\ pos=wx.DefaultPosi...
bsd-3-clause
sgraham/nope
tools/gyp/tools/pretty_vcproj.py
2637
9586
#!/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. """Make the format of a vcproj really pretty. This script normalize and sort an xml. It also fetches all the properties inside linked...
bsd-3-clause
bert9bert/statsmodels
statsmodels/tools/tests/test_eval_measures.py
34
3560
# -*- coding: utf-8 -*- """ Created on Tue Nov 08 22:28:48 2011 @author: josef """ from statsmodels.compat.python import zip import numpy as np from numpy.testing import assert_equal, assert_almost_equal, assert_ from statsmodels.tools.eval_measures import ( maxabs, meanabs, medianabs, medianbias, mse, rmse, std...
bsd-3-clause
jelly/calibre
src/calibre/gui2/tweak_book/ui.py
1
39312
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' import os from functools import partial from itertools import product from f...
gpl-3.0
MartialD/hyperspy
hyperspy/misc/io/utils_readfile.py
4
7340
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2010 Stefano Mazzucco # # This file is part of dm3_data_plugin. # # dm3_data_plugin is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 o...
gpl-3.0
trondhindenes/ansible-modules-extras
system/osx_defaults.py
36
14121
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, GeekChimp - Franck Nijhof <franck@geekchimp.com> # # 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 you...
gpl-3.0
andrewlewis/camera-id
test_characteristic.py
1
1197
#!/usr/bin/env python from make_characteristic import get_noise_from_file import cPickle import glob import numpy import sys from PIL import Image, ImageOps TILE_OVERLAP = 8 if len(sys.argv) != 3: print "Usage:\n\t%s noise_file_name path_with_png_files" % (sys.argv[0],) sys.exit(0) noise_file_name = sys.argv[...
mit
nikolasjansen/nija
node_modules/grunt-docker/node_modules/docker/node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/lexers/parsers.py
363
25835
# -*- coding: utf-8 -*- """ pygments.lexers.parsers ~~~~~~~~~~~~~~~~~~~~~~~ Lexers for parser generators. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, DelegatingLexer, \ include...
mit
lidan-fnst/samba
source4/dsdb/tests/python/ad_dc_medley_performance.py
4
17146
#!/usr/bin/env python # -*- coding: utf-8 -*- import optparse import sys sys.path.insert(0, 'bin/python') import os import samba import samba.getopt as options import random import tempfile import shutil import time import itertools from samba.netcmd.main import cmd_sambatool # We try to use the test infrastructure ...
gpl-3.0
vmanoria/bluemix-hue-filebrowser
hue-3.8.1-bluemix/desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/Cipher/CAST.py
116
4498
# -*- coding: utf-8 -*- # # Cipher/CAST.py : CAST # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone is granted a worldwide, perpetual, royalty-free, #...
gpl-2.0
caldwell/servo
tests/wpt/web-platform-tests/tools/wptserve/tests/functional/test_pipes.py
299
3178
import os import unittest import urllib2 import json import time import wptserve from base import TestUsingServer, doc_root class TestStatus(TestUsingServer): def test_status(self): resp = self.request("/document.txt", query="pipe=status(202)") self.assertEquals(resp.getcode(), 202) class TestHea...
mpl-2.0
mitodl/micromasters
dashboard/api_edx_cache_test.py
1
21604
""" Tests for the dashboard APIs functions that deal with the edx cached data """ from datetime import timedelta from unittest.mock import patch, MagicMock, ANY import ddt from requests.exceptions import HTTPError from edx_api.certificates.models import Certificate, Certificates from edx_api.enrollments.models import...
bsd-3-clause
tmpgit/intellij-community
python/lib/Lib/email/mime/message.py
573
1286
# Copyright (C) 2001-2006 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """Class representing message/* MIME documents.""" __all__ = ['MIMEMessage'] from email import message from email.mime.nonmultipart import MIMENonMultipart class MIMEMessage(MIMENonMultipart): """Class...
apache-2.0
Cicero-Zhao/mezzanine
mezzanine/pages/templatetags/pages_tags.py
18
8387
from __future__ import unicode_literals from future.builtins import str from collections import defaultdict from django.core.exceptions import ImproperlyConfigured from django.template import Context, TemplateSyntaxError, Variable from django.template.loader import get_template from django.utils.translation import ug...
bsd-2-clause
fablab-lannion/CMStools
FabLab/languages/tr.py
121
7256
# coding: utf-8 { '!langcode!': 'tr', '!langname!': 'Türkçe', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"güncelle" ("update") "field1=\'yenideğer\'" gibi isteğe bağlı bir ifadedir. JON sonucu güncelleyemez veya silemzsiniz.', '%s %%(shop)': '%s ...
gpl-2.0
DiptoDas8/Biponi
lib/python2.7/site-packages/django_filters/filterset.py
10
17044
from __future__ import absolute_import from __future__ import unicode_literals import types import copy from django import forms from django.forms.forms import NON_FIELD_ERRORS from django.core.validators import EMPTY_VALUES from django.db import models from django.db.models.fields import FieldDoesNotExist from djang...
mit
hortonworks/hortonworks-sandbox
desktop/core/ext-py/Twisted/doc/web/examples/lj.rpy.py
4
1501
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. # # Syndicate LiveJournal users # Demonstrates how to use chained callbacks from __future__ import nested_scopes from twisted.web import resource as resourcelib from twisted.web import client, microdom, domhelpers, server urlTemplate =...
apache-2.0
unt-libraries/django-nomination
nomination/migrations/0004_auto_20190927_1904.py
1
7862
# -*- coding: utf-8 -*- # Generated by Django 1.11.24 on 2019-09-27 19:04 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('nomination', '0003_project_archive_url'), ] opera...
bsd-3-clause