repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
kchodorow/tensorflow
tensorflow/contrib/tfprof/python/tools/tfprof/print_model_analysis_test.py
18
7442
# 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
chrisfilo/fmriprep
test/utils/test_misc.py
2
2734
import os import re import unittest from io import BytesIO from zipfile import ZipFile import pkg_resources as pkgr from future.standard_library import install_aliases import fmriprep.utils.misc as misc install_aliases() from urllib.request import urlopen class TestCollectBids(unittest.TestCase): fake_data_ro...
bsd-3-clause
slava-sh/NewsBlur
apps/rss_feeds/migrations/0001_initial.py
18
10737
from south.db import db from django.db import models from apps.rss_feeds.models import * class Migration: def forwards(self, orm): # Adding model 'Feed' db.create_table('feeds', ( ('id', orm['rss_feeds.Feed:id']), ('feed_address', orm['rss_feeds.Feed:feed_addr...
mit
andgoldschmidt/iEBE
EBE-Node/crank/SequentialEventDriver.py
1
33337
#! /usr/bin/env python2 # This package performs a sequential calculations of a given number of events, # after reading parameters from ParameterDict.py. The most important control # parameters are set in controlParameterList, for other parameters see # allParameterLists. This package is intended to be working-at-backgr...
gpl-3.0
ktalik/tornado-json
setup.py
2
1867
import os import sys __DIR__ = os.path.abspath(os.path.dirname(__file__)) import codecs from setuptools import setup from setuptools.command.test import test as TestCommand import tornado_json def read(filename): """Read and return `filename` in root dir of project and return string""" return codecs.open(os.p...
mit
jrajahalme/envoy
source/extensions/filters/network/kafka/protocol/launcher.py
6
1836
#!/usr/bin/python # Launcher for generating Kafka protocol code. import source.extensions.filters.network.kafka.protocol.generator as generator import sys import os def main(): """ Kafka code generator script ~~~~~~~~~~~~~~~~~~~~~~~~~~~ Generates C++ code from Kafka protocol specification for Kafka codec. ...
apache-2.0
huangbop/skywalker
rt-thread-2.0.0/tools/tools/clang-analyze.py
66
2006
""" Tool-specific initialization for Clang static analyzer There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ __revision__ = "tools/clang-analyze.py 2013-09-06 grissiom" import os import os.path import SCons.Ac...
mit
joerocklin/gem5
src/arch/x86/isa/insts/simd128/floating_point/data_transfer/move.py
88
7298
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
elim/django-rest-framework
tests/test_decorators.py
82
4840
from __future__ import unicode_literals from django.test import TestCase from rest_framework import status from rest_framework.authentication import BasicAuthentication from rest_framework.decorators import ( api_view, authentication_classes, parser_classes, permission_classes, renderer_classes, throttle_clas...
bsd-2-clause
vcoin-project/electrum
gui/qt/util.py
5
15748
from electrum.i18n import _ from PyQt4.QtGui import * from PyQt4.QtCore import * import os.path import time import traceback import sys import threading import platform if platform.system() == 'Windows': MONOSPACE_FONT = 'Lucida Console' elif platform.system() == 'Darwin': MONOSPACE_FONT = 'Monaco' else: M...
gpl-3.0
chouseknecht/ansible
lib/ansible/modules/storage/purestorage/purefa_smtp.py
19
4504
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018, Simon Dodsley (simon@purestorage.com) # 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
flacjacket/sympy
bin/generate_test_list.py
10
1510
""" Execute like this: $ python bin/generate_test_list.py tests = [ 'sympy.concrete.tests', 'sympy.core.tests', 'sympy.functions.combinatorial.tests', 'sympy.functions.elementary.tests', 'sympy.functions.special.tests', 'sympy.geometry.tests', 'sympy.integrals.tests', 'sympy.matrices.te...
bsd-3-clause
nolanelena/MyProjectSite-
node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py
1869
1247
# Copyright 2014 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. """A clone of the default copy.deepcopy that doesn't handle cyclic structures or complex types except for dicts and lists. This is because gyp copies so large structur...
mit
Just-D/chromium-1
tools/telemetry/telemetry/web_perf/metrics/single_event_unittest.py
21
3135
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import unittest from collections import namedtuple from telemetry.internal.results import page_test_results from telemetry.page import page from telemetry.w...
bsd-3-clause
ByteInternet/python-social-auth
social/backends/appsfuel.py
83
1502
""" Appsfueld OAuth2 backend (with sandbox mode support), docs at: http://psa.matiasaguirre.net/docs/backends/appsfuel.html """ from social.backends.oauth import BaseOAuth2 class AppsfuelOAuth2(BaseOAuth2): name = 'appsfuel' ID_KEY = 'user_id' AUTHORIZATION_URL = 'http://app.appsfuel.com/content/permi...
bsd-3-clause
gclenaghan/scikit-learn
examples/ensemble/plot_adaboost_twoclass.py
347
3268
""" ================== Two-class AdaBoost ================== This example fits an AdaBoosted decision stump on a non-linearly separable classification dataset composed of two "Gaussian quantiles" clusters (see :func:`sklearn.datasets.make_gaussian_quantiles`) and plots the decision boundary and decision scores. The di...
bsd-3-clause
outboxafrica/pimaa
PiMaa/sensors/lib/GrovePi/grove_nfc_tag.py
2
2787
#!/usr/bin/env python # # GrovePi Example for using the Grove NFC Tag module (http://www.seeedstudio.com/wiki/Grove_%EF%BC%8D_NFC) # # The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi # # Have a question about this example? Ask on...
gpl-3.0
etherkit/OpenBeacon2
client/linux-arm/venv/lib/python3.5/site-packages/PyInstaller/archive/writers.py
2
16682
#----------------------------------------------------------------------------- # Copyright (c) 2005-2019, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License with exception # for distributing bootloader. # # The full license is in the file COPYING.txt, distributed with this s...
gpl-3.0
scottbarstow/iris-python
tests/test_portins.py
2
10874
#!/usr/bin/env python import os import sys # For coverage. if __package__ is None: sys.path.append(os.path.dirname(os.path.abspath(__file__)) + "/..") from unittest import main, TestCase import requests import requests_mock from iris_sdk.client import Client from iris_sdk.models.account import Account XML_RES...
mit
yoer/hue
desktop/core/ext-py/parquet-python/parquet/ttypes.py
35
49277
# # Autogenerated by Thrift Compiler (0.9.0) # # DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING # # options string: py # from thrift.Thrift import TType, TMessageType, TException, TApplicationException from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol, TProtocol tr...
apache-2.0
idegtiarov/ceilometer
ceilometer/tests/functional/gabbi/test_gabbi_prefix.py
4
1234
# # Copyright 2015 Red Hat. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
Prism2/HUAWEI-U8686-Open-Source-U8686-JellyBean-kernel-3.4.0-
tools/perf/scripts/python/net_dropmonitor.py
4235
1554
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
kleinfeld/medpy
bin/medpy_reslice_3d_to_4d.py
2
5375
#!/usr/bin/python """ Reslices 4D information stacked into a 3D volume into a real 4D image. Copyright (C) 2013 Oskar Maier 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 L...
gpl-3.0
wetek-enigma/enigma2
lib/python/Plugins/SystemPlugins/AnimationSetup/plugin.py
15
9606
from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.ActionMap import ActionMap from Components.ConfigList import ConfigListScreen from Components.MenuList import MenuList from Components.Sources.StaticText import StaticText from Components.config import config, ConfigNumber, Conf...
gpl-2.0
viewdy/phantomjs2
src/qt/qtwebkit/Tools/Scripts/webkitpy/common/system/environment_unittest.py
124
1853
# Copyright (C) 2011 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
sairuk/webcade
wahcade.py
1
10039
#!/usr/bin/env python import cherrypy import os import glob import re import subprocess from subprocess import Popen USER_DIR = '.wahcade' IMAGE_FILETYPES= ['jpg', 'jpeg', 'png', 'bmp', 'gif','svg'] class WebCade(object): @cherrypy.expose def launch(self, r=None): if r: self.wc_launch(r) @cherrypy.expose...
gpl-2.0
fuselock/odoo
addons/account_followup/__init__.py
436
1098
# -*- 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
SpaceKatt/CSPLN
apps/scaffolding/win/web2py/gluon/contrib/markmin/markmin2html.py
16
55258
#!/usr/bin/env python # -*- coding: utf-8 -*- # created by Massimo Di Pierro # recreated by Vladyslav Kozlovskyy # license MIT/BSD/GPL import re import urllib from cgi import escape from string import maketrans try: from ast import parse as ast_parse import ast except ImportError: # python 2.5 from compiler i...
gpl-3.0
PLyczkowski/Sticky-Keymap
2.74/scripts/addons/modules/selection_utils.py
6
2654
# ##### BEGIN GPL LICENSE BLOCK ##### # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distrib...
gpl-2.0
bank-netforce/netforce
netforce_hr/netforce_hr/models/hr_payroll_settings.py
2
2304
# Copyright (c) 2012-2015 Netforce Co. Ltd. # # 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, modify, merge, publ...
mit
kouaw/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/ntv.py
12
5199
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( unescapeHTML ) class NTVIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?ntv\.ru/(?P<id>.+)' _TESTS = [ { 'url': 'http://www.ntv.ru/novosti/863142/', ...
gpl-3.0
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/sympy/assumptions/tests/test_assumptions_2.py
63
1885
""" rename this to test_assumptions.py when the old assumptions system is deleted """ from sympy.abc import x, y from sympy.assumptions.assume import global_assumptions, Predicate from sympy.assumptions.ask import _extract_facts, Q from sympy.core import symbols from sympy.logic.boolalg import Or from sympy.printing im...
mit
lym/allura-git
ForgeImporters/forgeimporters/github/tests/test_tracker.py
2
3857
# 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 (t...
apache-2.0
yuvipanda/deltas
deltas/segmenters/tests/test_segments.py
1
1606
from nose.tools import eq_ import pickle from ...tokenizers import Token from ..segments import MatchableSegment, Segment def test_matchable_segment(): words = ["foo", "bar", "baz"] ms = MatchableSegment(0, [Token(c) for c in enumerate(words)]) eq_(ms.start, 0) eq_(ms.end, len(words)) hash(ms) ...
mit
SauloAislan/ironic
releasenotes/source/conf.py
4
9480
# -*- 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
yunify/qingcloud-sdk-python
qingcloud/iaas/actions/instance.py
1
17729
# ========================================================================= # Copyright 2012-present Yunify, Inc. # ------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this work except in compliance with the Licens...
apache-2.0
tuxfux-hlp-notes/python-batches
archieves/batch-59/files/myvenv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/mbcssm.py
982
19608
######################## 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...
gpl-3.0
mgit-at/ansible
lib/ansible/modules/cloud/ovirt/ovirt_network.py
19
12341
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or #...
gpl-3.0
40223112/w16test
static/Brython3.1.1-20150328-091302/Lib/multiprocessing/util.py
696
9917
# # Module providing various facilities to other parts of the package # # multiprocessing/util.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # import sys import functools import os import itertools import weakref import atexit import threading # we want threading to ...
agpl-3.0
nkhuyu/graphite-web
webapp/tests/test_attime.py
2
10185
from mock import patch import datetime try: import unittest2 as unittest except ImportError: import unittest from django.test import TestCase from django.utils import timezone from graphite.render.attime import parseTimeReference, parseATTime, parseTimeOffset, getUnitString MOCK_DATE = datetime.datetime(2015, ...
apache-2.0
SnappleCap/oh-mainline
vendor/packages/django-debug-toolbar/debug_toolbar/panels/staticfiles.py
21
5746
from __future__ import absolute_import, unicode_literals from os.path import normpath, join try: import threading except ImportError: threading = None from django.conf import settings from django.core.files.storage import get_storage_class from django.contrib.staticfiles import finders, storage from django.con...
agpl-3.0
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/django/contrib/contenttypes/admin.py
273
5345
from __future__ import unicode_literals from functools import partial from django.contrib.admin.checks import InlineModelAdminChecks from django.contrib.admin.options import InlineModelAdmin, flatten_fieldsets from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.forms impo...
mit
siovene/crosswalk
app/tools/android/customize_launch_screen.py
34
6106
#!/usr/bin/env python # Copyright (c) 2014 Intel Corporation. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os import shutil import sys from util import GetBuildDir def CopyToPathWithName(root, name, final_path, rename): if name =...
bsd-3-clause
calvinkoder/markov
markov.py
1
3453
import random class Group: def __init__(self, nodes = []): self.nodes = nodes def __str__(self): return ' '.join(self.nodes) def __getitem__(self, index): return self.nodes[index] def __len__(self): return len(self.nodes) def walk(self, next_node): self.nodes = self.nodes[1:] self.nodes.append(nex...
mit
Diyago/Machine-Learning-scripts
DEEP LEARNING/Pytorch from scratch/MLP/fc_model.py
1
3423
import torch from torch import nn import torch.nn.functional as F class Network(nn.Module): def __init__(self, input_size, output_size, hidden_layers, drop_p=0.5): """ Builds a feedforward network with arbitrary hidden layers. Arguments --------- input_size: in...
apache-2.0
valentin-krasontovitsch/ansible
test/units/modules/network/netvisor/nvos_module.py
31
2977
# Copyright: (c) 2018, Pluribus Networks # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import os import json import tempfile from units.compat import u...
gpl-3.0
hradec/cortex
python/IECore/SequenceLsOp.py
12
12195
########################################################################## # # Copyright (c) 2007-2011, Image Engine Design 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: # # * Redis...
bsd-3-clause
mlperf/inference_results_v0.7
closed/Cisco/code/bert-99.9/tensorrt/int8_builder_vs_il.py
18
10184
# Copyright (c) 2020, NVIDIA CORPORATION. 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 appli...
apache-2.0
alrusdi/lettuce
tests/integration/lib/Django-1.3/tests/regressiontests/forms/localflavor/cl.py
86
2290
from django.contrib.localflavor.cl.forms import CLRutField, CLRegionSelect from django.core.exceptions import ValidationError from utils import LocalFlavorTestCase class CLLocalFlavorTests(LocalFlavorTestCase): def test_CLRegionSelect(self): f = CLRegionSelect() out = u'''<select name="foo"> <opt...
gpl-3.0
51kfa/mangos-classic
dep/ACE_wrappers/bin/svn_props.py
95
1292
#!/usr/bin/python import sys import re import os import string print """WARNING: this script is dumb. I mean, really, really dumb. Every file is treated as a text file, so if you are checking in any binary files, YOU MUST set a non-text MIME type by hand, otherwise it WILL be corrupted by the checkout process. A b...
gpl-2.0
Bredgren/AttrLib
c_writer.py
1
2941
from AttrLib.writer import Writer class CWriter(Writer): def __init__(self): Writer.__init__(self) def construct(self, rep): print "constructing from", rep def write(self, out_dir): print "writing to", out_dir def writeHeader(dest, type): accessor_template = Template...
mit
dshyshov/MAVProxy
MAVProxy/modules/mavproxy_relay.py
10
3625
#!/usr/bin/env python '''relay handling module''' import time from pymavlink import mavutil from MAVProxy.modules.lib import mp_module class RelayModule(mp_module.MPModule): def __init__(self, mpstate): super(RelayModule, self).__init__(mpstate, "relay") self.add_command('relay', self.cmd_relay, "...
gpl-3.0
gonrin/gatco
gatco/sessions/base.py
1
5109
import time from datetime import datetime import warnings import socket from .utils import CallbackDict def get_request_container(request): return request.ctx.__dict__ if hasattr(request, "ctx") else request def is_ip(value): """Determine if the given string is an IP address. :param value: value to check ...
mit
MonicaHsu/truvaluation
venv/lib/python2.7/lib2to3/tests/test_fixers.py
7
120120
""" Test suite for the fixer modules """ # Python imports import os import unittest from itertools import chain from operator import itemgetter # Local imports from lib2to3 import pygram, pytree, refactor, fixer_util from lib2to3.tests import support class FixerTestCase(support.TestCase): # Other test cases ca...
mit
Schevo/kiwi
kiwi/ui/views.py
1
37053
# # Kiwi: a Framework and Enhanced Widgets for Python # # Copyright (C) 2001-2006 Async Open Source # # 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 # version 2.1 of the License, ...
lgpl-2.1
chris-wood/picture-grid
src/pg.py
1
1206
import os import sys import math from PIL import Image import numpy as np imageFiles = [] for root, dirs, files in os.walk(sys.argv[1]): for fname in files: filename, extension = os.path.splitext(fname) if extension == ".jpg" or extension == ".jpeg": imageFiles.append(fname) # Big imag...
mit
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/elan/Pools/AddRemove/0a_Check_Theme_Settings.py
2
4674
from ImageScripter import * from elan import * Configurator.Start(password = '') Configurator.media.Click() Configurator.system.RealClick() #####################################Activate Dev Mode Configurator.Wait() Configurator.Press('f5') Configurator.Press('f5') sleep(3) HlConfig.PushButton.Click('OK') sleep(3) Lis...
gpl-3.0
hoangt/tpzsimul.gem5
util/checkpoint-tester.py
63
5044
#! /usr/bin/env python # Copyright (c) 2010 Advanced Micro Devices, 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,...
bsd-3-clause
tsbischof/photon_correlation
python/photon_correlation/FLID.py
1
2022
#!/usr/bin/env python import sys import csv import bz2 import matplotlib.pyplot as plt import numpy def force_aspect(ax,aspect=1): im = ax.get_images() extent = im[0].get_extent() ax.set_aspect(abs((extent[1]-extent[0])/(extent[3]-extent[2]))/aspect) class FLID(object): def __init__(self, filename=...
bsd-3-clause
procangroup/edx-platform
common/lib/xmodule/xmodule/tests/test_videoannotation.py
83
3571
# -*- coding: utf-8 -*- "Test for Annotation Xmodule functional logic." import unittest from mock import Mock from lxml import etree from xblock.field_data import DictFieldData from xblock.fields import ScopeIds from xmodule.videoannotation_module import VideoAnnotationModule from . import get_test_system class V...
agpl-3.0
phenoxim/nova
nova/db/sqlalchemy/types.py
10
2491
# Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
apache-2.0
SoftwareExperiment4/SungkyunWiki
wiki/plugins/attachments/urls.py
11
1472
from __future__ import absolute_import from __future__ import unicode_literals from django import VERSION as DJANGO_VERSION from django.conf.urls import patterns, url from wiki.plugins.attachments import views urlpatterns = [ url(r'^$', views.AttachmentView.as_view(), name='attachments_index'), ...
gpl-3.0
igou/rt-thread
bsp/stm32l072/rtconfig.py
6
3507
import os # toolchains options ARCH='arm' CPU='cortex-m0' CROSS_TOOL='gcc' if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') # cross_tool provides the cross compiler # EXEC_PATH is the compiler execute path, for example, CodeSourcery, Keil MDK, IAR if CROSS_TOOL == 'gcc': PLATFORM = 'gcc' EXEC_PATH...
apache-2.0
ilsawa/p2pool-crypt
nattraverso/ipdiscover.py
288
4180
""" Generic methods to retreive the IP address of the local machine. TODO: Example @author: Raphael Slinckx @copyright: Copyright 2005 @license: LGPL @contact: U{raphael@slinckx.net<mailto:raphael@slinckx.net>} @version: 0.1.0 """ __revision__ = "$id" import random, socket, logging, itertools from twisted.internet...
gpl-3.0
deathjest3r/vh1
tools/sysgen.py
1
3291
#!/usr/bin/env python import struct CONFIG_ARM_VEXPRESS_RAMBASE = 0x60000000 PT_LVL1_SHIFT = 30 PT_LVL2_SHIFT = 21 PT_LVL3_SHIFT = 12 PT_ENTRY_SIZE = 8 def pt_lvl_offset(lvl, addr): if lvl == 1: return ((addr >> PT_LVL1_SHIFT) & 0x003) << 3 elif lvl == 2: return ((addr >> PT_LVL2_SHIFT) ...
gpl-2.0
cloudify-cosmo/cloudify-manager
resources/rest-service/cloudify/migrations/versions/9516df019579_4_5_5_to_4_6.py
1
1241
""" 4_5_5 to 4_6 - New 'Licenses' table Revision ID: 9516df019579 Revises: 1fbd6bf39e84 Create Date: 2019-02-17 14:39:21.868748 """ from alembic import op import sqlalchemy as sa from sqlalchemy.dialects import postgresql from manager_rest.storage.models_base import UTCDateTime # revision identifiers, used by Alemb...
apache-2.0
nutztherookie/wagtail
wagtail/api/v2/pagination.py
9
1406
from __future__ import absolute_import, unicode_literals from collections import OrderedDict from django.conf import settings from rest_framework.pagination import BasePagination from rest_framework.response import Response from .utils import BadRequestError class WagtailPagination(BasePagination): def paginat...
bsd-3-clause
rhndg/openedx
lms/djangoapps/verify_student/migrations/0001_initial.py
114
7568
# -*- 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 'SoftwareSecurePhotoVerification' db.create_table('verify_student_softwaresecurephotoverifica...
agpl-3.0
ilmanzo/scratch_extensions
venv/lib/python3.4/site-packages/pkg_resources/_vendor/packaging/version.py
451
11884
# Copyright 2014 Donald Stufft # # 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, so...
mit
notriddle/servo
tests/wpt/web-platform-tests/tools/third_party/tooltool/tooltool.py
25
46488
#!/usr/bin/env python # tooltool is a lookaside cache implemented in Python # Copyright (C) 2011 John H. Ford <john@johnford.info> # # 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 version 2 # #...
mpl-2.0
ahmadiga/min_edx
common/djangoapps/student/tests/test_verification_status.py
61
15311
"""Tests for per-course verification status on the dashboard. """ from datetime import datetime, timedelta import unittest import ddt from mock import patch from pytz import UTC from django.core.urlresolvers import reverse from django.conf import settings from student.helpers import ( VERIFY_STATUS_NEED_TO_VERIFY...
agpl-3.0
c86j224s/snippet
Python_asyncio_binary_echo/pyclient2/Lib/site-packages/pip/_vendor/urllib3/fields.py
288
5943
from __future__ import absolute_import import email.utils import mimetypes from .packages import six def guess_content_type(filename, default='application/octet-stream'): """ Guess the "Content-Type" of a file. :param filename: The filename to guess the "Content-Type" of using :mod:`mimetypes`. ...
apache-2.0
Elettronik/SickRage
lib/js2py/utils/definitions.py
78
3141
from pyparsing import * IdentifierStart = oneOf(['$', '_']+list(alphas)) Identifier = Combine(IdentifierStart + Optional(Word(alphas+nums+'$_'))) _keywords = ['break', 'do', 'instanceof', 'typeof', 'case', 'else', 'new', 'var', 'catch', 'finally', 'return', 'void', 'continue', 'for', 'switch', 'while', 'd...
gpl-3.0
cynicaldevil/servo
tests/wpt/web-platform-tests/tools/lint/tests/test_lint.py
17
4197
from __future__ import unicode_literals import os import mock import pytest import six from .. import lint as lint_mod from ..lint import filter_whitelist_errors, parse_whitelist, lint _dummy_repo = os.path.join(os.path.dirname(__file__), "dummy") def _mock_lint(name): wrapped = getattr(lint_mod, name) re...
mpl-2.0
aam-at/tensorflow
tensorflow/python/feature_column/sequence_feature_column.py
14
18286
# Copyright 2018 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
Cl3MM/metagoofil
hachoir_parser/file_system/linux_swap.py
95
3777
""" Linux swap file. Documentation: Linux kernel source code, files: - mm/swapfile.c - include/linux/swap.h Author: Victor Stinner Creation date: 25 december 2006 (christmas ;-)) """ from hachoir_parser import Parser from hachoir_core.field import (ParserError, GenericVector, UInt32, String, Bytes, NullByt...
gpl-2.0
jyejare/robottelo
tests/robottelo/test_issue_handlers.py
1
14834
import os import subprocess import sys from collections import defaultdict import pytest from pytest_plugins.issue_handlers import DEFAULT_BZ_CACHE_FILE from robottelo.constants import CLOSED_STATUSES from robottelo.constants import OPEN_STATUSES from robottelo.constants import WONTFIX_RESOLUTIONS from robottelo.util...
gpl-3.0
authmillenon/RIOT
dist/tools/stm32loader/stm32loader.py
32
22443
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # vim: sw=4:ts=4:si:et:enc=utf-8 # Author: Ivan A-R <ivan@tuxotronic.org> # With hacky error recovery by Gordon Williams <gw@pur3.co.uk> # Project page: http://tuxotronic.org/wiki/projects/stm32loader # # This file is part of stm32loader. # # stm32loader is free software...
lgpl-2.1
shaufi/odoo
addons/account_anglo_saxon/stock.py
208
2930
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
sudosurootdev/external_chromium_org
tools/telemetry/telemetry/value/scalar.py
40
3250
# 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. import numbers from telemetry import value as value_module from telemetry.value import list_of_scalar_values from telemetry.value import none_values class...
bsd-3-clause
katajakasa/utuputki2
utuputki/common/utils.py
1
1583
# -*- coding: utf-8 -*- import sys import os import pytz import isodate import datetime import binascii def utc_now(): """ Gets UTC datetime """ return pytz.utc.localize(datetime.datetime.utcnow()) def utc_minus_delta(seconds): """ Gets UTC datetime with deltatime substracted """ return pytz.utc.lo...
mit
lkash/test
dpkt/dpkt.py
5
6721
# $Id: dpkt.py 43 2007-08-02 22:42:59Z jon.oberheide $ # -*- coding: utf-8 -*- """Simple packet creation and parsing.""" import copy import itertools import socket import struct import array class Error(Exception): pass class UnpackError(Error): pass class NeedData(UnpackError): pass class PackErro...
bsd-3-clause
40223137/2015cbaa
static/Brython3.1.1-20150328-091302/Lib/ui/widget.py
706
1774
import random from browser import doc def getMousePosition(e): if e is None: e=win.event if e.pageX or e.pageY: return {'x': e.pageX, 'y': e.pageY} if e.clientX or e.clientY: _posx=e.clientX + doc.body.scrollLeft + doc.documentElement.scrollLeft; _posy=e.clientY + doc.body.scr...
gpl-3.0
msimacek/freeipa
install/migration/migration.py
3
3227
# Authors: # Pavel Zuna <pzuna@redhat.com> # # Copyright (C) 2009 Red Hat # see file 'COPYING' for use and warranty information # # 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 versio...
gpl-3.0
viranch/sam
sam/Cyberoam.py
1
2078
# # Author: Abhijeet Rastogi (http://www.google.com/profiles/abhijeet.1989) # Modified: Viranch Mehta <viranch.mehta@gmail.com> # cyberroamIP = "10.100.56.55" #The IP of the Cyberoam site. cyberroamPort = "8090" #Set to "" if not using. import cookielib import urllib2 import urllib def cyberroamAddress(): add = cyb...
bsd-2-clause
kawasaki2013/python-for-android-x86
python3-alpha/python3-src/Lib/email/base64mime.py
154
3558
# Copyright (C) 2002-2007 Python Software Foundation # Author: Ben Gertzfield # Contact: email-sig@python.org """Base64 content transfer encoding per RFCs 2045-2047. This module handles the content transfer encoding method defined in RFC 2045 to encode arbitrary 8-bit data using the three 8-bit bytes in four 7-bit ch...
apache-2.0
gdetrez/fscons-ticketshop
ticketshop/ticketapp/models.py
1
7127
# -*- coding: utf-8 -*- from uuid import uuid4 from django.db import models from django.db.models import Count, Q, F from django.core.exceptions import ValidationError from django.core.mail import send_mail, mail_admins from django.dispatch import Signal from paypal.standard.ipn.signals import payment_was_successful,...
mit
gammalib/gammalib
inst/cta/test/dev/test_likelihood_profile.py
1
9558
#! /usr/bin/env python # ========================================================================== # This script performs a likelihood profile computation # # Copyright (C) 2014 Juergen Knoedlseder # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public L...
gpl-3.0
Prometeo/personal_site_wagtail
blog/migrations/0003_blogpagegalleryimage.py
1
1194
# -*- coding: utf-8 -*- # Generated by Django 1.11.1 on 2017-05-15 23:15 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion import modelcluster.fields class Migration(migrations.Migration): dependencies = [ ('wagtailimages', '0019_delete_fil...
gpl-3.0
cdrooom/odoo
addons/stock/product.py
2
29301
# -*- 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
cyiops/easybuild-easyblocks
easybuild/easyblocks/generic/versionindependentpythonpackage.py
2
4380
## # Copyright 2013 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (FWO) (...
gpl-2.0
lrubior88/rate_position_controller
scripts/receive_udp_pose.py
1
4116
#! /usr/bin/env python import rospy, time, math, os # Sockets import socket, struct # Messages from StringIO import StringIO from std_msgs.msg import Float64 from geometry_msgs.msg import PoseStamped, Vector3 from omni_msgs.msg import OmniFeedback import roslib.message _struct_10d = struct.Struct("<10d") _struct_11d...
bsd-3-clause
coronary/RandomEpisode
depends/Lib/site-packages/pip/_vendor/webencodings/tests.py
340
6562
# coding: utf8 """ webencodings.tests ~~~~~~~~~~~~~~~~~~ A basic test suite for Encoding. :copyright: Copyright 2012 by Simon Sapin :license: BSD, see LICENSE for details. """ from __future__ import unicode_literals from . import (lookup, LABELS, decode, encode, iter_decode, iter_encode, ...
mit
russelmahmud/mess-account
django/contrib/gis/maps/google/gmap.py
321
9000
from django.conf import settings from django.contrib.gis import geos from django.template.loader import render_to_string from django.utils.safestring import mark_safe class GoogleMapException(Exception): pass from django.contrib.gis.maps.google.overlays import GPolygon, GPolyline, GMarker, GIcon # The default Google ...
bsd-3-clause
qtekfun/htcDesire820Kernel
external/chromium_org/tools/telemetry/telemetry/core/timeline/slice.py
27
2271
# 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. import telemetry.core.timeline.event as timeline_event class Slice(timeline_event.TimelineEvent): """A Slice represents an interval of time plus parameter...
gpl-2.0
simongoffin/website_version
addons/mail/mail_group_menu.py
12
2723
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-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
aws-quickstart/taskcat
tests/test_common_utils.py
1
4514
import errno import os import unittest import mock from taskcat._common_utils import ( exit_with_code, fetch_ssm_parameter_value, get_s3_domain, make_dir, merge_dicts, name_from_stack_id, param_list_to_dict, pascal_to_snake, region_from_stack_id, s3_bucket_name_from_url, s3_...
apache-2.0
nanditav/15712-TensorFlow
tensorflow/tensorboard/backend/handler_test.py
40
2239
# 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
grap/odoo-addons-cpo
purchase_package_qty/model/__init__.py
3
1142
# -*- encoding: utf-8 -*- ############################################################################## # # Purchase - Package Quantity Module for Odoo # Copyright (C) 2013-Today GRAP (http://www.grap.coop) # @author Julien WESTE # @author Sylvain LE GAL (https://twitter.com/legalsylvain) # # This progr...
agpl-3.0
levondov/nextbus_alexa_skill
requests/status_codes.py
481
3316
# -*- coding: utf-8 -*- from .structures import LookupDict _codes = { # Informational. 100: ('continue',), 101: ('switching_protocols',), 102: ('processing',), 103: ('checkpoint',), 122: ('uri_too_long', 'request_uri_too_long'), 200: ('ok', 'okay', 'all_ok', 'all_okay', 'all_good', '\\o/'...
mit