repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
akaariai/django | refs/heads/master | django/contrib/gis/geoip/prototypes.py | 535 | 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... |
nattee/cafe-grader-web | refs/heads/master | lib/assets/Lib/encodings/cp875.py | 37 | """ Python Character Mapping Codec cp875 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP875.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 deco... |
Danielhiversen/home-assistant | refs/heads/master | tests/components/automation/test_webhook.py | 7 | """The tests for the webhook automation trigger."""
from homeassistant.core import callback
from homeassistant.setup import async_setup_component
async def test_webhook_json(hass, aiohttp_client):
"""Test triggering with a JSON webhook."""
events = []
@callback
def store_event(event):
"""Hele... |
alrusdi/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/django/template/loader_tags.py | 44 | from django.template import TemplateSyntaxError, TemplateDoesNotExist, Variable
from django.template import Library, Node, TextNode
from django.template.loader import get_template
from django.conf import settings
from django.utils.safestring import mark_safe
register = Library()
BLOCK_CONTEXT_KEY = 'block_context'
c... |
hrydgard/nodeprep | refs/heads/master | python/convert.py | 1 | from xmpp_stringprep import nodeprep
import json
import logging
import sys
import codecs
import os
sys.stdout = codecs.getwriter("utf-8")(sys.stdout)
for line in sys.stdin.read().split("\n")[:-1]:
try:
a = unicode(line.strip(), "utf-8")
try:
print nodeprep.prepare(a)
except UnicodeError as e:
print "ILLE... |
adityahase/frappe | refs/heads/develop | frappe/printing/doctype/print_settings/test_print_settings.py | 6 | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies and Contributors
# See license.txt
from __future__ import unicode_literals
import unittest
class TestPrintSettings(unittest.TestCase):
pass
|
SeedScientific/polio | refs/heads/master | source_data/migrations/0075_auto__del_sourceshapes.py | 1 | # -*- 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):
# Deleting model 'SourceShapes'
db.delete_table(u'source_data_sourceshape... |
asadziach/tensorflow | refs/heads/pedestrian_detection_walabot_tf | tensorflow/contrib/layers/python/layers/optimizers.py | 12 | # 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... |
liushilive/HTMLReport | refs/heads/master | HTMLReport/log/HandlerFactory.py | 1 | import logging
import logging.handlers
import sys
import threading
from io import StringIO
LOG_LEVEL_NOTSET = logging.NOTSET
LOG_LEVEL_DEBUG = logging.DEBUG
LOG_LEVEL_INFO = logging.INFO
LOG_LEVEL_WARNING = logging.WARNING
LOG_LEVEL_ERROR = logging.ERROR
# logger target
LOG_TARGET_CONSOLE = 0x1
LOG_TARGET_LOG_FILE ... |
837468220/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/lib2to3/fixes/fix_unicode.py | 67 | """Fixer that changes unicode to str, unichr to chr, and u"..." into "...".
"""
import re
from ..pgen2 import token
from .. import fixer_base
_mapping = {"unichr" : "chr", "unicode" : "str"}
_literal_re = re.compile(r"[uU][rR]?[\'\"]")
class FixUnicode(fixer_base.BaseFix):
BM_compatible = True
PATTERN = "ST... |
optimsoc/gzll-binutils | refs/heads/gzll | gdb/python/lib/gdb/__init__.py | 15 | # Copyright (C) 2010-2015 Free Software Foundation, Inc.
# 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 progr... |
LittleLama/Sick-Beard-BoxCar2 | refs/heads/development | lib/hachoir_parser/file_system/linux_swap.py | 90 | """
Linux swap file.
Documentation: Linux kernel source code, files:
- mm/swapfile.c
- include/linux/swap.h
Author: Victor Stinner
Creation date: 25 december 2006 (christmas ;-))
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (ParserError, GenericVector,
UInt32, String,
Bytes,... |
chanceraine/nupic | refs/heads/master | nupic/math/stats.py | 40 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... |
ntymtsiv/tempest | refs/heads/master | tempest/api/compute/admin/test_flavors_access_negative.py | 2 | # Copyright 2013 IBM Corporation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... |
google/syzygy | refs/heads/master | third_party/numpy/files/numpy/lib/tests/test_arraysetops.py | 22 | """ Test functions for 1D array set operations.
"""
from numpy.testing import *
import numpy as np
from numpy.lib.arraysetops import *
import warnings
class TestAso(TestCase):
def test_unique( self ):
a = np.array( [5, 7, 1, 2, 1, 5, 7] )
ec = np.array( [1, 2, 5, 7] )
c = unique( a )
... |
bionoid/kivy | refs/heads/master | kivy/modules/touchring.py | 10 | '''
Touchring
=========
Shows rings around every touch on the surface / screen. You can use this module
to check that you don't have any calibration issues with touches.
Configuration
-------------
:Parameters:
`image`: str, defaults to '<kivy>/data/images/ring.png'
Filename of the image to use.
`sca... |
don-github/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/modulestore/split_mongo/__init__.py | 201 | """
General utilities
"""
from collections import namedtuple
from contracts import contract, check
from opaque_keys.edx.locator import BlockUsageLocator
class BlockKey(namedtuple('BlockKey', 'type id')):
__slots__ = ()
@contract(type="string[>0]")
def __new__(cls, type, id):
return super(BlockKe... |
varunkamra/kuma | refs/heads/master | vendor/packages/babel/messages/mofile.py | 64 | # -*- coding: utf-8 -*-
"""
babel.messages.mofile
~~~~~~~~~~~~~~~~~~~~~
Writing of files in the ``gettext`` MO (machine object) format.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
import array
import struct
from babel.messages.catalog import Catalog, ... |
tkaitchuck/nupic | refs/heads/master | external/linux64/lib/python2.6/site-packages/psutil/_pslinux.py | 4 | #!/usr/bin/env python
#
# $Id: _pslinux.py 800 2010-11-12 21:51:25Z g.rodola $
#
__all__ = ["NUM_CPUS", "TOTAL_PHYMEM",
"PlatformProcess",
"avail_phymem", "used_phymem", "total_virtmem", "avail_virtmem",
"used_virtmem", "get_system_cpu_times", "pid_exists", "get_pid_list",
"... |
cdrooom/odoo | refs/heads/master | addons/l10n_hr/__openerp__.py | 8 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Module: l10n_hr
# Author: Goran Kliska
# mail: goran.kliska(AT)slobodni-programi.hr
# Copyright: Slobodni programi d.o.o., Zagreb
# Contributions:
#... |
felipelindemberg/ControleMultimidiaUniversal | refs/heads/master | Python_Controle_Multimidia_Universal/trunk/Comodo/Room.py | 1 | # coding: utf-8
import sched, time
from threading import Timer
from TV import * # @UnusedWildImport
from SOUND import * # @UnusedWildImport
class Room:
"""Classe Room é uma classe que vai simular um cômodo de uma residência
:version 153
:author Felipe Lindemberg
"""
def __init__(self, name... |
elektroschmock/android_kernel_google_msm | refs/heads/cm-10.2 | tools/perf/scripts/python/netdev-times.py | 11271 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
nlholdem/icodoom | refs/heads/master | .venv/lib/python2.7/site-packages/tensorflow/contrib/learn/python/learn/graph_actions.py | 23 | # 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... |
lmazuel/azure-sdk-for-python | refs/heads/master | azure-mgmt-network/azure/mgmt/network/v2017_03_01/models/virtual_network_peering_py3.py | 1 | # 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 ... |
jmartinm/invenio | refs/heads/master | modules/webstat/lib/webstat_engine.py | 14 | ## This file is part of Invenio.
## Copyright (C) 2007, 2008, 2010, 2011, 2013 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any ... |
iTeam-org/iteam-site | refs/heads/dev | iTeam/pages/views.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Adrien Chardon
# @Date: 2014-08-19 18:35:38
# @Last Modified by: Adrien Chardon
# @Last Modified time: 2014-12-04 16:35:31
# This file is part of iTeam.org.
# Copyright (C) 2014 Adrien Chardon (Nodraak).
#
# iTeam.org is free software: you can redistribute i... |
slevenhagen/odoo-npg | refs/heads/8.0 | addons/base_report_designer/plugin/openerp_report_designer/bin/script/ExportToRML.py | 293 | #########################################################################
#
# Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com
# Copyright (C) 2004-2013 OpenERP SA (<http://openerp.com>).
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser Gene... |
eugene1g/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/watchlist/filenamepattern.py | 134 | # Copyright (C) 2011 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... |
jagguli/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/localflavor/cz/forms.py | 72 | """
Czech-specific form helpers
"""
from django.core.validators import EMPTY_VALUES
from django.forms import ValidationError
from django.forms.fields import Select, RegexField, Field
from django.utils.translation import ugettext_lazy as _
import re
birth_number = re.compile(r'^(?P<birth>\d{6})/?(?P<id>\d{3,4})$')
ic_... |
loumatrix/android_kernel_asus_me301t | refs/heads/android-5.1 | tools/perf/scripts/python/netdev-times.py | 11271 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... |
ProjectFacet/facet | refs/heads/master | project/editorial/migrations/0091_auto_20190512_1710.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2019-05-13 00:10
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('editorial', '0090_auto_20190512_1558'),
]
operations = [
migrations.RemoveF... |
jiadaizhao/LeetCode | refs/heads/master | 0001-0100/0011-Container With Most Water/0011-Container With Most Water.py | 1 | class Solution:
def maxArea(self, height: List[int]) -> int:
left = 0
right = len(height) - 1
maxA = 0
while left < right:
maxA = max(maxA, min(height[left], height[right])*(right - left))
if height[left] <= height[right]:
left += 1
... |
MTgeophysics/mtpy | refs/heads/develop | mtpy/gui/SmartMT/utils/file_handler.py | 1 | """
Description:
todo to be written
Usage:
todo tobe written
Author: YingzhiGou
Date: 20/06/2017
"""
import os
import mtpy.core.mt as mt
from mtpy.utils.mtpylog import MtPyLog
DEFAULT_GROUP_PREFIX = 'Group'
DEFAULT_GROUP = "Default Group"
class FileHandler():
"""
Desc... |
rshipp/python-appassure | refs/heads/development | appassure/core/ICoreCallbackManagement.py | 1 | """AppAssure 5 Core API"""
from appassure.api import AppAssureAPI
class ICoreCallbackManagement(AppAssureAPI):
"""Full documentation online at
http://docs.appassure.com/display/AA50D/ICoreCallbackManagement
"""
def processAgentProtectionRequest(self, data):
"""The method is called by failover... |
fqez/JdeRobot | refs/heads/master | src/libs/comm_py/tests/testMotors.py | 7 | #!/usr/bin/env python3
import config
import comm
import sys
import time
import signal
from jderobotTypes import CMDVel
if __name__ == '__main__':
cfg = config.load(sys.argv[1])
jdrc= comm.init(cfg, "Test")
vel = CMDVel()
vel.vx = 1
vel.az = 0.1
client = jdrc.getMotorsClient("Test.Motors"... |
polyrabbit/WeCron | refs/heads/master | WeCron/wxhook/models.py | 1 | #coding: utf-8
from __future__ import unicode_literals, absolute_import
from django.db import models
# Create your models here.
|
kalahbrown/HueBigSQL | refs/heads/master | desktop/core/ext-py/Paste-2.0.1/tests/test_exceptions/test_httpexceptions.py | 47 | # (c) 2005 Ian Bicking, Clark C. Evans and contributors
# This module is part of the Python Paste Project and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
WSGI Exception Middleware
Regression Test Suite
"""
from nose.tools import assert_raises
from paste.httpexceptions im... |
OCA/stock-logistics-workflow | refs/heads/12.0 | stock_picking_invoice_link/migrations/12.0.2.0.0/post-migrate.py | 1 | # Copyright 2019 Sergio Teruel <sergio.teruel@tecnativa.com>
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
from openupgradelib import openupgrade
@openupgrade.migrate()
def migrate(env, version):
# Convert invoice_line_id Many2one field to Many2many field if relation
# table is empty.
# ... |
odicraig/kodi2odi | refs/heads/master | addons/plugin.video.ZemTV-shani/websocket/tests/test_websocket.py | 57 | # -*- coding: utf-8 -*-
#
import six
import sys
sys.path[0:0] = [""]
import os
import os.path
import base64
import socket
try:
from ssl import SSLError
except ImportError:
# dummy class of SSLError for ssl none-support environment.
class SSLError(Exception):
pass
if sys.version_info[0] == 2 and s... |
perror/checkproject | refs/heads/master | test/example/checks/check_02-codingstyle.py | 1 | from checkproject.case import CheckCase
class CheckProjectFiles3(CheckCase):
"""Checking the content of the projet."""
|
SPriyaJain/studybuddy | refs/heads/master | env/lib/python2.7/site-packages/requests/packages/urllib3/fields.py | 288 | from __future__ import absolute_import
import email.utils
import mimetypes
from .packages import six
def guess_content_type(filename, default='application/octet-stream'):
"""
Guess the "Content-Type" of a file.
:param filename:
The filename to guess the "Content-Type" of using :mod:`mimetypes`.
... |
Samsung/skia | refs/heads/dev/m36_1985 | third_party/externals/gyp/test/win/gyptest-cl-default-char-is-unsigned.py | 269 | #!/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 DefaultCharIsUnsigned option is functional.
"""
import TestGyp
import sys
if sys.platform == 'win32':
test = TestGyp.Test... |
daniel-bulger/word-sense-disambiguator | refs/heads/master | disambiguator/get_similarities.py | 1 | from nltk.corpus import brown
import sys
from graph import Graph,merge_graphs
from nltk.tree import ParentedTree
from stat_parser import Parser
parser = Parser()
user_sentence = sys.argv[1]
query = sys.argv[2]
trees = []
done = 0
# for sentence in brown.sents():
# if done >= 20:
# break
# if not query in sentence:... |
RogerioBorba/geonode | refs/heads/master | geonode/layers/views.py | 4 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2012 OpenPlans
#
# 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 versio... |
andresriancho/billiard | refs/heads/master | billiard/popen_fork.py | 2 | import os
import sys
import signal
import errno
from . import util
__all__ = ['Popen']
#
# Start child process using fork
#
class Popen(object):
method = 'fork'
def __init__(self, process_obj):
sys.stdout.flush()
sys.stderr.flush()
self.returncode = None
self._launch(proces... |
jericks/geoscript-py | refs/heads/master | geoscript/geom/multipolygon.py | 1 | from com.vividsolutions.jts.geom import MultiPolygon as _MultiPolygon
from geoscript import core
from polygon import Polygon
import geom
class MultiPolygon(_MultiPolygon):
"""
A MultiPolygon geometry.
*polygons* is a variable number of multidimensional lists of ``list``/``tuple``.
>>> MultiPolygon( [ [[1,2],... |
supersven/intellij-community | refs/heads/master | python/testData/resolve/multiFile/importSubmodule/ImportSubmodule.py | 83 | import p1.m1
p1.m1
# <ref> |
etherkit/OpenBeacon2 | refs/heads/master | client/linux-x86/venv/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-boto.py | 3 | # ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE.GPL.txt, distributed with
# this software.
#
# SPD... |
open-synergy/vertical-community | refs/heads/8.0 | __unreviewed__/community/__init__.py | 4 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Yannick Buron. Copyright Yannick Buron
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by t... |
enovance/numeter | refs/heads/master | web-app/numeter_webapp/multiviews/management/commands/skeleton.py | 2 | from django.core.management.base import BaseCommand, CommandError
from core.models import Host, Plugin, Data_Source as Source
from multiviews.models import Skeleton, View
from configuration.forms.skeleton import Skeleton_Form
from core.management.commands._utils import CommandDispatcher
from optparse import make_opti... |
Nexenta/cinder | refs/heads/master | cinder/volume/flows/api/create_volume.py | 1 | # 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
# d... |
p0psicles/SickGear | refs/heads/master | lib/hachoir_parser/archive/zip.py | 90 | """
Zip splitter.
Status: can read most important headers
Authors: Christophe Gisquet and Victor Stinner
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet, ParserError,
Bit, Bits, Enum,
TimeDateMSDOS32, SubFile,
UInt8, UInt16, UInt32, UInt64,
String, PascalString16... |
mat650/metagoofil | refs/heads/master | hachoir_parser/misc/ole2_util.py | 74 | from hachoir_core.endian import BIG_ENDIAN, LITTLE_ENDIAN
from hachoir_core.field import RawBytes, RootSeekableFieldSet, ParserError
from hachoir_parser import HachoirParser
class OLE2FragmentParser(HachoirParser,RootSeekableFieldSet):
tags = {
"description": "Microsoft Office document subfragments",
}... |
silly-wacky-3-town-toon/SOURCE-COD | refs/heads/master | toontown/ai/DistributedHydrantZeroMgrAI.py | 5 | from direct.directnotify import DirectNotifyGlobal
from toontown.ai.DistributedPhaseEventMgrAI import DistributedPhaseEventMgrAI
class DistributedHydrantZeroMgrAI(DistributedPhaseEventMgrAI):
notify = DirectNotifyGlobal.directNotify.newCategory("DistributedHydrantZeroMgrAI")
|
riklaunim/django-custom-multisite | refs/heads/master | tests/modeltests/model_package/models/article.py | 150 | from django.contrib.sites.models import Site
from django.db import models
class Article(models.Model):
sites = models.ManyToManyField(Site)
headline = models.CharField(max_length=100)
publications = models.ManyToManyField("model_package.Publication", null=True, blank=True,)
class Meta:
app_la... |
Dhivyap/ansible | refs/heads/devel | lib/ansible/plugins/test/__init__.py | 673 | # Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
|
LibriCerule/Cerulean_Tracking | refs/heads/master | env/lib/python3.5/site-packages/requests/packages/urllib3/contrib/ntlmpool.py | 1009 | """
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10
"""
try:
from http.client import HTTPSConnection
except ImportError:
from httplib import HTTPSConnection
from logging import getLogger
from ntlm import ntlm
from urllib3 import HTT... |
huongttlan/statsmodels | refs/heads/master | statsmodels/sandbox/examples/example_gam.py | 33 | '''original example for checking how far GAM works
Note: uncomment plt.show() to display graphs
'''
example = 2 # 1,2 or 3
import numpy as np
import numpy.random as R
import matplotlib.pyplot as plt
from statsmodels.sandbox.gam import AdditiveModel
from statsmodels.sandbox.gam import Model as GAM #?
from statsmode... |
WillGuan105/django | refs/heads/master | django/contrib/postgres/fields/array.py | 186 | import json
from django.contrib.postgres import lookups
from django.contrib.postgres.forms import SimpleArrayField
from django.contrib.postgres.validators import ArrayMaxLengthValidator
from django.core import checks, exceptions
from django.db.models import Field, IntegerField, Transform
from django.utils import six
f... |
patilsangram/erpnext | refs/heads/develop | erpnext/selling/doctype/lead_source/lead_source.py | 53 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class LeadSource(Document):
pass
|
walteranderson/python-koans | refs/heads/master | python3/koans/about_dictionaries.py | 91 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Based on AboutHashes in the Ruby Koans
#
from runner.koan import *
class AboutDictionaries(Koan):
def test_creating_dictionaries(self):
empty_dict = dict()
self.assertEqual(dict, type(empty_dict))
self.assertDictEqual({}, empty_dict)
... |
TeamSWAP/swap | refs/heads/master | external/pyinstaller/PyInstaller/depend/impdirector.py | 10 | #-----------------------------------------------------------------------------
# Copyright (c) 2013, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this softwa... |
asedunov/intellij-community | refs/heads/master | python/lib/Lib/dummy_threading.py | 102 | """Faux ``threading`` version using ``dummy_thread`` instead of ``thread``.
The module ``_dummy_threading`` is added to ``sys.modules`` in order
to not have ``threading`` considered imported. Had ``threading`` been
directly imported it would have made all subsequent imports succeed
regardless of whether ``thread`` wa... |
OpenVnmrJ/OpenVnmrJ | refs/heads/master | src/ddr/adm/acq/verifyCntlrsFlash.py | 1 | # -*- coding: utf-8 -*-
from __future__ import print_function
"""
This script Verifies the VNMRS Digital Controllers Flash Contents
It Compares the files on the controller's flash to those in /Vnmr/acq/download
If it finds mismatches , it downdloads the files from /vnmr/acq/download to
the controller's f... |
ryosuzuki/crowdsource-platform | refs/heads/develop2 | crowdsourcing/permissions/project.py | 3 | __author__ = 'dmorina'
from rest_framework import permissions
class IsProjectOwnerOrCollaborator(permissions.BasePermission):
def has_object_permission(self, request, view, obj):
if obj.owner == request.user.userprofile.requester:
return True
for collaborator in obj.collaborators.all():... |
kotfic/girder | refs/heads/master | plugins/dicom_viewer/plugin_tests/dicom_viewer_test.py | 2 | import os
import json
import six
from girder.models.collection import Collection
from girder.models.folder import Folder
from girder.models.item import Item
from girder.models.upload import Upload
from girder.models.user import User
import pydicom
from tests import base
from girder_dicom_viewer import _removeUniqueMe... |
nowismytime/laughing-waffle | refs/heads/master | copy3.py | 1 | import nltk
# floyd warshall algorithm
def flwa(gmatrix):
N = len(gmatrix[0])
dmatrix = []
for a in range(N):
temp = []
for b in range(N):
temp.extend([0])
dmatrix.append(temp)
for a in range(N):
for b in range(N):
if (a!=b) & (gmatrix[a][b]==0)... |
civisanalytics/ansible | refs/heads/civis | lib/ansible/modules/cloud/ovirt/ovirt_vms_facts.py | 13 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... |
marcellodesales/svnedge-console | refs/heads/master | svn-server/lib/pygments/lexers/other.py | 54 | # -*- coding: utf-8 -*-
"""
pygments.lexers.other
~~~~~~~~~~~~~~~~~~~~~
Lexers for other languages.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, include, bygroups, using, \
... |
pombredanne/SmartNotes | refs/heads/master | appengine_django/management/commands/console.py | 49 | #!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
drglove/SickRage | refs/heads/master | lib/unidecode/x05b.py | 252 | data = (
'Gui ', # 0x00
'Deng ', # 0x01
'Zhi ', # 0x02
'Xu ', # 0x03
'Yi ', # 0x04
'Hua ', # 0x05
'Xi ', # 0x06
'Hui ', # 0x07
'Rao ', # 0x08
'Xi ', # 0x09
'Yan ', # 0x0a
'Chan ', # 0x0b
'Jiao ', # 0x0c
'Mei ', # 0x0d
'Fan ', # 0x0e
'Fan ', # 0x0f
'Xian ', # 0x10
'Yi '... |
pombredanne/dynd-python | refs/heads/master | dynd/tests/test_nd_groupby.py | 3 | import sys
import unittest
from dynd import nd, ndt
"""
Todo: Fix this
class TestGroupBy(unittest.TestCase):
def test_immutable(self):
a = nd.array([
('x', 0),
('y', 1),
('x', 2),
('x', 3),
('y', 4)],
dtype='{A:... |
renaelectronics/linuxcnc | refs/heads/master | tests/motion-logger/mountaindew/test-ui.py | 16 | #!/usr/bin/env python
import linuxcnc
import hal
import time
import sys
#
# connect to LinuxCNC
#
c = linuxcnc.command()
s = linuxcnc.stat()
e = linuxcnc.error_channel()
#
# Come out of E-stop, turn the machine on, home, and switch to Auto mode.
#
c.state(linuxcnc.STATE_ESTOP_RESET)
c.state(linuxcnc.STATE_ON)
c... |
google/google-ctf | refs/heads/master | third_party/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/profile.py | 50 | #! /usr/bin/env python
#
# Class for profiling python code. rev 1.0 6/2/94
#
# Based on prior profile module by Sjoerd Mullender...
# which was hacked somewhat by: Guido van Rossum
"""Class for profiling Python code."""
# Copyright 1994, by InfoSeek Corporation, all rights reserved.
# Written by James Ro... |
markgw/jazzparser | refs/heads/master | annotator/annotator/bin/count_chord_type_use.py | 1 | """
Prints a count of the
"""
import sys
from django.db.models import Count
from apps.sequences.models import Chord, ChordType
from optparse import OptionParser
from jazzparser.tableprint import pprint_table
def count_chords(options, arguments):
table = [["Chord type", "Count"]]
for ctype in ChordType.objec... |
saurabh6790/ON-RISAPP | refs/heads/master | stock/report/delivery_note_trends/delivery_note_trends.py | 30 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from controllers.trends import get_columns,get_data
def execute(filters=None):
if not filters: filters ={}
data = []
conditions =... |
amenonsen/ansible | refs/heads/devel | lib/ansible/modules/cloud/google/gcp_sql_user_info.py | 5 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... |
vvv1559/intellij-community | refs/heads/master | python/lib/Lib/distutils/command/install_data.py | 138 | """distutils.command.install_data
Implements the Distutils 'install_data' command, for installing
platform-independent data files."""
# contributed by Bastian Kleineidam
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id: install_data.py 37828 2004-11-10 22:23:15Z loewis $"
import os
from... |
zbal/ansible | refs/heads/devel | lib/ansible/playbook/__init__.py | 108 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
odyaka341/pyglet | refs/heads/master | contrib/spryte/tilemap.py | 29 | from pyglet import image
import spryte
class Map(spryte.SpriteBatch):
'''Rectangular map.
"cells" argument must be a row-major list of lists of Sprite instances.
'''
def set_cells(self, cell_width, cell_height, cells, origin=None):
self.cell_width, self.cell_height = cell_width, cell_height
... |
d53dave/cgopt | refs/heads/master | examples/langermann/langermann_opt.py | 2 | import math
from csaopt.utils import clamp
from typing import MutableSequence, Sequence, Any, Tuple
from math import pi
# -- Globals
m = 5
c = (1, 2, 5, 2, 3)
A = ((3, 5), (5, 2), (2, 1), (1, 4), (7, 9))
# -- Globals
# Configuration
def empty_state() -> Tuple:
return (0.0, 0.0)
# Functions
def cool(initi... |
spinellic/Mission-Planner | refs/heads/master | Lib/distutils/dir_util.py | 53 | """distutils.dir_util
Utility functions for manipulating directories and directory trees."""
__revision__ = "$Id$"
import os
import errno
from distutils.errors import DistutilsFileError, DistutilsInternalError
from distutils import log
# cache for by mkpath() -- in addition to cheapening redundant calls,... |
jamslevy/gsoc | refs/heads/master | thirdparty/google_appengine/lib/django/django/db/backends/mysql_old/introspection.py | 32 | from django.db.backends.mysql_old.base import quote_name
from MySQLdb import ProgrammingError, OperationalError
from MySQLdb.constants import FIELD_TYPE
import re
foreign_key_re = re.compile(r"\sCONSTRAINT `[^`]*` FOREIGN KEY \(`([^`]*)`\) REFERENCES `([^`]*)` \(`([^`]*)`\)")
def get_table_list(cursor):
"Returns ... |
sunlianqiang/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/site-packages/setuptools/tests/test_develop.py | 286 | """develop tests
"""
import sys
import os, shutil, tempfile, unittest
import tempfile
import site
from distutils.errors import DistutilsError
from setuptools.command.develop import develop
from setuptools.command import easy_install as easy_install_pkg
from setuptools.compat import StringIO
from setuptools.dist import... |
abztrakt/django-badger | refs/heads/master | badger/tests/test_feeds.py | 3 | import logging
import feedparser
from django.conf import settings
from django.http import HttpRequest
from django.test.client import Client
from pyquery import PyQuery as pq
from nose.tools import assert_equal, with_setup, assert_false, eq_, ok_
from nose.plugins.attrib import attr
from django.template.defaultfilt... |
wschoenell/chimera | refs/heads/master | src/chimera/core/eventwrapper.py | 5 | #! /usr/bin/env python
# -*- coding: iso-8859-1 -*-
# chimera - observatory automation system
# Copyright (C) 2006-2007 P. Henrique Silva <henrique@astro.ufsc.br>
# 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 S... |
SebNickel/garrick | refs/heads/master | pick_card.py | 1 | from random import random
import card_repository
def pick_card(conn, cursor):
card = None
while card == None:
random_float = random()
if random_float < 0.4:
score = 0
elif random_float < 0.7:
score = 1
elif random_float < 0.85:
score = 2
... |
jdurbin/sandbox | refs/heads/master | python/basics/scripts/Dfileutilstest.py | 1 | #!/usr/bin/env python
from DFileUtils import *
TellMeYouLoveMe()
|
marc-sensenich/ansible | refs/heads/devel | lib/ansible/template/__init__.py | 3 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
mozilla/popcorn_maker | refs/heads/master | vendor-local/lib/python/requests/packages/oreos/__init__.py | 53 | # -*- coding: utf-8 -*-
from .core import dict_from_string |
vabs22/zulip | refs/heads/master | tools/linter_lib/custom_check.py | 1 | # -*- coding: utf-8 -*-
from __future__ import print_function
from __future__ import absolute_import
import os
import re
import traceback
from .printer import print_err, colors
from typing import cast, Any, Callable, Dict, List, Optional, Tuple
def build_custom_checkers(by_lang):
# type: (Dict[str, List[str]])... |
marineam/coreos-dev-util | refs/heads/master | constants.py | 3 | # Copyright (c) 2011 The Chromium OS 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 os
# Used for importing chromite which is expected to be 3 levels up from
# this file.
SOURCE_ROOT = os.path.join(os.path.dirname(__file__), o... |
simongoffin/my_odoo_tutorial | refs/heads/master | addons/account_analytic_plans/__init__.py | 445 | # -*- 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... |
ahmetdaglarbas/e-commerce | refs/heads/tez | sites/sandbox/apps/user/models.py | 43 | """
Sample user/profile models for testing. These aren't enabled by default in the
sandbox
"""
from django.db import models
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from oscar.core import compat
from oscar.apps.customer import abstract_models
class Profile(mod... |
hongbin-liu/nxt-python | refs/heads/master | nxt/brick.py | 21 | # nxt.brick module -- Classes to represent LEGO Mindstorms NXT bricks
# Copyright (C) 2006 Douglas P Lau
# Copyright (C) 2009 Marcus Wanner, rhn
# Copyright (C) 2010 rhn, Marcus Wanner, zonedabone
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public ... |
KnCMiner/bitcoin | refs/heads/knc | contrib/devtools/update-translations.py | 168 | #!/usr/bin/python
# Copyright (c) 2014 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Run this script from the root of the repository to update all translations from
transifex.
It will do the following... |
boegel/easybuild-easyblocks | refs/heads/master | easybuild/easyblocks/i/ifort.py | 1 | ##
# Copyright 2009-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... |
mfraezz/osf.io | refs/heads/develop | addons/box/settings/defaults.py | 14 | # OAuth app keys
BOX_KEY = None
BOX_SECRET = None
# https://docs.box.com/docs/oauth-20#section-6-using-the-access-and-refresh-tokens
EXPIRY_TIME = 60 * 60 * 24 * 60 # 60 days
REFRESH_TIME = 5 * 60 # 5 minutes
BOX_OAUTH_TOKEN_ENDPOINT = 'https://www.box.com/api/oauth2/token'
BOX_OAUTH_AUTH_ENDPOINT = 'https://www.bo... |
Telestream/telestream-cloud-python-sdk | refs/heads/master | telestream_cloud_qc_sdk/telestream_cloud_qc/models/p_se_parameter_type.py | 1 | # coding: utf-8
"""
Qc API
Qc API # noqa: E501
The version of the OpenAPI document: 3.0.0
Contact: cloudsupport@telestream.net
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from telestream_cloud_qc.configuration import Configuration
class... |
creativcoder/servo | refs/heads/master | tests/wpt/css-tests/tools/pytest/_pytest/pastebin.py | 181 | """ submit failure or test session information to a pastebin service. """
import pytest
import sys
import tempfile
def pytest_addoption(parser):
group = parser.getgroup("terminal reporting")
group._addoption('--pastebin', metavar="mode",
action='store', dest="pastebin", default=None,
choices=[... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.