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
gdub/django
tests/gis_tests/geoapp/tests.py
189
41436
from __future__ import unicode_literals import re import tempfile from django.contrib.gis import gdal from django.contrib.gis.db.models import Extent, MakeLine, Union from django.contrib.gis.geos import ( GeometryCollection, GEOSGeometry, LinearRing, LineString, Point, Polygon, fromstr, ) from django.core.man...
bsd-3-clause
rbaindourov/v8-inspector
Source/chrome/net/tools/net_docs/net_docs.py
15
3541
#!/usr/bin/env python # Copyright 2015 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. """Reads, parses, and (optionally) writes as HTML the contents of Markdown files passed as arguments. Intended for rendering network s...
bsd-3-clause
wrbutros/condominios
registro/serializers.py
1
1679
from rest_framework import serializers from models import Condominio, Edificio, Departamento, Servicio, LecturaServicio from models import AdministradorEdificio, Conserje class ConserjeSerializer(serializers.HyperlinkedModelSerializer): class Meta: model = Conserje class AdministradorEdificioSerializer...
gpl-3.0
harshilasu/GraphicMelon
y/google-cloud-sdk/platform/gsutil/third_party/boto/tests/integration/ec2/cloudwatch/__init__.py
761
1104
# Copyright (c) 2006-2011 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
gpl-3.0
davidobrien1985/ansible-modules-core
cloud/google/gc_storage.py
101
16678
#!/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 distributed...
gpl-3.0
frrp/ipcoin
contrib/testgen/base58.py
2139
2818
''' Bitcoin base58 encoding and decoding. Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain) ''' import hashlib # for compatibility with following code... class SHA256: new = hashlib.sha256 if str != bytes: # Python 3.x def ord(c): return c def chr(n): return byte...
mit
eufarn7sp/egads
egads/thirdparty/quantities/constants/naturalunits.py
4
1604
# -*- coding: utf-8 -*- """ """ from __future__ import absolute_import from ._utils import _cd from ..unitquantity import UnitConstant natural_unit_of_action = UnitConstant( 'natural_unit_of_action', _cd('natural unit of action'), symbol='hbar', u_symbol='ħ' ) natural_unit_of_energy = UnitConstant( ...
gpl-3.0
woutersmet/Zeosummer
lib/zeobuilder/expressions.py
2
2479
# Zeobuilder is an extensible GUI-toolkit for molecular model construction. # Copyright (C) 2007 - 2009 Toon Verstraelen <Toon.Verstraelen@UGent.be>, Center # for Molecular Modeling (CMM), Ghent University, Ghent, Belgium; all rights # reserved unless otherwise stated. # # This file is part of Zeobuilder. # # Zeobuilde...
gpl-3.0
danieljaouen/ansible
lib/ansible/modules/cloud/google/gcp_storage_bucket_access_control.py
12
12033
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
prakxys/flask
Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/setuptools/tests/test_upload_docs.py
522
2139
"""build_ext tests """ import sys, os, shutil, tempfile, unittest, site, zipfile from setuptools.command.upload_docs import upload_docs from setuptools.dist import Distribution SETUP_PY = """\ from setuptools import setup setup(name='foo') """ class TestUploadDocsTest(unittest.TestCase): def setUp(self): ...
apache-2.0
roryk/recipes
recipes/deepvariant/dv_call_variants.py
28
1904
#!/opt/anaconda1anaconda2anaconda3/bin/python # # Wrapper script for DeepVariant call_variants BINARY_DIR="/opt/anaconda1anaconda2anaconda3/BINARYSUB" MODEL_DIRS= {"wgs": "/opt/anaconda1anaconda2anaconda3/WGSMODELSUB", "wes": "/opt/anaconda1anaconda2anaconda3/WESMODELSUB"} import argparse import os impor...
mit
gdi2290/django
django/contrib/postgres/fields/hstore.py
14
4495
import json from django.contrib.postgres import forms from django.contrib.postgres.fields.array import ArrayField from django.core import exceptions from django.db.models import Field, Lookup, Transform, TextField from django.utils import six from django.utils.translation import ugettext_lazy as _ __all__ = ['HStore...
bsd-3-clause
stianrh/askbot-nordic
askbot/migrations/0168_add_twitter_fields_to_user_profile.py
13
35766
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models from askbot.migrations_api import safe_add_column class Migration(SchemaMigration): def forwards(self, orm): """add fields twitter_access_token, twitter_handle, social_sharing...
gpl-3.0
pyload/pyload
src/pyload/plugins/accounts/UptoboxCom.py
1
1145
# -*- coding: utf-8 -*- import re from ..base.xfs_account import XFSAccount class UptoboxCom(XFSAccount): __name__ = "UptoboxCom" __type__ = "account" __version__ = "0.25" __status__ = "testing" __description__ = """Uptobox.com account plugin""" __license__ = "GPLv3" __authors__ = [ ...
agpl-3.0
ESOedX/edx-platform
lms/djangoapps/bulk_email/tests/test_tasks.py
1
23176
# -*- coding: utf-8 -*- """ Unit tests for LMS instructor-initiated background tasks. Runs tasks on answers to course problems to validate that code paths actually work. """ from __future__ import absolute_import, print_function import json from itertools import chain, cycle, repeat from smtplib import SMTPAuthentic...
agpl-3.0
mgedmin/ansible
lib/ansible/modules/cloud/cloudstack/cs_zone_facts.py
48
5787
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2016, René Moser <mail@renemoser.net> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Lice...
gpl-3.0
SUSE/kiwi
test/unit/tasks/system_build_test.py
1
12177
import logging import sys import mock import os from pytest import fixture from mock import patch, call import kiwi from ..test_helper import argv_kiwi_tests from kiwi.tasks.system_build import SystemBuildTask class TestSystemBuildTask: @fixture(autouse=True) def inject_fixtures(self, caplog): self...
gpl-3.0
RusDavies/ansible-modules-core
database/postgresql/postgresql_user.py
89
25160
#!/usr/bin/python # -*- coding: utf-8 -*- # 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
heke123/chromium-crosswalk
tools/grit/grit/clique.py
25
18007
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''Collections of messages and their translations, called cliques. Also collections of cliques (uber-cliques). ''' import re impo...
bsd-3-clause
Argon-Zhou/django
tests/admin_checks/models.py
98
1724
""" Tests of ModelAdmin system checks logic. """ from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compatible class Album(models.Model): title = models.CharFie...
bsd-3-clause
badloop/SickRage
lib/unidecode/x0b7.py
253
4833
data = ( 'ddwim', # 0x00 'ddwib', # 0x01 'ddwibs', # 0x02 'ddwis', # 0x03 'ddwiss', # 0x04 'ddwing', # 0x05 'ddwij', # 0x06 'ddwic', # 0x07 'ddwik', # 0x08 'ddwit', # 0x09 'ddwip', # 0x0a 'ddwih', # 0x0b 'ddyu', # 0x0c 'ddyug', # 0x0d 'ddyugg', # 0x0e 'ddyugs', # 0x0f 'dd...
gpl-3.0
Krossom/python-for-android
python-modules/twisted/twisted/persisted/crefutil.py
61
4644
# -*- test-case-name: twisted.test.test_persisted -*- # Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ Utility classes for dealing with circular references. """ from twisted.python import log, reflect try: from new import instancemethod except: from org.python.core impo...
apache-2.0
feigames/Odoo
addons/portal_claim/portal_claim.py
315
1871
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
yan12125/youtube-dl
youtube_dl/extractor/rmcdecouverte.py
20
2017
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from .brightcove import BrightcoveLegacyIE from ..compat import ( compat_parse_qs, compat_urlparse, ) from ..utils import smuggle_url class RMCDecouverteIE(InfoExtractor): _VALID_URL = r'https?://rmcdecou...
unlicense
arikpoz/mxnet
example/recommenders/movielens_data.py
15
1636
"""MovieLens data handling: download, parse, and expose as DataIter """ import os import mxnet as mx def load_mldata_iter(filename, batch_size): """Not particularly fast code to parse the text file and load it into three NDArray's and product an NDArrayIter """ user = [] item = [] score = [] ...
apache-2.0
couwbat/couwbatns3
ns-allinone-3.23/ns-3.23/src/click/bindings/modulegen__gcc_ILP32.py
124
289391
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
dcherian/tools
ROMS/pmacc/tools/post_tools/rompy/tags/rompy-0.1.6/test.py
4
8114
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas from matplotlib.figure import Figure from rompy import rompy, plot_utils, utils map1 = False map2 = False map3 = False map4 = False map5 = False map6 = False map7 = Fa...
mit
CVL-GitHub/karaage
karaage/legacy/people/south_migrations/0001_initial.py
3
11036
# encoding: utf-8 from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Institute' db.create_table('institute', ( ('gid', self.gf('django.db.models.fields.IntegerField')()), ...
gpl-3.0
cloudbase/cinder
cinder/tests/unit/volume/drivers/emc/vnx/test_utils.py
5
6969
# Copyright (c) 2016 EMC Corporation, 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 ap...
apache-2.0
engdan77/edoAutoHomeMobile
twisted/conch/ssh/service.py
69
1408
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ The parent class for all the SSH services. Currently implemented services are ssh-userauth and ssh-connection. Maintainer: Paul Swartz """ from twisted.python import log class SSHService(log.Logger): name = None # this is the ssh name...
mit
ianyh/heroku-buildpack-python-opencv
vendor/.heroku/lib/python2.7/test/test_datetime.py
9
134923
"""Test date/time type. See http://www.zope.org/Members/fdrake/DateTimeWiki/TestCases """ from __future__ import division import sys import pickle import cPickle import unittest from test import test_support from datetime import MINYEAR, MAXYEAR from datetime import timedelta from datetime import tzinfo from datetim...
mit
adelina-t/neutron
neutron/api/v2/base.py
9
32455
# Copyright (c) 2012 OpenStack Foundation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless...
apache-2.0
kevinastone/sentry
tests/integration/tests.py
9
10414
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function import datetime import json import logging import mock import zlib from django.conf import settings from django.core.urlresolvers import reverse from django.test.utils import override_settings from django.utils import timezone from gzip i...
bsd-3-clause
TeachAtTUM/edx-platform
cms/djangoapps/contentstore/tests/test_import_pure_xblock.py
25
3002
""" Integration tests for importing courses containing pure XBlocks. """ from django.conf import settings from xblock.core import XBlock from xblock.fields import String from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.django import modulestore from xmodule.modulestore.mongo.draft import as_dr...
agpl-3.0
pleaseproject/python-for-android
python3-alpha/python3-src/Lib/test/pydocfodder.py
203
6332
"""Something just to look at via pydoc.""" import types class A_classic: "A classic class." def A_method(self): "Method defined in A." def AB_method(self): "Method defined in A and B." def AC_method(self): "Method defined in A and C." def AD_method(self): "Method de...
apache-2.0
asgard-lab/neutron
neutron/tests/unit/objects/qos/test_rule.py
10
3451
# 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
mm1ke/portage
pym/_emerge/post_emerge.py
3
5021
# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from __future__ import print_function import logging import textwrap import portage from portage import os from portage.emaint.modules.logs.logs import CleanLogs from portage.news import count_unread_news, disp...
gpl-2.0
stijnvanhoey/defence
node_modules/grunt-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/__init__.py
1524
22178
#!/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. import copy import gyp.input import optparse import os.path import re import shlex import sys import traceback from gyp.common import GypErr...
mit
sxjscience/mxnet
python/mxnet/gluon/contrib/estimator/batch_processor.py
12
3925
# 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
schreiberx/sweet
benchmarks_sphere/rexi_mass_energy_galewsky_martinium/pp_plot_csv.py
2
2918
#! /usr/bin/python2 import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import sys first = True s = 2e-5 eta_contour_levels = np.append(np.arange(-1e-4, 0, s), np.arange(s, 1e-4, s)) zoom_lat = True zoom_lat = False zoom_lat = 'eta' in sys.argv[1] fontsize=8 figsize=(9, 3)...
mit
dmilith/SublimeText3-dmilith
Packages/pygments/all/pygments/styles/algol_nu.py
37
2278
# -*- coding: utf-8 -*- """ pygments.styles.algol_nu ~~~~~~~~~~~~~~~~~~~~~~~~ Algol publication style without underlining of keywords. This style renders source code for publication of algorithms in scientific papers and academic texts, where its format is frequently used. It is based on the ...
mit
ovilab/atomify-lammps
libs/lammps/tools/moltemplate/moltemplate/postprocess_input_script.py
8
6687
#!/usr/bin/env python """ Reorder the integer arguments to the commands in a LAMMPS input file if these arguments violate LAMMPS order requirements. We have to do this because the moltemplate.sh script will automatically assign these integers in a way which may violate these restrictions and the user ha...
gpl-3.0
chubiei/ycmd
ycmd/extra_conf_store.py
13
7343
#!/usr/bin/env python # # Copyright (C) 2011, 2012 Google Inc. # # This file is part of YouCompleteMe. # # YouCompleteMe 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
astroumd/GradMap
notebooks/check_imports/draw_dolphins.py
1
3779
""" Draws dolphins using matplotlib features. From matplotlib documentation: https://matplotlib.org/gallery/shapes_and_collections/dolphin.html#sphx-glr-gallery-shapes-and-collections-dolphin-py """ # Fixing random state for reproducibility import matplotlib.cm as cm import matplotlib.pyplot as plt from matplotlib.pa...
gpl-3.0
jianpingye/linux
tools/perf/scripts/python/event_analyzing_sample.py
4719
7393
# event_analyzing_sample.py: general event handler in python # # Current perf report is already very powerful with the annotation integrated, # and this script is not trying to be as powerful as perf report, but # providing end user/developer a flexible way to analyze the events other # than trace points. # # The 2 dat...
gpl-2.0
zhoulingjun/django
django/utils/deprecation.py
199
2627
from __future__ import absolute_import import inspect import warnings class RemovedInDjango20Warning(PendingDeprecationWarning): pass class RemovedInDjango110Warning(DeprecationWarning): pass RemovedInNextVersionWarning = RemovedInDjango110Warning class warn_about_renamed_method(object): def __init...
bsd-3-clause
kitsunde/ansible
lib/ansible/plugins/action/fail.py
172
1228
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2012, Dag Wieers <dag@wieers.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 ...
gpl-3.0
pkimber/old_cms
cms/tests/test_service.py
1
1778
# -*- encoding: utf-8 -*- from __future__ import unicode_literals from django.test import TestCase from cms.models import Page from cms.service import init_page class TestService(TestCase): def setUp(self): self.SLUG = 'home' self.HOME = 'Home' def test_init_not(self): try: ...
apache-2.0
zenners/angular-contacts
node_modules/firebase/node_modules/faye-websocket/node_modules/websocket-driver/node_modules/websocket-extensions/node_modules/jstest/node_modules/nopt/node_modules/tap/node_modules/readable-stream/node_modules/string_decoder/node_modules/tap/node_modules/yamlish/yamlish-py/test/test_input.py
157
1764
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import test try: import unittest2 as unittest except ImportError: import unittest import yamlish test_data_list = [ { "name": "Input test", "in": r"""--- bill-to: address: city: "Royal Oak" ...
mit
nozuono/calibre-webserver
src/calibre/ebooks/rtf2xml/convert_to_tags.py
19
10742
import os, sys from codecs import EncodedFile from calibre.ebooks.rtf2xml import copy, check_encoding from calibre.ptempfile import better_mktemp public_dtd = 'rtf2xml1.0.dtd' class ConvertToTags: """ Convert file to XML """ def __init__(self, in_file, bug_handler, ...
gpl-3.0
pixelgremlins/ztruck
dj/lib/python2.7/site-packages/django/core/files/utils.py
901
1230
class FileProxyMixin(object): """ A mixin class used to forward file methods to an underlaying file object. The internal file object has to be called "file":: class FileProxy(FileProxyMixin): def __init__(self, file): self.file = file """ encoding = property(la...
apache-2.0
elventear/ansible-modules-core
system/group.py
25
14205
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Stephen Fromm <sfromm@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 Lice...
gpl-3.0
avocado-framework/avocado-vt
virttest/libvirt_xml/devices/base.py
8
10527
""" Common base classes for devices """ import logging from six import StringIO from virttest import xml_utils from virttest.libvirt_xml import base, xcepts, accessors from virttest.xml_utils import ElementTree class UntypedDeviceBase(base.LibvirtXMLBase): """ Base class implementing common functions for a...
gpl-2.0
VasLem/KinectPainting
palm_detection_alg.py
1
18445
import numpy as np import math import cv2 import itertools as it import sys import time import helping_functs as hf import class_objects as co def detect_corners(): '''function to detects intersection limits of mask with calib_edges''' calib_set = set([tuple(i) for i in np.transpose( np.fliplr(np.non...
bsd-3-clause
framon/samba
python/samba/tests/registry.py
49
1772
# Unix SMB/CIFS implementation. # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2007 # # 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 3 of the License, or # (at your option) a...
gpl-3.0
openfun/edx-platform
common/test/acceptance/tests/studio/test_studio_settings_certificates.py
20
8185
""" Acceptance tests for Studio's Setting pages """ from .base_studio_test import StudioCourseTest from ...pages.studio.settings_certificates import CertificatesPage class CertificatesTest(StudioCourseTest): """ Tests for settings/certificates Page. """ def setUp(self, is_staff=False): super(C...
agpl-3.0
Erotemic/dtool
dtool_ibeis/experimental_features.py
1
3573
# @ut.accepts_scalar_input2(argx_list=[1]) # def get_obj(depc, tablename, root_rowids, config=None, ensure=True): # """ Convinience function. Gets data in `tablename` as a list of # objects. """ # print('WARNING EXPERIMENTAL') # try: # if tablename == depc.root: # obj_list = list(de...
apache-2.0
bogdal/django-filer
filer/tests/permissions.py
1
14540
#-*- coding: utf-8 -*- try: from django.contrib.auth import get_user_model User = get_user_model() except ImportError: from django.contrib.auth.models import User, Permission # NOQA from django.contrib.auth.models import Group from django.core.files import File as DjangoFile from django.conf import setting...
bsd-3-clause
evancich/apm_motor
modules/waf/waflib/Utils.py
1
18328
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2005-2010 (ita) """ Utilities and platform-specific fixes The portability fixes try to provide a consistent behavior of the Waf API through Python versions 2.3 to 3.X and across different platforms (win32, linux, etc) """ import os, sys, errno, traceback, inspec...
gpl-3.0
kidaa/encoded
src/contentbase/util.py
1
1415
from past.builtins import basestring from pyramid.threadlocal import manager as threadlocal_manager def get_root_request(): if threadlocal_manager.stack: return threadlocal_manager.stack[0]['request'] def ensurelist(value): if isinstance(value, basestring): return [value] return value ...
mit
Denisolt/Tensorflow_Chat_Bot
local/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/dataframe/queues/feeding_functions.py
12
12480
# 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...
gpl-3.0
y-higuchi/ramcloud
scripts/upload.py
10
64911
#!/usr/bin/env python # # Copyright 2007 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 o...
isc
raphaelmerx/django
django/core/management/commands/sendtestemail.py
349
1449
import socket from django.core.mail import mail_admins, mail_managers, send_mail from django.core.management.base import BaseCommand from django.utils import timezone class Command(BaseCommand): help = "Sends a test email to the email addresses specified as arguments." missing_args_message = "You must specif...
bsd-3-clause
HanyuWorm/volatility
volatility/plugins/gui/vtypes/win7_sp0_x64_vtypes_gui.py
62
137575
win32k_types = { '_HANDLEENTRY': [0x18, { 'pOwner': [8, ['pointer64', ['void']]], 'phead': [0, ['pointer64', ['_HEAD']]], 'bFlags': [17, ['unsigned char']], 'wUniq': [18, ['unsigned short']], 'bType': [16, ['unsigned char']], }], 'tagTOUCHINPUTINFO': [0x50, { 'dwcInputs': [24, ['unsigned lon...
gpl-2.0
Sorsly/subtle
google-cloud-sdk/platform/gsutil/gslib/tests/test_notification.py
38
2770
# -*- coding: utf-8 -*- # Copyright 2013 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 require...
mit
wilvk/ansible
test/units/module_utils/test_distribution_version.py
13
35740
# -*- coding: utf-8 -*- # 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 itertools import product import pytest # the module we are actually te...
gpl-3.0
Ziqi-Li/bknqgis
bokeh/examples/embed/embed_multiple.py
7
2314
import io from jinja2 import Template from bokeh.embed import components from bokeh.models import Range1d from bokeh.plotting import figure from bokeh.resources import INLINE from bokeh.util.browser import view # create some data x1 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12] y1 = [0, 8, 2, 4, 6, 9, 5, 6, 25, 28, 4, 7]...
gpl-2.0
ulif/pulp
server/test/unit/server/db/model/test_consumer.py
15
14706
# -*- coding: utf-8 -*- """ This module contains tests for the pulp.server.db.model.consumer module. """ import unittest import mock from ....base import PulpServerTests from pulp.server.db.model import consumer class TestRepoProfileApplicability(PulpServerTests): """ Test the RepoProfileApplicability Mode...
gpl-2.0
tectronics/gpo2py
models/menu.py
7
6122
# -*- coding: utf-8 -*- # this file is released under public domain and you can use without limitations ######################################################################### ## Customize your APP title, subtitle and menus here ######################################################################### response.titl...
agpl-3.0
naototty/pyflag
src/plugins/Themes/Standard.py
7
6877
""" These are the standard themes that come with Pyflag. """ import pyflag.conf config=pyflag.conf.ConfObject() import pyflag.FlagFramework as FlagFramework import pyflag.Registry as Registry import pyflag.Theme as Theme class BlueTheme(Theme.BasicTheme): """ This class encapsulates the theme elements. The results...
gpl-2.0
matrix-org/synapse
synapse/rest/client/v1/login.py
1
18517
# Copyright 2014-2016 OpenMarket Ltd # # 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 w...
apache-2.0
Orav/kbengine
kbe/src/lib/python/Doc/tools/sphinxext/pyspecific.py
1
13744
# -*- coding: utf-8 -*- """ pyspecific.py ~~~~~~~~~~~~~ Sphinx extension with Python doc-specific markup. :copyright: 2008-2014 by Georg Brandl. :license: Python license. """ ISSUE_URI = 'http://bugs.python.org/issue%s' SOURCE_URI = 'https://hg.python.org/cpython/file/3.4/%s' from ...
lgpl-3.0
ThePletch/ansible
lib/ansible/modules/cloud/vmware/vmware_vmkernel.py
48
7589
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.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 Li...
gpl-3.0
mayankcu/Django-social
venv/Lib/site-packages/django/contrib/gis/gdal/geometries.py
388
26357
""" The OGRGeometry is a wrapper for using the OGR Geometry class (see http://www.gdal.org/ogr/classOGRGeometry.html). OGRGeometry may be instantiated when reading geometries from OGR Data Sources (e.g. SHP files), or when given OGC WKT (a string). While the 'full' API is not present yet, the API is "pythonic" u...
bsd-3-clause
JLMARIN/paparazziUAV
sw/tools/attitude_viz.py
52
11943
#! /usr/bin/python # Tool for visualizing quaternion as rotated cube from OpenGL.GLUT import * from OpenGL.GLU import * from OpenGL.GL import * import sys import math from ivy.std_api import * import logging import getopt import pygame import time import platform import os _NAME = 'attitude_viz' class TelemetryQ...
gpl-2.0
amarian12/p2pool-adaptive-drk
nattraverso/pynupnp/upnp.py
283
18985
""" This module is the heart of the upnp support. Device discover, ip discovery and port mappings are implemented here. @author: Raphael Slinckx @author: Anthony Baxter @copyright: Copyright 2005 @license: LGPL @contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>} @version: 0.1.0 """ __revision__ = "$id" impor...
gpl-3.0
kmod/icbd
stdlib/python2.5/ctypes/test/test_funcptr.py
66
3962
import os, unittest from ctypes import * try: WINFUNCTYPE except NameError: # fake to enable this test on Linux WINFUNCTYPE = CFUNCTYPE import _ctypes_test lib = CDLL(_ctypes_test.__file__) class CFuncPtrTestCase(unittest.TestCase): def test_basic(self): X = WINFUNCTYPE(c_int, c_int, c_int) ...
mit
simonwydooghe/ansible
lib/ansible/modules/network/f5/bigip_appsvcs_extension.py
19
16524
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, 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
licess/shadowsocks
shadowsocks/asyncdns.py
655
17416
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014-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 r...
apache-2.0
pabelanger/did
did/base.py
2
13985
# coding: utf-8 """ Config, Date, User and Exceptions """ from __future__ import unicode_literals, absolute_import import os import re import sys import codecs import datetime import optparse import StringIO import xmlrpclib import ConfigParser from dateutil.relativedelta import MO as MONDAY from ConfigParser import...
gpl-2.0
levkar/odoo
addons/base_iban/models/res_partner_bank.py
30
6689
# -*- coding: utf-8 -*- import re from odoo import api, models, _ from odoo.exceptions import UserError, ValidationError def normalize_iban(iban): return re.sub('[\W_]', '', iban or '') def pretty_iban(iban): """ return iban in groups of four characters separated by a single space """ return ' '.join([...
agpl-3.0
h4ck3rm1k3/pip
pip/_vendor/requests/packages/chardet/gb2312prober.py
2994
1681
######################## 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
rosedu/synergy
tools/gtest-1.6.0/test/gtest_env_var_test.py
2408
3487
#!/usr/bin/env python # # Copyright 2008, 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
mfwarren/createbucket
createbucket/create_s3_bucket.py
1
3009
#!/usr/bin/env python from __future__ import print_function import os import re import boto from boto.s3.connection import S3Connection from boto.iam.connection import IAMConnection import inquirer key_policy_json = """{ "Statement": [ { "Action": "iam:*AccessKey*", "Effect": "Allow", "Resour...
mit
slohse/ansible
lib/ansible/modules/network/nxos/nxos_vrrp.py
68
12591
#!/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
ominux/skia
tools/skpdiff/skpdiff_server.py
161
24230
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import print_function import argparse import BaseHTTPServer import json import os import os.path import re import subprocess import sys import tempfile import urllib2 # Grab the script path because that is where all the static assets are SCRIPT_DIR = os.path.d...
apache-2.0
garverp/gnuradio
gr-blocks/examples/ctrlport/usrp_sink_controller.py
24
1510
#!/usr/bin/env python import sys import pmt from gnuradio.ctrlport.GNURadioControlPortClient import GNURadioControlPortClient from optparse import OptionParser parser = OptionParser(usage="%prog: [options]") parser.add_option("-H", "--host", type="string", default="localhost", help="Hostname to conn...
gpl-3.0
jaantollander/CrowdDynamics
crowddynamics/core/geom2D.py
1
1734
import numba @numba.jit(['f8(f8[:, :])'], nopython=True, nogil=True, cache=True) def polygon_area(vertices): r"""Shoelace formula for computing area of polygon .. math:: A = \sum_{i=1}^{n} x_i \left(y_{i+1} - y_{i-1}\right), \quad i\mod n References: - https://en.wikipedia.org/wiki/Shoel...
gpl-3.0
liorvh/golismero
tools/sqlmap/plugins/generic/fingerprint.py
8
1726
#!/usr/bin/env python """ Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ from lib.core.common import Backend from lib.core.common import readInput from lib.core.data import logger from lib.core.enums import OS from lib.core.exception import SqlmapU...
gpl-2.0
nwjs/chromium.src
third_party/pycoverage/coverage/execfile.py
209
5865
"""Execute files of Python code.""" import imp, marshal, os, sys from coverage.backward import exec_code_object, open_source from coverage.misc import ExceptionDuringRun, NoCode, NoSource try: # In Py 2.x, the builtins were in __builtin__ BUILTINS = sys.modules['__builtin__'] except KeyError: # In Py 3....
bsd-3-clause
agiliq/merchant
billing/models/pin_models.py
3
3331
from django.db import models from django.conf import settings User = getattr(settings, 'AUTH_USER_MODEL', 'auth.User') class PinCard(models.Model): token = models.CharField(max_length=32, db_index=True, editable=False) display_number = models.CharField(max_length=20, editable=False) expiry_month = models...
bsd-3-clause
mdutkin/m2core
example/run_rest_tests.py
1
8041
import unittest from tornado.options import define, options from m2core.utils.tests import RESTTest from m2core.utils.data_helper import DataHelper from m2core import M2Core from m2core.bases import http_statuses from tornado.escape import json_decode from example.models import User # init empty object to pass it thr...
mit
mercycorps/tola-help
project/settings/production.py
47
2181
"""Production settings and globals.""" from os import environ from base import * # Normally you should not import ANYTHING from Django directly # into your settings, but ImproperlyConfigured is an exception. from django.core.exceptions import ImproperlyConfigured def get_env_setting(setting): """ Get the envi...
gpl-2.0
binking/News_website
news_website/models/user.py
1
1441
import datetime as dt from flask_login import UserMixin from news_website.extensions import db, bcrypt from news_website.database import ( Column, Model, ReferenceCol, relationship, SurrogatePK, ) class User(UserMixin, SurrogatePK, Model): __tablename__ = 'users' username = Column(db.Str...
bsd-3-clause
albertomurillo/ansible
lib/ansible/modules/network/f5/bigip_profile_analytics.py
38
24086
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright: (c) 2018, 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
ufownl/shadowsocks
shadowsocks/asyncdns.py
22
17640
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2014-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 r...
apache-2.0
unho/translate
translate/storage/cpo.py
1
35665
# -*- coding: utf-8 -*- # # Copyright 2002-2007 Zuza Software Foundation # # This file is part of translate. # # translate is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # ...
gpl-2.0
msalloum/cs181
HomeWork/HW3/TwitterStream/tweetstream.py
1
2124
""" tweet_read.py Serve tweets to a socket for spark-streaming. Adapted from: http://www.awesomestats.in/spark-twitter-stream/ """ import tweepy from tweepy import OAuthHandler from tweepy import Stream from tweepy.streaming import StreamListener import socket import json import logging logger = logging.getLog...
mit
vdjagilev/desefu
modules/file/Hash.py
1
1721
from modules import AbstractModule from kernel.output import Output import hashlib class Hash(AbstractModule): def is_collect_data(self) -> bool: return True def check(self): return True def description(self) -> str: return "A module which collects data about file hashes" de...
mit
orangeduck/PyAutoC
Python27/Lib/ctypes/test/test_structures.py
17
15068
import unittest from ctypes import * from struct import calcsize class SubclassesTest(unittest.TestCase): def test_subclass(self): class X(Structure): _fields_ = [("a", c_int)] class Y(X): _fields_ = [("b", c_int)] class Z(X): pass self.assertE...
bsd-2-clause