repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
SM-G920P/TeamSPR_Kernel
refs/heads/master
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
4653
# EventClass.py # # This is a library defining some events types classes, which could # be used by other scripts to analyzing the perf samples. # # Currently there are just a few classes defined for examples, # PerfEvent is the base class for all perf event sample, PebsEvent # is a HW base Intel x86 PEBS event, and use...
jeffery-do/Vizdoombot
refs/heads/master
doom/lib/python3.5/site-packages/wheel/test/extension.dist/setup.py
92
from setuptools import setup, Extension try: unicode def u8(s): return s.decode('unicode-escape').encode('utf-8') except NameError: def u8(s): return s.encode('utf-8') setup(name='extension.dist', version='0.1', description=u8('A testing distribution \N{SNOWMAN}'), ext_mo...
pkill-nine/qutebrowser
refs/heads/qutebrowser-custom
qutebrowser/browser/webkit/webkittab.py
1
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2016-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser 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 S...
gigq/flasktodo
refs/heads/master
jinja2/filters.py
199
# -*- coding: utf-8 -*- """ jinja2.filters ~~~~~~~~~~~~~~ Bundled jinja filters. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ import re import math from random import choice from operator import itemgetter from itertools import imap, groupby from jinja2....
arbitrahj/django-timepiece
refs/heads/develop
timepiece/entries/tests/test_timesheet.py
2
import datetime from dateutil.relativedelta import relativedelta from decimal import Decimal import random from six.moves.urllib.parse import urlencode from django.contrib.auth.models import Permission from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from django....
Juniper/ansible
refs/heads/juniper-pr
plugins/inventory/apache-libcloud.py
89
#!/usr/bin/env python # (c) 2013, Sebastien Goasguen <runseb@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 ...
openstack/trove
refs/heads/master
trove/tests/unittests/taskmanager/test_manager.py
1
# Copyright 2014 eBay Software Foundation # Copyright [2015] Hewlett-Packard Development Company, L.P. # 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 # # ...
dednal/chromium.src
refs/heads/nw12
net/tools/quic/benchmark/run_client.py
165
#!/usr/bin/env python # Copyright 2013 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 csv import datetime import json import os import shlex import subprocess import sys from optparse import OptionParser """Start...
justanotherbrain/HebbLearn
refs/heads/master
multilayer-demo.py
1
import sys import os.path import HebbLearn as hl import numpy as np import matplotlib.pyplot as plt try: import h5py except: print('h5py cannot be loaded - may cause error') pass if os.path.isfile('processed_data.npy'): print('==> Load previously saved (preprocessed) data') unlabeled = np.load('p...
whip112/Whip112
refs/heads/master
vendor/packages/pygments/lexers/actionscript.py
72
# -*- coding: utf-8 -*- """ pygments.lexers.actionscript ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lexers for ActionScript and MXML. :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, bygroups, using,...
FireWRT/OpenWrt-Firefly-Libraries
refs/heads/master
staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python2.7/bdb.py
144
"""Debugger basics""" import fnmatch import sys import os import types __all__ = ["BdbQuit","Bdb","Breakpoint"] class BdbQuit(Exception): """Exception to give up completely""" class Bdb: """Generic Python debugger base class. This class takes care of details of the trace facility; a derived class...
i-maravic/ns-3
refs/heads/master
examples/energy/examples-to-run.py
196
#! /usr/bin/env python ## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*- # A list of C++ examples to run in order to ensure that they remain # buildable and runnable over time. Each tuple in the list contains # # (example_name, do_run, do_valgrind_run). # # See test.py for more i...
dursk/django
refs/heads/master
tests/i18n/sampleproject/update_catalogs.py
344
#!/usr/bin/env python """ Helper script to update sampleproject's translation catalogs. When a bug has been identified related to i18n, this helps capture the issue by using catalogs created from management commands. Example: The string "Two %% Three %%%" renders differently using trans and blocktrans. This issue i...
ftl-toolbox/lib_openshift
refs/heads/master
test/test_v1_config_map_key_selector.py
2
# coding: utf-8 """ OpenAPI spec version: Generated by: https://github.com/swagger-api/swagger-codegen.git 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 ...
erickt/hue
refs/heads/master
desktop/core/ext-py/tablib-develop/tablib/packages/odf/svg.py
91
# -*- coding: utf-8 -*- # Copyright (C) 2006-2007 Søren Roug, European Environment Agency # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at you...
cooperra/antlr4
refs/heads/master
runtime/Python3/src/antlr4/IntervalSet.py
17
from io import StringIO import unittest from antlr4.Token import Token # need forward declarations IntervalSet = None class IntervalSet(object): def __init__(self): self.intervals = None self.readOnly = False def __iter__(self): if self.intervals is not None: for i in sel...
brandonium21/snowflake
refs/heads/master
snowflakeEnv/lib/python2.7/site-packages/sqlalchemy/dialects/firebird/kinterbasdb.py
33
# firebird/kinterbasdb.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: firebird+kinterbasdb :name: kinterbasdb :dbapi: kin...
IllusionRom-deprecated/android_platform_tools_idea
refs/heads/master
python/lib/Lib/types.py
81
"""Define names for all type symbols known in the standard interpreter. Types that are part of optional modules (e.g. array) are not listed. """ import sys # Iterators in Python aren't a matter of type but of protocol. A large # and changing number of builtin types implement *some* flavor of # iterator. Don't check...
akatsoulas/mozillians
refs/heads/master
mozillians/groups/middleware.py
2
import re from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect from mozillians.common.middleware import safe_query_string from mozillians.groups.models import Group class OldGroupRedirectionMiddleware(object): """ Redirect requests for groups from /group/<id>-<url> to ...
michath/ConMonkey
refs/heads/master
media/webrtc/trunk/tools/gyp/test/win/gyptest-link-debug-info.py
344
#!/usr/bin/env python # Copyright (c) 2012 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. """ Make sure debug info setting is extracted properly. """ import TestGyp import sys if sys.platform == 'win32': test = TestGyp.TestGy...
anhstudios/swganh
refs/heads/develop
data/scripts/templates/object/draft_schematic/bio_engineer/dna_template/shared_dna_template_gurreck.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Intangible() result.template = "object/draft_schematic/bio_engineer/dna_template/shared_dna_template_gurreck.iff" ...
gmimano/commcaretest
refs/heads/master
corehq/apps/data_interfaces/views.py
1
import csv import io import uuid from couchdbkit import ResourceNotFound from django.contrib import messages from django.core.cache import cache from dimagi.utils.excel import WorkbookJSONReader, JSONReaderError from django.utils.decorators import method_decorator from openpyxl.shared.exc import InvalidFileException fr...
Jgarcia-IAS/Fidelizacion_odoo
refs/heads/master
openerp/addons/hw_posbox_homepage/__openerp__.py
313
# -*- 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...
perezg/infoxchange
refs/heads/master
BASE/lib/python2.7/site-packages/django/utils/encoding.py
80
from __future__ import unicode_literals import codecs import datetime from decimal import Decimal import locale try: from urllib.parse import quote except ImportError: # Python 2 from urllib import quote import warnings from django.utils.functional import Promise from django.utils import six class Django...
jjhelmus/wradlib
refs/heads/master
examples/clutter_gabella_example.py
1
# ------------------------------------------------------------------------------- # Name: clutter_gabella_example # Purpose: # # Author: Thomas Pfaff # # Created: 26.10.2011 # Copyright: (c) Thomas Pfaff 2011 # Licence: The MIT License # ---------------------------------------------------...
optikfluffel/lagesonum
refs/heads/master
lagesonum/__main__.py
1
# coding: utf-8 # Datei zum lokalen testen, PythonAnywhere verwendet bottle_app.py direkt from bottle import run, debug from bottle_app import application debug(True) run(application, host='localhost', port=8080, reloader=True)
nickjj/deploy-web-apps-with-docker
refs/heads/master
chapter-4/website/app.py
6
from flask import Flask from redis import StrictRedis app = Flask(__name__) redis = StrictRedis(host='redis') @app.route('/') def hello_world(): hits = redis.incr('hits') return 'You visited {0} times!'.format(hits) if __name__ == '__main__': app.run(host='0.0.0.0', port=8000, debug=True)
shahalimurtaza/Pynet
refs/heads/master
Week1/Exercise6.py
1
import yaml import json exercise6 = [ 1, 2, 3, 4, 5, { 'key1': 'lock1', 'key2': 2 } , 'some string'] with open ("yaml-exercise6", "w") as f: f.write(yaml.dump(exercise6, default_flow_style=False)) with open ("json-exercise6", "w") as f: json.dump(exercise6, f)
Chilledheart/chromium
refs/heads/master
tools/telemetry/telemetry/internal/actions/page_action.py
29
# Copyright 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. import re from telemetry import decorators GESTURE_SOURCE_DEFAULT = 'DEFAULT' GESTURE_SOURCE_MOUSE = 'MOUSE' GESTURE_SOURCE_TOUCH = 'TOUCH' SUPPORTED_GESTU...
MihaiMoldovanu/ansible
refs/heads/devel
lib/ansible/modules/database/proxysql/proxysql_global_variables.py
30
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, 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 DOCUMENTATION = ''' --- module: proxysql_global_variables ...
floringrigoriu/Algorthitms
refs/heads/master
Leetcode2021/Monthly/January/jan27.py
1
# https://leetcode.com/explore/challenge/card/january-leetcoding-challenge-2021/582/week-4-january-22nd-january-28th/3618/ # Concatenation of Consecutive Binary Numbers # Given an integer n, return the decimal value of the binary string formed by concatenating the binary representations of 1 to n in order, modulo 109...
horstjens/ThePythonGameBook
refs/heads/master
en/pygame/003_static_blit_pretty2.py
1
# -*- coding: utf-8 -*- """ 003_static_blit_pretty.py static blitting and drawing (pretty version) url: http://thepythongamebook.com/en:part2:pygame:step003 author: horst.jens@spielend-programmieren.at licence: gpl, see http://www.gnu.org/licenses/gpl.html works with pyhton3.4 and python2.7 Blitting a surface on a st...
BenevolentAI/guacamol
refs/heads/master
tests/test_distribution_learning_benchmarks.py
1
from guacamol.distribution_learning_benchmark import ValidityBenchmark, UniquenessBenchmark, NoveltyBenchmark, \ KLDivBenchmark from guacamol.assess_distribution_learning import _assess_distribution_learning from .mock_generator import MockGenerator import numpy as np import tempfile from os.path import join def ...
Temeez/wagtail-simple-gallery
refs/heads/master
wagtail_simple_gallery/models.py
1
from django.conf import settings from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger from django.db import models from django.utils.translation import ugettext_lazy as _ from wagtail.admin.edit_handlers import FieldPanel from wagtail.core.fields import RichTextField from wagtail.core.models import...
cecep-edu/refactory
refs/heads/staging
requirements/PyChart-1.39/demos/tocssingle.py
6
# # Copyright (C) 2000-2005 by Yasushi Saito (yasushi.saito@gmail.com) # # Pychart 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, or (at your option) any # later version. # # Pychart is dis...
ossdemura/django-miniblog
refs/heads/dev
src/Lib/encodings/iso8859_10.py
272
""" Python Character Mapping Codec iso8859_10 generated from 'MAPPINGS/ISO8859/8859-10.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors...
andrewmoses/ssquiz
refs/heads/master
flask/lib/python2.7/encodings/mac_croatian.py
593
""" Python Character Mapping Codec mac_croatian generated from 'MAPPINGS/VENDORS/APPLE/CROATIAN.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,inp...
jeeftor/alfredToday
refs/heads/master
src/lib/pytz/lazy.py
514
from threading import RLock try: from UserDict import DictMixin except ImportError: from collections import Mapping as DictMixin # With lazy loading, we might end up with multiple threads triggering # it at the same time. We need a lock. _fill_lock = RLock() class LazyDict(DictMixin): """Dictionary popu...
prtx/What-I-learned-in-college
refs/heads/master
AI/mc2.py
1
#!/usr/bin/python from copy import deepcopy class Tree_Node: def __init__(self, item = None, parent = None): self.item = item self.parent = parent self.children = [] def set_item(self, node): self.parent = node def set_parent(self, node): self.parent = node def set_child(self, item): tree_node ...
gboudreau/CouchPotato
refs/heads/master
library/hachoir_parser/video/mov.py
10
""" Apple Quicktime Movie (file extension ".mov") parser. Documents: - Parsing and Writing QuickTime Files in Java (by Chris Adamson, 02/19/2003) http://www.onjava.com/pub/a/onjava/2003/02/19/qt_file_format.html - QuickTime File Format (official technical reference) http://developer.apple.com/documentation/QuickTi...
liangwang/m5
refs/heads/master
configs/example/memtest.py
1
# Copyright (c) 2006-2007 The Regents of The University of Michigan # 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 ...
mtndesign/myVim
refs/heads/master
myvim/bundle/ropevim/ftplugin/python/libs/rope/refactor/occurrences.py
91
import re import rope.base.pynames from rope.base import pynames, pyobjects, codeanalyze, evaluate, exceptions, utils, worder class Finder(object): """For finding occurrences of a name The constructor takes a `filters` argument. It should be a list of functions that take a single argument. For each po...
sjhewitt/graphene
refs/heads/master
graphene/types/argument.py
1
from collections import OrderedDict from itertools import chain from ..utils.orderedtype import OrderedType from .structures import NonNull from .dynamic import Dynamic class Argument(OrderedType): def __init__(self, type, default_value=None, description=None, name=None, required=False, _creation_counter=None):...
mircealungu/Zeeguu-Core
refs/heads/master
zeeguu_core_test/test_article.py
1
from unittest import TestCase from zeeguu_core_test.model_test_mixin import ModelTestMixIn import zeeguu_core from zeeguu_core_test.rules.article_rule import ArticleRule from zeeguu_core_test.rules.language_rule import LanguageRule from zeeguu_core.model import Topic, Article from zeeguu_core_test.test_data.mocking_t...
boomsbloom/dtm-fmri
refs/heads/master
DTM/for_gensim/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/jpcntx.py
1776
######################## 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...
magvugr/AT
refs/heads/master
EntVirtual/lib/python2.7/site-packages/django/conf/locale/fy/formats.py
852
# -*- 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 = # TIME_FORMAT = # DATETIME_FORMA...
msabramo/pip
refs/heads/develop
pip/_vendor/requests/packages/urllib3/packages/six.py
2374
"""Utilities for writing code that runs on Python 2 and 3""" #Copyright (c) 2010-2011 Benjamin Peterson #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 l...
ya7lelkom/linguist
refs/heads/master
samples/Python/django-models-base.py
92
from __future__ import unicode_literals import copy import sys from functools import update_wrapper from future_builtins import zip import django.db.models.manager # Imported to register signal handler. from django.conf import settings from django.core.exceptions import (ObjectDoesNotExist, MultipleObjectsRet...
isandlaTech/cohorte-devtools
refs/heads/master
org.cohorte.eclipse.runner.basic/files/jython/Lib/email/encoders.py
263
# Copyright (C) 2001-2006 Python Software Foundation # Author: Barry Warsaw # Contact: email-sig@python.org """Encodings and related functions.""" __all__ = [ 'encode_7or8bit', 'encode_base64', 'encode_noop', 'encode_quopri', ] import base64 from quopri import encodestring as _encodestring d...
fatadama/mavlink-vscl
refs/heads/master
MAVProxy-master/modules/lib/libchecklist.py
5
#!/usr/bin/env python """ MAVProxy checklist, implemented in a child process Created by Stephen Dade (stephen_dade@hotmail.com) """ class CheckItem(): '''Checklist item used for information transfer between threads/processes/pipes''' def __init__(self, name, state): self.name = name se...
aponxi/libmysqlpp
refs/heads/master
bakefile-0.2.9/src/formats.py
1
# # This file is part of Bakefile (http://www.bakefile.org) # # Copyright (C) 2003,2004 Vaclav Slavik # # 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 wit...
tethysplatform/tethys
refs/heads/master
tests/unit_tests/test_tethys_gizmos/test_gizmo_options/test_range_slider.py
2
import unittest import tethys_gizmos.gizmo_options.range_slider as gizmo_range_slider class TestRangeSlider(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_RangeSlider(self): name = 'Test Range Slider' min = 0 max = 100 initial ...
ashhher3/cvxpy
refs/heads/master
cvxpy/constraints/int_constr.py
12
""" Copyright 2013 Steven Diamond This file is part of CVXPY. CVXPY 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. CVXPY is distributed i...
Acehaidrey/incubator-airflow
refs/heads/master
tests/models/test_taskinstance.py
1
# # 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...
mjtamlyn/django
refs/heads/master
tests/migrations/test_migrations_squashed_erroneous/6_auto.py
266
from django.db import migrations class Migration(migrations.Migration): dependencies = [("migrations", "5_auto")] operations = [ migrations.RunPython(migrations.RunPython.noop) ]
Bleyddyn/malpi
refs/heads/master
exp/temp/captioning_solver.py
19
import numpy as np from cs231n import optim from cs231n.coco_utils import sample_coco_minibatch class CaptioningSolver(object): """ A CaptioningSolver encapsulates all the logic necessary for training image captioning models. The CaptioningSolver performs stochastic gradient descent using different update ru...
jrper/fluidity
refs/heads/master
examples/stokes_square_convection/Plot_RMS.py
4
#!/usr/bin/python # This sript plots up the RMS velocity for both the 24x24 and 48x48 case import pylab from fluidity_tools import stat_parser as stat # Stafiles: statfile24="stokes-sc-Ra1e5-24.stat" statfile48="stokes-sc-Ra1e5-48.stat" # First plot 24x24 case: pylab.plot(stat(statfile24)["CoordinateMesh"]["nodes"][...
Nolski/airmozilla
refs/heads/master
airmozilla/new/cron.py
14
import cronjobs from airmozilla.cronlogger.decorators import capture from . import eventemails @cronjobs.register @capture def send_new_event_emails(): eventemails.send_new_event_emails(verbose=True)
andersonsilvade/python_C
refs/heads/master
Python32/web2py/applications/admin/controllers/mercurial.py
4
from gluon.fileutils import read_file, write_file if DEMO_MODE or MULTI_USER_MODE: session.flash = T('disabled in demo mode') redirect(URL('default', 'site')) if not have_mercurial: session.flash = T("Sorry, could not find mercurial installed") redirect(URL('default', 'design', args=request.args(0))) ...
decisive/api-demo-python
refs/heads/master
sample_scripts/target_keywords.py
1
import sys # NOTE: for exiting import requests import datetime import pprint import ujson as json # NOTE: faster json API_KEY = '' # TODO: input api key here!!! if not API_KEY: sys.exit('Please insert your Decisive API key') print print 'Creating session to always add API key...' # NOTE: you can also use decisi...
TylerTemp/tomorrow
refs/heads/master
lib/hdlr/base.py
1
'''The basic handler of all tornado request provide some convenient methods''' import tornado.web import tornado.locale import tornado.escape import logging import functools import json import os try: from urllib.parse import quote, urlsplit, urlunsplit, urljoin except ImportError: from urllib import quote ...
edsuom/sAsync
refs/heads/master
sasync/test/test_items.py
1
# sAsync: # An enhancement to the SQLAlchemy package that provides persistent # item-value stores, arrays, and dictionaries, and an access broker for # conveniently managing database access, table setup, and # transactions. Everything can be run in an asynchronous fashion using # the Twisted framework and its deferred ...
discosultan/quake-console
refs/heads/master
Samples/Sandbox/Lib/pickletools.py
41
'''"Executable documentation" for the pickle module. Extensive comments about the pickle protocols and pickle-machine opcodes can be found here. Some functions meant for external use: genops(pickle) Generate all the opcodes in a pickle, as (opcode, arg, position) triples. dis(pickle, out=None, memo=None, indentl...
toby82/kolla
refs/heads/master
docker/swift/swift-base/build-swift-ring.py
5
#!/usr/bin/env python # Copyright 2015 Paul Bourke # # 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...
xuxiao19910803/edx-platform
refs/heads/master
cms/startup.py
88
""" Module with code executed during Studio startup """ from django.conf import settings # Force settings to run so that the python path is modified settings.INSTALLED_APPS # pylint: disable=pointless-statement from openedx.core.lib.django_startup import autostartup from monkey_patch import django_utils_translation...
TylerTemp/tomorrow
refs/heads/master
lib/tool/command/upload.py
1
""" Usage: upload [options] (<dir> | <file>)... Options: -p, --prefix=<name> format: <bucket>/<dir>/ [default: jolla] -k, --key=<key> -s, --secret=<secret> """ import qiniu import qiniu.config import logging logger = logging.getLogger('upload') CLIENT = None KEY = None ...
haoyuchen1992/CourseBuilder
refs/heads/master
tests/functional/controllers_review.py
4
# coding: utf-8 # Copyright 2013 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
alaski/nova
refs/heads/master
nova/tests/unit/objects/test_service.py
4
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agree...
pjryan126/solid-start-careers
refs/heads/master
store/api/glassdoor/venv/lib/python2.7/site-packages/requests/packages/chardet/hebrewprober.py
2928
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Shy Shalom # Portions created by the Initial Developer are Copyright (C) 2005 # the Initial Developer. All Rights Reserved. #...
jemandez/creaturas-magicas
refs/heads/master
Configuraciones básicas/scripts/addons/blendertools-1.0.0/maketarget/pose.py
1
#!/usr/bin/python # -*- coding: utf-8 -*- """ **Project Name:** MakeHuman **Product Home Page:** http://www.makehuman.org/ **Code Home Page:** http://code.google.com/p/makehuman/ **Authors:** Thomas Larsson **Copyright(c):** MakeHuman Team 2001-2014 **Licensing:** AGPL3 (see also ht...
patilsangram/erpnext
refs/heads/develop
erpnext/accounts/doctype/bank_statement_settings_item/bank_statement_settings_item.py
17
# -*- coding: utf-8 -*- # Copyright (c) 2018, sathishpy@gmail.com and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class BankStatementSettingsItem(Document): pass
mattwthompson/mdtraj
refs/heads/master
tests/test_neighbors.py
7
import numpy as np import mdtraj as md from mdtraj.testing import eq random = np.random.RandomState(0) def compute_neighbors_reference(traj, cutoff, query_indices, haystack_indices=None): if haystack_indices is None: haystack_indices = range(traj.n_atoms) # explicitly enumerate the pairs of query-hay...
openstack/nova
refs/heads/master
nova/scheduler/filters/isolated_hosts_filter.py
7
# Copyright (c) 2011-2012 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 # # Un...
davidharrigan/django
refs/heads/master
tests/urlpatterns_reverse/included_urls.py
452
from django.conf.urls import url from .views import empty_view urlpatterns = [ url(r'^$', empty_view, name="inner-nothing"), url(r'^extra/(?P<extra>\w+)/$', empty_view, name="inner-extra"), url(r'^(?P<one>[0-9]+)|(?P<two>[0-9]+)/$', empty_view, name="inner-disjunction"), ]
popazerty/e2_sh4
refs/heads/master
lib/python/Components/FileList.py
6
import os import re from MenuList import MenuList from Components.Harddisk import harddiskmanager from Tools.Directories import SCOPE_ACTIVE_SKIN, resolveFilename, fileExists, pathExists from enigma import RT_HALIGN_LEFT, eListboxPythonMultiContent, \ eServiceReference, eServiceCenter, gFont from Tools.LoadPixmap impo...
AndKe/MAVProxy
refs/heads/master
MAVProxy/modules/mavproxy_misseditor/button_renderer.py
10
#!/usr/bin/env python ''' Custom button render class for use inside a wx.grid (ported from http://forums.wxwidgets.org/viewtopic.php?t=14403 ) Michael Day June 2014 ''' from ..lib.wx_loader import wx from wx import grid import copy class ButtonRenderer(wx.grid.PyGridCellRenderer): def __init__(self,label,width=75...
pigeonflight/strider-plone
refs/heads/master
docker/appengine/lib/django-1.3/django/contrib/gis/maps/google/__init__.py
603
""" This module houses the GoogleMap object, used for generating the needed javascript to embed Google Maps in a Web page. Google(R) is a registered trademark of Google, Inc. of Mountain View, California. Example: * In the view: return render_to_response('template.html', {'google' : GoogleMap(key="...
tuenti/Diamond
refs/heads/master
src/collectors/celerymon/celerymon.py
60
# coding=utf-8 """ Collects simple task stats out of a running celerymon process #### Dependencies * celerymon connected to celery broker Example config file CelerymonCollector.conf ``` enabled=True host=celerymon.example.com port=16379 ``` """ import diamond.collector import urllib2 import time try: impor...
mbanderson/headtracker
refs/heads/master
src/data/sampler/recorder.py
1
#!/usr/bin/env python """Collects magnetometer/IMU data measurements sent over serial.""" import serial import sys import numpy as np import argparse import time # Scale count values by initialized sensor sensitivities. def mag_count_to_gauss(x): COUNT_RES = 0.92 mG = x * COUNT_RES return mG / 1000.0 d...
aperigault/ansible
refs/heads/devel
lib/ansible/modules/cloud/vmware/vmware_target_canonical_facts.py
2
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2015, Joseph Callen <jcallen () csc.com> # Copyright: (c) 2018, 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 ...
hackultura/procult
refs/heads/master
procult/authentication/managers.py
1
# -*- coding: utf-8 -*- import operator from functools import reduce from django.db import models from django.db.models import Q from django.contrib.auth.models import BaseUserManager class UserManager(BaseUserManager): def create_user(self, email, password=None, **kwargs): if not email: rai...
diorcety/intellij-community
refs/heads/master
python/testData/refactoring/changeSignature/duplicateParam.before.py
83
def some_funct<caret>ion_name(argument_1, opt1 = None, opt2 = None, **extra_info): print locals() class A(object): def someMethod(self): self.url = some_function_name(0, extra1=True, extra2=2)
h3llrais3r/SickRage
refs/heads/master
lib/ndg/httpsclient/urllib2_build_opener.py
66
"""urllib2 style build opener integrates with HTTPSConnection class from this package. """ __author__ = "P J Kershaw" __date__ = "21/12/10" __copyright__ = "(C) 2011 Science and Technology Facilities Council" __license__ = "BSD - see LICENSE file in top-level directory" __contact__ = "Philip.Kershaw@stfc.ac.uk" __revis...
motion2015/edx-platform
refs/heads/master
lms/djangoapps/open_ended_grading/open_ended_notifications.py
66
import datetime import json import logging from django.conf import settings from xmodule.open_ended_grading_classes import peer_grading_service from xmodule.open_ended_grading_classes.controller_query_service import ControllerQueryService from courseware.access import has_access from edxmako.shortcuts import render_...
chromium2014/src
refs/heads/master
tools/cr/cr/commands/install.py
113
# Copyright 2013 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. """A module for the install command.""" import cr class InstallCommand(cr.Command): """The implementation of the install command. This first uses Bui...
hzruandd/WebSocket-for-Python
refs/heads/master
test/test_websocket.py
6
# -*- coding: utf-8 -*- import unittest import os import socket import struct from mock import MagicMock, call, patch from ws4py.framing import Frame, \ OPCODE_CONTINUATION, OPCODE_TEXT, \ OPCODE_BINARY, OPCODE_CLOSE, OPCODE_PING, OPCODE_PONG from ws4py.websocket import WebSocket from ws4py.messaging import...
rotofly/odoo
refs/heads/master
addons/purchase_double_validation/__init__.py
441
# -*- 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...
HyperBaton/ansible
refs/heads/devel
lib/ansible/modules/network/nxos/nxos_file_copy.py
10
#!/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...
willingc/oh-mainline
refs/heads/master
vendor/packages/twisted/twisted/test/test_stateful.py
18
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Test cases for twisted.protocols.stateful """ from twisted.test import test_protocols from twisted.protocols.stateful import StatefulProtocol from struct import pack, unpack, calcsize class MyInt32StringReceiver(StatefulProtocol): """...
DougFirErickson/qgisSpaceSyntaxToolkit
refs/heads/master
esstoolkit/external/pyqtgraph/graphicsItems/ButtonItem.py
52
from ..Qt import QtGui, QtCore from .GraphicsObject import GraphicsObject __all__ = ['ButtonItem'] class ButtonItem(GraphicsObject): """Button graphicsItem displaying an image.""" clicked = QtCore.Signal(object) def __init__(self, imageFile=None, width=None, parentItem=None, pixmap=None): ...
dimtruck/magnum
refs/heads/master
magnum/common/pythonk8sclient/swagger_client/models/v1_replication_controller.py
5
# coding: utf-8 """ Copyright 2015 SmartBear Software 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...
edxzw/edx-platform
refs/heads/master
lms/djangoapps/oauth2_handler/tests.py
57
# pylint: disable=missing-docstring from django.core.cache import cache from django.test.utils import override_settings from lang_pref import LANGUAGE_KEY from xmodule.modulestore.tests.factories import (check_mongo_calls, CourseFactory) from student.models import anonymous_id_for_user from student.models import UserP...
thesuperzapper/tensorflow
refs/heads/master
tensorflow/contrib/sparsemax/python/ops/sparsemax_loss.py
103
# 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...
shakamunyi/tensorflow
refs/heads/master
tensorflow/contrib/linear_optimizer/python/sdca_estimator.py
27
# 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...
bartosh/layerindex-web
refs/heads/master
layerindex/views.py
1
# layerindex-web - view definitions # # Copyright (C) 2013-2014 Intel Corporation # # Licensed under the MIT license, see COPYING.MIT for details from django.shortcuts import get_object_or_404, render from django.http import HttpResponse, HttpResponseRedirect, HttpResponseForbidden, Http404 from django.core.urlresolve...
BMCV/galaxy-image-analysis
refs/heads/master
tools/2d_histogram_equalization/histogram_equalization.py
1
import argparse import os import sys import skimage.io import skimage.exposure import skimage.util hOptions = { 'default' : lambda img_raw: skimage.exposure.equalize_hist(img_raw), 'clahe' : lambda img_raw: skimage.exposure.equalize_adapthist(img_raw) } if __name__ == "__main__": parser = argparse.Argumen...
keyboard-k/youtube-dl-pet
refs/heads/master
youtube_dl/extractor/daum.py
3
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse, ) class DaumIE(InfoExtractor): _VALID_URL = r'https?://(?:m\.)?tvpot\.daum\.net/(?:v/|.*?clipid=)(?P<id>[^?#&]+)' IE_NAME = 'daum.net' _TESTS = [{ ...
youdonghai/intellij-community
refs/heads/master
python/testData/refactoring/inlinelocal/methodCallInlinedAsQualifier.after.py
79
a.method().strip()
AstroTech/workshop-python
refs/heads/master
django/src/django-rest-views.py
1
import json from django.http import JsonResponse, HttpResponse from django.views import View from contact.models import Contact class ContactAPI(View): http_method_names = ['get', 'post', 'options'] def options(self, request, *args, **kwargs): response = HttpResponse(status=200) response['Acc...
kbrebanov/ansible
refs/heads/devel
lib/ansible/module_utils/facts/system/cmdline.py
137
# This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that ...