repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
nck0405/MyOwn | refs/heads/master | controllers/scenario.py | 18 | # -*- coding: utf-8 -*-
"""
Scenario Module - Controllers
http://eden.sahanafoundation.org/wiki/BluePrintScenario
"""
module = request.controller
resourcename = request.function
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
# ----------------------------------... |
polymorphm/LiRuReferer | refs/heads/master | _liru_referer_lib__api_2655426353/task_widget.py | 1 | #-*- coding: utf-8 -*-
#
# This program 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 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the h... |
kalahbrown/HueBigSQL | refs/heads/master | desktop/core/ext-py/requests-2.6.0/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py | 2057 | try:
# Python 3.2+
from ssl import CertificateError, match_hostname
except ImportError:
try:
# Backport of the function from a pypi module
from backports.ssl_match_hostname import CertificateError, match_hostname
except ImportError:
# Our vendored copy
from ._implementati... |
kbdick/RecycleTracker | refs/heads/gh-pages | recyclecollector/scrap/gdata-2.0.18/upload-diffs.py | 23 | #!/usr/bin/env python
#
# Copyright 2007 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 o... |
michaelgallacher/intellij-community | refs/heads/master | python/testData/completion/keywordArgumentsForImplicitCall.after.py | 83 | class C:
def xyzzy(self, shazam):
pass
def foo(param):
param.xyzzy(shazam=)
|
jn7163/django | refs/heads/master | django/db/backends/base/schema.py | 339 | import hashlib
import logging
from django.db.backends.utils import truncate_name
from django.db.transaction import atomic
from django.utils import six
from django.utils.encoding import force_bytes
logger = logging.getLogger('django.db.backends.schema')
def _related_non_m2m_objects(old_field, new_field):
# Filte... |
yousafsyed/casperjs | refs/heads/master | bin/Lib/lib2to3/fixes/fix_exitfunc.py | 140 | """
Convert use of sys.exitfunc to use the atexit module.
"""
# Author: Benjamin Peterson
from lib2to3 import pytree, fixer_base
from lib2to3.fixer_util import Name, Attr, Call, Comma, Newline, syms
class FixExitfunc(fixer_base.BaseFix):
keep_line_order = True
BM_compatible = True
PATTERN = """
... |
ffissore/badger | refs/heads/master | yun/root/oauth2client/__init__.py | 36 | """Client library for using OAuth2, especially with Google APIs."""
__version__ = '1.4.11'
GOOGLE_AUTH_URI = 'https://accounts.google.com/o/oauth2/auth'
GOOGLE_DEVICE_URI = 'https://accounts.google.com/o/oauth2/device/code'
GOOGLE_REVOKE_URI = 'https://accounts.google.com/o/oauth2/revoke'
GOOGLE_TOKEN_URI = 'https://... |
Alwnikrotikz/dpkt | refs/heads/master | dpkt/dpkt.py | 16 |
# $Id$
"""Simple packet creation and parsing."""
import copy, itertools, socket, struct
class Error(Exception): pass
class UnpackError(Error): pass
class NeedData(UnpackError): pass
class PackError(Error): pass
class _MetaPacket(type):
def __new__(cls, clsname, clsbases, clsdict):
t = type.__new__(cls,... |
mtivadar/qiew | refs/heads/master | HexViewMode.py | 1 | from ViewMode import *
from cemu import *
import TextSelection
from TextDecorators import *
import string
import PyQt5
from PyQt5 import QtGui, QtCore, QtWidgets
class HexViewMode(ViewMode):
def __init__(self, width, height, data, cursor, widget=None, plugin=None):
super(HexViewMode, self).__init__()
... |
szilveszter/django | refs/heads/master | tests/invalid_models_tests/test_relative_fields.py | 12 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from django.core.checks import Error, Warning as DjangoWarning
from django.db import models
from django.test.utils import override_settings
from django.test.testcases import skipIfDBFeature
from .base import IsolatedModelsTestCase
class RelativeField... |
nivertech/duktape | refs/heads/master | website/buildimages.py | 15 | #!/bin/python
#
# Build data URIs for images. Results are manually embedded into CSS.
#
# https://en.wikipedia.org/wiki/Data_URI_scheme
#
import base64
if __name__ == '__main__':
for image in [
'bg-c.png', 'bg-ecmascript.png',
'bg-c-2.png', 'bg-ecmascript-2.png'
]:
f = open(image, 'rb')
data = f.read... |
CWatM/CWatM | refs/heads/version091 | cwatm/hydrological_modules/soil.py | 1 | # -------------------------------------------------------------------------
# Name: Soil module
# Purpose:
#
# Author: PB
#
# Created: 15/07/2016
# Copyright: (c) PB 2016 based on PCRGLOBE, LISFLOOD, HBV
# -------------------------------------------------------------------------
from cwatm.management... |
pauloschilling/sentry | refs/heads/master | src/sentry/rules/actions/notify_event.py | 25 | """
sentry.rules.actions.notify_event
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from sentry.plugins import plugins
from sentry.rules.actions.base import EventAct... |
clinicalml/theanomodels | refs/heads/master | utils/checkin.py | 1 | import smtplib
from email.mime.text import MIMEText
# Open a plain text file for reading. For this example, assume that
# the text file contains only ASCII characters.
fp = open(textfile, 'rb')
# Create a text/plain message
msg = MIMEText(fp.read())
fp.close()
# me == the sender's email address
# you == the recipien... |
JasonCC/stm32radio | refs/heads/master | rt-thread/components/rtgui/common/freetype/builds/mac/ascii2mpw.py | 830 | #!/usr/bin/env python
import sys
import string
if len( sys.argv ) == 1 :
for asc_line in sys.stdin.readlines():
mpw_line = string.replace(asc_line, "\\xA5", "\245")
mpw_line = string.replace(mpw_line, "\\xB6", "\266")
mpw_line = string.replace(mpw_line, "\\xC4", "\304")
mpw_line = string.replace(mpw_... |
PlayUAV/MissionPlanner | refs/heads/master | Lib/uu.py | 62 | #! /usr/bin/env python
# Copyright 1994 by Lance Ellinghouse
# Cathedral City, California Republic, United States of America.
# All Rights Reserved
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# ... |
matthiasdiener/spack | refs/heads/develop | var/spack/repos/builtin/packages/bertini/package.py | 5 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... |
sheqi/TVpgGLM | refs/heads/master | test/practice6_pystan_hmc_Qi_loop_test.py | 1 | import pickle
import numpy as np
import numpy.random as npr
import matplotlib.pyplot as plt
from pyglm.utils.utils import expand_scalar, compute_optimal_rotation
dim = 2
N = 20
r = 1 + np.arange(N) // (N/2.)
th = np.linspace(0, 4 * np.pi, N, endpoint=False)
x = r * np.cos(th)
y = r * np.sin(th)
L = np.hstack((x[:, Non... |
mindbody/API-Examples | refs/heads/master | SDKs/Python/test/test_checkout_appointment_booking_request.py | 1 | # coding: utf-8
"""
MINDBODY Public API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v6
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
impo... |
Emergya/icm-openedx-educamadrid-platform-basic | refs/heads/ci | lms/djangoapps/certificates/tests/test_cert_management.py | 70 | """Tests for the resubmit_error_certificates management command. """
import ddt
from contextlib import contextmanager
from django.core.management.base import CommandError
from nose.plugins.attrib import attr
from django.test.utils import override_settings
from mock import patch
from opaque_keys.edx.locator import Cour... |
andmos/ansible | refs/heads/devel | lib/ansible/module_utils/gitlab.py | 37 | # -*- coding: utf-8 -*-
# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr)
# Copyright: (c) 2018, Marcus Watkins <marwatk@marcuswatkins.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import
import json
from ansible.module_u... |
currychou/1 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/pickle.py | 1265 | from json import * |
apahim/avocado-misc-tests | refs/heads/master | io/net/infiniband/ucmatose.py | 1 | #!/usr/bin/env 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 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that ... |
frappe/erpnext | refs/heads/develop | erpnext/hotels/doctype/hotel_room_type/hotel_room_type.py | 19 | # -*- coding: utf-8 -*-
# Copyright (c) 2017, 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 HotelRoomType(Document):
pass
|
ambimorph/malaprop | refs/heads/master | malaprop/test/test_corrector.py | 1 | # test_corrector.py
from malaprop.correction.corrector import *
from recluse.nltk_based_segmenter_tokeniser import *
from malaprop.correction.HMM import *
from DamerauLevenshteinDerivor.cderivor import Derivor
from BackOffTrigramModel.BackOffTrigramModelPipe import BackOffTMPipe
import unittest, StringIO, subprocess
... |
was4444/chromium.src | refs/heads/nw15 | chrome/common/extensions/docs/server2/compiled_file_system_test.py | 79 | #!/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 functools
import os
from compiled_file_system import Cache, CompiledFileSystem
from copy import deepcopy
from environment impor... |
jswope00/griffinx | refs/heads/master | common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py | 7 | """
A Self Assessment module that allows students to write open-ended responses,
submit, then see a rubric and rate themselves. Persists student supplied
hints, answers, and assessment judgment (currently only correct/incorrect).
Parses xml definition file--see below for exact format.
"""
import json
import logging
f... |
eranroz/revscoring | refs/heads/master | revscoring/languages/vietnamese.py | 1 | import re
import sys
import enchant
from .language import Language, LanguageUtility
# https://vi.wiktionary.org/wiki/Th%C3%A0nh_vi%C3%AAn:Laurent_Bouvier/Free_Vietnamese_Dictionary_Project_Vietnamese-Vietnamese#Allwiki_.28closed.29
STOPWORDS = set([
"ai", "bằng", "bị", "bộ", "cho", "chưa", "chỉ", "cuối", "cuộc",... |
specify/specify7 | refs/heads/next-release | specifyweb/workbench/upload/column_options.py | 1 | from typing import List, Dict, Any, NamedTuple, Union, Optional, Set
from typing_extensions import Literal
MatchBehavior = Literal["ignoreWhenBlank", "ignoreAlways", "ignoreNever"]
class ColumnOptions(NamedTuple):
column: str
matchBehavior: MatchBehavior
nullAllowed: bool
default: Optional[str]
d... |
drawks/ansible | refs/heads/devel | test/units/modules/storage/netapp/test_na_ontap_lun_copy.py | 43 | # (c) 2018, NetApp, Inc
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
''' unit test template for ONTAP Ansible module '''
from __future__ import print_function
import json
import pytest
from units.compat import unittest
from units.compat.mock import patch, Mock
from ans... |
ritashugisha/MoonMovie | refs/heads/master | requests/compat.py | 571 | # -*- coding: utf-8 -*-
"""
pythoncompat
"""
from .packages import chardet
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_py3 = (_ver[0] == 3)
#: Python 3.0.x
is_py30 = (is_py3 and _ver[1] == 0)
#: Python 3.1.x
is_py31 =... |
Linkinzoo/H5Exercise | refs/heads/master | Task11_SASS学习/JiKe/node_modules/node-gyp/gyp/pylib/gyp/common_test.py | 2542 | #!/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.
"""Unit tests for the common.py file."""
import gyp.common
import unittest
import sys
class TestTopologicallySorted(unittest.TestCase):
... |
olegv142/stm32tivc_usb_cdc | refs/heads/master | tools/cdc_detect.py | 1 | # Enumerate registered USB devices on windows host
import _winreg as reg
def cdc_enum(vid, pid):
"""Returns the list of port names for the giver VID/PID"""
k, i = None, 0
ports = []
try:
k = reg.OpenKey(reg.HKEY_LOCAL_MACHINE, "SYSTEM\CurrentControlSet\Enum\USB\Vid_%04x&Pid_%04x" % (vid, pid))
while True:
... |
ESSolutions/ESSArch_Core | refs/heads/master | ESSArch_Core/essxml/ProfileMaker/migrations/0003_auto_20160830_0701.py | 1 | """
ESSArch is an open source archiving and digital preservation system
ESSArch
Copyright (C) 2005-2019 ES Solutions AB
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... |
odubno/microblog | refs/heads/master | venv/lib/python2.7/site-packages/babel/messages/catalog.py | 86 | # -*- coding: utf-8 -*-
"""
babel.messages.catalog
~~~~~~~~~~~~~~~~~~~~~~
Data structures for message catalogs.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
import re
import time
from cgi import parse_header
from datetime import datetime, time as time_... |
jeanlinux/calibre | refs/heads/master | src/calibre/utils/chm/chm.py | 22 | ## Copyright (C) 2003-2006 Rubens Ramos <rubensr@users.sourceforge.net>
## Based on code by:
## Copyright (C) 2003 Razvan Cojocaru <razvanco@gmx.net>
## pychm 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 Foundatio... |
Neitsch/ASE4156 | refs/heads/master | stocks/migrations/0015_auto_20171014_1627.py | 2 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2017-10-14 16:27
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('stocks', '0014_auto_20171014_1355'),
]
operations = [... |
jabez1314/youtube-dl | refs/heads/master | youtube_dl/extractor/kaltura.py | 63 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse
from ..utils import (
ExtractorError,
int_or_none,
)
class KalturaIE(InfoExtractor):
_VALID_URL = r'''(?x)
(?:kaltura:|
https?://(:?(?:www|cdnapisec)\.)... |
cbrepo/celery | refs/heads/django16 | celery/tests/test_task/__init__.py | 14 | from __future__ import absolute_import
from __future__ import with_statement
from datetime import datetime, timedelta
from functools import wraps
from celery import task
from celery.app import app_or_default
from celery.task import task as task_dec
from celery.exceptions import RetryTaskError
from celery.execute impo... |
jallohm/django | refs/heads/master | tests/str/tests.py | 149 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from unittest import skipIf
from django.test import TestCase
from django.utils import six
from .models import Article, InternationalArticle
class SimpleTests(TestCase):
@skipIf(six.PY3, "tests a __str__ method returning unicode un... |
sekikn/ambari | refs/heads/trunk | ambari-common/src/main/python/ambari_jinja2/ambari_jinja2/testsuite/api.py | 5 | # -*- coding: utf-8 -*-
"""
ambari_jinja2.testsuite.api
~~~~~~~~~~~~~~~~~~~~
Tests the public API and related stuff.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import time
import tempfile
import unittest
from ambari_jinja2.testsuite import J... |
bocaaust/FreshLife | refs/heads/master | django_project/env/lib/python2.7/site-packages/django/contrib/admin/actions.py | 101 | """
Built-in, globally-available admin actions.
"""
from django.core.exceptions import PermissionDenied
from django.contrib.admin import helpers
from django.contrib.admin.util import get_deleted_objects, model_ngettext
from django.db import router
from django.template.response import TemplateResponse
from django.utils... |
abhishek-ch/hue | refs/heads/master | desktop/core/ext-py/pysaml2-2.4.0/example/sp-wsgi/service_conf.py | 31 | from saml2.assertion import Policy
HOST = '127.0.0.1'
PORT = 8087
HTTPS = False
# Which groups of entity categories to use
POLICY = Policy(
{
"default": {"entity_categories": ["swamid", "edugain"]}
}
)
# HTTPS cert information
SERVER_CERT = "pki/mycert.pem"
SERVER_KEY = "pki/mykey.pem"
CERT_CHAIN = "... |
bSr43/WinObjC | refs/heads/master | deps/3rdparty/icu/icu/as_is/bomlist.py | 348 | #!/usr/bin/python
# Copyright (C) 2011 IBM Corporation and Others. All Rights Reserved.
#
# run in icu/
# will create file icu/as_is/bomlist.txt
#
# Usage:
# ( python as_is/bomlist.py > as_is/bomlist.txt ) || rm -f as_is/bomlist.txt
import os
import codecs
tree = os.walk(".")
nots=0
notutf8=0
noprops=0
utf8=0
fi... |
xen0l/ansible | refs/heads/devel | lib/ansible/plugins/action/package.py | 48 | # (c) 2015, Ansible Inc,
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is di... |
strets123/rdkit | refs/heads/master | rdkit/VLib/NodeLib/__init__.py | 6 | __all__=['SmartsMolFilter','SDSupply','SmartsRemover','SmilesDupeFilter',
'SmilesOutput']
|
yangxiaohua1977/sound-linux-4.5.7 | refs/heads/master | tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py | 12527 | # Util.py - Python extension for perf script, miscellaneous utility code
#
# Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com>
#
# This software may be distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Free Software
# Foundation.
import errno, os
FUTEX_WAIT = 0... |
felipenaselva/felipe.repository | refs/heads/master | plugin.video.mrpiracy/resources/lib/Downloader.py | 8 | import os
import xbmcgui
import xbmc
import time
import urllib
class Downloader:
def __init__(self,):
pass
def download(self,path,url,name):
if os.path.isfile(path) is True:
xbmc.log("SIM")
while os.path.exists(path):
try: os.remove(path); break
... |
amarzavery/AutoRest | refs/heads/master | src/generator/AutoRest.Python.Tests/Expected/AcceptanceTests/Validation/auto_rest_validation_test/__init__.py | 25 | # 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 ... |
youdonghai/intellij-community | refs/heads/master | python/testData/create_tests/create_tst.expected.py | 39 | from unittest import TestCase
class Spam(TestCase):
def eggs(self):
self.fail()
def eggs_and_ham(self):
self.fail()
|
Big-B702/python-for-android | refs/heads/master | python3-alpha/extra_modules/gdata/tlslite/constants.py | 48 | """Constants used in various places."""
class CertificateType:
x509 = 0
openpgp = 1
cryptoID = 2
class HandshakeType:
hello_request = 0
client_hello = 1
server_hello = 2
certificate = 11
server_key_exchange = 12
certificate_request = 13
server_hello_done = 14
certificate_ve... |
maohongyuan/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/test_argparse.py | 60 | # Author: Steven J. Bethard <steven.bethard@gmail.com>.
import codecs
import inspect
import os
import shutil
import stat
import sys
import textwrap
import tempfile
import unittest
import argparse
from io import StringIO
from test import support
from unittest import mock
class StdIOBuffer(StringIO):
pass
class T... |
onecloud/neutron | refs/heads/master | neutron/openstack/common/db/sqlalchemy/utils.py | 5 | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# Copyright 2010-2011 OpenStack Foundation.
# Copyright 2012 Justin Santa Barbara
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# ... |
DemocracyClub/UK-Polling-Stations | refs/heads/master | polling_stations/apps/data_importers/management/commands/import_worcester.py | 1 | from data_importers.management.commands import BaseXpressDemocracyClubCsvImporter
class Command(BaseXpressDemocracyClubCsvImporter):
council_id = "WOC"
addresses_name = (
"2021-03-26T11:04:20.460985/Worcester Democracy_Club__06May2021 (1).CSV"
)
stations_name = (
"2021-03-26T11:04:20.4... |
dak/webview | refs/heads/master | test/selenium/python/Delete_Page.py | 3 | import unittest
from selenium import webdriver
class DeletePage(unittest.TestCase):
'''
This test will create a Page and delete it.
It makes one assumption in order for the test to work:
* Assumes the new Page is the first item in the Workspace Page list
'''
authkey = ""
pw = ""
url ... |
tafaRU/odoo | refs/heads/8.0 | addons/hr_attendance/__openerp__.py | 52 | # -*- 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... |
eleonrk/SickRage | refs/heads/master | lib/bs4/tests/test_htmlparser.py | 31 | """Tests to ensure that the html.parser tree builder generates good
trees."""
from pdb import set_trace
import pickle
from bs4.testing import SoupTest, HTMLTreeBuilderSmokeTest
from bs4.builder import HTMLParserTreeBuilder
class HTMLParserTreeBuilderSmokeTest(SoupTest, HTMLTreeBuilderSmokeTest):
@property
de... |
fredkingham/blog-of-fred | refs/heads/master | django/core/serializers/pyyaml.py | 81 | """
YAML serializer.
Requires PyYaml (http://pyyaml.org/), but that's checked for in __init__.
"""
from StringIO import StringIO
import decimal
import yaml
from django.db import models
from django.core.serializers.base import DeserializationError
from django.core.serializers.python import Serializer as PythonSeriali... |
foursquare/commons-old | refs/heads/master | src/python/twitter/pants/tasks/python/__init__.py | 2 | # ==================================================================================================
# Copyright 2012 Twitter, Inc.
# --------------------------------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... |
rotofly/odoo | refs/heads/master | addons/hr_attendance/__init__.py | 434 | # -*- 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... |
vanstoner/xlr-sonatype-nexus-iq-plugin | refs/heads/master | src/main/resources/nexusiq/evaluateBinary.py | 1 | #
# THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS
# FOR A PARTICULAR PURPOSE. THIS CODE AND INFORMATION ARE NOT SUPPORTED BY XEBIALABS.
#
import sys
import json
import urll... |
mne-tools/mne-tools.github.io | refs/heads/main | 0.21/_downloads/36e789cbf04a4ef0f75e81dbcd49ca2a/plot_20_events_from_raw.py | 3 | # -*- coding: utf-8 -*-
"""
.. _tut-events-vs-annotations:
Parsing events from raw data
============================
This tutorial describes how to read experimental events from raw recordings,
and how to convert between the two different representations of events within
MNE-Python (Events arrays and Annotations obje... |
gitreset/Data-Science-45min-Intros | refs/heads/master | python-logging-201/dog.py | 26 | import logging
from pet import Pet
logger = logging.getLogger("pet_world." + __name__)
class Dog(Pet):
def __init__(self, **kwargs):
# default values
self.name = "Fido"
self.word = "Arf!"
self.legs = 4
super(Dog,self).__init__(**kwargs)
self.logger = logger
... |
hughperkins/kgsgo-dataset-preprocessor | refs/heads/master | thirdparty/future/src/past/types/__init__.py | 62 | """
Forward-ports of types from Python 2 for use with Python 3:
- ``basestring``: equivalent to ``(str, bytes)`` in ``isinstance`` checks
- ``dict``: with list-producing .keys() etc. methods
- ``str``: bytes-like, but iterating over them doesn't product integers
- ``long``: alias of Py3 int with ``L`` suffix in the ``... |
jonathon-love/snapcraft | refs/heads/master | snapcraft/tests/test_plugin_make.py | 2 | # -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the h... |
kaedroho/django | refs/heads/master | tests/nested_foreign_keys/tests.py | 62 | from django.test import TestCase
from .models import (
Event, Movie, Package, PackageNullFK, Person, Screening, ScreeningNullFK,
)
# These are tests for #16715. The basic scheme is always the same: 3 models with
# 2 relations. The first relation may be null, while the second is non-nullable.
# In some cases, Dja... |
google/picatrix | refs/heads/main | picatrix/notebook_init.py | 1 | # Copyright 2020 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
nubark/odoo | refs/heads/9.0 | addons/l10n_at/migrations/9.0.2.0/post-migrate_tags_on_taxes.py | 536 | from openerp.modules.registry import RegistryManager
def migrate(cr, version):
registry = RegistryManager.get(cr.dbname)
from openerp.addons.account.models.chart_template import migrate_tags_on_taxes
migrate_tags_on_taxes(cr, registry)
|
dreamsxin/kbengine | refs/heads/master | kbe/src/lib/python/Lib/test/test_setcomps.py | 201 | doctests = """
########### Tests mostly copied from test_listcomps.py ############
Test simple loop with conditional
>>> sum({i*i for i in range(100) if i&1 == 1})
166650
Test simple case
>>> {2*y + x + 1 for x in (0,) for y in (1,)}
{3}
Test simple nesting
>>> list(sorted({(i,j) for i in rang... |
perezg/infoxchange | refs/heads/master | BASE/lib/python2.7/site-packages/django/contrib/gis/db/backends/postgis/operations.py | 100 | import re
from decimal import Decimal
from django.conf import settings
from django.contrib.gis.db.backends.base import BaseSpatialOperations
from django.contrib.gis.db.backends.util import SpatialOperation, SpatialFunction
from django.contrib.gis.db.backends.postgis.adapter import PostGISAdapter
from django.contrib.gi... |
opinkerfi/adagios | refs/heads/master | adagios/objectbrowser/urls.py | 3 | # Adagios is a web based Nagios configuration interface
#
# Copyright (C) 2014, Pall Sigurdsson <palli@opensource.is>
#
# 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 the Free Software Foundation, either version 3 of... |
TxBlackWolf/My-Gray-Hacker-Resources | refs/heads/master | Network_and_802.11/802.11/wifiReader.py | 4 | #!/usr/bin/env python
# simple python script to boost txpower and spoof the
# mac address of your wireless interface
# copied from the internet, i lost the reference
import sys
import os
import time
class Colors:
GREEN = '\033[92m'
Yellow = '\033[93m'
ENDC = '\033[0m'
def cls():
os.system(['clear', ... |
birdonwheels5/p2pool-saffronSha | refs/heads/master | p2pool/util/switchprotocol.py | 280 | from twisted.internet import protocol
class FirstByteSwitchProtocol(protocol.Protocol):
p = None
def dataReceived(self, data):
if self.p is None:
if not data: return
serverfactory = self.factory.first_byte_to_serverfactory.get(data[0], self.factory.default_serverfactory)
... |
mkolar/pyblish-ftrack | refs/heads/master | pyblish_ftrack/plugins/collect_context_version.py | 1 | import os
import sys
import re
# sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
# import pyblish_ftrack_utils
import pyblish.api
@pyblish.api.log
class CollectContextVersion(pyblish.api.ContextPlugin):
"""Finds version in the filename or passes the one found in the context
... |
shl198/Pipeline | refs/heads/master | DreamChallenge/06_human_provean.py | 2 | import pandas as pd
import gffutils
import re
from natsort import natsorted
import os
import numpy as np
import math
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.style.use('ggplot')
def tr2pr(tr,ensembl_trpr,ncbi_trpr):
if tr.startswith('ENS'):
if '_' in tr:
tr = '_'.join(tr.sp... |
openqt/algorithms | refs/heads/master | leetcode/python/lc409-longest-palindrome.py | 1 | # coding=utf-8
import unittest
"""409. Longest Palindrome
https://leetcode.com/problems/longest-palindrome/description/
Given a string which consists of lowercase or uppercase letters, find the
length of the longest palindromes that can be built with those letters.
This is case sensitive, for example `"Aa"` is not c... |
he7d3r/ores | refs/heads/master | ores/lock_manager/__init__.py | 2 | from .ip_range_list import IpRangeList
from .lock_manager import LockManager
from .poolcounter import PoolCounter
__all__ = [IpRangeList, LockManager, PoolCounter]
|
kemalakyol48/python-for-android | refs/heads/master | python-modules/twisted/twisted/words/toctap.py | 54 |
# Copyright (c) 2001-2004 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Support module for making TOC servers with twistd.
"""
from twisted.words.protocols import toc
from twisted.python import usage
from twisted.application import strports
class Options(usage.Options):
synopsis = "[-p <port>]"
... |
qizdyyt/CPLogProgram | refs/heads/master | HebcaLog/Pods/AVOSCloudCrashReporting/Breakpad/src/tools/gyp/test/mac/gyptest-xctest.py | 221 | #!/usr/bin/env python
# Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that xctest targets are correctly configured.
"""
import TestGyp
import sys
if sys.platform == 'darwin':
test = TestGyp.Te... |
jayhetee/coveragepy | refs/heads/master | tests/try_execfile.py | 3 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Test file for run_python_file.
This file is executed two ways::
$ coverage run try_execfile.py
and::
$ python try_execfile.py
The output is compared... |
sperez4mba/pyNES | refs/heads/0.1.x | pynes/tests/ldx_test.py | 28 | # -*- coding: utf-8 -*-
'''
LDX, Load Register X
This is one of the memory operations on the 6502
'''
import unittest
from pynes.compiler import lexical, syntax, semantic
class LdxTest(unittest.TestCase):
def test_ldx_imm(self):
tokens = list(lexical('LDX #$10'))
self.assertEquals(2, len(token... |
w1ll1am23/home-assistant | refs/heads/dev | tests/components/dynalite/conftest.py | 6 | """dynalite conftest."""
from tests.components.light.conftest import mock_light_profiles # noqa: F401
|
libracore/erpnext | refs/heads/v12 | erpnext/healthcare/doctype/patient_appointment/patient_appointment.py | 6 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, ESS LLP and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
import json
from frappe.utils import getdate, add_days, get_time
from frappe import _
import datetime... |
bhamza/ntu-dsi-dcn | refs/heads/master | src/flow-monitor/examples/flowmon-parse-results.py | 75 | from __future__ import division
import sys
import os
try:
from xml.etree import cElementTree as ElementTree
except ImportError:
from xml.etree import ElementTree
def parse_time_ns(tm):
if tm.endswith('ns'):
return long(tm[:-2])
raise ValueError(tm)
class FiveTuple(object):
__slots__ = ['... |
gangadharkadam/vlinkerp | refs/heads/master | erpnext/tests/test_client.py | 7 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import unittest, frappe
from frappe.utils import sel
from frappe.utils import formatdate
selenium_tests = True
class TestLogin(unittest.TestCase):
de... |
varunnaganathan/django | refs/heads/master | tests/migrations/migrations_test_apps/unspecified_app_with_conflict/migrations/0001_initial.py | 2995 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
operations = [
migrations.CreateModel(
"Author",
[
("id", models.AutoField(primary_key=True)),
("name",... |
kadhikari/navitia | refs/heads/dev | source/jormungandr/tests/routing_tests_experimental.py | 1 | # Copyright (c) 2001-2015, Canal TP and/or its affiliates. All rights reserved.
#
# This file is part of Navitia,
# the software to build cool stuff with public transport.
#
# Hope you'll enjoy and contribute to this project,
# powered by Canal TP (www.canaltp.fr).
# Help us simplify mobility and open public tr... |
liamgh/liamgreenhughes-sl4a-tf101 | refs/heads/master | python/gdata/src/gdata/tlslite/utils/PyCrypto_TripleDES.py | 359 | """PyCrypto 3DES implementation."""
from cryptomath import *
from TripleDES import *
if pycryptoLoaded:
import Crypto.Cipher.DES3
def new(key, mode, IV):
return PyCrypto_TripleDES(key, mode, IV)
class PyCrypto_TripleDES(TripleDES):
def __init__(self, key, mode, IV):
TripleDE... |
alexlo03/ansible | refs/heads/devel | lib/ansible/module_utils/network/eos/eos.py | 21 | #
# This code is part of Ansible, but is an independent component.
#
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complet... |
robwarm/gpaw-symm | refs/heads/master | doc/documentation/tddft/Be_8bands_lrtddft_dE.py | 1 | from gpaw import GPAW
from gpaw.lrtddft import LrTDDFT
c = GPAW('Be_gs_8bands.gpw')
dE = 10 # maximal Kohn-Sham transition energy to consider in eV
lr = LrTDDFT(c, xc='LDA', energy_range=dE)
lr.write('lr_dE.dat.gz')
|
aforalee/RRally | refs/heads/master | tests/unit/plugins/openstack/scenarios/ironic/test_utils.py | 6 | # Copyright 2015: Mirantis 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 b... |
tschijnmo/osmABTS | refs/heads/master | osmABTS/readosm.py | 1 | """
OpenStreetMap XML file parsing
==============================
This module defined classes for nodes, ways and a shallow data structure for
all of these raw information from OSM XML file, as well as a parser based on
the standard expat library.
It contains classes for holding information about the raw map
.. auto... |
aidan-fitz/instant-press | refs/heads/master | modules/users.py | 7 | # -*- coding: utf-8 -*-
#
# Instant Press. Instant sites. CMS developed in Web2py Framework
# Site: http://www.instant2press.com
#
# Copyright (c) 2010 Mulone, Pablo Martín
#
# License Code: GPL, General Public License v. 2.0
# License Content: Creative Commons Attribution 3.0
#
# Also visit: www.web2py.com
# ... |
bspink/django | refs/heads/master | django/contrib/gis/geos/coordseq.py | 129 | """
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 byref, c_double, c_uint
from django.contrib.gis.geos import prototypes as capi
from django.contrib.gis.geos.base import... |
fxfitz/ansible | refs/heads/devel | lib/ansible/modules/network/nxos/nxos_bgp_neighbor.py | 62 | #!/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... |
jiobert/python | refs/heads/master | Horan_Colby/email_validation-db/emailval.py | 2 | from flask import Flask
from flask import render_template
from flask import session
from flask import request
from flask import redirect
from flask import flash
from mysqlconnection import MySQLConnector
import re
email_regex = re.compile(r'^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9._-]+\.[a-zA-Z]+$')
app = Flask(__name__)
app.se... |
jaimegildesagredo/expects_docs_mamba_formatter | refs/heads/master | mamba/example_group.py | 6 | # -*- coding: utf-8 -*-
import sys
from datetime import datetime, timedelta
import inspect
from mamba import error
from mamba.example import Example, PendingExample
class ExecutionContext(object):
pass
class ExampleGroup(object):
def __init__(self, subject, parent=None, execution_context=None):
sel... |
miscbrah/misccoin | refs/heads/master | share/qt/make_spinner.py | 4415 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... |
JingJunYin/tensorflow | refs/heads/master | tensorflow/contrib/gan/python/estimator/python/head_test.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.