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
kangye1014/python_practice
base_syntax/threads/threadwithmodual.py
1
1997
#!/usr/bin/python # -*- coding: UTF-8 -*- # added by kangye, dependent on python27 import threading import time ''' Python通过两个标准库thread和threading提供对线程的支持。thread提供了低级别的、原始的线程以及一个简单的锁。 thread 模块提供的其他方法: threading.currentThread(): 返回当前的线程变量。 threading.enumerate(): 返回一个包含正在运行的线程的list。正在运行指线程启动后、结束前,不包括启动前和终止后的线程。 threadi...
apache-2.0
ramadhane/odoo
addons/l10n_be_invoice_bba/invoice.py
141
12671
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # i...
agpl-3.0
valexandersaulys/prudential_insurance_kaggle
venv/lib/python2.7/site-packages/pip/_vendor/distlib/metadata.py
427
38314
# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Implementation of the Metadata for Python packages PEPs. Supports all metadata formats (1.0, 1.1, 1.2, and 2.0 experimental). """ from __future__ import unicode_literals import codecs from email...
gpl-2.0
BorisJeremic/Real-ESSI-Examples
education_examples/_Chapter_Material_Behaviour_Examples/Interface_Models/Axial_Models/SoftContact/ForceBasedSoftContact/plot.py
1
1421
#!/usr/bin/python import h5py import matplotlib.pylab as plt import matplotlib as mpl import sys import numpy as np; plt.rcParams.update({'font.size': 24}) # set tick width mpl.rcParams['xtick.major.size'] = 10 mpl.rcParams['xtick.major.width'] = 5 mpl.rcParams['xtick.minor.size'] = 10 mpl.rcParams['xtick.minor.width...
cc0-1.0
crossbridge-community/avmplus
gtest/gtest-1.6.0/test/gtest_catch_exceptions_test.py
414
9312
#!/usr/bin/env python # # Copyright 2010 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 o...
mpl-2.0
thnuclub/elasticsearch
dev-tools/upgrade-tests.py
74
15347
# Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except...
apache-2.0
mandeepdhami/neutron
neutron/tests/unit/db/test_l3_hamode_db.py
4
23255
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicabl...
apache-2.0
alxgu/ansible
lib/ansible/modules/web_infrastructure/jenkins_job.py
39
11412
#!/usr/bin/python # # Copyright: (c) 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': ['previe...
gpl-3.0
GoogleChromeLabs/chromeos_smart_card_connector
third_party/googletest/src/googletest/test/googletest-setuptestsuite-test.py
23
2244
#!/usr/bin/env python # # Copyright 2019, 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...
apache-2.0
mollstam/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Scrapy-1.0.1/scrapy/utils/signal.py
18
2931
"""Helper functions for working with signals""" import logging from twisted.internet.defer import maybeDeferred, DeferredList, Deferred from twisted.python.failure import Failure from scrapy.xlib.pydispatch.dispatcher import Any, Anonymous, liveReceivers, \ getAllReceivers, disconnect from scrapy.xlib.pydispatch...
mit
waylan/rheostatic
rheostatic/utils.py
1
6618
""" Rheostatic - A Static File Server with options. MIT License Copyright (c) 2016 Waylan Limberg 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 limitatio...
mit
mancoast/CPythonPyc_test
cpython/232_test_richcmp.py
9
11493
# Tests for rich comparisons import unittest from test import test_support import operator class Number: def __init__(self, x): self.x = x def __lt__(self, other): return self.x < other def __le__(self, other): return self.x <= other def __eq__(self, other): return...
gpl-3.0
fafaman/django
tests/queryset_pickle/tests.py
209
6081
from __future__ import unicode_literals import datetime import pickle import unittest import warnings from django.test import TestCase from django.utils import six from django.utils.encoding import force_text from django.utils.version import get_version from .models import Container, Event, Group, Happening, M2MMode...
bsd-3-clause
SomethingExplosive/android_external_chromium_org
tools/perf/measurements/page_cycler.py
23
5337
# 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. """The page cycler measurement. This measurement registers a window load handler in which is forces a layout and then records the value of performance.n...
bsd-3-clause
jalilm/ryu
ryu/controller/ofp_event.py
33
2338
# Copyright (C) 2012 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp> # # 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://...
apache-2.0
ArcherSys/ArcherSys
Lib/base64.py
1
60641
<<<<<<< HEAD <<<<<<< HEAD #! /usr/bin/env python3 """Base16, Base32, Base64 (RFC 3548), Base85 and Ascii85 data encodings""" # Modified 04-Oct-1995 by Jack Jansen to use binascii module # Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support # Modified 22-May-2007 by Guido van Rossum to use bytes everywhe...
mit
kawamon/hue
desktop/core/ext-py/billiard-3.5.0.5/billiard/dummy/connection.py
12
2954
# # 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...
apache-2.0
python-rope/rope
ropetest/refactor/usefunctiontest.py
3
5142
try: import unittest2 as unittest except ImportError: import unittest from rope.base import exceptions from ropetest import testutils from rope.refactor.usefunction import UseFunction class UseFunctionTest(unittest.TestCase): def setUp(self): super(UseFunctionTest, self).setUp() self.pro...
lgpl-3.0
laszlocsomor/tensorflow
tensorflow/python/kernel_tests/random/random_gamma_test.py
112
10741
# 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
jayceyxc/hue
desktop/core/ext-py/simplejson/simplejson/tests/test_scanstring.py
125
3835
import sys import decimal from unittest import TestCase import simplejson as json import simplejson.decoder class TestScanString(TestCase): def test_py_scanstring(self): self._test_scanstring(simplejson.decoder.py_scanstring) def test_c_scanstring(self): if not simplejson.decoder.c_scanstring...
apache-2.0
michalkurka/h2o-3
h2o-py/tests/testdir_algos/automl/pyunit_automl_reruns.py
2
10484
from __future__ import print_function import os import sys sys.path.insert(1, os.path.join("..","..","..")) import h2o from tests import pyunit_utils as pu from h2o.automl import H2OAutoML max_models = 5 def import_dataset(): df = h2o.import_file(path=pu.locate("smalldata/prostate/prostate.csv")) target = ...
apache-2.0
knnniggett/weewx
bin/daemon.py
13
2886
# -*- coding: iso-8859-1 -*- # # Copyright (c) 2009-2015 Tom Keffer <tkeffer@gmail.com> # # See the file LICENSE.txt for your full rights. # ''' This module is used to fork the current process into a daemon. Almost none of this is necessary (or advisable) if your daemon is being started by inetd. In t...
gpl-3.0
agry/NGECore2
scripts/mobiles/endor/blood_frenzied_boar_wolf.py
2
1487
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate...
lgpl-3.0
romain-dartigues/ansible
lib/ansible/modules/utilities/logic/set_fact.py
6
3231
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2013, Dag Wieers (@dagwieers) <dag@wieers.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_v...
gpl-3.0
akhilesh-k/Intelligent-Alarm
mat alarm/raspberrypi.py
3
2014
import RPi.GPIO as GPIO import os from gpiozero import Buzzer from time import sleep from flask import Flask,render_template.url_for,request GPIO.setmode(GPIO.BCM) but1=15 but2=16 but3=22 but4=19 led1=10 led2=11 led3=12 led4=13 buz=Buzzer(40) GPIO.setup(int(buz),GPIO.OUT) GPIO.setup(int(but1),GPIO.IN,pu...
mit
trik/djangae
djangae/wsgi.py
4
2260
from djangae.utils import on_production def fix_c_whitelist(): from google.appengine.tools.devappserver2.python import sandbox if '_sqlite3' not in sandbox._WHITE_LIST_C_MODULES: sandbox._WHITE_LIST_C_MODULES.extend([ '_sqlite3', '_ssl', # Workaround for App Engine bug #9246 ...
bsd-3-clause
mellanox-openstack/vsa
src/vsa/infra/infra.py
1
7884
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 Mellanox Technologies, Ltd # # 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
bjesus/wagtail
wagtail/wagtailsearch/views/frontend.py
12
2871
import json from django.conf import settings from django.shortcuts import render from django.http import HttpResponse from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from wagtail.wagtailcore import models from wagtail.wagtailsearch.models import Query def search( request, te...
bsd-3-clause
benchisell/photostream-bc
flask/lib/python2.7/site-packages/jinja2/testsuite/core_tags.py
412
11858
# -*- coding: utf-8 -*- """ jinja2.testsuite.core_tags ~~~~~~~~~~~~~~~~~~~~~~~~~~ Test the core tags like for and if. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import unittest from jinja2.testsuite import JinjaTestCase from jinja2 import Environment...
bsd-3-clause
ChristianKniep/QNIB
serverfiles/usr/local/lib/networkx-1.6/networkx/readwrite/p2g.py
76
3279
""" This module provides the following: read and write of p2g format used in metabolic pathway studies. See http://www.cs.purdue.edu/homes/koyuturk/pathway/ for a description. The summary is included here: A file that describes a uniquely labeled graph (with extension ".gr") format looks like the following: name ...
gpl-2.0
krdlab/ansible-modules-core
system/hostname.py
5
19910
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Hiroaki Nakamura <hnakamur@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...
gpl-3.0
jaantollander/Legendre
src/plotting/animate_series.py
4
2747
# coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import matplotlib.animation as animation import matplotlib.pyplot as plt import numpy as np import seaborn from src.fourier_series import piecewise_analyt...
mit
SYNHAK/spiff
spiff/donations/migrations/0001_initial.py
1
7321
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Donation' db.create_table(u'donations_donation', ( ...
agpl-3.0
wargo32/Polcoin
qa/rpc-tests/mempool_coinbase_spends.py
125
3785
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Test re-org scenarios with a mempool that contains transactions # that spend (directly or indirectly) coin...
mit
aiguofer/bokeh
tests/integration/plotting/test_plot_fill_properties.py
5
2085
from __future__ import absolute_import import io import os from jinja2 import Template from bokeh.util.string import decode_utf8 from bokeh.embed import file_html from bokeh.models import Plot, Range1d, Circle, LinearAxis from bokeh.resources import INLINE from tests.integration.utils import has_no_console_errors i...
bsd-3-clause
gizeminci/espresso-1
samples/python/hello_parallel_world.py
13
1767
# # Copyright (C) 2013,2014 The ESPResSo project # # This file is part of ESPResSo. # # ESPResSo 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 l...
gpl-3.0
Sing-Li/go-buildpack
builds/runtimes/python-2.7.6/lib/python2.7/ftplib.py
57
36966
"""An FTP client class and some helper functions. Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Reynolds Example: >>> from ftplib import FTP >>> ftp = FTP('ftp.python.org') # connect to host, default port >>> ftp.login() # default, i.e.: user anonymous, passwd anonymous@ '230 Guest login ok, ac...
mit
albertomurillo/ansible
lib/ansible/modules/cloud/vmware/vmware_host_acceptance.py
48
6958
#!/usr/bin/python # -*- coding: utf-8 -*- # 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 __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadat...
gpl-3.0
Ravenm/2143-OOP-NASH
python3env/Lib/site-packages/PIL/_binary.py
58
1408
# # The Python Imaging Library. # $Id$ # # Binary input/output support routines. # # Copyright (c) 1997-2003 by Secret Labs AB # Copyright (c) 1995-2003 by Fredrik Lundh # Copyright (c) 2012 by Brian Crowell # # See the README file for information on usage and redistribution. # from struct import unpack, pack if byte...
cc0-1.0
gorjuce/odoo
addons/hw_scanner/__openerp__.py
220
1738
# -*- 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
blakev/suds
suds/sax/date.py
160
10456
# This program is free software; you can redistribute it and/or modify # it under the terms of the (LGPL) GNU Lesser 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 distributed in the hope that it will ...
lgpl-3.0
JakeBrand/CMPUT410-E6
v1/lib/python2.7/site-packages/django/contrib/auth/urls.py
113
1203
# The views used below are normally mapped in django.contrib.admin.urls.py # This URLs file is used to provide a reliable view deployment for test purposes. # It is also provided as a convenience to those who want to deploy these URLs # elsewhere. from django.conf.urls import patterns, url urlpatterns = patterns('', ...
apache-2.0
watspidererik/testenv
flask/lib/python2.7/site-packages/werkzeug/testsuite/urls.py
145
15382
# -*- coding: utf-8 -*- """ werkzeug.testsuite.urls ~~~~~~~~~~~~~~~~~~~~~~~ URL helper tests. :copyright: (c) 2014 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import unittest from werkzeug.testsuite import WerkzeugTestCase from werkzeug.datastructures import OrderedMultiD...
mit
spookylukey/django-paypal
paypal/pro/helpers.py
3
12559
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import logging import pprint import time import requests from django.conf import settings from django.forms.models import fields_for_model from django.http import QueryDict from django.utils import timezone from djan...
mit
prodromou87/gem5
src/arch/x86/isa/insts/general_purpose/rotate_and_shift/__init__.py
91
2283
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
stuart-warren/kubernetes
cluster/juju/charms/trusty/kubernetes-master/unit_tests/test_install.py
145
4106
#!/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
2uller/LotF
App/Lib/site-packages/PIL/PdfImagePlugin.py
40
5558
# # The Python Imaging Library. # $Id$ # # PDF (Acrobat) file handling # # History: # 1996-07-16 fl Created # 1997-01-18 fl Fixed header # 2004-02-21 fl Fixes for 1/L/CMYK images, etc. # 2004-02-24 fl Fixes for 1 and P images. # # Copyright (c) 1997-2004 by Secret Labs AB. All rights reserved. # Copyright (c) ...
gpl-2.0
Erve1879/feedjack
feedjack/admin.py
6
1387
# -*- coding: utf-8 -*- """ feedjack Gustavo Picón admin.py """ from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from feedjack import models class LinkAdmin(admin.ModelAdmin): pass class SiteAdmin(admin.ModelAdmin): list_display = ('url', 'name') filter_vertic...
bsd-3-clause
Bitl/RBXLegacy-src
Cut/RBXLegacyDiscordBot/lib/cffi/api.py
19
39647
import sys, types from .lock import allocate_lock from .error import CDefError from . import model try: callable except NameError: # Python 3.1 from collections import Callable callable = lambda x: isinstance(x, Callable) try: basestring except NameError: # Python 3.x basestring = str c...
gpl-3.0
onelife/rt-thread
bsp/stm32/stm32f407-realtouch/rtconfig.py
1
1862
import os BUILD = 'debug' # toolchains options ARCH='arm' CPU='cortex-m4' CROSS_TOOL='gcc' # bsp lib config BSP_LIBRARY_TYPE = None if os.getenv('RTT_CC'): CROSS_TOOL = os.getenv('RTT_CC') if os.getenv('RTT_ROOT'): RTT_ROOT = os.getenv('RTT_ROOT') # cross_tool provides the cross compiler # EXEC_PATH is the...
gpl-2.0
furgerf/kaggle-projects
cancer/tf_network.py
1
1220
import tensorflow as tf class TfNetwork(object): def __init__(self, dimensionality): """ Creates a new TfNetwork. Note that it is apparently required to define variables W and b even if they'll be later restored from a previous session. dimensionality: (int) Number of dimensions (features) for the ...
apache-2.0
turbulenz/gyp
pylib/gyp/easy_xml.py
12
5182
# Copyright (c) 2011 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import re import os import locale import sys try: # reduce moved to functools in python3. reduce except NameError: from functools import reduce def XmlToSt...
bsd-3-clause
hgl888/chromium-crosswalk-efl
tools/perf/page_sets/tough_scrolling_cases.py
33
1471
# 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. from telemetry.page import page as page_module from telemetry.page import page_set as page_set_module class ToughScrollingCasesPage(page_module.Page): de...
bsd-3-clause
roderickm/textfsm
texttable.py
1
32239
#!/usr/bin/python2.6 # # Copyright 2012 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 require...
apache-2.0
noroutine/ansible
lib/ansible/modules/cloud/azure/azure_rm_securitygroup.py
2
27566
#!/usr/bin/python # # Copyright (c) 2016 Matt Davis, <mdavis@ansible.com> # Chris Houseknecht, <house@redhat.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 ANS...
gpl-3.0
caisq/tensorflow
tensorflow/python/platform/app.py
23
3660
# 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
ToonTownInfiniteRepo/ToontownInfinite
toontown/toon/DistributedBankerMgr.py
1
6690
from direct.gui.DirectGui import * from pandac.PandaModules import * from toontown.toonbase.ToontownGlobals import * from toontown.toonbase.ToonBaseGlobal import * from pandac.PandaModules import * from direct.interval.IntervalGlobal import * from direct.distributed.ClockDelta import * from toontown.toonbase import Too...
mit
adamtiger/tensorflow
tensorflow/python/estimator/inputs/queues/feeding_functions_test.py
59
13552
# 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
iglpdc/nipype
nipype/interfaces/freesurfer/tests/test_utils.py
6
7427
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: import os from tempfile import mkdtemp from shutil import rmtree import numpy as np import nibabel as nif from nipype.testing import (assert_equal, assert_not_equal, assert_ra...
bsd-3-clause
zvolsky/muzika
languages/zh.py
152
10080
# coding: utf8 { '!langcode!': 'zh-tw', '!langname!': '中文', '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"更新" 是選擇性的條件式, 格式就像 "欄位1=\'值\'". 但是 JOIN 的資料不可以使用 update 或是 delete"', '%s %%{row} deleted': '已刪除 %s 筆', '%s %%{row} updated': '已更新 %s 筆', '%s s...
agpl-3.0
alexanderturner/ansible
lib/ansible/modules/cloud/univention/udm_group.py
21
5387
#!/usr/bin/python # -*- coding: UTF-8 -*- # Copyright (c) 2016, Adfinis SyGroup AG # Tobias Rueetschi <tobias.ruetschi@adfinis-sygroup.ch> # # 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 Fr...
gpl-3.0
venediktov/vanilla-rtb
examples/bidder/generator/ico.py
1
2403
import random max_campaigns = 100 required = {'ref': ['www.coinbase.com'], 'size': [300, 100], 'campaigns': []} domain_list = ['www.coinbase.com', 'www.coindesk.com' , 'www.cointelegraph.com', 'www.coinmarketcap.com'] ico_domains = [] for n, ref in enumerate(domain_list): ico_domains.append([ref, n]) file = o...
gpl-3.0
se4u/pylearn2
pylearn2/gui/graph_2D.py
28
4942
""" Classes for making simple 2D visualizations. """ import numpy as N from theano.compat.six.moves import xrange from theano import config class Graph2D(object): """ A class for plotting simple graphs in two dimensions. Parameters ---------- shape : tuple The shape of the display of the ...
bsd-3-clause
singingwolfboy/oauthlib
oauthlib/oauth2/rfc6749/clients/mobile_application.py
85
8793
# -*- coding: utf-8 -*- """ oauthlib.oauth2.rfc6749 ~~~~~~~~~~~~~~~~~~~~~~~ This module is an implementation of various logic needed for consuming and providing OAuth 2.0 RFC6749. """ from __future__ import absolute_import, unicode_literals from .base import Client from ..parameters import prepare_grant_uri from ..pa...
bsd-3-clause
yashsharan/sympy
sympy/sets/sets.py
5
63689
from __future__ import print_function, division from itertools import product from sympy.core.sympify import (_sympify, sympify, converter, SympifyError) from sympy.core.basic import Basic from sympy.core.expr import Expr from sympy.core.singleton import Singleton, S from sympy.core.evalf import EvalfMixin from s...
bsd-3-clause
apache/airflow
airflow/kubernetes/volume.py
2
1156
# # 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...
apache-2.0
FlipperPA/wagtail
wagtail/tests/testapp/migrations/0042_simplechildpage_simpleparentpage.py
17
1179
# Generated by Django 2.1.7 on 2019-03-15 10:39 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('wagtailcore', '0041_group_collection_permissions_verbose_name_plural'), ('tests', '0041_secretpage'), ] ope...
bsd-3-clause
Tesora-Release/tesora-horizon
openstack_dashboard/dashboards/admin/instances/views.py
18
7798
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 OpenStack Foundation # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use t...
apache-2.0
chain/chain
vendor/github.com/facebook/rocksdb/tools/write_stress_runner.py
42
2296
#! /usr/bin/env python import subprocess import argparse import random import time import sys def generate_runtimes(total_runtime): # combination of short runtimes and long runtimes, with heavier # weight on short runtimes possible_runtimes_sec = range(1, 10) + range(1, 20) + [100, 1000] runtimes = []...
agpl-3.0
NCI-Cloud/horizon
openstack_dashboard/dashboards/project/vpn/tests.py
22
33688
# Copyright 2013, Mirantis 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 law or agre...
apache-2.0
dharmabumstead/ansible
lib/ansible/module_utils/six/__init__.py
60
31144
# This code is strewn with things that are not defined on Python3 (unicode, # long, etc) but they are all shielded by version checks. This is also an # upstream vendored file that we're not going to modify on our own # pylint: disable=undefined-variable # Copyright (c) 2010-2017 Benjamin Peterson # # Permission is he...
gpl-3.0
marianosimone/listal-widgets
listal.py
1
2180
from bs4 import BeautifulSoup from urllib.request import urlopen import re _image_finder = re.compile(r"img src='(.*)'") _statuses = { 'Yes': 'used', 'Using': 'using', 'No': 'unused', 'used': 'Yes', 'using': 'Using', 'unused': 'No', '': 'unused' } _status = { 'books': { 'want...
unlicense
adminneyk/codificacionproyectando
application/views/Generacion/Generacion/lib/openoffice/openoffice.org/basis3.4/program/python-core-2.6.1/lib/lib-tk/ScrolledText.py
20
1638
# A ScrolledText widget feels like a text widget but also has a # vertical scroll bar on its right. (Later, options may be added to # add a horizontal bar as well, to make the bars disappear # automatically when not needed, to move them to the other side of the # window, etc.) # # Configuration options are passed to t...
mit
StructuralNeurobiologyLab/SyConnFS
syconnfs/representations/connectivity_helper.py
1
4439
import numpy as np import super_segmentation as ss import segmentation import connectivity def extract_connectivity_thread(args): sj_obj_ids = args[0] sj_version = args[1] ssd_version = args[2] working_dir = args[3] ssd = ss.SuperSegmentationDataset(working_dir, ...
gpl-2.0
pjh5/nml502_spring2016
porter_stemmer.py
3
12210
#!/usr/bin/env python """Porter Stemming Algorithm This is the Porter stemming algorithm, ported to Python from the version coded up in ANSI C by the author. It may be be regarded as canonical, in that it follows the algorithm presented in Porter, 1980, An algorithm for suffix stripping, Program, Vol. 14, no. 3, pp 1...
mit
michelts/lettuce
tests/integration/lib/Django-1.3/tests/modeltests/m2m_through/tests.py
90
12896
from datetime import datetime from operator import attrgetter from django.test import TestCase from models import Person, Group, Membership, CustomMembership, \ TestNoDefaultsOrNulls, PersonSelfRefM2M, Friendship class M2mThroughTests(TestCase): def setUp(self): self.bob = Person.objects.create(name...
gpl-3.0
Metallice/android_kernel_samsung_espressowifi
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
yqm/sl4a
python/gdata/tests/atom_tests/service_test.py
89
6868
#!/usr/bin/python # # Copyright (C) 2006 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 law ...
apache-2.0
dfang/odoo
addons/sale_stock/models/account_invoice.py
15
2982
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import fields, models class AccountInvoice(models.Model): _inherit = 'account.invoice' incoterms_id = fields.Many2one('stock.incoterms', string="Incoterms", help="Incoterms are series of sale...
agpl-3.0
akash1808/nova_test_latest
nova/tests/unit/api/openstack/compute/contrib/test_availability_zone.py
33
15688
# Copyright 2012 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 agreed t...
apache-2.0
caphrim007/ansible
lib/ansible/plugins/strategy/free.py
8
13129
# (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
nan86150/ImageFusion
lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/cp949prober.py
2801
1782
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
mit
JFriel/honours_project
venv/lib/python2.7/site-packages/nltk/sem/chat80.py
7
25797
# Natural Language Toolkit: Chat-80 KB Reader # See http://www.w3.org/TR/swbp-skos-core-guide/ # # Copyright (C) 2001-2016 NLTK Project # Author: Ewan Klein <ewan@inf.ed.ac.uk>, # URL: <http://nltk.sourceforge.net> # For license information, see LICENSE.TXT """ Overview ======== Chat-80 was a natural language system ...
gpl-3.0
adlius/osf.io
api_tests/registrations/filters/test_filters.py
6
5027
# -*- coding: utf-8 -*- from nose.tools import * # noqa: from osf.models import Node, Registration from framework.auth.core import Auth from osf_tests.factories import ( AuthUserFactory, NodeFactory, ProjectFactory, RegistrationFactory, ) class RegistrationListFilteringMixin(object): def setUp(...
apache-2.0
AleksNeStu/ggrc-core
test/selenium/src/lib/constants/objects.py
1
3523
# Copyright (C) 2017 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Constants and methods for work with objects.""" import sys # objects PROGRAMS = "programs" WORKFLOWS = "workflows" AUDITS = "audits" ASSESSMENTS = "assessments" ASSESSMENT_TEMPLATES = "assessment_templa...
apache-2.0
corradio/electricitymap
parsers/CH.py
1
2907
#!/usr/bin/env python3 import arrow from . import ENTSOE import logging import requests def fetch_swiss_exchanges(session, target_datetime, logger): """Returns the total exchanges of Switzerland with its neighboring countries.""" swiss_transmissions = {} for exchange_key in ['AT', 'DE', 'IT', 'FR']: ...
gpl-3.0
indhub/mxnet
example/reinforcement-learning/parallel_actor_critic/envs.py
52
1875
# 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
vng/omim
3party/freetype/src/tools/glnames.py
165
105237
#!/usr/bin/env python # # # FreeType 2 glyph name builder # # Copyright 1996-2015 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, # and distributed under the terms of the FreeType project license, # LICENSE.TXT. By continuing to u...
apache-2.0
openfun/edx-platform
pavelib/paver_tests/test_jshint.py
130
1694
""" Tests for paver quality tasks """ import unittest from mock import patch import pavelib.quality from paver.easy import BuildFailure class TestPaverJsHint(unittest.TestCase): """ For testing run_jshint """ def setUp(self): super(TestPaverJsHint, self).setUp() # Mock the paver @ne...
agpl-3.0
edmond-chhung/linkchecker
linkcheck/director/interrupt.py
9
1819
# -*- coding: iso-8859-1 -*- # Copyright (C) 2006-2014 Bastian Kleineidam # # 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 versi...
gpl-2.0
lichuan261/wuand
XX-Net/python27/1.0/lib/pprint.py
71
11777
# Author: Fred L. Drake, Jr. # fdrake@acm.org # # This is a simple little module I wrote to make life easier. I didn't # see anything quite like it in the library, though I may have overlooked # something. I wrote this when I was trying to read some heavily nested # tuples with fairly non-desc...
gpl-2.0
johnnymo87/simple-db-migrate
tests/config_test.py
1
11813
import os import unittest from simple_db_migrate.config import Config, FileConfig class ConfigTest(unittest.TestCase): def test_it_should_parse_migrations_dir_with_one_relative_dir(self): dirs = Config._parse_migrations_dir('.') self.assertEqual(1, len(dirs)) self.assertEqual(os.path.abspa...
apache-2.0
mdeemer/XlsxWriter
xlsxwriter/test/comparison/test_chart_data_labels18.py
8
1837
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
bsd-2-clause
rhiever/bokeh
bokeh/sphinxext/collapsible_code_block.py
43
3128
""" Display code blocks in collapsible sections when outputting to HTML. Usage ----- This directive takes a heading to use for the collapsible code block:: .. collapsible-code-block:: python :heading: Some Code from __future__ import print_function print("Hello, Bokeh!") Options ------...
bsd-3-clause
admcrae/tensorflow
tensorflow/contrib/learn/python/learn/estimators/rnn_common.py
27
12727
# 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
BruceDai/crosswalk-test-suite
webapi/tct-csp-w3c-tests/csp-py/csp_sandbox_empty_inline-manual.py
30
2574
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0]) _CSP = "sandbox " respons...
bsd-3-clause
avedaee/DIRAC
Core/scripts/dirac-admin-bdii-cluster.py
1
1471
#! /usr/bin/env python ######################################################################## # $HeadURL$ # File : dirac-admin-bdii-cluster # Author : Adria Casajus ######################################################################## """ Check info on BDII for Cluster """ __RCSID__ = "$Id$" from DIRAC.Core...
gpl-3.0
gurneyalex/OpenUpgrade
addons/base_iban/__openerp__.py
125
1768
# -*- 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
valentin-krasontovitsch/ansible
lib/ansible/plugins/action/bigip.py
37
4448
# # (c) 2016 Red Hat Inc. # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is d...
gpl-3.0
CarlFK/steve
steve/util.py
1
15762
####################################################################### # This file is part of steve. # # Copyright (C) 2012-2014 Will Kahn-Greene # Licensed under the Simplified BSD License. See LICENSE for full # license. ####################################################################### import argparse import ...
bsd-2-clause