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
RossBrunton/django
tests/admin_changelist/models.py
61
2777
from django.db import models from django.utils.encoding import python_2_unicode_compatible class Event(models.Model): # Oracle can have problems with a column named "date" date = models.DateField(db_column="event_date") class Parent(models.Model): name = models.CharField(max_length=128) class Child(mo...
bsd-3-clause
cryptobanana/ansible
lib/ansible/utils/module_docs_fragments/mlnxos.py
23
3530
# # 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 in the hope tha...
gpl-3.0
mathiasertl/django-ca
ca/django_ca/tests/tests_base.py
1
8262
# This file is part of django-ca (https://github.com/mathiasertl/django-ca). # # django-ca 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
pbrod/numpy
numpy/lib/nanfunctions.py
4
58930
""" Functions that ignore NaN. Functions --------- - `nanmin` -- minimum non-NaN value - `nanmax` -- maximum non-NaN value - `nanargmin` -- index of minimum non-NaN value - `nanargmax` -- index of maximum non-NaN value - `nansum` -- sum of non-NaN values - `nanprod` -- product of non-NaN values - `nancumsum` -- cumul...
bsd-3-clause
quellobiondo/Backy
BackupPlugin.py
1
3514
#! /bin/usr/python from random import shuffle import consul from KVwrapper import retrieve_remote_snapshot_metadata, update_remote_metadata, get_server_list, get_node_meta from Utils import dataset_name, get_latest_snapshot from plugin.SanoidBackupPlugin import SanoidBackupPlugin """ Generic backup plugin - Allow t...
gpl-3.0
fgandiya/rpsls-lm
py/sample2.py
1
1704
import os, sys, inspect, thread, time # src_dir = os.path.dirname(inspect.getfile(inspect.currentframe())) # arch_dir = '../lib/x64' if sys.maxsize > 2**32 else '../lib/x86' # sys.path.insert(0, os.path.abspath(os.path.join(src_dir, arch_dir))) import Leap from Leap import CircleGesture, KeyTapGesture, ScreenTapGestur...
unlicense
bswartz/cinder
cinder/objects/base.py
1
20695
# Copyright 2015 IBM Corp. # # 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 agree...
apache-2.0
emwta/iBlockly
blockly/i18n/xliff_to_json.py
203
8319
#!/usr/bin/python # Converts .xlf files into .json files for use at http://translatewiki.net. # # Copyright 2013 Google Inc. # https://developers.google.com/blockly/ # # 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...
apache-2.0
itkvideo/ITK
Wrapping/WrapITK/Languages/SwigInterface/pygccxml-1.0.0/pygccxml/msvc/bsc_impl_details.py
13
19401
import os import sys import ctypes import logging import msvc_details from ctypes import * from ctypes.wintypes import ULONG from ctypes.wintypes import DWORD from ctypes.wintypes import BOOL from ctypes.wintypes import BYTE from ctypes.wintypes import WORD from ctypes.wintypes import UINT sys.path.append( r'../..' ) ...
apache-2.0
zmwangx/you-get
src/you_get/extractors/tumblr.py
1
4687
#!/usr/bin/env python __all__ = ['tumblr_download'] from ..common import * from .universal import * from .dailymotion import dailymotion_download from .vimeo import vimeo_download from .vine import vine_download def tumblr_download(url, output_dir='.', merge=True, info_only=False, **kwargs): if re.match(r'https?...
mit
mdeejay/msm7x30-ics
tools/perf/scripts/python/sctop.py
895
1936
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
kbrebanov/ansible
lib/ansible/modules/cloud/amazon/cloudformation_facts.py
23
12411
#!/usr/bin/python # Copyright: 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
miniconfig/home-assistant
homeassistant/components/light/rflink.py
1
8576
""" Support for Rflink lights. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/light.rflink/ """ import asyncio import logging from homeassistant.components import group from homeassistant.components.light import ( ATTR_BRIGHTNESS, SUPPORT_BRIGHTNESS...
mit
brandond/ansible
lib/ansible/modules/cloud/amazon/cloudformation_facts.py
35
12335
#!/usr/bin/python # Copyright: 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 ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], ...
gpl-3.0
fajoy/nova
nova/tests/api/ec2/test_middleware.py
4
5120
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
apache-2.0
EloYGomeZ/test_kernel_g620s
scripts/gcc-wrapper.py
580
3524
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, The Linux Foundation. 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 th...
gpl-2.0
mesarpe/socialccnsim
cache_management/SEMANTIC.py
1
3292
##################################################################### #SocialCCNSim, a simulator of caches for Content Centric Networking. # #Developed by Cesar A. Bernardini Copyright (C) 2014. #This library is free software; you can redistribute it and/or #modify it under the terms of the GNU Library General Public #...
gpl-2.0
halfcrazy/sqlalchemy
test/orm/test_session.py
13
48608
from sqlalchemy.testing import eq_, assert_raises, \ assert_raises_message from sqlalchemy.testing.util import gc_collect from sqlalchemy.testing import pickleable from sqlalchemy.util import pickle import inspect from sqlalchemy.orm import create_session, sessionmaker, attributes, \ make_transient, make_transi...
mit
harish2rb/pyGeoNet
pygeonet_V3/prepare_pygeonet_defaults.py
2
2215
#! /usr/bin/env python # Set default parameters for GeoNet # Reporting, plotting and file handling doFileOutput = 1 doReport = 1 doPlot = 0 doResetFiguresOnStart = 1 # **** Default parameters for Perona-Malik nonlinear diffusion # ... could be: PeronaMalik1, PeronaMalik2, Tukey, rampPreserving diffusionMethod = 'Per...
gpl-3.0
chromium/chromium
tools/memory_inspector/memory_inspector/core/memory_map.py
54
3760
# 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 bisect PAGE_SIZE = 4096 class Map(object): """Models the memory map of a given |backends.Process|. This is typically obtained by calling back...
bsd-3-clause
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/django-1.8.2/tests/gis_tests/gis_migrations/migrations/0001_initial.py
32
1912
import django.contrib.gis.db.models.fields from django.db import migrations, models class Migration(migrations.Migration): """ Used for gis.specific migration tests. """ operations = [ migrations.CreateModel( name='Neighborhood', fields=[ ('id', models.A...
mit
bmwanz/AudioMessenger
client_turnin.py
1
7613
#Chien Kai Wang, Brian Wan, William Chen #TCP CHAT CLIENT import pyaudio import sys import socket import select import time from array import array from struct import pack msgType = 0 check = 0 receive = 0 ALPHA_LOWER = ['a', 'b', 'c', 'd', 'e', 'f', 'g', ' ', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', ...
apache-2.0
VisTrails/VisTrails
vistrails/db/versions/v0_9_5/__init__.py
4
1965
############################################################################### ## ## Copyright (C) 2014-2016, New York University. ## Copyright (C) 2011-2014, NYU-Poly. ## Copyright (C) 2006-2011, University of Utah. ## All rights reserved. ## Contact: contact@vistrails.org ## ## This file is part of VisTrails. ## ## ...
bsd-3-clause
harshilasu/GraphicMelon
y/google-cloud-sdk/lib/requests/packages/urllib3/util/connection.py
319
1348
from socket import error as SocketError try: from select import poll, POLLIN except ImportError: # `poll` doesn't exist on OSX and other platforms poll = False try: from select import select except ImportError: # `select` doesn't exist on AppEngine. select = False def is_connection_dr...
gpl-3.0
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/scipy/linalg/matfuncs.py
4
13333
# # Author: Travis Oliphant, March 2002 # from __future__ import division, print_function, absolute_import __all__ = ['expm','expm2','expm3','cosm','sinm','tanm','coshm','sinhm', 'tanhm','logm','funm','signm','sqrtm', 'expm_frechet', 'expm_cond', 'fractional_matrix_power'] from numpy import (In...
agpl-3.0
kaedroho/django
django/conf/locale/uz/formats.py
35
1199
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = r'j-E, Y-\y\i\l' TIME_FORMAT = 'G:i' DATETIME_FORMAT = r'j-E, Y-\y\i\l G:i' YEAR_MONTH_FORMAT = r'F ...
bsd-3-clause
blowmage/gcloud-ruby
google-cloud-dlp/synth.py
1
2791
# Copyright 2018 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
apache-2.0
shsingh/ansible
test/support/integration/plugins/modules/postgresql_query.py
53
10477
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Felix Archambault # Copyright: (c) 2019, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru> # 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)...
gpl-3.0
dgladkov/django
tests/fixtures/tests.py
5
40416
from __future__ import unicode_literals import os import sys import tempfile import unittest import warnings from django.apps import apps from django.contrib.sites.models import Site from django.core import management from django.core.files.temp import NamedTemporaryFile from django.core.management import CommandErro...
bsd-3-clause
groovecoder/kuma
kuma/core/tests/test_taggit_extras.py
29
2546
from django.test import TestCase from .taggit_extras.models import Food class NamespacedTaggableManagerTest(TestCase): food_model = Food def assert_tags_equal(self, qs, tags, sort=True, attr="name"): got = map(lambda tag: getattr(tag, attr), qs) if sort: got.sort() ta...
mpl-2.0
GUR9000/Deep_MRI_brain_extraction
NNet_Core/NN_PerceptronLayer.py
1
17932
""" This software is an implementation of Deep MRI brain extraction: A 3D convolutional neural network for skull stripping You can download the paper at http://dx.doi.org/10.1016/j.neuroimage.2016.01.024 If you use this software for your projects please cite: Kleesiek and Urban et al, Deep MRI brain extraction: A 3...
mit
a-bioinformatician/BreaKmer
breakmer/assembly/contig.py
1
45574
#! /usr/bin/python # -*- coding: utf-8 -*- import os import sys import logging import shutil import pysam import breakmer.assembly.olc as olcAssembly import breakmer.assembly.utils as assemblyUtils import breakmer.realignment.realigner as realigner import breakmer.caller.sv_caller as sv_caller import breakmer.utils as...
mit
PaulWay/spacewalk
backend/satellite_tools/reposync.py
1
30348
# # Copyright (c) 2008--2014 Red Hat, Inc. # Copyright (c) 2010--2011 SUSE Linux Products GmbH # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FO...
gpl-2.0
SirVer/ultisnips
test/test_Format.py
5
4553
from test.vim_test_case import VimTestCase as _VimTest from test.constant import * from test.util import running_on_windows class _ExpandTabs(_VimTest): def _extra_vim_config(self, vim_config): vim_config.append("set sw=3") vim_config.append("set expandtab") class RecTabStopsWithExpandtab_Simple...
gpl-3.0
spcui/autotest
utils/reindent.py
17
10422
#! /usr/bin/env python # Released to the public domain, by Tim Peters, 03 October 2000. """reindent [-d][-r][-v] [ path ... ] -d (--dryrun) Dry run. Analyze, but don't make any changes to, files. -r (--recurse) Recurse. Search for all .py files in subdirectories too. -n (--nobackup) No backup. Does not make a...
gpl-2.0
staticlibs/android-ndk-r9d-arm-linux-androideabi-4.8
lib/python2.7/mailcap.py
351
7427
"""Mailcap file handling. See RFC 1524.""" import os __all__ = ["getcaps","findmatch"] # Part 1: top-level interface. def getcaps(): """Return a dictionary containing the mailcap database. The dictionary maps a MIME type (in all lowercase, e.g. 'text/plain') to a list of dictionaries corresponding to ...
gpl-2.0
cslzchen/osf.io
api_tests/logs/serializers/test_serializers.py
17
1820
import pytest from framework.auth import Auth from osf.models import NodeLog from api.logs.serializers import NodeLogSerializer from osf_tests.factories import ProjectFactory, UserFactory from tests.utils import make_drf_request_with_version pytestmark = pytest.mark.django_db class TestNodeLogSerializer: # Regr...
apache-2.0
GuardianRG/CuckooSploit
analyzer/windows/lib/core/config.py
6
2082
# Copyright (C) 2010-2015 Cuckoo Foundation. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. import ConfigParser class Config: def __init__(self, cfg): """@param cfg: configuration file.""" config = ConfigParser.ConfigParse...
gpl-3.0
pcm17/tensorflow
tensorflow/contrib/framework/python/ops/arg_scope_test.py
115
7232
# 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
vauxoo-dev/stock-logistics-warehouse
stock_location_area_management/models/stock_location.py
12
2059
# -*- encoding: utf-8 -*- ############################################################################## # # Odoo, Open Source Management Solution # This module copyright (C) 2015 Savoir-faire Linux # (<http://www.savoirfairelinux.com>). # # This program is free software: you can redistribute it and/or modi...
agpl-3.0
okuta/chainer
chainer/functions/array/resize_images.py
2
11026
from __future__ import division import numpy from chainer import backend from chainer.backends import cuda from chainer import function_node from chainer.utils import type_check def _infer_lines(B, C, H, W, out_H, out_W, kH, kW): target_size = 2 ** 17 line_size = B * C * (H * W // out_H + kH * kW * out_W) ...
mit
gnu-sandhi/gnuradio
gruel/src/python/qa_pmt_to_python.py
9
1080
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # ...
gpl-3.0
docmeth02/CouchPotatoServer
libs/tornado/platform/interface.py
387
2244
#!/usr/bin/env python # # Copyright 2011 Facebook # # 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...
gpl-3.0
arborh/tensorflow
tensorflow/python/ops/parallel_for/__init__.py
52
1204
# 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
heeraj123/oh-mainline
vendor/packages/requests/requests/packages/urllib3/packages/ordered_dict.py
2040
8935
# Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. # Passes Python2.7's test suite and incorporates all the latest updates. # Copyright 2009 Raymond Hettinger, released under the MIT License. # http://code.activestate.com/recipes/576693/ try: from thread import get_ident as _get_iden...
agpl-3.0
ceph/teuthology
teuthology/suite/build_matrix.py
3
6739
import logging import os import random from teuthology.suite import matrix log = logging.getLogger(__name__) def build_matrix(path, subset=None, seed=None): """ Return a list of items descibed by path such that if the list of items is chunked into mincyclicity pieces, each piece is still a good subs...
mit
jing-bao/pa-chromium
tools/perf_expectations/tests/perf_expectations_unittest.py
178
5766
#!/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. """Verify perf_expectations.json can be loaded using simplejson. perf_expectations.json is a JSON-formatted file. This script ver...
bsd-3-clause
nvoron23/scikit-learn
sklearn/linear_model/randomized_l1.py
68
23405
""" Randomized Lasso/Logistic: feature selection based on Lasso and sparse Logistic Regression """ # Author: Gael Varoquaux, Alexandre Gramfort # # License: BSD 3 clause import itertools from abc import ABCMeta, abstractmethod import warnings import numpy as np from scipy.sparse import issparse from scipy import spar...
bsd-3-clause
PaulWay/insights-core
insights/combiners/grub_conf.py
1
5936
""" Combiner for GRUB v1 and v2 configurations ========================================== Combiner for Red Hat Grub v1 and Grub v2 information. This combiner uses both the Grub1Config and the Grub2Config parsers. It determines which parser was used by checking the class attribute in shared. When the appropriate Grub p...
apache-2.0
tdgoodrich/mase
src/stats.py
13
3643
from __future__ import division import sys, random, math, datetime, time,re sys.dont_write_bytecode = True from base import * def rank_simple(vector): return sorted(range(len(vector)), key=vector.__getitem__) def rankdata(a): n = len(a) ivec=rank_simple(a) svec=[a[rank] for rank in ivec] sumranks...
unlicense
google/gae-secure-scaffold-python
src/base/api_fixer_test.py
9
1803
# Copyright 2014 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
apache-2.0
LaMi-/pmatic
ccu_pkg/python/lib/python2.7/dist-packages/pytz/lazy.py
514
5263
from threading import RLock try: from UserDict import DictMixin except ImportError: from collections import Mapping as DictMixin # With lazy loading, we might end up with multiple threads triggering # it at the same time. We need a lock. _fill_lock = RLock() class LazyDict(DictMixin): """Dictionary popu...
gpl-2.0
vaishalip25/instaauto
vtwsclib/Vtiger/WSClient.py
1
8786
#/*+*********************************************************************************** # * The contents of this file are subject to the Vtiger CRM Public License Version 1.0 # * ("License"); You may not use this file except in compliance with the License # * The Original Code is: Vtiger CRM Open Source # * The Initia...
mit
damdam-s/OCB
addons/survey/__openerp__.py
261
2391
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
cdcapano/pycbc
test/test_matchedfilter.py
4
5923
# Copyright (C) 2012 Alex Nitz, Josh Willis # # 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) any later version. # # This program is distr...
gpl-3.0
Kudeshido/namebench
nb_third_party/dns/rdtypes/ANY/NSEC3.py
248
6716
# Copyright (C) 2004-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
kdmurray91/biopipes
biopipes/bwa.py
1
1289
from Bio.Sequencing.Applications import ( BwaAlignCommandline, BwaSampeCommandline, BwaSamseCommandline, BwaBwaswCommandline, ) import pipes import logging from biopipes.samtools import ( sam_to_ubam, sort_bam, index_bam, ) def fastq_to_sai(index, read_file, args={}, debug=False, pipeli...
gpl-3.0
surligas/gnuradio
gr-utils/python/modtool/scm.py
49
8688
# # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later version. # #...
gpl-3.0
idncom/odoo
addons/mrp_repair/wizard/make_invoice.py
168
3151
# -*- 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
kevinmel2000/sl4a
python/src/Lib/distutils/tests/test_sysconfig.py
30
2336
"""Tests for distutils.dist.""" from distutils import sysconfig import os import unittest from test.test_support import TESTFN class SysconfigTestCase(unittest.TestCase): def test_get_config_h_filename(self): config_h = sysconfig.get_config_h_filename() self.assert_(os.path.isfile(config_h), con...
apache-2.0
linsalrob/PyFBA
PyFBA/tests/test_fba.py
1
3122
import os import unittest import sys import PyFBA test_file_loc = os.path.dirname(os.path.realpath(__file__)) class TestFBA(unittest.TestCase): modeldata = PyFBA.parse.model_seed.parse_model_seed_data('gramnegative', verbose=True) media = PyFBA.parse.pyfba_media(media_name="ArgonneLB", modeldata=modeldata, ...
mit
spock1104/android_kernel_zte_nex
tools/perf/scripts/python/syscall-counts-by-pid.py
11180
1927
# system call counts, by pid # (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, sys sys.path.append(os.env...
gpl-2.0
wkritzinger/asuswrt-merlin
release/src/router/samba36/lib/dnspython/dns/rdtypes/ANY/AFSDB.py
248
1847
# Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
gpl-2.0
retomerz/intellij-community
python/lib/Lib/logging/__init__.py
80
47156
# Copyright 2001-2007 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
apache-2.0
xlhtc007/blaze
blaze/expr/arrays.py
10
3787
from __future__ import absolute_import, division, print_function from collections import Iterable from datashape import DataShape from odo.utils import copydoc from .expressions import Expr, ndim, symbol __all__ = 'Transpose', 'TensorDot', 'dot', 'transpose', 'tensordot' class Transpose(Expr): """ Transpose di...
bsd-3-clause
podemos-info/odoo
addons/l10n_be_hr_payroll/l10n_be_hr_payroll.py
8
3128
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
ghukill/peewee
examples/redis_vtable/redis_vtab.py
20
7166
#!/usr/bin/env python import json import apsw from playhouse.apsw_ext import * from redis import Redis class RedisModule(object): def __init__(self, db): self.db = db def Create(self, db, modulename, dbname, tablename, *args): schema = 'CREATE TABLE %s (rowid, key, value, type, parent);' ...
mit
inkerra/cinder
cinder/db/sqlalchemy/migrate_repo/versions/002_quota_class.py
2
5346
# 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
bq-dev/android_kernel_bq_msm8976
tools/perf/util/setup.py
2079
1438
#!/usr/bin/python2 from distutils.core import setup, Extension from os import getenv from distutils.command.build_ext import build_ext as _build_ext from distutils.command.install_lib import install_lib as _install_lib class build_ext(_build_ext): def finalize_options(self): _build_ext.finalize_optio...
gpl-2.0
zhoulingjun/django
tests/view_tests/tests/test_debug.py
150
39389
# -*- coding: utf-8 -*- # This coding header is significant for tests, as the debug view is parsing # files to search for such a header to decode the source file content from __future__ import unicode_literals import importlib import inspect import os import re import sys import tempfile from unittest import skipIf f...
bsd-3-clause
adamjmcgrath/glancydesign
src/django-nonrel/tests/regressiontests/humanize/tests.py
50
3315
from datetime import timedelta, date from django.template import Template, Context, add_to_builtins from django.utils import unittest from django.utils.dateformat import DateFormat from django.utils.translation import ugettext as _ from django.utils.html import escape add_to_builtins('django.contrib.humanize.template...
bsd-3-clause
ryfeus/lambda-packs
Rasterio_osgeo_shapely_PIL_pyproj_numpy/source/rasterio/rio/main.py
2
2354
""" Main command group for Rasterio's CLI. Subcommands developed as a part of the Rasterio package have their own modules under ``rasterio.rio`` (like ``rasterio/rio/info.py``) and are registered in the 'rasterio.rio_commands' entry point group in Rasterio's ``setup.py``: entry_points=''' [console_scripts...
mit
google/syzygy
third_party/numpy/files/numpy/linalg/tests/test_linalg.py
22
14734
""" Test functions for linalg module """ import numpy as np from numpy.testing import * from numpy import array, single, double, csingle, cdouble, dot, identity from numpy import multiply, atleast_2d, inf, asarray, matrix from numpy import linalg from numpy.linalg import matrix_power, norm, matrix_rank def ifthen(a, ...
apache-2.0
rec/DMXIS
Macros/Python/posixpath.py
1
13207
"""Common operations on Posix pathnames. Instead of importing this module directly, import os and refer to this module as os.path. The "os.path" name is an alias for this module on Posix systems; on other systems (e.g. Mac, Windows), os.path provides the same operations in a manner specific to that platform, an...
artistic-2.0
GDGLima/contentbox
third_party/unidecode/x09e.py
4
4873
data = ( 'Shu ', # 0x00 'Luo ', # 0x01 'Qi ', # 0x02 'Yi ', # 0x03 'Ji ', # 0x04 'Zhe ', # 0x05 'Yu ', # 0x06 'Zhan ', # 0x07 'Ye ', # 0x08 'Yang ', # 0x09 'Pi ', # 0x0a 'Ning ', # 0x0b 'Huo ', # 0x0c 'Mi ', # 0x0d 'Ying ', # 0x0e 'Meng ', # 0x0f 'Di ', ...
apache-2.0
camon/Flexget
flexget/plugins/metainfo/tmdb_lookup.py
4
2958
from __future__ import unicode_literals, division, absolute_import import logging from flexget import plugin from flexget.event import event from flexget.manager import Session from flexget.utils import imdb from flexget.utils.log import log_once try: # TODO: Fix this after api_tmdb has module level functions ...
mit
andersk/zulip
zerver/migrations/0322_realm_create_audit_log_backfill.py
4
1380
# Generated by Django 3.1.8 on 2021-04-20 10:09 from django.db import migrations from django.db.backends.postgresql.schema import DatabaseSchemaEditor from django.db.migrations.state import StateApps def backfill_realm_creation_log_events( apps: StateApps, schema_editor: DatabaseSchemaEditor ) -> None: Realm...
apache-2.0
kxliugang/edx-platform
common/lib/xmodule/xmodule/video_module/video_xfields.py
46
8327
""" XFields for video module. """ import datetime from xblock.fields import Scope, String, Float, Boolean, List, Dict, DateTime from xmodule.fields import RelativeTime # Make '_' a no-op so we can scrape strings _ = lambda text: text class VideoFields(object): """Fields for `VideoModule` and `VideoDescriptor`....
agpl-3.0
samuelstjean/dipy
tools/toollib.py
12
1332
"""Various utilities common to nibabel release and maintenance tools. """ # Library imports import os import sys from distutils.dir_util import remove_tree # Useful shorthands pjoin = os.path.join cd = os.chdir # Utility functions def c(cmd): """Run system command, raise SystemExit if it returns an error.""" ...
bsd-3-clause
EkaterinaFedorova/murano-repository
muranorepository/openstack/common/crypto/utils.py
2
6219
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Red Hat, 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 # #...
apache-2.0
JPinSPACE/AdventOfCode
day19/02_spacechem/solution.py
1
1453
""" Solution to the second puzzle of Day 19 on adventofcode.com """ import os def main(): """ Spacechem medicine is a hell of a drug """ basedir = os.path.dirname(os.path.realpath(__file__)) file_path = os.path.join(basedir, 'input') transforms = [] molecule = '' with open(file_path, 'r')...
mit
meetshah1995/tf-3dgan
src/3dgan_test.py
1
11035
#!/usr/bin/env python import os import sys import numpy as np import tensorflow as tf import dataIO as d from tqdm import * from utils import * ''' Global Parameters ''' n_epochs = 10000 batch_size = 32 g_lr = 0.0025 d_lr = 0.00001 beta = 0.5 d_thresh = 0.8 z_size = 200 leak_value = 0.2 cub...
mit
hilario/trep
examples/piston/pypiston.py
2
3174
import math import trep from OpenGL.GL import * import numpy as np class PyPistonForce(trep.Force): def __init__(self, system, crank_angle, offset, piston, curve): trep.Force.__init__(self, system, name='%s-force' % piston) # The combustion is modeled as a simple spline that is # dependen...
gpl-3.0
pombredanne/python-v8
tests/test_wrapper.py
2
24724
# -*- coding: utf-8 -*- from datetime import * import pytest import os import sys from v8 import * from v8.utils import * if is_py3k: def toUnicodeString(s): return s else: def toUnicodeString(s, encoding='utf-8'): return s if isinstance(s, unicode) else unicode(s, encoding) def testObject(): ...
apache-2.0
youprofit/django-cms
cms/south_migrations/0023_plugin_table_naming_function_changed.py
1680
20032
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() user_orm_label...
bsd-3-clause
vaideesg/omsdk
omdrivers/lifecycle/iDRAC/SCPParsers.py
1
6663
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # # Copyright © 2017 Dell Inc. or its subsidiaries. All rights reserved. # Dell, EMC, and other trademarks are trademarks of Dell Inc. or its # subsidiaries. Other trademarks may be trademarks of their respective owners. # # This program is free software: you can redistr...
gpl-3.0
andrebellafronte/stoq
stoq/gui/test/test_config_wizard.py
2
10749
# -*- coding: utf-8 -*- # vi:si:et:sw=4:sts=4:ts=4 ## ## Copyright (C) 2012-2013 Async Open Source <http://www.async.com.br> ## All rights reserved ## ## 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 Fou...
gpl-2.0
jcu-eresearch/climas-ng
webapp/climasng/views/dataview.py
1
3516
import os import json from pyramid.response import Response from pyramid.response import FileResponse from pyramid.view import view_config import pyramid.httpexceptions as httpexceptions # database stuff from sqlalchemy.exc import DBAPIError from sqlalchemy import or_ from climasng.models import * # json data stuff ...
apache-2.0
Eksmo/django-tastypie
tests/core/tests/http.py
8
2277
# Basically just a sanity check to make sure things don't change from underneath us. from django.test import TestCase from tastypie import http class HttpTestCase(TestCase): def test_201(self): response = http.HttpCreated(location='http://example.com/thingy/1/') self.assertEqual(response.status_c...
bsd-3-clause
Dhivyap/ansible
lib/ansible/modules/cloud/vmware/vmware_guest_disk_info.py
10
13626
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2019, NAER William Leemans (@bushvin) <willie@elaba.net> # Copyright: (c) 2018, Ansible Project # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __f...
gpl-3.0
idncom/odoo
addons/purchase_requisition/purchase_requisition.py
200
23548
# -*- encoding: 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
Serag8/Bachelor
google_appengine/lib/django-0.96/django/middleware/http.py
33
2543
import datetime class ConditionalGetMiddleware(object): """ Handles conditional GET operations. If the response has a ETag or Last-Modified header, and the request has If-None-Match or If-Modified-Since, the response is replaced by an HttpNotModified. Removes the content from any response to a HEA...
mit
cbrewster/servo
tests/wpt/web-platform-tests/tools/wptrunner/wptrunner/browsers/chrome.py
3
3718
from .base import Browser, ExecutorBrowser, require_arg from ..webdriver_server import ChromeDriverServer from ..executors import executor_kwargs as base_executor_kwargs from ..executors.executorselenium import (SeleniumTestharnessExecutor, # noqa: F401 SeleniumRefTestExecutor...
mpl-2.0
scs/uclinux
user/python/python-2.4.4/Mac/scripts/buildpkg.py
5
15904
#!/usr/bin/env python """buildpkg.py -- Build OS X packages for Apple's Installer.app. This is an experimental command-line tool for building packages to be installed with the Mac OS X Installer.app application. It is much inspired by Apple's GUI tool called PackageMaker.app, that seems to be part of the OS X develo...
gpl-2.0
Mirantis/vmware-dvs
networking_vsphere/agent/firewalls/vcenter_firewall.py
2
10534
# Copyright 2015 Mirantis, 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 a...
apache-2.0
markovmodel/PyEMMA
pyemma/util/discrete_trajectories.py
2
18601
# This file is part of PyEMMA. # # Copyright (c) 2015, 2014 Computational Molecular Biology Group, Freie Universitaet Berlin (GER) # # PyEMMA is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either vers...
lgpl-3.0
amboutin/GCP
appengine/standard/mailjet/main_test.py
17
1469
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
cogeorg/BlackRhino
examples/firesales_SA/networkx/tests/test.py
96
1244
#!/usr/bin/env python import sys from os import path,getcwd def run(verbosity=1,doctest=False,numpy=True): """Run NetworkX tests. Parameters ---------- verbosity: integer, optional Level of detail in test reports. Higher numbers provide more detail. doctest: bool, optional True to...
gpl-3.0
lzambella/Qyoutube-dl
youtube_dl/extractor/atttechchannel.py
155
1961
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import unified_strdate class ATTTechChannelIE(InfoExtractor): _VALID_URL = r'https?://techchannel\.att\.com/play-video\.cfm/([^/]+/)*(?P<id>.+)' _TEST = { 'url': 'http://techchannel.att.com/play-video.cfm/2014/1/27...
gpl-3.0
smilezino/shadowsocks
shadowsocks/eventloop.py
949
7288
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright 2013-2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
apache-2.0