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
ianzhengnan/learnpy
task_master.py
1
1106
import random, time, queue from multiprocessing.managers import BaseManager from multiprocessing import freeze_support task_queue = queue.Queue() result_queue = queue.Queue() class QueueManager(BaseManager): pass def return_task_queue(): global task_queue return task_queue def return...
apache-2.0
9kopb/django-easy-maps
easy_maps/migrations/0005_auto__add_unique_address_address.py
3
1806
# -*- 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): # Removing index on 'Address', fields ['address'] if db.backend_name != 'sqlite3': # South forg...
mit
eddo888/Tools
parser.py
1
15876
#!/usr/bin/env python2 # $Date$ # $Revision$ # $Author$ # $HeadURL$ # $Id$ import sys, re, os import xml.parsers.expat from xml.dom import minidom from Tools.pretty import * from Tools.colours import Colours tokens = [ ['&amp;' , '####amp####'], ['&' , '&amp;'], ['<' , '&lt;'], ['>' , '&gt;'], ...
mit
chenjun0210/tensorflow
tensorflow/contrib/cudnn_rnn/__init__.py
54
1524
# 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
mozilla-b2g/fxos-certsuite
mcts/web-platform-tests/tests/tools/wptserve/tests/functional/base.py
293
1831
import base64 import logging import os import unittest import urllib import urllib2 import urlparse import wptserve logging.basicConfig() here = os.path.split(__file__)[0] doc_root = os.path.join(here, "docroot") class Request(urllib2.Request): def __init__(self, *args, **kwargs): urllib2.Request.__init...
mpl-2.0
hanwenyan/ud858
Lesson_4/00_Conference_Central/conference.py
35
3749
#!/usr/bin/env python """ conference.py -- Udacity conference server-side Python App Engine API; uses Google Cloud Endpoints $Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $ created by wesc on 2014 apr 21 """ __author__ = 'wesc+api@google.com (Wesley Chun)' from datetime import datetime import ...
gpl-3.0
bminchew/PySAR
pysar/insar/sarcorrelation.py
1
4976
#!/usr/bin/env python """ sarcorrelation.py : Calculates interferometric correlation usage:: $ sarcorrelation.py int_file amp_input [options] Parameters ---------- int_file : complex interferogram file amp_input : amplitude file(s); one of: -a bip_amp...
gpl-3.0
liuqr/edx-xiaodun
lms/djangoapps/psychometrics/models.py
38
2026
# # db model for psychometrics data # # this data is collected in real time # from django.db import models from courseware.models import StudentModule class PsychometricData(models.Model): """ This data is a table linking student, module, and module performance, including number of attempts, grade, max g...
agpl-3.0
moksha11/xen-hv
dist/install/usr/lib64/python2.6/site-packages/xen/util/utils.py
43
1937
import traceback import sys import os def exception_string(e): (ty,v,tb) = sys.exc_info() return traceback.format_exception_only(ty,v) def daemonize(prog, args, stdin_tmpfile=None): """Runs a program as a daemon with the list of arguments. Returns the PID of the daemonized program, or returns...
gpl-2.0
andreafrittoli/testtracker
testtracker/ttracker/models.py
2
2984
# This is an auto-generated Django model module. # You'll have to do the following manually to clean this up: # * Rearrange models' order # * Make sure each model has one field with primary_key=True # * Remove `managed = False` lines if you wish to allow Django to create, modify, and delete the table # Feel free ...
gpl-2.0
shdxiang/yunba-smartoffice
tests/get_status.py
2
1501
#!/usr/bin/env python import time import sys import logging import argparse from socketIO_client import SocketIO from messenger import Messenger logger = logging.getLogger('get_status') logging.basicConfig(level=logging.DEBUG) APPKEY = '5697113d4407a3cd028abead' #TOPIC = 'yunba_smart_plug' #ALIAS = 'plc_0' class St...
mit
calfonso/ansible
lib/ansible/modules/web_infrastructure/django_manage.py
22
11134
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Scott Anderson <scottanderson42@gmail.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': ...
gpl-3.0
ganeshmurthy/qpid-dispatch
python/qpid_dispatch_internal/tools/__init__.py
7
1221
# # 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
dlab-berkeley/collaboratool-archive
bsd2/vagrant-ansible/ansible/lib/ansible/runner/action_plugins/debug.py
2
1760
# Copyright 2012, Dag Wieers <dag@wieers.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) any later versi...
apache-2.0
embeddedarm/android_external_chromium_org
third_party/android_platform/development/scripts/stack_core.py
50
9531
#!/usr/bin/env python # # Copyright (C) 2013 The Android Open Source Project # # 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 req...
bsd-3-clause
hfp/tensorflow-xsmm
tensorflow/python/ops/functional_ops.py
3
44679
# 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
bluecoiner/bluecoin-new
qa/rpc-tests/disablewallet.py
102
1820
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # # Exercise API with -disablewallet. # from test_framework.test_framework import BitcoinTestFramework f...
mit
rockyzhang/zhangyanhit-python-for-android-mips
python3-alpha/python3-src/Lib/email/test/test_email_torture.py
85
3657
# Copyright (C) 2002-2004 Python Software Foundation # # A torture test of the email package. This should not be run as part of the # standard Python test suite since it requires several meg of email messages # collected in the wild. These source messages are not checked into the # Python distro, but are available as...
apache-2.0
ep1cman/workload-automation
wlauto/tests/test_instrumentation.py
5
7244
# Copyright 2013-2015 ARM Limited # # 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 w...
apache-2.0
salamer/django
django/contrib/gis/geoip/prototypes.py
535
3943
from ctypes import POINTER, Structure, c_char_p, c_float, c_int, string_at from django.contrib.gis.geoip.libgeoip import free, lgeoip # #### GeoIP C Structure definitions #### class GeoIPRecord(Structure): _fields_ = [('country_code', c_char_p), ('country_code3', c_char_p), ('cou...
bsd-3-clause
damienmg/bazel
third_party/def_parser/def_parser_test.py
17
4087
# Copyright 2017 The Bazel 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 applicable la...
apache-2.0
arnavd96/Cinemiezer
myvenv/lib/python3.4/site-packages/boto/services/result.py
153
5596
#!/usr/bin/env python # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rig...
mit
psychotechnik/mycv
mycv/apps/projects/migrations/0013_auto__add_field_skill_applicant__add_field_client_applicant__add_field.py
1
12221
# -*- 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 field 'Skill.applicant' db.add_column(u'projects_skill', 'applic...
gpl-2.0
2013Commons/hue
desktop/core/ext-py/Django-1.4.5/docs/_ext/applyxrefs.py
143
2148
"""Adds xref targets to the top of files.""" import sys import os testing = False DONT_TOUCH = ( './index.txt', ) def target_name(fn): if fn.endswith('.txt'): fn = fn[:-4] return '_' + fn.lstrip('./').replace('/', '-') def process_file(fn, lines): lines.insert(0, '\n') lines...
apache-2.0
petersanchez/django-allauth
allauth/socialaccount/views.py
8
3507
from django.contrib import messages from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse, reverse_lazy from django.contrib.auth.decorators import login_required from django.views.generic.base import TemplateView from django.views.generic.edit import FormView from ..account.views im...
mit
davidzchen/tensorflow
tensorflow/python/eager/def_function_test.py
1
28978
# 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
meabsence/python-for-android
python-build/python-libs/gdata/src/gdata/tlslite/mathtls.py
273
11647
"""Miscellaneous helper functions.""" from utils.compat import * from utils.cryptomath import * import hmac import md5 import sha #1024, 1536, 2048, 3072, 4096, 6144, and 8192 bit groups] goodGroupParameters = [(2,0xEEAF0AB9ADB38DD69C33F80AFA8FC5E86072618775FF3C0B9EA2314C9C256576D674DF7496EA81D3383B4813D692C6E0E0D5D...
apache-2.0
blooparksystems/odoo
addons/website_slides/models/slides.py
2
25969
# -*- coding: utf-8 -*- import datetime import io import json from PIL import Image import re from urllib import urlencode import urllib2 from urlparse import urlparse from openerp import api, fields, models, SUPERUSER_ID, _ from openerp.tools import image from openerp.exceptions import Warning from openerp.addons.we...
gpl-3.0
Namita26/ycmd
cpp/ycm/tests/gmock/test/gmock_output_test.py
986
5999
#!/usr/bin/env python # # Copyright 2008, 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...
gpl-3.0
Ayub-Khan/edx-platform
lms/djangoapps/verify_student/tests/test_models.py
27
36071
# -*- coding: utf-8 -*- from datetime import timedelta, datetime import ddt import json import mock import requests.exceptions import pytz from django.conf import settings from django.db import IntegrityError from django.test import TestCase from mock import patch from nose.tools import assert_is_none, assert_equals, ...
agpl-3.0
40223226/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/logging/__init__.py
733
66279
# Copyright 2001-2013 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
gpl-3.0
magenta/magenta
magenta/pipelines/dag_pipeline_test.py
1
29773
# Copyright 2021 The Magenta 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 or agreed to in ...
apache-2.0
jgoclawski/django
tests/messages_tests/base.py
319
14243
from django import http from django.contrib.messages import constants, get_level, set_level, utils from django.contrib.messages.api import MessageFailure from django.contrib.messages.constants import DEFAULT_LEVELS from django.contrib.messages.storage import base, default_storage from django.contrib.messages.storage.ba...
bsd-3-clause
ArcticWarriors/scouting-app-2016
ScoutingWebsite/Scouting2017/model/get_team_metrics.py
2
1861
''' Created on Mar 5, 2017 @author: PJ ''' from django.db.models.aggregates import Avg, Sum from django.db.models.expressions import Case, When def get_team_metrics(team, regional_code): metrics = team.scoreresult_set.filter(competition__code=regional_code).aggregate( ...
mit
bringingheavendown/numpy
numpy/distutils/fcompiler/g95.py
229
1379
# http://g95.sourceforge.net/ from __future__ import division, absolute_import, print_function from numpy.distutils.fcompiler import FCompiler compilers = ['G95FCompiler'] class G95FCompiler(FCompiler): compiler_type = 'g95' description = 'G95 Fortran Compiler' # version_pattern = r'G95 \((GCC (?P<gccver...
bsd-3-clause
liyitest/rr
openstack_dashboard/api/ceilometer.py
13
49091
# 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 t...
apache-2.0
vstoykov/django-cms
cms/migrations/0002_auto_start.py
525
20033
# -*- 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
wevial/bpython
bpython/test/test_line_properties.py
2
10588
import re from bpython.test import unittest from bpython.line import current_word, current_dict_key, current_dict, \ current_string, current_object, current_object_attribute, \ current_from_import_from, current_from_import_import, current_import, \ current_method_definition_name, current_single_word, \ ...
mit
waytai/p2pool
wstools/MIMEAttachment.py
294
3379
#TODO add the license #I had to rewrite this class because the python MIME email.mime (version 2.5) #are buggy, they use \n instead \r\n for new line which is not compliant #to standard! # http://bugs.python.org/issue5525 #TODO do not load all the message in memory stream it from the disk import re import random impo...
gpl-3.0
coleifer/irc
bots/markov.py
3
5130
#!/usr/bin/python import os import pickle import random import re import sys from irc import IRCBot, IRCConnection class MarkovBot(IRCBot): """ Hacking on a markov chain bot - based on: http://code.activestate.com/recipes/194364-the-markov-chain-algorithm/ http://github.com/ericflo/yourmomdotcom ...
mit
simonolander/euler
euler-126.py
1
1057
from itertools import count def layer(x, y, z, n): return 2*(x*y + y*z + x*z) + 4*(x + y + z + n - 2) * (n - 1) print(layer(3, 2, 1, 1)) # 22 print(layer(3, 2, 1, 2)) # 46 print(layer(3, 2, 1, 3)) # 78 print(layer(3, 2, 1, 4)) # 118 print(layer(5, 1, 1, 1)) # 22 limit = 30000 memo = {} for x in count(1): ...
mit
licode/scikit-xray
skbeam/core/fitting/models.py
4
5983
# ###################################################################### # Copyright (c) 2014, Brookhaven Science Associates, Brookhaven # # National Laboratory. All rights reserved. # # # # @author: Li Li (lili@bnl.g...
bsd-3-clause
DanielleQuinn/studyGroup
scripts/updateCalendar.py
27
6851
####################################################################### # date: 2015-07-28 # author: Thea Van Rossum theavanrossum@gmail.com # functionality: # 1. Creates a Google Calendar API service object # 2. Deletes all events in the calendar in case changes have been # made to existing events # 3. ...
apache-2.0
Thraxis/SickRage
sickbeard/providers/torrentbytes.py
1
7783
# Author: Idan Gutman # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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 ...
gpl-3.0
kokogaga/arducopter
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
ARCCN/elt
server/pox/openflow/libopenflow_01.py
1
126604
# Copyright 2011,2012 James McCauley # # This file is part of POX. # # POX 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. # # POX is d...
bsd-3-clause
was4444/chromium.src
tools/perf/profile_creators/fast_navigation_profile_extender.py
14
8768
# 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 time from profile_creators import profile_extender from telemetry.core import exceptions from telemetry.core import util class FastNavigationProfile...
bsd-3-clause
Telrik/komimport-2.0
vendor/guzzlehttp/guzzle/docs/conf.py
100
2995
import sys, os from sphinx.highlighting import lexers from pygments.lexers.web import PhpLexer lexers['php'] = PhpLexer(startinline=True, linenos=1) lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1) primary_domain = 'php' # -- General configuration -----------------------------------------------------...
bsd-3-clause
kewisch/bedrock
bedrock/newsletter/tests/test_footer_form.py
3
2110
from funfactory.urlresolvers import reverse from mock import patch from nose.tools import eq_ from pyquery import PyQuery as pq from bedrock.mozorg.tests import TestCase @patch('bedrock.newsletter.utils.get_languages_for_newsletters', lambda *x: set(['en', 'fr', 'pt'])) @patch('lib.l10n_utils.template_is_acti...
mpl-2.0
Microsoft/PTVS
Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/isapi/simple.py
23
2490
"""Simple base-classes for extensions and filters. None of the filter and extension functions are considered 'optional' by the framework. These base-classes provide simple implementations for the Initialize and Terminate functions, allowing you to omit them, It is not necessary to use these base-classes - but if you...
apache-2.0
datalogistics/libdlt
tools/dlt_xfer.py
1
4008
#!/usr/bin/env python3 import os import argparse import json import libdlt from unis.exceptions import CollectionIndexError from libdlt.util.common import print_progress SYS_PATH="/etc/periscope" USER_DEPOTS=os.path.join(SYS_PATH, "depots.conf") UNIS_URL = "http://unis.crest.iu.edu:8890" XFER_TOTAL = 0 def progress(...
bsd-3-clause
whitzhu/kolibri
kolibri/auth/test/test_permissions_classes.py
10
5747
from __future__ import absolute_import, print_function, unicode_literals from django.test import TestCase from mock import Mock from ..models import FacilityUser, DeviceOwner, Facility, KolibriAnonymousUser from ..api import KolibriAuthPermissions from ..permissions.base import BasePermissions from ..permissions.gene...
mit
FedeDR/django-oscar-paypal
paypal/payflow/models.py
9
3364
from __future__ import unicode_literals import re from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext from paypal.payflow import codes from paypal import base @python_2_unicod...
bsd-3-clause
Ban3/Limnoria
plugins/Dict/__init__.py
4
2289
### # Copyright (c) 2004, Jeremiah Fincher # 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 conditi...
bsd-3-clause
kennedyshead/home-assistant
homeassistant/components/smarthab/config_flow.py
2
2392
"""SmartHab configuration flow.""" import logging import pysmarthab import voluptuous as vol from homeassistant import config_entries from homeassistant.const import CONF_EMAIL, CONF_PASSWORD from . import DOMAIN _LOGGER = logging.getLogger(__name__) class SmartHabConfigFlow(config_entries.ConfigFlow, domain=DOMA...
apache-2.0
sql-machine-learning/sqlflow
python/runtime/pai/submitter_evaluate.py
1
4277
# Copyright 2020 The SQLFlow 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 applicable law o...
apache-2.0
hgrimelid/feincms
feincms/views/base.py
1
3756
from django.contrib.auth.decorators import permission_required from django.shortcuts import get_object_or_404, render_to_response from django.template import RequestContext from django.utils.cache import add_never_cache_headers try: from django.template.response import TemplateResponse except ImportError: Templ...
bsd-3-clause
charlesbastos/ArduPilotMega_demo
Tools/LogAnalyzer/LogAnalyzer.py
74
12240
#!/usr/bin/env python # # A module to analyze and identify any common problems which can be determined from log files # # Initial code by Andrew Chapman (amchapman@gmail.com), 16th Jan 2014 # # some logging oddities noticed while doing this, to be followed up on: # - tradheli MOT labels Mot1,Mot2,Mot3,Mot4,GGain # ...
gpl-3.0
MoamerEncsConcordiaCa/tensorflow
tensorflow/python/saved_model/builder.py
126
1271
# 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
mpharrigan/mdtraj
mdtraj/geometry/distance.py
1
11815
############################################################################## # MDTraj: A Python Library for Loading, Saving, and Manipulating # Molecular Dynamics Trajectories. # Copyright 2012-2015 Stanford University and the Authors # # Authors: Robert McGibbon # Contributors: Kyle A Beauchamp, Jason Swails...
lgpl-2.1
Suite5/DataColibri
articles/migrations/0001_initial.py
10
13440
# encoding: 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): # Adding model 'Tag' db.create_table('articles_tag', ( ('id', self.gf('django.db.models.fields...
mit
pombreda/fs-googledrive
test_googledrivefs.py
1
3955
# -*- coding: utf-8 -*- from __future__ import (print_function, division, absolute_import, unicode_literals) import unittest from mock import Mock from pytest import fixture from oauth2client.client import OAuth2Credentials from pydrive.auth import GoogleAuth from pydrive.drive import GoogleDri...
gpl-2.0
nagyistoce/odoo-dev-odoo
addons/resource/faces/pcalendar.py
433
28436
#@+leo-ver=4 #@+node:@file pcalendar.py #@@language python #@<< Copyright >> #@+node:<< Copyright >> ############################################################################ # Copyright (C) 2005, 2006, 2007, 2008 by Reithinger GmbH # mreithinger@web.de # # This file is part of faces. # # faces is free softw...
agpl-3.0
vaygr/ansible
lib/ansible/module_utils/k8s/raw.py
30
8686
# # Copyright 2018 Red Hat | Ansible # # 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. # # ...
gpl-3.0
ubc/edx-platform
lms/lib/comment_client/user.py
144
6343
from .utils import merge_dict, perform_request, CommentClientRequestError import models import settings class User(models.Model): accessible_fields = [ 'username', 'follower_ids', 'upvoted_ids', 'downvoted_ids', 'id', 'external_id', 'subscribed_user_ids', 'children', 'course_id', 'group_...
agpl-3.0
morucci/repoxplorer
repoxplorer/auth/__init__.py
1
7152
# Copyright 2019, Matthieu Huin # Copyright 2019, Red Hat # # 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
ajose01/rethinkdb
test/interface/metadata_persistence.py
29
2500
#!/usr/bin/env python # Copyright 2010-2014 RethinkDB, all rights reserved. from __future__ import print_function import sys, os, time startTime = time.time() sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir, 'common'))) import driver, scenario_common, utils, vcoptparse op = v...
agpl-3.0
sebrandon1/neutron
neutron/tests/unit/agent/linux/test_ip_link_support.py
38
7364
# Copyright 2014 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 # # Unless required by applicable law or agreed t...
apache-2.0
collex100/odoo
addons/base_setup/res_config.py
261
5089
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
ATIX-AG/ansible
lib/ansible/modules/monitoring/datadog_monitor.py
25
13345
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Sebastian Kornehl <sebastian.kornehl@asideas.de> # 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_vers...
gpl-3.0
Arafatk/sympy
sympy/polys/densebasic.py
92
36015
"""Basic tools for dense recursive polynomials in ``K[x]`` or ``K[X]``. """ from __future__ import print_function, division from sympy.core import igcd from sympy import oo from sympy.polys.monomials import monomial_min, monomial_div from sympy.polys.orderings import monomial_key from sympy.core.compatibility import...
bsd-3-clause
ALISCIFP/tensorflow-resnet-segmentation
convert_mhd2jpg_png_LUNA16.py
1
3214
#!/usr/bin/env python # This script belongs to https://github.com/ # this script convert LUNA 16 mhd file to RGB-jpg file. __author__ = "Zengming Shen,Email:szm0219@gmail.com" import os,glob import argparse import numpy as np import SimpleITK as sitk from PIL import Image import cv2 import scipy.misc DATA_DIRE...
mit
theguardian/KodiDB
cherrypy/_cpdispatch.py
39
24149
"""CherryPy dispatchers. A 'dispatcher' is the object which looks up the 'page handler' callable and collects config for the current request based on the path_info, other request attributes, and the application architecture. The core calls the dispatcher as early as possible, passing it a 'path_info' argument. The de...
gpl-2.0
criccomini/airflow
airflow/example_dags/example_skip_dag.py
14
1865
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
poryfly/scikit-learn
sklearn/kernel_ridge.py
155
6545
"""Module :mod:`sklearn.kernel_ridge` implements kernel ridge regression.""" # Authors: Mathieu Blondel <mathieu@mblondel.org> # Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # License: BSD 3 clause import numpy as np from .base import BaseEstimator, RegressorMixin from .metrics.pairwise import pairwise...
bsd-3-clause
jeffmarcom/checkbox
checkbox_gtk/hyper_text_view.py
2
4689
# # This file is part of Checkbox. # # Copyright 2008 Canonical Ltd. # # Checkbox 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. # # C...
gpl-3.0
reyha/zulip
zerver/views/pointer.py
11
1988
from __future__ import absolute_import from django.core.exceptions import ValidationError from django.http import HttpRequest, HttpResponse from django.utils.translation import ugettext as _ from six import text_type from zerver.decorator import to_non_negative_int from zerver.lib.actions import do_update_pointer fro...
apache-2.0
shellyw19-meet/meet2017y1final-proj
showcase.py
1
13266
### Shelly's code import turtle import random import time SIZE_X=1300 SIZE_Y=750 turtle.setup(SIZE_X,SIZE_Y) UP_EDGE = SIZE_Y/2 DOWN_EDGE = -SIZE_Y/2 RIGHT_EDGE = SIZE_X/2 LEFT_EDGE = -SIZE_X/2 #how far the snake moves SQUARE_SIZE=40 pos_list=[] turtle.tracer(1,0) #def first_screen(): w = turtle.clone() turtle.bg...
mit
synconics/odoo
addons/account_payment/__init__.py
436
1279
# -*- 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
ensemblr/llvm-project-boilerplate
include/llvm/utils/lit/lit/util.py
3
9754
import errno import itertools import math import os import platform import signal import subprocess import sys import threading def to_bytes(str): # Encode to UTF-8 to get binary data. return str.encode('utf-8') def to_string(bytes): if isinstance(bytes, str): return bytes return to_bytes(byte...
mit
snava10/sqlRunner
websqlrunner/websqlrunner/views.py
1
3365
import datetime import re from django.conf import settings from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render from django.shortcuts import redirect from .core.sqlRunner import * from .core.SqlRunnerThread import * from .forms import SqlScriptForm from .forms import RunForm ...
apache-2.0
liamf/suds
suds/bindings/binding.py
191
19047
# 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
wenjoy/homePage
node_modules/geetest/node_modules/request/node_modules/karma/node_modules/optimist/node_modules/tap/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
pcarrier/linux
tools/perf/scripts/python/compaction-times.py
958
7950
# report time spent in compaction # Licensed under the terms of the GNU GPL License version 2 # testing: # 'echo 1 > /proc/sys/vm/compact_memory' to force compaction of all zones import os import sys import re import signal signal.signal(signal.SIGPIPE, signal.SIG_DFL) usage = "usage: perf script report compaction-...
gpl-2.0
evax/ansible-modules-core
cloud/amazon/ec2_vol.py
50
15330
#!/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
tarc/gyp
test/mac/gyptest-lto.py
69
2050
#!/usr/bin/env python # Copyright (c) 2015 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. """ Verifies that LTO flags work. """ import TestGyp import os import re import subprocess import sys if sys.platform == 'darwin': test...
bsd-3-clause
jjdicharry/godot
tools/scripts/makeargs.py
50
1945
text=""" #define FUNC$numR(m_r,m_func,$argt)\\ virtual m_r m_func($argtp) { \\ if (Thread::get_caller_ID()!=server_thread) {\\ m_r ret;\\ command_queue.push_and_ret( visual_server, &VisualServer::m_func,$argp,&ret);\\ return ret;\\ } else {\\ return visual_server->m_func($argp);\\ }\\ } #define FU...
mit
angelmtenor/IDSFC
L1_intro/H_olympics_medal_points.py
1
1606
import numpy as np from pandas import DataFrame def numpy_dot(): """ Imagine a point system in which each country is awarded 4 points for each gold medal, 2 points for each silver medal, and one point for each bronze medal. Using the numpy.dot function, create a new dataframe called 'oly...
mit
Proteu5/LiteMonitor
LiteMonitor-0.3.py
1
13212
""" The MIT License (MIT) Copyright (c) 2014 Proteu5 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publ...
mit
karban/field
resources/python/rope/base/oi/__init__.py
112
1684
"""Rope object analysis and inference package Rope makes some simplifying assumptions about a python program. It assumes that a program only performs assignments and function calls. Tracking assignments is simple and `PyName` objects handle that. The main problem is function calls. Rope uses these two approaches fo...
gpl-2.0
rgerkin/python-neo
neo/test/coretest/test_block.py
1
32775
# -*- coding: utf-8 -*- """ Tests of the neo.core.block.Block class """ # needed for python 3 compatibility from __future__ import absolute_import, division, print_function from datetime import datetime from copy import deepcopy import unittest import numpy as np try: from IPython.lib.pretty import pretty exce...
bsd-3-clause
yoyo2k/l10n-romania
account_compensation_vat_on_payment/account_compensation.py
2
10256
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012 Domsense s.r.l. (<http://www.domsense.com>). # Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>) # # This program is ...
agpl-3.0
mganeva/mantid
scripts/Interface/reduction_gui/widgets/inelastic/dgs_pd_sc_conversion.py
1
5097
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source # & Institut Laue - Langevin # SPDX - License - Identifier: GPL - 3.0 + #pylint: disable=invalid-name from __future__...
gpl-3.0
jualvarez/charlex
03-Bonus/charlexapi/charlas/models.py
2
2443
from django.db import models from django.conf import settings class Orador(models.Model): class Meta: verbose_name = "orador" verbose_name_plural = "oradores" nombre = models.CharField(verbose_name='nombre', max_length=100) bio = models.TextField(verbose_name='curriculum vitae') foto...
gpl-3.0
vicente-gonzalez-ruiz/QSVC
trunk/src/old_py/motion_expand_COPIA_SIN_LIST.py
1
4326
#!/usr/bin/python # -*- coding: iso-8859-15 -*- # motion_expand.py # Descomprime los datos con el movimiento. import os import sys from GOP import GOP from subprocess import check_call from subprocess import CalledProcessError from MCTF_parser import MCTF_parser #MOTION_DECODER_NAME = "gzip" #MOTION_DECODER_NAME = "...
gpl-2.0
anhaidgroup/py_entitymatching
benchmarks/benchmark_sn_blocker.py
1
11105
# Write the benchmarking functions here. # See "Writing benchmarks" in the asv docs for more information. import os import sys import py_entitymatching as mg p = mg.get_install_path() datasets_path = os.sep.join([p, 'datasets', 'example_datasets']) snb = mg.SortedNeighborhood...
bsd-3-clause
sencha/chromium-spacewalk
third_party/closure_compiler/processor_test.py
33
3425
#!/usr/bin/env python # 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. """Test resources processing, i.e. <if> and <include> tag handling.""" import unittest from processor import FileCache, Processor, Lin...
bsd-3-clause
openstack-dev/devstack
roles/write-devstack-local-conf/library/devstack_local_conf.py
3
12720
# Copyright (C) 2017 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
pgielda/linux-renesas
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
f3rdy/pybox
walkdict/walkdict.py
1
1212
__author__ = 'fthiele' data = { 'level 1-1': { 'level 1-1-1': { 'a': 1, 'b': 2, 'c': 3, }, 'level 1-1-2': { 'd': 4, 'e': 5, ...
apache-2.0