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
tempbottle/ironpython3
Src/StdLib/Lib/test/test_univnewlines.py
130
3922
# Tests universal newline support for both reading and parsing files. import io import _pyio as pyio import unittest import os import sys from test import support if not hasattr(sys.stdin, 'newlines'): raise unittest.SkipTest( "This Python does not have universal newline support") FATX = 'x' * (2**14) DA...
apache-2.0
elysium001/zamboni
scripts/gaia_package.py
18
1605
""" Gaia Marketplace helper. Takes packaged manifest as only argument. Copy this into the Marketplace app folder (dev/stage/prod whatever), and run. Fetches Marketplace package and Etags (e.g., m.f.c/packaged.webapp). Downloads application.zip for you. If metadata.json is in path, replaces the appropriate fields. >> p...
bsd-3-clause
francisco-dlp/hyperspy
hyperspy/drawing/utils.py
1
57321
# -*- coding: utf-8 -*- # Copyright 2007-2016 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
gpl-3.0
rg3915/django-experience
djexperience/settings.py
1
3763
import os from decouple import config, Csv from dj_database_url import parse as dburl # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Quick-start development settings - unsuitable for production # See https://docs.django...
mit
popazerty/obh-gui
lib/python/Components/RcModel.py
30
1436
import os from Tools.HardwareInfo import HardwareInfo from Tools.Directories import SCOPE_SKIN, resolveFilename class RcModel: RcModels = {} def __init__(self): self.model = HardwareInfo().get_device_model() # cfg files has modelname rcname entries. # modelname is boxname optionally followed by .rctyp...
gpl-2.0
tgroh/incubator-beam
sdks/python/apache_beam/examples/complete/juliaset/setup.py
4
4732
# # 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
linegpe/FYS3150
Project4/expect_random_T1.py
1
3161
import numpy as np import matplotlib.pyplot as plt data1 = np.loadtxt("expect_random_T1.00.dat") data2 = np.loadtxt("expect_ordered_T1.00.dat") data3 = np.loadtxt("expect_random2_T2.40.dat") data4 = np.loadtxt("expect_ordered2_T2.40.dat") values1 = data1[0::1] values2 = data2[0::1] values3 = data3[0::1] values4 = data...
gpl-3.0
shoyer/xray
xarray/backends/locks.py
1
5397
import multiprocessing import threading import weakref from typing import Any, MutableMapping try: from dask.utils import SerializableLock except ImportError: # no need to worry about serializing the lock SerializableLock = threading.Lock try: from dask.distributed import Lock as DistributedLock excep...
apache-2.0
vodik/pacman
test/pacman/pmpkg.py
2
7696
#! /usr/bin/python2 # # Copyright (c) 2006 by Aurelien Foret <orelien@chez.com> # Copyright (c) 2006-2013 Pacman Development Team <pacman-dev@archlinux.org> # # 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 Sof...
gpl-2.0
notifico/notifico
notifico/services/messages.py
3
1916
# -*- coding: utf8 -*- __all__ = ('MessageService',) import json class MessageService(object): #: Key name for the outgoing message queue. key_queue_messages = 'queue_message' #: Key name for recent messages. key_recent_messages = 'recent_messages' def __init__(self, redis=None): self._re...
mit
brahle/eval2
scripts/haski/actions/reviewaction.py
1
1578
#!/usr/bin/env python3.2 # Copyright 2011 Bruno Rahle # # This file is part of Evaluator. # # Evaluator is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your opt...
agpl-3.0
crosswalk-project/chromium-crosswalk-efl
tools/telemetry/telemetry/core/platform/profiler/android_profiling_helper_unittest.py
26
4767
# 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 os import pickle import re import shutil import tempfile import unittest from telemetry import benchmark from telemetry.core import util from telemet...
bsd-3-clause
skidzo/sympy
sympy/simplify/tests/test_powsimp.py
9
11985
from sympy import ( symbols, powsimp, symbols, MatrixSymbol, sqrt, pi, Mul, gamma, Function, S, I, exp, simplify, sin, E, log, hyper, Symbol, Dummy, powdenest, root, Rational) from sympy.abc import x, y, z, t, a, b, c, d, e, f, g, h, i, k def test_powsimp(): x, y, z, n = symbols('x,y,z,n') f = Fu...
bsd-3-clause
pelodelfuego/word2vec-toolbox
toolbox/mlLib/conceptPairFeature.py
1
4358
#!/usr/bin/env python # -*- coding: utf-8 -*- import __init__ import numpy as np from scipy.weave import inline from sklearn.ensemble import RandomForestClassifier import cpLib.concept as cp import utils.skUtils as sku # PROJECTION def projCosSim(c1, c2): v1 = c1.vect v2 = c2.vect dimCount = len(v1) ...
gpl-3.0
ojengwa/oh-mainline
vendor/packages/Pygments/pygments/lexers/_luabuiltins.py
275
6863
# -*- coding: utf-8 -*- """ pygments.lexers._luabuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This file contains the names and modules of lua functions It is able to re-generate itself, but for adding new functions you probably have to add some callbacks (see function module_callbacks). Do not edit th...
agpl-3.0
Adel-Magebinary/odoo
openerp/addons/test_documentation_examples/tests/test_delegation.py
366
1299
# -*- coding: utf-8 -*- from openerp.tests import common class TestDelegation(common.TransactionCase): def setUp(self): super(TestDelegation, self).setUp() env = self.env record = env['delegation.parent'].create({ 'child0_id': env['delegation.child0'].create({'field_0': 0}).id,...
agpl-3.0
skodapetr/lbvs-environment
scripts/libs/core.py
1
1664
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import csv import os import logging import gzip __license__ = "X11" def init_logging(): logging.basicConfig( level=logging.DEBUG, format='%(asctime)s [%(levelname)s] - %(message)s', datefmt='%H:%M:%S') def create_directory(path...
mit
willbarton/regulations-site
regulations/generator/layers/interpretations.py
7
2479
from django.http import HttpRequest # Don't import PartialInterpView or utils directly; causes an import cycle from regulations import generator, views from regulations.generator.node_types import label_to_text from regulations.generator.section_url import SectionUrl class InterpretationsLayer(object): """Fetc...
cc0-1.0
kaniblu/hangul-utils
hangul_utils/unicode.py
1
8775
__all__ = ["split_syllable_char", "split_syllables", "join_jamos", "join_jamos_char", "CHAR_INITIALS", "CHAR_MEDIALS", "CHAR_FINALS"] import itertools INITIAL = 0x001 MEDIAL = 0x010 FINAL = 0x100 CHAR_LISTS = { INITIAL: list(map(chr, [ 0x3131, 0x3132, 0x3134, 0x3137, 0x3138, 0x3139, ...
gpl-3.0
leorochael/odoo
addons/account_analytic_analysis/res_config.py
426
1408
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
maftieu/CouchPotatoServer
libs/git/__init__.py
121
1673
# Copyright (c) 2009, Rotem Yaari <vmalloc@gmail.com> # 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 li...
gpl-3.0
h3llrais3r/Auto-Subliminal
lib/ws4py/websocket.py
4
17891
# -*- coding: utf-8 -*- import logging import socket import ssl import time import threading import types import errno try: from OpenSSL.SSL import Error as pyOpenSSLError except ImportError: class pyOpenSSLError(Exception): pass from ws4py import WS_KEY, WS_VERSION from ws4py.exc import HandshakeErro...
gpl-3.0
crosby823/pgd
sites/all/modules/fckeditor/fckeditor/_samples/py/sample01.py
33
2083
#!/usr/bin/env python """ FCKeditor - The text editor for Internet - http://www.fckeditor.net Copyright (C) 2003-2010 Frederico Caldeira Knabben == BEGIN LICENSE == Licensed under the terms of any of the following licenses at your choice: - GNU General Public License Version 2 or later (the "GPL") h...
gpl-2.0
YACOWS/opps
tests/core/permissions/test_models.py
4
2200
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.test import TestCase from django.contrib.sites.models import Site from django.contrib.auth import get_user_model from django.contrib.auth.models import Group from opps.channels.models import Channel from opps.core.permissions.models import Permission, Permissio...
mit
Distrotech/bzr
bzrlib/tests/test_cache_utf8.py
2
4352
# Copyright (C) 2006 Canonical Ltd # # 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 distributed in ...
gpl-2.0
jss-emr/openerp-7-src
openerp/addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/__init__.py
392
1180
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
eirslett/microservices-infrastructure
docs/conf.py
25
9388
# -*- coding: utf-8 -*- # # Microservices Infrastructure documentation build configuration file, created by # sphinx-quickstart on Wed Feb 4 06:59:14 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # auto...
apache-2.0
gskachkov/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/w3c/test_parser.py
135
6756
#!/usr/bin/env python # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code must retain the above # copyright n...
bsd-3-clause
drnextgis/QGIS
python/plugins/processing/core/parameters.py
1
55397
# -*- coding: utf-8 -*- """ *************************************************************************** Parameters.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ****************************...
gpl-2.0
andrewk1/Climb-Bot
climb-bot.py
1
3083
import praw import requests import json import time import re # Function iterates over each submission title and checks if the title contains route syntax that indicates the post is about a route def parse_titles(bot, subreddit): start_time = time.time() for submission in subreddit.stream.submissions(): if (submi...
mit
UXE/local-edx
cms/envs/common.py
1
24184
# -*- coding: utf-8 -*- """ This is the common settings file, intended to set sane defaults. If you have a piece of configuration that's dependent on a set of feature flags being set, then create a function that returns the calculated value based on the value of FEATURES[...]. Modules that extend this one can change th...
agpl-3.0
Phoenix-Silver/Zte-Blade-New-35-kernel
tools/perf/scripts/python/syscall-counts.py
944
1429
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
yuxng/Deep_ISM
ISM/lib/setup.py
1
6351
# -------------------------------------------------------- # Fast R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- import os from os.path import join as pjoin import numpy as np from dis...
mit
bev-a-tron/pledgeservice
testlib/waitress/receiver.py
39
4849
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # TH...
agpl-3.0
havt/odoo
addons/stock_account/stock_account.py
89
19895
# -*- 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
sethshill/final
build/lib.linux-armv7l-2.7/bibliopixel/animation.py
2
14970
import time import log from led import LEDMatrix from led import LEDStrip from led import LEDCircle import colors from util import d import threading class animThread(threading.Thread): def __init__(self, anim, args): super(animThread, self).__init__() self.setDaemon(True) self._anim =...
mit
protatremy/buildbot
master/buildbot/test/unit/test_scripts_upgrade_master.py
10
8417
# This file is part of Buildbot. Buildbot 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. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
tsl143/addons-server
src/olympia/zadmin/management/commands/addusertogroup.py
2
1528
from django.core.management.base import BaseCommand, CommandError from django.db import IntegrityError import olympia.core.logger from olympia.access.models import Group, GroupUser from olympia.users.models import UserProfile class Command(BaseCommand): help = 'Add a new user to a group.' log = olympia.core...
bsd-3-clause
gnowxilef/youtube-dl
youtube_dl/extractor/tmz.py
65
2138
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor class TMZIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?tmz\.com/videos/(?P<id>[^/?#]+)' _TESTS = [{ 'url': 'http://www.tmz.com/videos/0_okj015ty/', 'md5': '4d22a51ef205b6c06395d8394f72d560', ...
unlicense
BaichuanWu/Blog_on_django
site-packages/django/contrib/gis/tests/distapp/tests.py
54
19622
from __future__ import unicode_literals from unittest import skipUnless from django.db import connection from django.db.models import Q from django.contrib.gis.geos import HAS_GEOS from django.contrib.gis.measure import D # alias for Distance from django.contrib.gis.tests.utils import ( HAS_SPATIAL_DB, mysql, or...
mit
ivanvladimir/gensim
gensim/corpora/ucicorpus.py
68
7517
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2012 Jonathan Esterhazy <jonathan.esterhazy at gmail.com> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ University of California, Irvine (UCI) Bag-of-Words format. http://archive.ics.uci.edu/ml/datasets/Bag+of+Words """ ...
gpl-3.0
AlexOugh/horizon
openstack_dashboard/dashboards/identity/roles/urls.py
64
1070
# Copyright 2013 Hewlett-Packard Development Company, L.P. # # 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 requir...
apache-2.0
opencb-cloud/opencga-lib
opencga-cloud/analysis/samtools-0.1.18/misc/varfilter.py
80
5783
#!/software/bin/python # Author: lh3, converted to python and modified to add -C option by Aylwyn Scally # # About: # varfilter.py is a port of Heng's samtools.pl varFilter script into # python, with an additional -C INT option. This option sets a minimum # consensus score, above which the script will output a...
gpl-2.0
kuiche/chromium
tools/grit/grit/tool/count.py
7
1024
#!/usr/bin/python2.4 # Copyright (c) 2006-2008 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. '''Count number of occurrences of a given message ID ''' import getopt import os import types from grit.tool import interface...
bsd-3-clause
gamechanger/kafka-python
kafka/protocol/admin.py
1
1182
from .struct import Struct from .types import Array, Bytes, Int16, Schema, String class ListGroupsResponse(Struct): SCHEMA = Schema( ('error_code', Int16), ('groups', Array( ('group', String('utf-8')), ('protocol_type', String('utf-8')))) ) class ListGroupsRequest(Str...
apache-2.0
CooperLuan/airflow
airflow/operators/hive_to_mysql.py
29
2324
import logging from airflow.hooks import HiveServer2Hook, MySqlHook from airflow.models import BaseOperator from airflow.utils import apply_defaults class HiveToMySqlTransfer(BaseOperator): """ Moves data from Hive to MySQL, note that for now the data is loaded into memory before being pushed to MySQL, s...
apache-2.0
elainenaomi/sciwonc-dataflow-examples
sbbd2016/experiments/1-postgres/3_workflow_full_10files_primary_nosh_nors_annot_with_proj_3s/pegasus.bDkvI/pegasus-4.6.0/lib/pegasus/externals/python/boto/__init__.py
87
41904
# Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010-2011, Eucalyptus Systems, Inc. # Copyright (c) 2011, Nexenta Systems Inc. # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # Copyright (c) 2010, Google, Inc. # All rights reserved. # # Permission is hereby granted, free of charge, ...
gpl-3.0
sam-m888/gramps
gramps/gen/filters/rules/media/_hasnotematchingsubstringof.py
5
1776
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2002-2006 Donald N. Allingham # # 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 you...
gpl-2.0
pkilambi/python-gnocchiclient
gnocchiclient/openstack/common/version.py
15
5885
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack LLC # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
apache-2.0
UTSA-ICS/keystone-SID
keystone/tests/test_auth.py
1
44678
# Copyright 2012 OpenStack Foundation # # 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...
apache-2.0
Xeralux/tensorflow
tensorflow/contrib/slim/python/slim/nets/inception_v2.py
96
26999
# 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
olysonek/tuned
tests/unit/profiles/test_profile.py
1
1691
import unittest2 import tuned.profiles import collections class MockProfile(tuned.profiles.profile.Profile): def _create_unit(self, name, config): return (name, config) class ProfileTestCase(unittest2.TestCase): def test_init(self): MockProfile("test", {}) def test_create_units(self): profile = MockProfile...
gpl-2.0
Celedhrim/persomov
libs/enzyme/riff.py
179
20109
# -*- coding: utf-8 -*- # enzyme - Video metadata parser # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # Copyright 2003-2006 Thomas Schueppel <stain@acm.org> # Copyright 2003-2006 Dirk Meyer <dischi@freevo.org> # # This file is part of enzyme. # # enzyme is free software; you can redistribute it and/or mod...
gpl-3.0
AnselCmy/ARPS
report_crawler/report_crawler/spiders/spiders_001/_B/BNU001.py
2
1386
# -*- coding:utf-8 -*- import scrapy from report_crawler.spiders.__Global_function import get_localtime from report_crawler.spiders.__Global_variable import now_time, end_time class BNU001_Spider(scrapy.Spider): name = 'BNU001' start_urls = ['http://cist.bnu.edu.cn/tzgg/index.html'] domain = 'http://cist.bnu.edu.c...
mit
atgreen/bitcoin
qa/rpc-tests/smartfees.py
131
12419
#!/usr/bin/env python2 # Copyright (c) 2014-2015 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test fee estimation code # from test_framework.test_framework import BitcoinTestFramework from test_...
mit
ddelemeny/calligra
3rdparty/google-breakpad/src/tools/gyp/test/lib/TestCmd.py
330
52544
""" TestCmd.py: a testing framework for commands and scripts. The TestCmd module provides a framework for portable automated testing of executable commands and scripts (in any language, not just Python), especially commands and scripts that require file system interaction. In addition to running tests and evaluating...
gpl-2.0
ShassAro/ShassAro
DockerAdmin/dockerVirtualEnv/lib/python2.7/site-packages/pip/download.py
328
22580
import cgi import email.utils import hashlib import getpass import mimetypes import os import platform import re import shutil import sys import tempfile import pip from pip.backwardcompat import urllib, urlparse, raw_input from pip.exceptions import InstallationError, HashMismatch from pip.util import (splitext, rmt...
gpl-2.0
harshita-gupta/Harvard-FRSEM-Catalog-2016-17
flask/lib/python2.7/site-packages/wheel/test/test_basic.py
472
6405
""" Basic wheel tests. """ import os import pkg_resources import json import sys from pkg_resources import resource_filename import wheel.util import wheel.tool from wheel import egg2wheel from wheel.install import WheelFile from zipfile import ZipFile from shutil import rmtree test_distributions = ("complex-dist"...
mit
NaturalGIS/naturalgis_qgis
tests/src/python/test_qgsimagecache.py
41
5431
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsImageCache. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ __a...
gpl-2.0
JerryLX/DPDK
tools/dpdk-devbind.py
2
20921
#! /usr/bin/python # # BSD LICENSE # # Copyright(c) 2010-2014 Intel Corporation. All rights reserved. # 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 sou...
gpl-2.0
blacklin/kbengine
kbe/src/lib/python/Lib/test/test_parser.py
113
26114
import parser import unittest import sys import operator import struct from test import support from test.script_helper import assert_python_failure # # First, we test that we can generate trees from valid source fragments, # and that these valid trees are indeed allowed by the tree-loading side # of the parser mod...
lgpl-3.0
kritak/textdungeon
Internal/pricerandomtester.py
1
1114
"""testing random frequency of items based on price for item. a cheap item is more common, a expensive item is very rare""" import random d = {"healing":50, "berserk":60, "clever":100, "swiftness":100, "might":100, "awesomeness":500, } # reverse d dr = [[1/b,a] for [a,b] in d....
gpl-2.0
developerfm/zulip
api/integrations/hg/zulip-changegroup.py
114
6096
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Zulip hook for Mercurial changeset pushes. # Copyright © 2012-2014 Zulip, Inc. # # 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 rest...
apache-2.0
naototty/pyflag
src/plugins_old/MemoryForensics/VolatilityCommon.py
7
3679
import os,sys import pyflag.IO as IO import pyflag.FlagFramework as FlagFramework ## Find and insert the volatility modules volatility_path = None for d in os.listdir(os.path.dirname(__file__)): if d.startswith("Volatility-1.3"): ## Check that volatility is actually in there path = os.path.join(os....
gpl-2.0
SPARLab/BikeMaps
mapApp/views/__init__.py
1
1138
from .about import about, contact from .alerts import alertUsers, postAlertPolygon, readAlertPoint from .disclaimer import disclaimer from .edit import editHazards, editShape, updateHazard from .index import index from .postPoint import (postHazard, postIncident, postNearmiss, postNewInfra...
mit
JulianAtGitHub/CocosBuilderExtend
CocosBuilder/libs/cocos2d-iphone/tools/template_generator.py
46
8351
#!/usr/bin/python # -*- coding: utf-8 -*- # ---------------------------------------------------------------------------- # Xcode 4 template generator for cocos2d project # (c) 2011 Ricardo Quesada # # LICENSE: Dual License: MIT & GNU GPL v2 Whatever suits you best. # # Given a directory, it generates the "Definitions" ...
mit
unt-libraries/django-name
name/api/serializers.py
1
6208
"""Serializers for the Name App Models. This module leverages the Django Rest Framework's Serializer components to build JSON representations of the models defined in this app. These JSON representations are designed to be backwards compatible with the API documented in previous versions. For documentation regarding...
bsd-3-clause
ychen820/microblog
y/google-cloud-sdk/platform/gsutil/third_party/boto/boto/ec2/autoscale/policy.py
13
6223
# Copyright (c) 2009-2010 Reza Lotun http://reza.lotun.name/ # Copyright (c) 2011 Jann Kleen # # 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 limitat...
bsd-3-clause
loneknightpy/spark
python/pyspark/statcounter.py
130
5115
# # 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
fooelisa/ansible-modules-extras
database/misc/riak.py
57
7967
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, James Martin <jmartin@basho.com>, Drew Kerrigan <dkerrigan@basho.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 Fou...
gpl-3.0
ecugol/django-geoip
django_geoip/vendor/progressbar/progressbar.py
3
9159
#!/usr/bin/python # -*- coding: utf-8 -*- # # progressbar - Text progress bar library for Python. # Copyright (c) 2005 Nilton Volpato # # 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; ei...
mit
bluemini/kuma
vendor/packages/setuptools/command/bdist_egg.py
306
17184
"""setuptools.command.bdist_egg Build .egg distributions""" from distutils.errors import DistutilsSetupError from distutils.dir_util import remove_tree, mkpath from distutils import log from types import CodeType import sys import os import marshal import textwrap from pkg_resources import get_build_platform, Distri...
mpl-2.0
mou4e/zirconium
chrome/common/extensions/docs/server2/samples_data_source.py
16
1167
# 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. import logging import traceback from data_source import DataSource from extensions_paths import EXAMPLES from future import All, Future from jsc_view im...
bsd-3-clause
neubot/neubot
neubot/system_posix.py
2
3747
# neubot/system_posix.py # # Copyright (c) 2010-2011 # Nexa Center for Internet & Society, Politecnico di Torino (DAUIN) # and Simone Basso <bassosimone@gmail.com> # # This file is part of Neubot <http://www.neubot.org/>. # # Neubot is free software: you can redistribute it and/or modify # it under the terms o...
gpl-3.0
carlodri/moviepy
moviepy/video/io/VideoFileClip.py
14
2711
import os from moviepy.video.VideoClip import VideoClip from moviepy.audio.io.AudioFileClip import AudioFileClip from moviepy.Clip import Clip from moviepy.video.io.ffmpeg_reader import FFMPEG_VideoReader class VideoFileClip(VideoClip): """ A video clip originating from a movie file. For instance: :: ...
mit
mithron/opendatahack
web/main.py
1
1805
from datetime import datetime import json import os from urlparse import urlparse from pymongo.connection import Connection import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web from tornado.options import define, options MONGO_URL = "" # found with $>heroku config we_live = True...
mit
jnerin/ansible
lib/ansible/modules/source_control/gitlab_project.py
16
14955
#!/usr/bin/python # (c) 2015, Werner Dijkerman (ikben@werner-dijkerman.nl) # 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
dexterx17/nodoSocket
clients/Python-2.7.6/Lib/bsddb/test/test_early_close.py
72
7440
"""TestCases for checking that it does not segfault when a DBEnv object is closed before its DB objects. """ import os, sys import unittest from test_all import db, test_support, verbose, get_new_environment_path, get_new_database_path # We're going to get warnings in this module about trying to close the db when # ...
mit
cgmckeever/contests
2012-mebipenny/contest/reductio-ad-egyptium/solution.py
7
1843
import sys import math class Fraction: def __init__(self, num, denom): if (num > 0 and denom % num == 0): # Reduce the fraction denom /= num num = 1 self.num = num self.denom = denom def subtract(self, other_num, other_denom): common_denom = self.denom * other_denom converted_nu...
mit
aptomar/apt-file-format
test/testAptofile.py
1
23249
################################################################ # # # testAptofile.py # # Copyright (c) 2013 Aptomar AS, All Rights Reserved # # ...
bsd-3-clause
uclouvain/osis
base/migrations/0062_add_uuid_field.py
2
2432
# -*- coding: utf-8 -*- # Generated by Django 1.9 on 2016-09-05 12:48 from __future__ import unicode_literals import uuid from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('base', '0061_auto_20160902_1639'), ] operations = [ migrations.Re...
agpl-3.0
ojengwa/grr
lib/rdfvalues/checks.py
2
12558
#!/usr/bin/env python """Implementation of check types.""" from grr.lib import config_lib from grr.lib import rdfvalue from grr.lib.checks import checks from grr.lib.checks import filters from grr.lib.checks import hints from grr.lib.checks import triggers from grr.lib.rdfvalues import structs from grr.proto import che...
apache-2.0
CloudBoltSoftware/cloudbolt-forge
ui_extensions/veeam_admin_extension/restore_backup.py
1
1717
import requests import time from xml.dom import minidom from common.methods import set_progress from xui.veeam.veeam_admin import VeeamManager def run(server, *args, **kwargs): set_progress(f"Starting Veeam Backup restoration... ") veeam = VeeamManager() server_ci = veeam.get_connection_info(...
apache-2.0
sunlianqiang/kbengine
kbe/src/lib/python/Lib/test/test_pprint.py
72
30339
# -*- coding: utf-8 -*- import pprint import test.support import unittest import test.test_set import random import collections import itertools # list, tuple and dict subclasses that do or don't overwrite __repr__ class list2(list): pass class list3(list): def __repr__(self): return list.__repr__(se...
lgpl-3.0
MinimalOS/external_skia
platform_tools/android/tests/utils.py
146
1155
#!/usr/bin/python # Copyright 2014 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Common code for tests. """ import filecmp import os EXPECTATIONS_DIR = os.path.join(os.path.dirname(__file__), 'expectations') def compare_to_expectation(actual_...
bsd-3-clause
FlorianLudwig/odoo
addons/account_sequence/account_sequence.py
338
2534
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
archetipo/account-invoicing
account_invoice_line_sort/models/account_invoice.py
26
4940
# -*- coding: utf-8 -*- ############################################################################## # This file is part of account_invoice_line_sort, an Odoo module. # # Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>) # # account_invoice_line_sort is free software: you can redistribute it # and...
agpl-3.0
lckung/spark-ec2
launch-script/lib/boto-2.34.0/boto/ec2/zone.py
152
2601
# Copyright (c) 2006-2008 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...
apache-2.0
vroyer/elasticassandra
dev-tools/smoke_test_rc.py
56
11737
# Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except...
apache-2.0
zhxwmessi/or-tools
examples/python/secret_santa.py
34
3832
# Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com # # 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 ...
apache-2.0
drawks/ansible
lib/ansible/modules/network/f5/bigip_firewall_rule.py
14
42629
#!/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
ArchiveTeam/spuf-grab
pipeline.py
1
11245
# encoding=utf8 import datetime from distutils.version import StrictVersion import hashlib import os.path import random from seesaw.config import realize, NumberConfigValue from seesaw.externalprocess import ExternalProcess from seesaw.item import ItemInterpolation, ItemValue from seesaw.task import SimpleTask, LimitCo...
unlicense
fffonion/you-get
src/you_get/extractors/miomio.py
19
1195
#!/usr/bin/env python __all__ = ['miomio_download'] from ..common import * from .sina import sina_download_by_xml from .tudou import tudou_download_by_id from .youku import youku_download_by_vid def miomio_download(url, output_dir = '.', merge = True, info_only = False): html = get_html(url) title = r1(r'<...
mit
m4ns0ur/grumpy
third_party/stdlib/getopt.py
31
7319
"""Parser for command line options. This module helps scripts to parse the command line arguments in sys.argv. It supports the same conventions as the Unix getopt() function (including the special meanings of arguments of the form `-' and `--'). Long options similar to those supported by GNU software may be used as ...
apache-2.0
geggo/pyface
pyface/tree/api.py
1
1198
#------------------------------------------------------------------------------ # Copyright (c) 2005-2011, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in enthought/LICENSE.txt and may be redistributed only # under the conditions des...
bsd-3-clause
vqw/frappe
frappe/commands/translate.py
6
2622
from __future__ import unicode_literals, absolute_import import click import frappe from frappe.commands import pass_context, get_site # translation @click.command('build-message-files') @pass_context def build_message_files(context): "Build message files for translation" import frappe.translate for site in context...
mit
Encrylize/flask-blogger
app/utils/helpers.py
1
1218
from urllib.parse import urljoin, urlparse from flask import request def get_or_create(model, **kwargs): """ Gets or creates an instance of model. Args: model: SQLAlchemy model **kwargs: Model properties Returns: An instance of model and True if it was created, False if it w...
mit
aperigault/ansible
lib/ansible/modules/windows/win_eventlog_entry.py
38
2212
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Andrew Saraceni <andrew.saraceni@gmail.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'suppo...
gpl-3.0
ygol/dotfiles
link/hammerspoon/hs/node_modules/node-gyp/gyp/tools/graphviz.py
2679
2878
#!/usr/bin/env python # Copyright (c) 2011 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. """Using the JSON dumped by the dump-dependency-json generator, generate input suitable for graphviz to render a dependency graph of targets...
mit
coupdair/pyoptools
pyoptools/misc/GS/gs.py
9
10699
from mako.template import Template from pyoptools.misc.resources import has_double_support, has_amd_double_support ### ojo, toca solucionar esta importacion en caso de que no exista pypencl try: from pyfft.cl import Plan import pyopencl as cl import pyopencl.array as cl_array except: pass from numpy.fft import...
bsd-3-clause