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
hujiajie/chromium-crosswalk
build/android/devil/utils/zip_utils.py
69
1212
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import logging import os import zipfile def WriteToZipFile(zip_file, path, arc_path): """Recursively write |path| to |zip_file| as |arc_path|. zip_fil...
bsd-3-clause
dyninc/dns_lg
ldnsx.py
1
36283
# Copyright (c) 2011, Xelerance # Author: Christopher Olah <chris@xelerance.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 ab...
bsd-3-clause
davidcusatis/horizon
openstack_dashboard/dashboards/identity/mappings/tables.py
13
2814
# Copyright (C) 2015 Yahoo! 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
divio/django
tests/custom_pk/fields.py
379
1731
import random import string from django.db import models from django.utils import six from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class MyWrapper(object): def __init__(self, value): self.value = value def __repr__(self): return "<%s: %s>" % (sel...
bsd-3-clause
duydb2/ZTC
atc/django-atc-profile-storage/atc_profile_storage/views.py
1
4558
from atc_profile_storage.models import Profile from atc_profile_storage.serializers import ProfileSerializer from functools import wraps from rest_framework.exceptions import APIException from rest_framework.exceptions import ParseError from rest_framework.response import Response from rest_framework.views import APIV...
bsd-3-clause
bandit145/PyVenture
PyVentureClass.py
1
2904
class Class01: # class file for PyVentureGen #Did this because classes are cool and declutter the program like a b0ss #PY_BASE is for the gen function in the main program. I need to actually work on the game code itself soon - 3/2/2016 Bove PY_BASE = (""" #PyVenture by Philip Bove| #Created on 2/8/2016 ...
mit
nan86150/ImageFusion
lib/python2.7/site-packages/PIL/FliImagePlugin.py
41
3432
# # The Python Imaging Library. # $Id$ # # FLI/FLC file handling. # # History: # 95-09-01 fl Created # 97-01-03 fl Fixed parser, setup decoder tile # 98-07-15 fl Renamed offset attribute to avoid name clash # # Copyright (c) Secret Labs AB 1997-98. # Copyright (c) Fredrik Lundh 1995-97. # ...
mit
matthewoliver/swift
swift/container/server.py
2
28572
# Copyright (c) 2010-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 agree...
apache-2.0
goddardl/cortex
python/IECore/registerRunTimeTyped.py
7
7239
########################################################################## # # Copyright (c) 2007-2013, 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
simonkuang/grpc
tools/run_tests/artifacts/artifact_targets.py
1
15032
#!/usr/bin/env python # Copyright 2016 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
conversationai/wikidetox
experimental/conversation_go_awry/feature_extraction/utils/politeness_with_spacy/features/vectorizer.py
1
6272
from __future__ import unicode_literals import os import cPickle import string import nltk from itertools import chain from collections import defaultdict from spacy.en import English from nltk.stem.wordnet import WordNetLemmatizer import json import re # local import from politeness_strategies import get_politeness_s...
apache-2.0
sklnet/openhdf-enigma2
lib/python/Plugins/SystemPlugins/WirelessLan/plugin.py
9
16398
from enigma import eTimer, eEnv from Screens.Screen import Screen from Components.ActionMap import ActionMap, NumberActionMap from Components.Pixmap import Pixmap,MultiPixmap from Components.Label import Label from Components.Sources.StaticText import StaticText from Components.Sources.List import List from Components....
gpl-2.0
slohse/ansible
lib/ansible/modules/system/mount.py
13
21486
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Red Hat, inc # Written by Seth Vidal # based on the mount modules from salt and puppet # 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 __metacl...
gpl-3.0
jeffersonfparil/GTWAS_POOL_RADseq_SIM
simulateTRANS1.py
2
1274
#!/usr/bin/env python #generate the numeric transcript data import os, subprocess, sys, math import numpy as np from Bio import SeqIO from Bio import Seq from Bio.SeqRecord import SeqRecord workDIR = sys.argv[1] transcript = sys.argv[2] nIND = int(sys.argv[3]) name = sys.argv[4] #maybe there are better ways to define...
gpl-3.0
lxn2/mxnet
example/reinforcement-learning/ddpg/strategies.py
15
1705
import numpy as np class BaseStrategy(object): """ Base class of exploration strategy. """ def get_action(self, obs, policy): raise NotImplementedError def reset(self): pass class OUStrategy(BaseStrategy): """ Ornstein-Uhlenbeck process: dxt = theta * (mu - xt) * dt +...
apache-2.0
ostree/plaso
plaso/parsers/firefox_cache.py
3
15620
# -*- coding: utf-8 -*- """Implements a parser for Firefox cache 1 and 2 files.""" import collections import logging import os import construct import pyparsing from plaso.events import time_events from plaso.lib import errors from plaso.lib import eventdata from plaso.parsers import interface from plaso.parsers imp...
apache-2.0
michael-pacheco/dota2-predictor
tools/metadata.py
2
1505
""" Module responsible for parsing metadata """ import json import logging METADATA_JSON_PATH = 'metadata.json' logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) def _load_metadata(): """ Loads the metadata JSON Returns: JSON containing the metadata """ global MET...
mit
shusenl/scikit-learn
sklearn/utils/tests/test_extmath.py
70
16531
# Authors: Olivier Grisel <olivier.grisel@ensta.org> # Mathieu Blondel <mathieu@mblondel.org> # Denis Engemann <d.engemann@fz-juelich.de> # # License: BSD 3 clause import numpy as np from scipy import sparse from scipy import linalg from scipy import stats from sklearn.utils.testing import assert_eq...
bsd-3-clause
JianfengXu/crosswalk-test-suite
cordova/cordova-webapp-android-tests/webapp/comm.py
3
16228
#!/usr/bin/env python # coding=utf-8 # # Copyright (c) 2015 Intel Corporation. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of works must retain the original copyright notice, this # list of c...
bsd-3-clause
ilo10/deeppy
deeppy/dataset/cifar10.py
17
2196
import os import pickle import numpy as np from ..base import float_, int_ from .dataset import Dataset _URLS = [ 'http://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz', ] _SHA1S = [ '874905e36347c8536514d0a26261acf3bff89bc7', ] class CIFAR10(Dataset): ''' The CIFAR-10 dataset [1] http://www....
mit
Graghav/surabi
ADMIN/venv/lib/python2.7/site-packages/eve/tests/default_values.py
23
7872
import unittest from eve.defaults import build_defaults, resolve_default_values class TestBuildDefaults(unittest.TestCase): def test_schemaless_dict(self): schema = { "address": { 'type': 'dict' } } self.assertEqual({}, build_defaults(schema)) ...
apache-2.0
jedie/pypyjs-standalone
website/js/pypy.js-0.3.0/lib/modules/distutils/file_util.py
171
7795
"""distutils.file_util Utility functions for operating on single files. """ __revision__ = "$Id$" import os from distutils.errors import DistutilsFileError from distutils import log # for generating verbose output in 'copy_file()' _copy_action = {None: 'copying', 'hard': 'hard linking', ...
mit
ghedsouza/django
django/db/backends/sqlite3/schema.py
18
13024
import codecs import contextlib import copy from decimal import Decimal from django.apps.registry import Apps from django.db.backends.base.schema import BaseDatabaseSchemaEditor class DatabaseSchemaEditor(BaseDatabaseSchemaEditor): sql_delete_table = "DROP TABLE %(table)s" sql_create_inline_fk = "REFERENCES...
bsd-3-clause
xushuwei202/Vintageous
ex/ex_location.py
9
3136
import sublime def get_line_nr(view, point): """Return 1-based line number for `point`. """ return view.rowcol(point)[0] + 1 # TODO: Move this to sublime_lib; make it accept a point or a region. def find_eol(view, point): return view.line(point).end() # TODO: Move this to sublime_lib; make it acce...
mit
onecrayon/PopClip-Extensions
source/OneNote/requests/packages/urllib3/packages/ssl_match_hostname/_implementation.py
2360
3778
"""The match_hostname() function from Python 3.3.3, essential when using SSL.""" # Note: This file is under the PSF license as the code comes from the python # stdlib. http://docs.python.org/3/license.html import re __version__ = '3.4.0.2' class CertificateError(ValueError): pass def _dnsname_match(dn, host...
mit
lxml/lxml
doc/rest2html.py
1
1812
#!/usr/bin/python """ A minimal front end to the Docutils Publisher, producing HTML with Pygments syntax highlighting. """ # Set to True if you want inline CSS styles instead of classes INLINESTYLES = False try: import locale locale.setlocale(locale.LC_ALL, '') except: pass # set up Pygments from pygm...
bsd-3-clause
theheros/kbengine
kbe/src/lib/python/Lib/test/test_itertools.py
48
69382
import unittest from test import support from itertools import * from weakref import proxy from decimal import Decimal from fractions import Fraction import sys import operator import random import copy import pickle from functools import reduce maxsize = support.MAX_Py_ssize_t minsize = -maxsize-1 def lzip(*args): ...
lgpl-3.0
jespino/urwintranet
urwintranet/ui/widgets/generic.py
1
10342
# -*- coding: utf-8 -*- """ urwintranet.ui.widgets.generic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ """ import urwid from . import mixins, utils def box_solid_fill(char, height): sf = urwid.SolidFill(char) return urwid.BoxAdapter(sf, height=height) def wrap_in_whitespace(widget, cls=urwid.Columns): whitespace = ...
apache-2.0
bdoner/SickRage
lib/guessit/transfo/guess_filetype.py
29
11928
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2013 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
Changaco/oh-mainline
vendor/packages/scrapy/scrapy/core/downloader/__init__.py
19
6133
import random import warnings from time import time from collections import deque from functools import partial from twisted.internet import reactor, defer from twisted.python.failure import Failure from scrapy.utils.defer import mustbe_deferred from scrapy.utils.signal import send_catch_log from scrapy.utils.httpobj...
agpl-3.0
ChristineLaMuse/mozillians
vendor-local/lib/python/kombu/entity.py
10
19337
""" kombu.entity ================ Exchange and Queue declarations. :copyright: (c) 2009 - 2012 by Ask Solem. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import from .abstract import MaybeChannelBound TRANSIENT_DELIVERY_MODE = 1 PERSISTENT_DELIVERY_MODE = 2 DELIVERY_MODES = {"tr...
bsd-3-clause
trondeau/gnuradio
gr-analog/python/analog/nbfm_rx.py
23
3478
# # Copyright 2005,2012 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
menardorama/ReadyNAS-Add-ons
headphones-1.0.0/debian/headphones/apps/headphones/lib/unidecode/x004.py
249
4071
data = ( 'Ie', # 0x00 'Io', # 0x01 'Dj', # 0x02 'Gj', # 0x03 'Ie', # 0x04 'Dz', # 0x05 'I', # 0x06 'Yi', # 0x07 'J', # 0x08 'Lj', # 0x09 'Nj', # 0x0a 'Tsh', # 0x0b 'Kj', # 0x0c 'I', # 0x0d 'U', # 0x0e 'Dzh', # 0x0f 'A', # 0x10 'B', # 0x11 'V', # 0x12 'G', # 0x...
gpl-2.0
factorlibre/OCB
openerp/report/misc.py
458
1425
# -*- coding: 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 the...
agpl-3.0
kazitanvirahsan/scrapy
tests/test_http_headers.py
161
6348
import unittest import copy from scrapy.http import Headers class HeadersTest(unittest.TestCase): def assertSortedEqual(self, first, second, msg=None): return self.assertEqual(sorted(first), sorted(second), msg) def test_basics(self): h = Headers({'Content-Type': 'text/html', 'Content-Length...
bsd-3-clause
bssrdf/deeppy
deeppy/dataset/cifar10.py
17
2196
import os import pickle import numpy as np from ..base import float_, int_ from .dataset import Dataset _URLS = [ 'http://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz', ] _SHA1S = [ '874905e36347c8536514d0a26261acf3bff89bc7', ] class CIFAR10(Dataset): ''' The CIFAR-10 dataset [1] http://www....
mit
liuyisiyisi/django-cms
cms/migrations/0004_auto_20140924_1038.py
65
1420
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('cms', '0003_auto_20140926_2347'), ] operations = [ migrations.AddField( model_name='cmsplugin', name...
bsd-3-clause
andyzsf/edx_data_research
reporting_scripts/navigation_tabs_data_date_completers.py
1
2700
''' This module keeps track of the number of times each Navigation tab was clicked/views, by students who completed the course, for each day during the course Usage: python navigation_tabs_data_date.py ''' import csv from datetime import datetime from collections import defaultdict import sys from base_edx impor...
mit
Kilhog/odoo
addons/gamification/models/goal.py
219
26522
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
agpl-3.0
crateio/crate.web
crate/web/history/migrations/0003_convert_changelog_to_history.py
1
10430
# -*- coding: utf-8 -*- from south.v2 import DataMigration class Migration(DataMigration): depends_on = ( ("packages", "0019_auto__add_field_releasefile_hidden"), ) def forwards(self, orm): for cl in orm["packages.ChangeLog"].objects.all().select_related("package", "version"): ...
bsd-2-clause
aronparsons/spacewalk
backend/common/rhnFlags.py
4
1402
# Copyright (c) 2008--2015 Red Hat, Inc. # # 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 # FOR A PARTICULAR PURPOSE. You should have received a cop...
gpl-2.0
spring-week-topos/horizon-week
openstack_dashboard/test/integration_tests/tests/test_login.py
25
1210
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
potash/scikit-learn
sklearn/neural_network/tests/test_rbm.py
225
6278
import sys import re import numpy as np from scipy.sparse import csc_matrix, csr_matrix, lil_matrix from sklearn.utils.testing import (assert_almost_equal, assert_array_equal, assert_true) from sklearn.datasets import load_digits from sklearn.externals.six.moves import cStringIO as ...
bsd-3-clause
pawaranand/phr_frappe
frappe/core/doctype/workflow/workflow.py
32
2524
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # MIT License. See license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document class Workflow(Document): def validate(self): self.set_active() self.create_custom_field_f...
mit
theguardian/headphones
lib/unidecode/x0d2.py
253
4724
data = ( 'toels', # 0x00 'toelt', # 0x01 'toelp', # 0x02 'toelh', # 0x03 'toem', # 0x04 'toeb', # 0x05 'toebs', # 0x06 'toes', # 0x07 'toess', # 0x08 'toeng', # 0x09 'toej', # 0x0a 'toec', # 0x0b 'toek', # 0x0c 'toet', # 0x0d 'toep', # 0x0e 'toeh', # 0x0f 'tyo', # 0x10...
gpl-3.0
pdellaert/ansible
lib/ansible/modules/network/fortimanager/fmgr_secprof_ssl_ssh.py
39
39490
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
unaizalakain/django
django/contrib/sessions/middleware.py
256
2658
import time from importlib import import_module from django.conf import settings from django.utils.cache import patch_vary_headers from django.utils.http import cookie_date class SessionMiddleware(object): def __init__(self): engine = import_module(settings.SESSION_ENGINE) self.SessionStore = eng...
bsd-3-clause
Nabs007/ansible
lib/ansible/module_utils/rax.py
280
11974
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by # Ansible still belong to the author of the module, and may assign their own # license to the complete wo...
gpl-3.0
SUSE/azure-sdk-for-python
azure-keyvault/azure/keyvault/models/certificate_update_parameters.py
4
1565
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
Trigition/MTG-DataScraper
scripts/variant_cards.py
1
1256
#!/usr/bin/env python import pandas as pd import argparse parser = argparse.ArgumentParser(description="This python script generates a csv describing all the physical cards") parser.add_argument('inputs', help='Input CSV files', nargs='+') parser.add_argument('output', help='Optional output csv filename, defaults to ...
mit
Abschiedsstein/ANWP
draft.py
1
1423
import numpy as np class RnD : Server{ draw() reveal(n) shuffle() pick() } class Archive : Server{ add(face) reveal(n) pick() } class Hand{ add() remove() reveal() } class Server { create() install() } ...
gpl-2.0
jphilipsen05/zulip
zerver/views/push_notifications.py
5
1932
from __future__ import absolute_import import requests import json from typing import Optional, Text from django.conf import settings from django.http import HttpRequest, HttpResponse from django.utils.translation import ugettext as _ from zerver.lib.push_notifications import add_push_device_token, \ remove_pus...
apache-2.0
ciminaghi/linux-3.3.8
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
AnanyaKumar/kubernetes
cluster/juju/charms/trusty/kubernetes-master/hooks/setup.py
213
1409
#!/usr/bin/env python # Copyright 2015 The Kubernetes 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 # # Unle...
apache-2.0
uclouvain/OSIS-Louvain
base/tests/views/test_my_osis.py
1
6883
############################################################################# # # OSIS stands for Open Student Information System. It's an application # designed to manage the core business of higher education institutions, # such as universities, faculties, institutes and professional schools. # The core b...
agpl-3.0
ekiourk/ansible-modules-core
web_infrastructure/supervisorctl.py
61
8777
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Matt Wright <matt@nobien.net> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License...
gpl-3.0
moodboom/beets
test/testall.py
25
1497
#!/usr/bin/env python # This file is part of beets. # Copyright 2015, Adrian Sampson. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation th...
mit
pong3489/TEST_Mission
Lib/site-packages/numpy/oldnumeric/ma.py
81
75739
"""MA: a facility for dealing with missing observations MA is generally used as a numpy.array look-alike. by Paul F. Dubois. Copyright 1999, 2000, 2001 Regents of the University of California. Released for unlimited redistribution. Adapted for numpy_core 2005 by Travis Oliphant and (mainly) Paul Dubois. """ import ty...
gpl-3.0
almarklein/pywasm
wasmfun/util.py
2
5596
""" Utils for working with WASM and binary data. """ import os import tempfile import subprocess from .components import Module __all__ = ['inspect_bytes_at', 'hexdump', 'export_wasm_example', 'run_wasm_in_node', 'run_wasm_in_notebook'] def inspect_bytes_at(bb, offset): """ Inspect bytes at the spe...
bsd-2-clause
mjtamlyn/django
tests/sessions_tests/models.py
85
1160
""" This custom Session model adds an extra column to store an account ID. In real-world applications, it gives you the option of querying the database for all active sessions for a particular account. """ from django.contrib.sessions.backends.db import SessionStore as DBStore from django.contrib.sessions.base_session ...
bsd-3-clause
leighpauls/k2cro4
third_party/python_26/Lib/ctypes/test/test_as_parameter.py
66
6600
import unittest from ctypes import * import _ctypes_test dll = CDLL(_ctypes_test.__file__) try: CALLBACK_FUNCTYPE = WINFUNCTYPE except NameError: # fake to enable this test on Linux CALLBACK_FUNCTYPE = CFUNCTYPE class POINT(Structure): _fields_ = [("x", c_int), ("y", c_int)] class BasicWrapTestCase(...
bsd-3-clause
rajashreer7/autotest-client-tests
linux-tools/python_urlgrabber/python_urlgrabber.py
3
1617
#!/bin/python import os, subprocess import logging from autotest.client import test from autotest.client.shared import error class python_urlgrabber(test.test): """ Autotest module for testing basic functionality of python_urlgrabber @author Kingsuk Deb, kingsdeb@linux.vnet.ibm.com ...
gpl-2.0
pranavtendolkr/horizon
openstack_dashboard/dashboards/project/loadbalancers/tables.py
16
13632
# Copyright 2013, Big Switch Networks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applic...
apache-2.0
EvenStrangest/tensorflow
tensorflow/examples/skflow/iris_save_restore.py
9
1677
# Copyright 2015-present The Scikit Flow 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 require...
apache-2.0
deuxpi/pytrainer
pytrainer/gui/windowextensions.py
2
5311
# -*- coding: iso-8859-1 -*- #Copyright (C) Fiz Vazquez vud1@sindominio.net #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...
gpl-2.0
eaplatanios/tensorflow
tensorflow/python/util/tf_contextlib_test.py
141
3075
# Copyright 2017 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
epiqc/ScaffCC
clang/utils/ABITest/ABITestGen.py
35
30467
#!/usr/bin/env python from __future__ import absolute_import, division, print_function from pprint import pprint import random, atexit, time from random import randrange import re from Enumeration import * from TypeGen import * #### class TypePrinter(object): def __init__(self, output, outputHeader=None, ...
bsd-2-clause
dr0pz0ne/sibble
lib/ansible/executor/task_executor.py
3
31318
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
mruwnik/magnolia
src/magnolia/ui/canvas.py
1
6571
import math from path import Path from qtpy.QtWidgets import QOpenGLWidget from qtpy.QtGui import QOpenGLShader, QOpenGLShaderProgram, QMatrix4x4, QOpenGLVersionProfile, QVector3D from magnolia.ui.drawables import MeristemDisplay class OGLCanvas(MeristemDisplay, QOpenGLWidget): """A class to handle displaying O...
gpl-3.0
zuazo-forks/beaver
beaver/worker.py
2
8162
import errno import os import stat import time from beaver.utils import REOPEN_FILES, eglob class Worker(object): """Looks for changes in all files of a directory. This is useful for watching log file changes in real-time. It also supports files rotation. Example: >>> def callback(filename, lin...
mit
sargas/scipy
scipy/linalg/tests/test_lapack.py
4
3736
#!/usr/bin/env python # # Created by: Pearu Peterson, September 2002 # from __future__ import division, print_function, absolute_import from numpy.testing import TestCase, run_module_suite, assert_equal, \ assert_array_almost_equal, assert_, assert_raises import numpy as np from scipy.linalg import _flapack as ...
bsd-3-clause
mwmuni/LIGGGHTS_GUI
OpenGL/raw/GL/_types.py
9
5267
"""OpenGL-wide constant types (not OpenGL.GL-specific) These are basically the fundamental data-types that OpenGL uses (note, doesn't include the OpenGL-ES types!) """ import ctypes from OpenGL.constant import Constant from OpenGL._bytes import bytes,unicode,as_8_bit, long from OpenGL._opaque import opaque_pointer_cl...
gpl-3.0
Kongsea/tensorflow
tensorflow/contrib/tensor_forest/hybrid/python/kernel_tests/k_feature_routing_function_op_test.py
103
3383
# 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
revmischa/boto
tests/integration/dynamodb2/test_cert_verification.py
125
1564
# Copyright (c) 2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. # All rights reserved. # # 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 withou...
mit
odejesush/tensorflow
tensorflow/contrib/slim/python/slim/nets/overfeat.py
164
5562
# 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
nburn42/tensorflow
tensorflow/contrib/kfac/python/ops/linear_operator.py
14
3662
# 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
elsonrodriguez/madhatter
cobbler/cli.py
1
22124
""" Command line interface for cobbler. Copyright 2006-2009, Red Hat, Inc Michael DeHaan <mdehaan@redhat.com> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at ...
gpl-2.0
veger/ansible
lib/ansible/modules/cloud/vmware/vmware_local_user_manager.py
56
6294
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2016, IBM Corp # Author(s): Andreas Nafpliotis <nafpliot@de.ibm.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...
gpl-3.0
iruga090/python-social-auth
social/backends/mailru.py
83
1693
""" Mail.ru OAuth2 backend, docs at: http://psa.matiasaguirre.net/docs/backends/mailru.html """ from hashlib import md5 from social.p3 import unquote from social.backends.oauth import BaseOAuth2 class MailruOAuth2(BaseOAuth2): """Mail.ru authentication backend""" name = 'mailru-oauth2' ID_KEY = 'uid'...
bsd-3-clause
janelia-pypi/kicad_netlist_reader
setup.py
2
3679
from setuptools import setup, find_packages # Always prefer setuptools over distutils from codecs import open # To use a consistent encoding from os import path from version import get_git_version here = path.abspath(path.dirname(__file__)) # Get the long description from the relevant file with open(path.join(here,...
gpl-2.0
xuegang/gpdb
src/test/tinc/tincrepo/mpp/gpdb/tests/storage/lib/sql_torment_testcase.py
9
5153
""" Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at ...
apache-2.0
danielpalomino/gem5
ext/ply/test/lex_optimize3.py
164
1062
# ----------------------------------------------------------------------------- # lex_optimize3.py # # Writes table in a subdirectory structure. # ----------------------------------------------------------------------------- import sys if ".." not in sys.path: sys.path.insert(0,"..") import ply.lex as lex tokens = ( ...
bsd-3-clause
jay-tuckey/python-vmwaremirage
tests/test_main_functions.py
1
4514
from vmwaremirage import VmwareMirageClient import config import config_secure import os vm = VmwareMirageClient(server=config_secure.server, username=config_secure.username, password=os.environ['VMWARE_MIRAGE_PASSWORD']) def test_reauth(): # Cofirm we are working...
mit
khinsen/pyh5md
examples/random_walk_1d.py
2
1086
# -*- coding: utf-8 -*- # Copyright 2012-2013 Pierre de Buyl # Copyright 2013 Felix Hoëfling # # This file is part of pyh5md # # pyh5md is free software and is licensed under the modified BSD license (see # LICENSE file). import numpy as np import pyh5md # Open a H5MD file f = pyh5md.H5MD_File('walk_1d.h5', 'w', crea...
bsd-3-clause
doraemonext/wechat-platform
wechat_platform/system/keyword/tests.py
1
4271
# -*- coding: utf-8 -*- from system.core.test import WechatTestCase from system.official_account.models import OfficialAccount from system.rule.models import Rule from system.keyword.models import Keyword class KeywordTest(WechatTestCase): def test_add_keyword(self): """ 测试添加关键字 """ ...
bsd-2-clause
fidlej/searchrss
src/formatter.py
1
1389
import urllib import web import time from src import config def install(): web.template.Template.globals["len"] = len web.template.Template.globals["int"] = int web.template.Template.globals["urlEncode"] = urlEncode web.template.Template.globals["formatDay"] = formatDay web.template.Template.glo...
gpl-3.0
mims2707/bite-project
deps/gdata-python-client/src/gdata/tlslite/Session.py
359
4733
"""Class representing a TLS session.""" from utils.compat import * from mathtls import * from constants import * class Session: """ This class represents a TLS session. TLS distinguishes between connections and sessions. A new handshake creates both a connection and a session. Data is transmitt...
apache-2.0
ismail-s/warehouse
warehouse/migrations/versions/5988e3e8d2e_add_primary_key_to_release_files.py
7
1119
# 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 # distributed under the Li...
apache-2.0
ragupta-git/ImcSdk
imcsdk/mometa/error/Error.py
1
3229
"""This module contains the general information for Error ManagedObject.""" from ...imcmo import ManagedObject from ...imccoremeta import MoPropertyMeta, MoMeta from ...imcmeta import VersionMeta class ErrorConsts: pass class Error(ManagedObject): """This is Error class.""" consts = ErrorConsts() ...
apache-2.0
dmitriy0611/django
tests/template_tests/templatetags/custom.py
42
4823
import operator import warnings from django import template from django.template.defaultfilters import stringfilter from django.utils import six register = template.Library() @register.filter @stringfilter def trim(value, num): return value[:num] @register.filter def noop(value, param=None): """A noop fil...
bsd-3-clause
adobecs5/urp2015
lib/python3.4/site-packages/_markerlib/markers.py
1769
3979
# -*- coding: utf-8 -*- """Interpret PEP 345 environment markers. EXPR [in|==|!=|not in] EXPR [or|and] ... where EXPR belongs to any of those: python_version = '%s.%s' % (sys.version_info[0], sys.version_info[1]) python_full_version = sys.version.split()[0] os.name = os.name sys.platform = sys.platfo...
apache-2.0
MRigal/django
django/contrib/postgres/lookups.py
199
1175
from django.db.models import Lookup, Transform class PostgresSimpleLookup(Lookup): def as_sql(self, qn, connection): lhs, lhs_params = self.process_lhs(qn, connection) rhs, rhs_params = self.process_rhs(qn, connection) params = lhs_params + rhs_params return '%s %s %s' % (lhs, self...
bsd-3-clause
gaumire/heroku-buildpack-python
vendor/pip-pop/pip/pep425tags.py
249
4427
"""Generate and work with PEP 425 Compatibility Tags.""" from __future__ import absolute_import import re import sys import warnings try: import sysconfig except ImportError: # pragma nocover # Python < 2.7 import distutils.sysconfig as sysconfig import distutils.util _osx_arch_pat = re.compile(r'(.+)_(...
mit
40223209/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/compat.py
603
3054
"""Python 2.x/3.x compatibility tools""" import sys __all__ = ['geterror', 'long_', 'xrange_', 'ord_', 'unichr_', 'unicode_', 'raw_input_', 'as_bytes', 'as_unicode'] def geterror (): return sys.exc_info()[1] try: long_ = long except NameError: long_ = int try: xrange_ = xrange except Nam...
gpl-3.0
OpenHumans/open-humans
private_sharing/api_authentication.py
2
3436
import arrow from django.contrib.auth import get_user_model from oauth2_provider.models import AccessToken from oauth2_provider.contrib.rest_framework import OAuth2Authentication from rest_framework import exceptions from rest_framework.authentication import BaseAuthentication, get_authorization_header from .models...
mit
twotreeszf/AriaThunder
xunlei-lixian/lixian_cli.py
14
1801
#!/usr/bin/env python from lixian_commands.util import * import lixian_help import sys from lixian_commands.login import login from lixian_commands.logout import logout from lixian_commands.download import download_task from lixian_commands.list import list_task from lixian_commands.add import add_task from lixian_co...
bsd-3-clause
csm0042/guibyini
guibyini/_main.py
1
2739
__author__ = 'chris.maue' ####################################################################################################################### # Import required libraries ####################################################################################################################### import logging import os...
gpl-2.0
Yen-Chung-En/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/xml/etree/__init__.py
1200
1604
# $Id: __init__.py 3375 2008-02-13 08:05:08Z fredrik $ # elementtree package # -------------------------------------------------------------------- # The ElementTree toolkit is # # Copyright (c) 1999-2008 by Fredrik Lundh # # By obtaining, using, and/or copying this software and/or its # associated documentation, you ...
gpl-3.0
sysadmind/ansible-modules-extras
cloud/amazon/dynamodb_table.py
48
14484
#!/usr/bin/python # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed...
gpl-3.0
cchurch/ansible
lib/ansible/modules/network/fortios/fortios_report_theme.py
21
15174
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
gpl-3.0