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
emon10005/scikit-image
skimage/filter/rank/__init__.py
28
1502
from ...filters.rank.generic import (autolevel, bottomhat, equalize, gradient, maximum, mean, subtract_mean, median, minimum, modal, enhance_contrast, pop, threshold, tophat, noise_filter, entropy, otsu, sum, windowed_histogram) from ...filters.rank._per...
bsd-3-clause
mgit-at/ansible
lib/ansible/modules/storage/purestorage/purefb_dsrole.py
11
6070
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2018, Simon Dodsley (simon@purestorage.com) # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1',...
gpl-3.0
loco-odoo/localizacion_co
openerp/addons-extra/odoo-pruebas/odoo-server/addons-extra/stock_account_track/stock_account.py
3
19551
# -*- 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
leoliujie/odoo
addons/stock_account/__openerp__.py
269
2348
# -*- 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
StrongMonkey/agent
tests/tests/cattle/plugins/docker/__init__.py
2
2471
import logging from docker.utils import kwargs_from_env from tests.cattle import default_value, Config log = logging.getLogger('docker') _ENABLED = True class DockerConfig: def __init__(self): pass @staticmethod def docker_enabled(): return default_value('DOCKER_ENABLED', 'true') == 't...
apache-2.0
mrDoctorWho/vk4xmpp
library/writer.py
1
1712
# coding: utf-8 # © simpleApps, 2010 """ This module used to read, write files and crash logs """ __author__ = "mrDoctorWho <mrdoctorwho@gmail.com>" import __main__ import logging import os import sys import time import traceback from printer import * logger = logging.getLogger("vk4xmpp") fixme = lambda msg: Prin...
mit
pepsipepsi/nodebox_opengl_python3
examples/12-experimental/02-blend.py
1
2043
import os, sys sys.path.insert(0, os.path.join("..","..")) from nodebox.graphics.context import * from nodebox.graphics import * from pyglet.gl import * from random import seed # A question that regularly pops up is: # "How can I draw shapes to the canvas with a blending mode? (e.g. multiply)" # OpenGL has different...
bsd-3-clause
endorphinl/horizon
openstack_dashboard/dashboards/project/stacks/resource_types/tests.py
25
1919
# 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...
apache-2.0
rcarrillocruz/ansible
lib/ansible/inventory/data.py
6
10052
# (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
Katharsis/unfrozen_binary
unpyc3.py
3
62223
""" Decompiler for Python3.3. Decompile a module or a function using the decompile() function >>> from unpyc3 import decompile >>> def foo(x, y, z=3, *args): ... global g ... for i, j in zip(x, y): ... if z == i + j or args[i] == j: ... g = i, j ... return ... >>> print(decompile...
mit
bdoner/SickRage
lib/unidecode/x016.py
252
4140
data = ( 'kka', # 0x00 'kk', # 0x01 'nu', # 0x02 'no', # 0x03 'ne', # 0x04 'nee', # 0x05 'ni', # 0x06 'na', # 0x07 'mu', # 0x08 'mo', # 0x09 'me', # 0x0a 'mee', # 0x0b 'mi', # 0x0c 'ma', # 0x0d 'yu', # 0x0e 'yo', # 0x0f 'ye', # 0x10 'yee', # 0x11 'yi', # 0x12 'ya...
gpl-3.0
mutirri/bokeh
sphinx/source/docs/tutorials/exercises/hover.py
23
2153
from __future__ import division import itertools import numpy as np from bokeh.plotting import ColumnDataSource, figure, output_file, show from bokeh.models import HoverTool # Create a set of tools to use TOOLS="pan,wheel_zoom,box_zoom,reset,hover" xx, yy = np.meshgrid(np.arange(0, 101, 4), np.arange(0, 101, 4)) x...
bsd-3-clause
bast/xcfun
cmake/autocmake/extract.py
22
1049
def extract_list(config, section): from collections import Iterable l = [] if 'modules' in config: for module in config['modules']: for k, v in module.items(): for x in v: if section in x: if isinstance(x[section], Iterable) and...
mpl-2.0
chungg/aodh
aodh/alarm/storage/impl_hbase.py
1
6634
# # 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...
apache-2.0
AnishShah/tensorflow
tensorflow/python/client/virtual_gpu_test.py
19
9656
# 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
jbking/demo-appengine-django-golang
myproject/django/contrib/localflavor/de/forms.py
110
3266
""" DE-specific Form helpers """ from __future__ import absolute_import, unicode_literals import re from django.contrib.localflavor.de.de_states import STATE_CHOICES from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select from...
mit
ale3andro/mouse-training
images2.py
1
1470
#!/usr/bin/python # -*- coding: utf-8 -*- import json, random class images2: def __init__(self, json_filename, random_order=False): self.questions = [] self.question_index = 0 self.questions_count = 0 self.quiz_caption = "" self.background_image = "" json_data = op...
gpl-3.0
VyacheslavHashov/python-swiftclient
tests/unit/test_multithreading.py
2
8746
# Copyright (c) 2010-2013 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 # # Unless required by applicable law or agreed to ...
apache-2.0
RoyalStudios/ProjectJepanPaperDiaper
example/akachan.py
2
8193
# coding=utf-8 ''' Created on 2015年7月21日 用urllib,urllib2模拟浏览器,伪造UA,COOKIE抢购 @author: Administrator ''' import threading import xlrd import time from poplib import POP3 import re from bs4 import BeautifulSoup as BS import urllib import urllib2 import cookielib import urlparse EMAIL_FORM_URL = 'https://aksale.advs.jp/cp/...
mit
doismellburning/edx-platform
lms/djangoapps/courseware/tests/test_views.py
6
49157
# coding=UTF-8 """ Tests courseware views.py """ import cgi from urllib import urlencode import ddt import json import unittest from datetime import datetime from HTMLParser import HTMLParser from nose.plugins.attrib import attr from django.conf import settings from django.contrib.auth.models import AnonymousUser from...
agpl-3.0
tst-eclamar/earthenterprise
earth_enterprise/src/server/wsgi/wms/ogc/common/projections.py
5
8312
#!/usr/bin/env python2.7 # # Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
apache-2.0
thundernet8/WRGameVideos-Server
venv/lib/python2.7/site-packages/sqlalchemy/testing/suite/test_results.py
155
6685
from .. import fixtures, config from ..config import requirements from .. import exclusions from ..assertions import eq_ from .. import engines from sqlalchemy import Integer, String, select, util, sql, DateTime import datetime from ..schema import Table, Column class RowFetchTest(fixtures.TablesTest): __backend...
gpl-2.0
hn8841182/W11
static/Brython3.1.0-20150301-090019/Lib/shutil.py
720
39101
"""Utility functions for copying and archiving files and directory trees. XXX The functions here don't copy the resource fork or other metadata on Mac. """ import os import sys import stat from os.path import abspath import fnmatch import collections import errno import tarfile try: import bz2 del bz2 _...
gpl-3.0
ernstp/kivy
examples/widgets/lists/list_cascade.py
51
7056
from kivy.adapters.listadapter import ListAdapter from kivy.adapters.models import SelectableDataItem from kivy.uix.gridlayout import GridLayout from kivy.uix.listview import ListView, ListItemButton from fixtures import fruit_categories, fruit_data_list_of_dicts from fruit_detail_view import FruitDetailView # This ...
mit
idea4bsd/idea4bsd
plugins/hg4idea/testData/bin/hgext/patchbomb.py
90
21409
# patchbomb.py - sending Mercurial changesets as patch emails # # Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. '''command to send changesets as (a series of) patch ...
apache-2.0
kuiwei/edx-platform
lms/djangoapps/branding/__init__.py
10
2616
from xmodule.modulestore.django import modulestore from xmodule.course_module import CourseDescriptor from django.conf import settings from opaque_keys.edx.locations import SlashSeparatedCourseKey from microsite_configuration import microsite def get_visible_courses(): """ Return the set of CourseDescriptors...
agpl-3.0
40223227/2015cdbg6w0622-40223227-
static/Brython3.1.1-20150328-091302/Lib/multiprocessing/dummy/connection.py
707
3049
# # Analogue of `multiprocessing.connection` which uses queues instead of sockets # # multiprocessing/dummy/connection.py # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditi...
gpl-3.0
arnavd96/Cinemiezer
myvenv/lib/python3.4/site-packages/music21/ext/chardet/langcyrillicmodel.py
2762
17725
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
mit
harisankarma/Ardupilot
mk/PX4/Tools/genmsg/test/test_genmsg_msg_loader.py
215
29225
# Software License Agreement (BSD License) # # Copyright (c) 2009, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code must retain the above...
gpl-3.0
SurfasJones/icecream-info
icecream/lib/python2.7/site-packages/django/core/management/sql.py
107
8922
from __future__ import unicode_literals import codecs import os import re from django.conf import settings from django.core.management.base import CommandError from django.db import models from django.db.models import get_models from django.utils._os import upath def sql_create(app, style, connection): "Returns...
mit
ebukoz/thrive
erpnext/controllers/buying_controller.py
1
37433
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _, msgprint from frappe.utils import flt,cint, cstr, getdate from erpnext.accounts.party import get_party_details from...
gpl-3.0
baquiax/AlexMNCBundle
Symfony/vendor/doctrine/orm/docs/en/conf.py
2448
6497
# -*- coding: utf-8 -*- # # Doctrine 2 ORM documentation build configuration file, created by # sphinx-quickstart on Fri Dec 3 18:10:24 2010. # # 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 # autogenerated file. ...
gpl-2.0
bespoyasov/groontograf
node_modules/yamlish/yamlish-py/test/__init__.py
161
3430
# -*- coding: utf-8 -*- IGNORE:C0111 from __future__ import absolute_import, print_function, unicode_literals import logging import yamlish import yaml import tempfile import textwrap INPUT = 1 OUTPUT = 2 if yamlish.py3k: unicode = str #logging.basicConfig(level=logging.DEBUG) def _generate_test_name(source):...
mit
nitinitprof/odoo
addons/account/wizard/account_statement_from_invoice.py
224
4128
# -*- 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
vseledkin/LV_groundhog
groundhog/models/LM_model.py
3
11649
""" Implementation of a language model class. TODO: write more documentation """ __docformat__ = 'restructedtext en' __authors__ = ("Razvan Pascanu " "KyungHyun Cho " "Caglar Gulcehre ") __contact__ = "Razvan Pascanu <r.pascanu@gmail>" import numpy import itertools import logging impo...
bsd-3-clause
savoirfairelinux/OpenUpgrade
openerp/addons/base/res/res_users.py
30
43915
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you ca...
agpl-3.0
cherry-wb/pyew
vstruct/builder.py
17
8115
''' VStruct builder! Used to serialize structure definitions etc... ''' import copy import types import inspect import vstruct import vstruct.primitives as vs_prim prim_types = [ None, vs_prim.v_uint8, vs_prim.v_uint16, None, vs_prim.v_ui...
gpl-2.0
SSupattapone/Final-Project
sam'sfinalproject.py
1
3724
""" Sam's Final Project Author: Sam Supattapone Credit: "Every Word Ever" website, Description: Hangman. """ with open("everywordever.txt") as f: data = f.readlines() name = input("Welcome, please enter your name: ") print(" ") level = input(("Hello {0}, please select a level, 1, 2, 3, or INSANE: ").format(...
mit
WhireCrow/openwrt-mt7620
staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/test/test_support.py
17
44182
"""Supporting definitions for the Python regression tests.""" if __name__ != 'test.test_support': raise ImportError('test_support must be imported from the test package') import contextlib import errno import functools import gc import socket import sys import os import platform import shutil import warnings impo...
gpl-2.0
frederick-masterton/django
tests/m2m_through_regress/models.py
166
2643
from __future__ import unicode_literals from django.contrib.auth.models import User from django.db import models from django.utils.encoding import python_2_unicode_compatible # Forward declared intermediate model @python_2_unicode_compatible class Membership(models.Model): person = models.ForeignKey('Person') ...
bsd-3-clause
ray-project/ray
rllib/contrib/maddpg/maddpg.py
1
6624
"""Contributed port of MADDPG from OpenAI baselines. The implementation has a couple assumptions: - The number of agents is fixed and known upfront. - Each agent is bound to a policy of the same name. - Discrete actions are sent as logits (pre-softmax). For a minimal example, see rllib/examples/two_step_game.py, and ...
apache-2.0
douglasvegas/mycli
mycli/packages/special/favoritequeries.py
26
2102
# -*- coding: utf-8 -*- from __future__ import unicode_literals class FavoriteQueries(object): section_name = 'favorite_queries' usage = ''' Favorite Queries are a way to save frequently used queries with a short name. Examples: # Save a new favorite query. > \\fs simple select * from abc where a is...
bsd-3-clause
lukasjuhrich/sipa
sipa/model/__init__.py
1
12008
# -*- coding: utf-8 -*- import logging import operator from collections import namedtuple from ipaddress import IPv4Address, AddressValueError from flask import request, session, current_app from flask_login import current_user, AnonymousUserMixin from sqlalchemy.exc import OperationalError from werkzeug.local import ...
mit
brain-research/mirage-rl-qprop
rllab/optimizers/hessian_free_optimizer.py
2
2936
from rllab.misc.ext import compile_function, lazydict from rllab.core.serializable import Serializable from rllab.optimizers.hf import hf_optimizer import time from rllab.optimizers.minibatch_dataset import BatchDataset class HessianFreeOptimizer(Serializable): """ Performs unconstrained optimization via Hess...
mit
CydarLtd/ansible
lib/ansible/modules/commands/expect.py
6
7900
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Matt Martz <matt@sivel.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
swails/mdtraj
mdtraj/geometry/thermodynamic_properties.py
16
6589
""" Notes ----- The functions in this file use the MDTraj version of simtk.unit *internally*. However, all inputs and outputs are done with implicit units. This is to avoid incompatibilities between versions of simtk.unit and MDTraj.utils.unit. """ import numpy as np import mdtraj as md import mdtraj.utils.unit.unit_...
lgpl-2.1
srene/ns-3-mptcp
src/internet/bindings/modulegen__gcc_LP64.py
8
926014
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
gpl-2.0
HiSPARC/station-software
user/python/Lib/lib-tk/Tkconstants.py
375
1493
# Symbolic constants for Tk # Booleans NO=FALSE=OFF=0 YES=TRUE=ON=1 # -anchor and -sticky N='n' S='s' W='w' E='e' NW='nw' SW='sw' NE='ne' SE='se' NS='ns' EW='ew' NSEW='nsew' CENTER='center' # -fill NONE='none' X='x' Y='y' BOTH='both' # -side LEFT='left' TOP='top' RIGHT='right' BOTTOM='bottom' # -relief RAISED='rai...
gpl-3.0
savoirfairelinux/odoo
openerp/addons/base/ir/ir_mail_server.py
38
25751
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011-2012 OpenERP S.A (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
boyuegame/kbengine
kbe/res/scripts/common/Lib/plistlib.py
84
31477
r"""plistlib.py -- a tool to generate and parse MacOSX .plist files. The property list (.plist) file format is a simple XML pickle supporting basic object types, like dictionaries, lists, numbers and strings. Usually the top level object is a dictionary. To write out a plist file, use the dump(value, file) function. ...
lgpl-3.0
Prasad9/incubator-mxnet
example/rnn/old/lstm.py
52
7972
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
timpalpant/calibre
src/cherrypy/lib/sessions.py
24
29818
"""Session implementation for CherryPy. You need to edit your config file to use sessions. Here's an example:: [/] tools.sessions.on = True tools.sessions.storage_type = "file" tools.sessions.storage_path = "/home/site/sessions" tools.sessions.timeout = 60 This sets the session to be stored in fi...
gpl-3.0
soutaro/nullarihyon
vendor/googletest/googletest/scripts/common.py
1180
2919
# Copyright 2013 Google Inc. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the foll...
mit
ran5515/DeepDecision
tensorflow/python/estimator/export/export_test.py
30
11069
# 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
marctc/django
django/contrib/auth/migrations/0001_initial.py
108
4524
# -*- coding: utf-8 -*- from __future__ import unicode_literals import django.contrib.auth.models from django.core import validators from django.db import migrations, models from django.utils import timezone class Migration(migrations.Migration): dependencies = [ ('contenttypes', '__first__'), ] ...
bsd-3-clause
sangwook236/SWDT
sw_dev/python/rnd/test/machine_learning/pytorch/pytorch_tensorboard.py
2
7004
#!/usr/bin/env python # -*- coding: UTF-8 -*- import numpy as np import torch import torchvision import torchvision.transforms as transforms import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torch.utils.tensorboard import SummaryWriter import matplotlib.pyplot as plt # REF [site] ...
gpl-3.0
Antiun/c2c-rd-addons
mrp_reopen/mrp.py
4
6731
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2012-2012 ChriCar Beteiligungs- und Beratungs- GmbH (<http://www.camptocamp.at>) # # Thi...
agpl-3.0
jinnykoo/christmas
tests/_site/apps/partner/migrations/0001_initial.py
138
6441
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import oscar.models.fields.autoslugfield import oscar.models.fields from django.conf import settings class Migration(migrations.Migration): dependencies = [ ('catalogue', '0001_initial'), ('a...
bsd-3-clause
ofermend/medicare-demo
socialite/jython/Lib/xml/parsers/expat.py
35
21998
# coding: utf-8 #------------------------------------------------------------------------------ # Copyright (c) 2008 Sébastien Boisgérault # # 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 w...
apache-2.0
sublee/lets
lets/jobqueue.py
1
3626
# -*- coding: utf-8 -*- """ lets.jobqueue ~~~~~~~~~~~~~ :copyright: (c) 2013-2018 by Heungsub Lee :license: BSD, see LICENSE for more details. """ import gevent import gevent.pool import gevent.queue __all__ = ['JobQueue'] class JobQueue(object): """Pool-like job queue. :param size: the queue...
bsd-3-clause
lepistone/odoo
addons/claim_from_delivery/__openerp__.py
172
1576
############################################################################## # # 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 GNU Affero General Public L...
agpl-3.0
jrowan/zulip
zerver/management/commands/export.py
1
5707
from __future__ import absolute_import from __future__ import print_function from typing import Any from argparse import ArgumentParser, RawTextHelpFormatter from django.core.management.base import BaseCommand, CommandError from django.core.exceptions import ValidationError import os import shutil import subprocess ...
apache-2.0
hzqst/Syscall-Monitor
ddimon/capstone/bindings/python/capstone/ppc_const.py
28
23906
# For Capstone Engine. AUTO-GENERATED FILE, DO NOT EDIT [ppc_const.py] # PPC branch codes for some branch instructions PPC_BC_INVALID = 0 PPC_BC_LT = (0<<5)|12 PPC_BC_LE = (1<<5)|4 PPC_BC_EQ = (2<<5)|12 PPC_BC_GE = (0<<5)|4 PPC_BC_GT = (1<<5)|12 PPC_BC_NE = (2<<5)|4 PPC_BC_UN = (3<<5)|12 PPC_BC_NU = (3<<5)|4 PPC_BC_S...
mit
KMK-ONLINE/ansible-modules-core
network/ios/ios_facts.py
4
13596
#!/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
CatsAndDogsbvba/odoo
addons/project/__openerp__.py
259
2562
# -*- 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
Southpaw-TACTIC/Team
src/python/Lib/site-packages/PySide/examples/widgets/scribble.py
1
10503
#!/usr/bin/env python ############################################################################* ## ## Copyright (C) 2005-2005 Trolltech AS. All rights reserved. ## ## This file is part of the example classes of the Qt Toolkit. ## ## This file may be used under the terms of the GNU General Public ## License version...
epl-1.0
drexly/tonginBlobStore
lib/django/template/base.py
26
39996
""" This is the Django template system. How it works: The Lexer.tokenize() function converts a template string (i.e., a string containing markup with custom template tags) to tokens, which can be either plain text (TOKEN_TEXT), variables (TOKEN_VAR) or block statements (TOKEN_BLOCK). The Parser() class takes a list ...
bsd-3-clause
meteorcloudy/tensorflow
tensorflow/python/ops/distributions/identity_bijector.py
18
1814
# 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
EmreAtes/spack
var/spack/repos/builtin/packages/elemental/package.py
1
10895
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
koehlma/uv
uv/handles/stream.py
1
18089
# -*- coding: utf-8 -*- # Copyright (C) 2016, Maximilian Köhl <mail@koehlma.de> # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License version 3 as published by # the Free Software Foundation. # # This program is distributed in the hope th...
lgpl-3.0
cpgoncalves/gameplayer
Example2.py
1
1131
# Carlos Pedro Gonçalves (2015), Game Theory with Python # Game Theory and Applied A.I. Classes # Instituto Superior de Ciências Sociais e Políticas (ISCSP) # University of Lisbon # cgoncalves@iscsp.ulisboa.pt # # Three Person's Prisonners' Dilemma Game # # For more details see the user manual that comes with the pack...
mit
newerthcom/savagerebirth
libs/python-2.72/Lib/distutils/tests/test_clean.py
95
1475
"""Tests for distutils.command.clean.""" import sys import os import unittest import getpass from distutils.command.clean import clean from distutils.tests import support from test.test_support import run_unittest class cleanTestCase(support.TempdirManager, support.LoggingSilencer, ...
gpl-2.0
citrix-openstack-build/neutron
neutron/services/vpn/service_drivers/__init__.py
4
1114
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013, Nachi Ueno, NTT I3, 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-2.0
asser/django
django/conf/locale/zh_Hans/formats.py
1008
1810
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'Y年n月j日' # 2016年9月5...
bsd-3-clause
psiq/gdsfactory
pp/tests/test_connect_bundle.py
1
5928
import pp from pp import Port from pp.routing.connect_bundle import connect_bundle def test_connect_bundle(): xs_top = [-100, -90, -80, 0, 10, 20, 40, 50, 80, 90, 100, 105, 110, 115] pitch = 127.0 N = len(xs_top) xs_bottom = [(i - N / 2) * pitch for i in range(N)] top_ports = [Port("top_{}".for...
mit
dreamhost/ceilometer
ceilometer/compute/manager.py
2
3043
# -*- encoding: utf-8 -*- # # Copyright © 2012-2013 eNovance <licensing@enovance.com> # # Author: Julien Danjou <julien@danjou.info> # # 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 # # h...
apache-2.0
michl/l10n-switzerland
l10n_ch_payment_slip_layouts/company.py
10
1133
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # Copyright 2015 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publi...
agpl-3.0
blackecho/Deep-Belief-Network
tests/test_utils.py
2
1374
import numpy as np import unittest import utils class TestUtilsMethods(unittest.TestCase): """ Test the utils method in the utils module. """ def setUp(self): """ Setup values for testing. """ self.v = 13 self.x = np.random.rand(39, 58) def test_masking_noise(self): ...
apache-2.0
Nu3001/external_chromium_org
chrome/test/webdriver/test/chromedriver_launcher.py
51
3008
# 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. """Launches and kills ChromeDriver. For ChromeDriver documentation, refer to: http://dev.chromium.org/developers/testing/webdriver-for-chrome """ imp...
bsd-3-clause
Code-In-Action/python-in-action
flask/todo-api/flask/lib/python3.6/site-packages/werkzeug/testapp.py
364
9396
# -*- coding: utf-8 -*- """ werkzeug.testapp ~~~~~~~~~~~~~~~~ Provide a small test application that can be used to test a WSGI server and check it for WSGI compliance. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ impo...
mit
huaweiswitch/neutron
neutron/plugins/ml2/drivers/cisco/nexus/exceptions.py
36
3102
# Copyright (c) 2013 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
apache-2.0
simonwydooghe/ansible
lib/ansible/modules/cloud/vmware/vcenter_extension.py
23
7306
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Michael Tipton <mike () ibeta.org> # 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'...
gpl-3.0
lesguillemets/termeet.py
termeet/pprinter.py
1
2881
#!/usr/bin/env python3 from textwrap import dedent import time import re from html.parser import unescape as usc from colors import prettify as p htmltag = re.compile(r'<[^>]+>') def pptweet(tweet): # FIXME : 140+letters after RT text = usc(tweet['text']) urls = tweet['entities']['urls'] for url in u...
mit
Testy14/blccoin
contrib/pyminer/pyminer.py
766
6434
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
mit
0Chencc/CTFCrackTools
Lib/Lib/platform.py
6
55923
#!/usr/bin/env python """ This module tries to retrieve as much platform-identifying data as possible. It makes this information available via function APIs. If called from the command line, it prints the platform information concatenated as single string to stdout. The output format is useable as par...
gpl-3.0
aldian/tensorflow
tensorflow/python/keras/_impl/keras/utils/conv_utils.py
35
2626
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
happyleavesaoc/home-assistant
homeassistant/components/notify/lannouncer.py
26
2596
""" Lannouncer platform for notify component. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.lannouncer/ """ import logging from urllib.parse import urlencode import socket import voluptuous as vol from homeassistant.components.notify import ( ...
apache-2.0
liuyisiyisi/django-cms
cms/south_migrations/0036_auto__add_field_cmsplugin_changed_date.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
Tejal011089/trufil-erpnext
erpnext/config/support.py
57
1628
from __future__ import unicode_literals from frappe import _ def get_data(): return [ { "label": _("Documents"), "icon": "icon-star", "items": [ { "type": "doctype", "name": "Issue", "description": _("Support queries from customers."), }, { "type": "doctype", "name": "W...
agpl-3.0
samuelhavron/heroku-buildpack-python
Python-3.4.3/Lib/pty.py
120
4763
"""Pseudo terminal utilities.""" # Bugs: No signal handling. Doesn't set slave termios and window size. # Only tested on Linux. # See: W. Richard Stevens. 1992. Advanced Programming in the # UNIX Environment. Chapter 19. # Author: Steen Lumholt -- with additions by Guido. from select import select imp...
mit
xbezdick/tempest
tempest/services/compute/json/availability_zone_client.py
6
1316
# Copyright 2013 NEC Corporation. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
apache-2.0
hellais/Adium-old
Utilities/AppcastReplaceItem.py
5
3173
#!/usr/bin/env python """ Usage: AppcastReplaceItem <path-to-appcast> <old-version> <new-version> <path-to-dmg> Example: AppcastReplaceItem appcast-release.xml 1.1.4 1.2 Release/build/Adium_1.2.dmg """ # Configurable variables. app_name = 'Adium' changelog_fmt = 'http://www.adium.im/changelogs/%(version)s.html' encl...
gpl-2.0
AndrewGrossman/django
tests/admin_filters/models.py
99
2009
from __future__ import unicode_literals from django.contrib.auth.models import User from django.contrib.contenttypes.fields import ( GenericForeignKey, GenericRelation, ) from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.encoding import python_2_unicode_compa...
bsd-3-clause
proversity-org/edx-platform
openedx/core/djangoapps/user_api/partition_schemes.py
22
4553
""" Provides partition support to the user service. """ import logging import random import course_tag.api as course_tag_api from eventtracking import tracker from xmodule.partitions.partitions import UserPartitionError, NoSuchUserPartitionGroupError log = logging.getLogger(__name__) class NotImplementedPartitionS...
agpl-3.0
MebiusHKU/flask-web
flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/latin1prober.py
1778
5232
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
bsd-3-clause
pixbuffer/django-cms
cms/migrations/0012_publisher.py
385
19523
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Dummy migration pass def backwards(self, orm): # Dummy migration pass models = { ...
bsd-3-clause
jolynch/mit-tab
mittab/libs/tab_logic/rankings.py
1
3520
from abc import ABC from functools import total_ordering from mittab.apps.tab.models import Debater, Team from mittab.libs.tab_logic.stats import * def rank_speakers(): return sorted([ DebaterScore(d) for d in Debater.objects.prefetch_related("team_set").all() ]) def rank_teams(): retur...
mit
lood339/CalibMe
python/extractVideoFrames.py
1
2118
# -*- coding: utf-8 -*- """ Created on Tue Sep 20 16:25:42 2016 @author: jimmy play video """ import numpy as np import cv2 import argparse import os parser = argparse.ArgumentParser() parser.add_argument('--video_file', type = str, required = True) parser.add_argument('--start_frame', type = int, required = True) ...
bsd-2-clause
BellScurry/gem5-fault-injection
src/arch/power/PowerInterrupts.py
69
1719
# Copyright (c) 2011 Google # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list of conditions and the following dis...
bsd-3-clause
halvertoluke/edx-platform
common/lib/xmodule/xmodule/modulestore/xml_importer.py
28
48160
""" Each store has slightly different semantics wrt draft v published. XML doesn't officially recognize draft but does hold it in a subdir. Old mongo has a virtual but not physical draft for every unit in published state. Split mongo has a physical for every unit in every state. Given that, here's a table of semantics...
agpl-3.0