repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
⌀
algobunny/fanocean.ff
refs/heads/master
handlers_oauth.py
1
import json import hashlib import pytumblr import urlparse import code import oauth2 as oauth from ignore_me import pokedex from handlers_custom import SessionHandler from models import Author request_token_url = 'http://www.tumblr.com/oauth/request_token' authorize_url = 'http://www.tumblr.com/oauth/authorize' acces...
LearnEra/LearnEraPlaftform
refs/heads/master
lms/djangoapps/shoppingcart/migrations/0006_auto__add_field_order_refunded_time__add_field_orderitem_refund_reques.py
58
# -*- 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): # Adding field 'Order.refunded_time' db.add_column('shoppingcart_order', 'refunded_time', ...
Distrotech/intellij-community
refs/heads/master
python/testData/selectWord/literal/after3.py
83
x = <selection>r"hello world again"</selection>
liuzheng712/webTeX
refs/heads/master
django_wsgi.py
1
#!/usr/bin/env python # coding: utf-8 __author__ = 'liuzheng' import os import sys reload(sys) sys.setdefaultencoding('utf8') os.environ.setdefault("DJANGO_SETTINGS_MODULE", "webTeX.settings") from django.core.wsgi import get_wsgi_application application = get_wsgi_application()
semolex/astropylis
refs/heads/master
camera.py
1
# -*- coding: utf-8 -*- # TODO: add formulas. from decimal import Decimal, getcontext getcontext().prec = 3 class Camera(object): """ Simple class that represents user's camera for astronomy (CCD/CMOS etc). """ def __init__(self, pixel_size, resolution, sensor_h=None, sensor_w=None, megapixels=Non...
jeeftor/alfredToday
refs/heads/master
src/lib/pyasn1/compat/binary.py
172
from sys import version_info if version_info[0:2] < (2, 6): def bin(x): if x <= 1: return '0b'+str(x) else: return bin(x>>1) + str(x&1) else: bin = bin
ljhljh235/AutoRest
refs/heads/master
src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Http/auto_rest_http_infrastructure_test_service/operations/http_retry_operations.py
14
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
googlearchive/titan
refs/heads/master
titan/tasks/handlers.py
1
#!/usr/bin/env python # 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 ...
ga7g08/sympy
refs/heads/master
sympy/sets/contains.py
77
from __future__ import print_function, division from sympy.core import Basic from sympy.logic.boolalg import BooleanFunction class Contains(BooleanFunction): """ Asserts that x is an element of the set S Examples ======== >>> from sympy import Symbol, Integer, S >>> from sympy.sets.contains...
popazerty/oe-alliance-core
refs/heads/2.4
meta-oe/recipes-devtools/python/python-process/process.py
14
import os import signal class Process(object): """Represents a process""" def __init__(self, pid): """Make a new Process object""" self.proc = "/proc/%d" % pid f = open(os.path.join(self.proc, "stat")) pid,command,state,parent_pid = f.read().strip().split()[:4] f.close() command = command[1:-1] self.p...
calancha/DIRAC
refs/heads/rel-v6r12
ResourceStatusSystem/Utilities/ComponentSynchronizer.py
8
# $HeadURL: $ """ ComponentSynchronizer Module that reads ComponentMonitoringDB.compmon_Components table and copies it to a RSS-like family of status tables to make everything easier. """ from DIRAC import gConfig, gLogger, S_OK from DIRAC.FrameworkSystem.DB.Com...
ShineFan/odoo
refs/heads/8.0
openerp/addons/test_uninstall/models.py
341
# -*- coding: utf-8 -*- import openerp from openerp.osv import fields from openerp.osv.orm import Model class test_uninstall_model(Model): """ This model uses different types of columns to make it possible to test the uninstall feature of OpenERP. """ _name = 'test_uninstall.model' _columns = ...
AlericInglewood/3p-google-breakpad
refs/heads/singularity
src/tools/gyp/test/dependencies/gyptest-extra-targets.py
401
#!/usr/bin/env python # Copyright (c) 2009 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. """ Verify that dependencies don't pull unused targets into the build. """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('extra_ta...
Lektorium-LLC/edx-platform
refs/heads/master
lms/djangoapps/course_wiki/tests/test_access.py
19
""" Tests for wiki permissions """ from django.contrib.auth.models import Group from nose.plugins.attrib import attr from wiki.models import URLPath from course_wiki import settings from course_wiki.utils import course_wiki_slug, user_is_article_course_staff from course_wiki.views import get_or_create_root from cours...
alphagov/notify-api
refs/heads/master
migrations/versions/50_added_sender_id.py
1
"""empty message Revision ID: 50_added_sender_id Revises: 40_sent_at_column Create Date: 2015-10-19 15:32:00.951750 """ # revision identifiers, used by Alembic. revision = '50_added_sender_id' down_revision = '40_sent_at_column' from alembic import op import sqlalchemy as sa def upgrade(): ### commands auto g...
TangHao1987/intellij-community
refs/heads/master
python/helpers/pydev/pydev_runfiles_xml_rpc.py
42
import threading import traceback import warnings from _pydev_filesystem_encoding import getfilesystemencoding from pydev_imports import xmlrpclib, _queue Queue = _queue.Queue from pydevd_constants import * #This may happen in IronPython (in Python it shouldn't happen as there are #'fast' replacements that are used i...
satanas/Turpial
refs/heads/development
turpial/ui/gtk/htmlview.py
3
# -*- coding: utf-8 -*- # Widget for HTML view in Turpial # # Author: Wil Alvarez (aka Satanas) import os from gi.repository import Gtk from gi.repository import GLib from gi.repository import WebKit from gi.repository import GObject class HtmlView(Gtk.VBox): __gsignals__ = { "action-request": (GObject....
Gabriel0402/zulip
refs/heads/master
zerver/management/commands/check_redis.py
116
from __future__ import absolute_import from zerver.models import get_user_profile_by_id from zerver.lib.rate_limiter import client, max_api_calls, max_api_window from django.core.management.base import BaseCommand from django.conf import settings from optparse import make_option import time, logging class Command(B...
hojel/calibre
refs/heads/master
src/calibre/gui2/convert/toc.py
14
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' from calibre.gui2.convert.toc_ui import Ui_Form from calibre.gui2.convert import Wi...
ethanbao/api-client-staging-1
refs/heads/master
generated/python/gapic-google-longrunning-v1/docs/conf.py
3
# -*- coding: utf-8 -*- # # gapic-google-longrunning documentation build configuration file # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; valu...
KiranJKurian/XScheduler
refs/heads/master
venv/lib/python2.7/site-packages/pyasn1/compat/__init__.py
3653
# This file is necessary to make this directory a package.
osmocom/osmo-bts
refs/heads/master
contrib/dump_docs.py
1
#!/usr/bin/env python """ Start the process and dump the documentation to the doc dir """ import socket, subprocess, time,os env = os.environ env['L1FWD_BTS_HOST'] = '127.0.0.1' bts_proc = subprocess.Popen(["./src/osmo-bts-sysmo/sysmobts-remote", "-c", "./doc/examples/sysmo/osmo-bts-sysmo.cfg"], env = env, stdi...
mnowster/compose
refs/heads/master
compose/cli/docopt_command.py
17
from __future__ import absolute_import from __future__ import unicode_literals import sys from inspect import getdoc from docopt import docopt from docopt import DocoptExit def docopt_full_help(docstring, *args, **kwargs): try: return docopt(docstring, *args, **kwargs) except DocoptExit: rai...
li6xiang/ts_push
refs/heads/master
.vim/syntax_checkers/python/codec.py
97
#!/usr/bin/env python from __future__ import print_function from sys import argv, exit import codecs import re import os if len(argv) != 2: exit(1) try: with open(argv[1]) as fle: text = fle.readlines() if text: match = re.match(r"#\s*coding\s*:\s*(?P<coding>\w+)", text[0]) if ...
hellsgate1001/bookit
refs/heads/master
docs/env/Lib/site-packages/django/contrib/sessions/middleware.py
215
import time from django.conf import settings from django.utils.cache import patch_vary_headers from django.utils.http import cookie_date from django.utils.importlib import import_module class SessionMiddleware(object): def process_request(self, request): engine = import_module(settings.SESSION_ENGINE) ...
ntt-sic/cinder
refs/heads/master
cinder/tests/test_conf.py
3
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2011 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not...
Jopie64/cppformat
refs/heads/master
support/update-converity-branch.py
2
#!/usr/bin/env python # Update the coverity branch from the master branch. # It is not done automatically because Coverity Scan limits # the number of submissions per day. from __future__ import print_function import shutil, tempfile from subprocess import check_output, STDOUT class Git: def __init__(self, dir): ...
aopp-pred/rpe
refs/heads/master
generator/python/rpgen/operators.py
1
"""Fortran operator definitions.""" # Copyright 2015 Andrew Dawson, Peter Dueben # # 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 ...
graphite-project/carbon
refs/heads/master
lib/carbon/tests/test_util.py
2
import platform import socket import unittest from carbon.util import parseDestinations from carbon.util import enableTcpKeepAlive from carbon.util import TaggedSeries class UtilTest(unittest.TestCase): @unittest.skipIf(platform.system() == 'Darwin', "test_enable_tcp_keep_alive broken on MacOS") def test_en...
MattDevo/edk2
refs/heads/master
BaseTools/Source/Python/UPT/Object/Parser/__init__.py
2
## @file # Python 'Object' package initialization file. # # This file is required to make Python interpreter treat the directory # as containing package. # # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials are licensed and made available # ...
xfournet/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/gis/geos/coordseq.py
411
""" This module houses the GEOSCoordSeq object, which is used internally by GEOSGeometry to house the actual coordinates of the Point, LineString, and LinearRing geometries. """ from ctypes import c_double, c_uint, byref from django.contrib.gis.geos.base import GEOSBase, numpy from django.contrib.gis.geos.error impo...
jjkoletar/panda3d
refs/heads/master
direct/src/http/webAIInspector.py
11
"""This is a web based inspector for the AI System. It can be accessed via http://hostname.domain:port/inspect The hostname.domain would of course be the computer that the AI is running on. The port will need to be defined when the instance is inited. """ import string, time, direct, inspect, socket from operator im...
tucbill/manila
refs/heads/master
manila/tests/image/__init__.py
2
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC. # 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/...
deeponion/deeponion
refs/heads/master
test/functional/wallet_listsinceblock.py
16
#!/usr/bin/env python3 # Copyright (c) 2017-2018 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 the listsincelast RPC.""" from test_framework.test_framework import BitcoinTestFramework from tes...
eneldoserrata/marcos_openerp
refs/heads/master
addons/account_analytic_analysis/__openerp__.py
48
# -*- 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...
interfect/cjdns
refs/heads/master
node_build/dependencies/libuv/build/gyp/test/actions/gyptest-errors.py
351
#!/usr/bin/env python # Copyright (c) 2009 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 behavior for different action configuration errors: exit status of 1, and the expected error message must be in stderr. """ im...
vijayanandnandam/youtube-dl
refs/heads/master
youtube_dl/extractor/viki.py
10
# coding: utf-8 from __future__ import unicode_literals import hashlib import hmac import itertools import json import re import time from .common import InfoExtractor from ..utils import ( ExtractorError, int_or_none, parse_age_limit, parse_iso8601, sanitized_Request, ) class VikiBaseIE(InfoExt...
kernc/networkx
refs/heads/master
examples/pygraphviz/write_dotfile.py
25
#!/usr/bin/env python """ Write a dot file from a networkx graph for further processing with graphviz. You need to have either pygraphviz or pydot for this example. See http://networkx.github.io/documentation/latest/reference/drawing.html for more info. """ __author__ = """Aric Hagberg (hagberg@lanl.gov)""" # Cop...
t0mk/ansible
refs/heads/devel
lib/ansible/modules/cloud/openstack/_nova_keypair.py
21
#!/usr/bin/python #coding: utf-8 -*- # (c) 2013, Benno Joy <benno@ansible.com> # (c) 2013, John Dewey <john@dewey.ws> # # This module 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 Li...
welex91/ansible-modules-core
refs/heads/devel
system/selinux.py
198
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Derek Carter<goozbach@friocorte.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 ...
theguardian/headphones
refs/heads/master
lib/httplib2/__init__.py
24
from __future__ import generators """ httplib2 A caching http interface that supports ETags and gzip to conserve bandwidth. Requires Python 2.3 or later Changelog: 2007-08-18, Rick: Modified so it's able to use a socks proxy if needed. """ __author__ = "Joe Gregorio (joe@bitworking.org)" __copyright__ = "Copyright...
boegel/easybuild-framework
refs/heads/master
easybuild/toolchains/compiler/cuda.py
1
## # Copyright 2013-2020 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (F...
shivylp/xLisp
refs/heads/master
xLisp/evaluator.py
1
from environment import xLispEnvironment class xLispEvaluator(object): def __init__(self, env = None): if env is None: env = xLispEnvironment() self.env = env def evaluate(self, atom_generator): results = [] for atom in atom_generator: results.append(at...
JesusMtnez/devexperto-challenge
refs/heads/master
jesusmtnez/python/koans/koans/about_strings.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutStrings(Koan): def test_double_quoted_strings_are_strings(self): string = "Hello, world." self.assertEqual(True, isinstance(string, str)) def test_single_quoted_strings_are_also_strings(self): string =...
pycassa/pycassa
refs/heads/master
pycassa/marshal.py
1
""" Tools for marshalling and unmarshalling data stored in Cassandra. """ import uuid import struct import calendar from datetime import datetime from decimal import Decimal import pycassa.util as util _number_types = frozenset((int, long, float)) def make_packer(fmt_string): return struct.Struct(fmt_string) ...
jrversteegh/softsailor
refs/heads/master
deps/numpy-1.6.1/numpy/testing/numpytest.py
40
import os import sys import traceback __all__ = ['IgnoreException', 'importall',] DEBUG=0 get_frame = sys._getframe class IgnoreException(Exception): "Ignoring this exception due to disabled feature" def output_exception(printstream = sys.stdout): try: type, value, tb = sys.exc_info() info ...
glovebx/odoo
refs/heads/8.0
addons/base_vat/base_vat.py
238
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2012 OpenERP SA (<http://openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
duncan-r/SHIP
refs/heads/develop
ship/fmp/datunits/spillunit.py
1
""" Summary: Contains the SpillUnit class. This holds all of the data read in from the spill units in the dat file. Can be called to load in the data and read and update the contents held in the object. Author: Duncan R. Created: 01 Apr 2016 Copyright: Duncan Runnacles 2016 TOD...
oberlin/django
refs/heads/master
tests/m2m_through_regress/tests.py
89
from __future__ import unicode_literals from django.contrib.auth.models import User from django.core import management from django.test import TestCase from django.utils.six import StringIO from .models import ( Car, CarDriver, Driver, Group, Membership, Person, UserMembership, ) class M2MThroughTestCase(TestCa...
erichuang1994/tornado
refs/heads/master
maint/scripts/run_fixers.py
124
#!/usr/bin/env python # Usage is like 2to3: # $ maint/scripts/run_fixers.py -wn --no-diffs tornado import sys from lib2to3.main import main sys.exit(main("custom_fixers"))
rdblue/Impala
refs/heads/cdh5-trunk
thirdparty/hive-1.1.0-cdh5.5.0-SNAPSHOT/lib/py/fb303_scripts/__init__.py
214
# # 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...
helinb/Tickeys-linux
refs/heads/master
tickeys/kivy/uix/videoplayer.py
6
''' Video player ============ .. versionadded:: 1.2.0 The video player widget can be used to play video and let the user control the play/pausing, volume and position. The widget cannot be customized much because of the complex assembly of numerous base widgets. .. image:: images/videoplayer.jpg :align: center ...
cedricbonhomme/shelter-database
refs/heads/master
shelter/scripts/export_shelters.py
1
#! /usr/bin/python # -*- coding:utf-8 -* import csv import os.path import sys from web.models import ( Section, Category, Attribute, Property, Value, Association, Shelter, ) from bootstrap import db def export_shelters(dump_file, truncate=""): if truncate == "overwrite": pass ...
mlalevic/pythontsp
refs/heads/master
web/application.py
33
""" Web application (from web.py) """ import webapi as web import webapi, wsgi, utils import debugerror import httpserver from utils import lstrips, safeunicode import sys import urllib import traceback import itertools import os import types from exceptions import SystemExit try: import wsgiref.handlers except ...
jaredks/rumps
refs/heads/master
examples/example_simple.py
2
import rumps import time rumps.debug_mode(True) # turn on command line logging information for development - default is off @rumps.clicked("About") def about(sender): sender.title = 'NOM' if sender.title == 'About' else 'About' # can adjust titles of menu items dynamically rumps.alert("This is a cool app!"...
cirruscluster/cirruscluster
refs/heads/master
cirruscluster/ext/ansible/__init__.py
1
# (c) 2012, 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) any lat...
pumaking/hackracer
refs/heads/master
lib/flask/sessions.py
348
# -*- coding: utf-8 -*- """ flask.sessions ~~~~~~~~~~~~~~ Implements cookie based sessions based on itsdangerous. :copyright: (c) 2012 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import uuid import hashlib from datetime import datetime from werkzeug.http import http_date, ...
LaMi-/pmatic
refs/heads/master
ccu_pkg/python/lib/python2.7/quopri.py
8
#! /usr/bin/python2.7 """Conversions to/from quoted-printable transport encoding as per RFC 1521.""" # (Dec 1991 version). __all__ = ["encode", "decode", "encodestring", "decodestring"] ESCAPE = '=' MAXLINESIZE = 76 HEX = '0123456789ABCDEF' EMPTYSTRING = '' try: from binascii import a2b_qp, b2a_qp except Impor...
codeinthehole/purl
refs/heads/master
purl/template.py
1
import re import functools try: from urllib.parse import quote except ImportError: # Python 2 from urllib import quote from . import url __all__ = ['Template', 'expand'] patterns = re.compile(r"{([^\}]+)}") class Template(object): def __init__(self, url_str): self._base = url_str d...
akail/fiplanner
refs/heads/master
tests/__init__.py
14224
# -*- coding: utf-8 -*-
aviweit/libcloud
refs/heads/trunk
libcloud/test/compute/test_base.py
42
# 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 use ...
victor-prado/broker-manager
refs/heads/master
environment/lib/python3.5/site-packages/pandas/tests/plotting/test_series.py
7
#!/usr/bin/env python # coding: utf-8 import nose import itertools from datetime import datetime import pandas as pd from pandas import Series, DataFrame, date_range from pandas.compat import range, lrange import pandas.util.testing as tm from pandas.util.testing import slow import numpy as np from numpy.random imp...
CiscoUcs/Ironic-UCS
refs/heads/master
build/lib.linux-x86_64-2.7/ironic/objects/port.py
7
# coding=utf-8 # # # 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 writi...
makei/gnome15
refs/heads/master
src/plugins/volume/volume.py
8
# Gnome15 - Suite of tools for the Logitech G series keyboards and headsets # Copyright (C) 2010 Brett Smith <tanktarta@blueyonder.co.uk> # # 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, e...
lukeiwanski/tensorflow-opencl
refs/heads/master
tensorflow/contrib/sparsemax/python/ops/sparsemax.py
104
# 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...
GoogleCloudPlatform/datacatalog-connectors-hive
refs/heads/master
google-datacatalog-hive-connector/src/google/datacatalog_connectors/hive/__init__.py
9
#!/usr/bin/python # # Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
lvgilmore/Luke
refs/heads/master
LukeClient/Disks.py
1
#! /usr/bin/python # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the...
dajusc/trimesh
refs/heads/master
tests/test_ray.py
1
try: from . import generic as g except BaseException: import generic as g class RayTests(g.unittest.TestCase): def test_rays(self): meshes = [g.get_mesh(**k) for k in g.data['ray_data']['load_kwargs']] rays = g.data['ray_data']['rays'] names = [m.metadata['file_n...
shft117/SteckerApp
refs/heads/master
erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.py
17
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe.utils import cstr, cint from frappe import msgprint, _ from calendar import monthrange def execute(filters=None): if not fil...
ABaldwinHunter/django-clone
refs/heads/master
django/template/backends/django.py
28
# Since this package contains a "django" module, this is required on Python 2. from __future__ import absolute_import import sys from importlib import import_module from pkgutil import walk_packages from django.apps import apps from django.conf import settings from django.template import TemplateDoesNotExist from dja...
hellhovnd/django
refs/heads/master
django/contrib/contenttypes/generic.py
3
""" Classes allowing "generic" relations through ContentType and object-id fields. """ from __future__ import unicode_literals from collections import defaultdict from functools import partial from django.core.exceptions import ObjectDoesNotExist from django.db import connection from django.db import models, router, ...
sourabhjains/Selfconfiguring-red
refs/heads/master
src/internet/bindings/callbacks_list.py
19
callback_classes = [ ['void', 'ns3::Ipv6Address', 'unsigned char', 'unsigned char', 'unsigned char', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', 'ns3::empty'], ['void', 'ns3::Ipv4Address', 'unsigned char', 'unsigned char', 'unsigned char', 'unsigned int', 'ns3::empty', 'ns3::empty', 'ns3::empty', ...
meilalina/kotlin-web-site
refs/heads/master
src/pages/MyFlatPages.py
6
import re from flask_flatpages.flatpages import FlatPages from werkzeug.utils import import_string from src.pages.MyPage import MyPage class MyFlatPages(FlatPages): def _parse(self, content, path): """Parse a flatpage file, i.e. read and parse its meta data and body. :return: initialized :class:...
ept/windmill
refs/heads/master
windmill/management/commands/test_windmill.py
1
# Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.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 req...
Gabotero/GNURadioNext
refs/heads/master
gr-trellis/examples/python/test_sccc_hard.py
13
#!/usr/bin/env python from gnuradio import gr from gnuradio import trellis, digital, blocks from gnuradio import eng_notation import math import sys import random import fsm_utils try: from gnuradio import analog except ImportError: sys.stderr.write("Error: Program requires gr-analog.\n") sys.exit(1) def...
bussiere/gitfs
refs/heads/master
tests/cache/__init__.py
36
# Copyright 2014 PressLabs SRL # # 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,...
MER-GROUP/intellij-community
refs/heads/master
python/lib/Lib/site-packages/django/contrib/databrowse/sites.py
329
from django import http from django.db import models from django.contrib.databrowse.datastructures import EasyModel from django.shortcuts import render_to_response from django.utils.safestring import mark_safe class AlreadyRegistered(Exception): pass class NotRegistered(Exception): pass class DatabrowsePlugi...
hnikolov/pihdf_doc
refs/heads/master
_python/filters.py
20
def dateformat(value, format="%d-%b-%Y"): return value.strftime(format) filters = {} filters['dateformat'] = dateformat
GHackAnonymous/qemu
refs/heads/master
scripts/qmp/qmp.py
21
# QEMU Monitor Protocol Python class # # Copyright (C) 2009, 2010 Red Hat Inc. # # Authors: # Luiz Capitulino <lcapitulino@redhat.com> # # This work is licensed under the terms of the GNU GPL, version 2. See # the COPYING file in the top-level directory. import json import errno import socket class QMPError(Excepti...
benpatterson/edx-platform
refs/heads/master
common/test/acceptance/pages/lms/tab_nav.py
112
""" High-level tab navigation. """ from bok_choy.page_object import PageObject from bok_choy.promise import Promise, EmptyPromise class TabNavPage(PageObject): """ High-level tab navigation. """ url = None def is_browser_on_page(self): return self.q(css='ol.course-tabs').present de...
Bashar/django
refs/heads/master
django/db/backends/mysql/client.py
84
import os import sys from django.db.backends import BaseDatabaseClient class DatabaseClient(BaseDatabaseClient): executable_name = 'mysql' def runshell(self): settings_dict = self.connection.settings_dict args = [self.executable_name] db = settings_dict['OPTIONS'].get('db', settings_...
wayneicn/crazyflie-clients-python
refs/heads/master
lib/cflib/utils/__init__.py
40
#!/usr/bin/env python # -*- coding: utf-8 -*- # # || ____ _ __ # +------+ / __ )(_) /_______________ _____ ___ # | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \ # +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/ # || || /_____/_/\__/\___/_/ \__,_/ /___/\___/ # # Copyright (C) 20...
HarmonyEnterpriseSolutions/harmony-platform
refs/heads/master
src/gnue/common/formatting/masks/MaskTokenizer.py
2
# # This file is part of GNU Enterprise. # # GNU Enterprise 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. # # GNU Enterprise is distributed in the h...
EVERROCKET/mobile-data
refs/heads/master
lib/oauth2client/keyring_storage.py
52
# Copyright 2014 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 applicable law or ...
tempbottle/kbengine
refs/heads/master
kbe/res/scripts/common/Lib/importlib/_bootstrap.py
76
"""Core implementation of import. This module is NOT meant to be directly imported! It has been designed such that it can be bootstrapped into Python as the implementation of import. As such it requires the injection of specific modules and attributes in order to work. One should use importlib as the public-facing ver...
iulian787/spack
refs/heads/develop
var/spack/repos/builtin/packages/snap-korf/package.py
2
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) class SnapKorf(MakefilePackage): """SNAP is a general purpose gene finding program suitable for both eukaryoti...
greenaddress/pycoin
refs/heads/master
pycoin/convention/__init__.py
4
import decimal SATOSHI_PER_COIN = decimal.Decimal(1e8) COIN_PER_SATOSHI = decimal.Decimal(1)/SATOSHI_PER_COIN def satoshi_to_btc(satoshi_count): if satoshi_count == 0: return decimal.Decimal(0) r = satoshi_count * COIN_PER_SATOSHI return r.normalize() def btc_to_satoshi(btc): return int(deci...
uberamd/NGECore2
refs/heads/master
scripts/object/tangible/component/armor/armor_layer_heat.py
85615
import sys def setup(core, object): return
piers7/rpi_ws281x
refs/heads/master
python/setup.py
27
# Python wrapper for the rpi_ws281x library. # Author: Tony DiCola (tony@tonydicola.com) from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages, Extension setup(name = 'rpi_ws281x', version = '1.0.0', author = 'Jeremy Garff', ...
eleweek/twitter_sentiment_analysis
refs/heads/master
run.py
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys import models import datasets import inspect import logging import random import numpy as np from sklearn.neural_network import MLPClassifier FORMAT = "%(asctime)s:%(levelname)s:%(name)s:%(message)s" logging.basicConfig(level=logging.INFO, format=FORMAT) def...
ganeshnalawade/ansible
refs/heads/devel
test/lib/ansible_test/_data/sanity/code-smell/use-compat-six.py
68
#!/usr/bin/env python from __future__ import (absolute_import, division, print_function) __metaclass__ = type import re import sys def main(): for path in sys.argv[1:] or sys.stdin.read().splitlines(): with open(path, 'r') as path_fd: for line, text in enumerate(path_fd.readlines()): ...
sinbazhou/odoo
refs/heads/8.0
addons/portal/tests/test_portal.py
198
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
billwanjohi/ansible-modules-core
refs/heads/devel
cloud/quantum_router_interface.py
47
#!/usr/bin/python #coding: utf-8 -*- # (c) 2013, Benno Joy <benno@ansible.com> # # This module 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 ...
piotroxp/scibibscan
refs/heads/master
scib/lib/python3.5/site-packages/wheel/util.py
219
"""Utility functions.""" import sys import os import base64 import json import hashlib __all__ = ['urlsafe_b64encode', 'urlsafe_b64decode', 'utf8', 'to_json', 'from_json', 'matches_requirement'] def urlsafe_b64encode(data): """urlsafe_b64encode without padding""" return base64.urlsafe_b64encode(da...
mrkm4ntr/incubator-airflow
refs/heads/master
airflow/providers/docker/__init__.py
5130
# # 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...
zsoltika/rdbms-subsetter
refs/heads/master
setup.py
8
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys try: from setuptools import setup except ImportError: from distutils.core import setup if sys.argv[-1] == 'publish': os.system('python setup.py sdist upload') sys.exit() curdir = os.path.dirname(os.path.realpath(__file__)) readme = op...
caphrim007/ansible
refs/heads/devel
test/units/module_utils/basic/test_deprecate_warn.py
127
# -*- 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) import json import pytest @pytest.mark.parametrize('stdin', [{}], indirect=['stdin']) def test_warn(am, capfd): am.warn('warning1') with pytest.raises...
GabrielNicolasAvellaneda/kafka
refs/heads/trunk
system_test/mirror_maker_testsuite/mirror_maker_test.py
70
# 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...
cherbear263/gulp-basic
refs/heads/master
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py
1789
# Copyright (c) 2014 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. """Xcode-ninja wrapper project file generator. This updates the data structures passed to the Xcode gyp generator to build with ninja instead. The Xcode project i...
akbargumbira/inasafe
refs/heads/develop
safe/messaging/item/preformatted_text.py
16
""" InaSAFE Disaster risk assessment tool developed by AusAid - **Preformatted.** Contact : ole.moller.nielsen@gmail.com .. note:: 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 ve...