repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
pyfisch/servo | refs/heads/master | tests/wpt/web-platform-tests/webdriver/tests/execute_script/__init__.py | 12133432 | |
appsembler/edx-platform | refs/heads/appsembler/tahoe/master | lms/djangoapps/badges/migrations/__init__.py | 12133432 | |
inducer/codery | refs/heads/main | coding/migrations/011_allow_blank_assignment_tags.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('coding', '0010_auto_20141123_1239'),
]
operations = [
migrations.AlterField(
model_name='codingassignment',
... |
orekyuu/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/db/backends/mysql/__init__.py | 12133432 | |
larsbegas/rip-master | refs/heads/master | sites/__init__.py | 12133432 | |
andymckay/addons-server | refs/heads/master | src/olympia/amo/ext.py | 32 | import jinja2.runtime
from jinja2 import nodes
import caching.ext
class FragmentCacheExtension(caching.ext.FragmentCacheExtension):
"""Extends the default fragment cache to include request.APP in the key."""
def process_cache_arguments(self, args):
args.append(nodes.Getattr(nodes.ContextReference(),... |
dzhuang/django-crispy-forms | refs/heads/dev | crispy_forms/tests/test_dynamic_api.py | 12 | # -*- coding: utf-8 -*-
import logging, warnings
from django import forms
from django.conf import settings
from .base import CrispyTestCase
from crispy_forms.compatibility import string_types
from crispy_forms.exceptions import DynamicError
from crispy_forms.helper import FormHelper, FormHelpersException
from crispy_fo... |
scmorse/bitcoin | refs/heads/master | contrib/linearize/linearize-data.py | 170 | #!/usr/bin/python
#
# linearize-data.py: Construct a linear, no-fork version of the chain.
#
# Copyright (c) 2013-2014 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from __future__ import print_func... |
theonewolf/siegvswolf | refs/heads/master | lib/werkzeug/contrib/__init__.py | 320 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib
~~~~~~~~~~~~~~~~
Contains user-submitted code that other users may find useful, but which
is not part of the Werkzeug core. Anyone can write code for inclusion in
the `contrib` package. All modules in this package are distributed as an
add-on libra... |
StepicOrg/Stepic-API | refs/heads/master | examples/get_user_name.py | 1 | import json
import requests
token = "..."
api_url = 'https://stepik.org/api/stepics/1' # should be stepic with "c"!
resp = json.loads(requests.get(api_url, headers={'Authorization': 'Bearer '+ token}).text)
user = resp['users']
name = user[0]['first_name'] +' ' + user[0]['last_name']
print(name)
|
raoanirudh/oq-risklib | refs/heads/master | openquake/commonlib/tests/commands_test.py | 1 | import os
import mock
import shutil
import tempfile
import unittest
from openquake.commonlib.commands.info import info
from openquake.commonlib.commands.reduce import reduce
from openquake.qa_tests_data.classical_risk import case_3
from openquake.qa_tests_data.scenario import case_4
from openquake.qa_tests_data.event_b... |
tedlaz/pyted | refs/heads/master | misthodosia/m13a/utils.py | 2 | # -*- coding: utf-8 -*-
'''
Created on 19 Νοε 2012
@author: tedlaz
'''
import decimal
def isNum(value): # Einai to value arithmos, i den einai ?
""" use: Returns False if value is not a number , True otherwise
input parameters :
1.value : the value to check against.
output... |
pizzapanther/Church-Source | refs/heads/master | dependencies/south/management/commands/schemamigration.py | 15 | """
Startmigration command, version 2.
"""
import sys
import os
import re
import string
import random
import inspect
from optparse import make_option
try:
set
except NameError:
from sets import Set as set
from django.core.management.base import BaseCommand
from django.core.management.color import no_style
fr... |
agiliq/django | refs/heads/master | django/contrib/gis/geos/prototypes/threadsafe.py | 34 | import threading
from django.contrib.gis.geos.libgeos import lgeos, notice_h, error_h, CONTEXT_PTR
class GEOSContextHandle(object):
"""
Python object representing a GEOS context handle.
"""
def __init__(self):
# Initializing the context handler for this thread with
# the notice and err... |
smdabdoub/kraken-biom | refs/heads/master | setup.py | 1 | # -*- coding: utf-8 -*-
from __future__ import with_statement
from setuptools import setup
def get_version():
with open('kraken_biom.py') as f:
for line in f:
if line.startswith('__version__'):
return eval(line.split('=')[-1])
def get_long_description():
descr = []
... |
comcidis/portal | refs/heads/master | member/admin.py | 1 | from django.contrib import admin
from .models import ScholarshipFounder
from .models import ScholarshipType
from .models import Scholarship
from .models import Member
from .models import Institution
from .models import InstitutionDepartment
from .models import Degree
from .models import LineOfResearch
admin.site.regi... |
marty331/jakesclock | refs/heads/master | flask/lib/python2.7/site-packages/pkg_resources/_vendor/packaging/_structures.py | 906 | # Copyright 2014 Donald Stufft
#
# 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, so... |
TuSimple/mxnet | refs/heads/master | docs/mxdoc.py | 3 | # 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... |
hatwar/buyback-erpnext | refs/heads/master | erpnext/stock/report/requested_items_to_be_transferred/__init__.py | 12133432 | |
krtkmj/zulip | refs/heads/master | zerver/views/webhooks/__init__.py | 12133432 | |
gaoce/TimeVis | refs/heads/master | tests/__init__.py | 12133432 | |
loic/django | refs/heads/master | django/contrib/staticfiles/management/__init__.py | 12133432 | |
vad/django-cms | refs/heads/develop | cms/utils/compat/tests.py | 73 | from django.utils import six
if six.PY3:
class UnittestCompatMixin(object):
pass
else:
class UnittestCompatMixin(object):
def assertNotRegex(self, text, regex, msg=None):
return self.assertNotRegexpMatches(text, regex, msg)
|
dbertha/odoo | refs/heads/8.0 | addons/mrp_repair/__init__.py | 380 | # -*- 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... |
kutenai/django | refs/heads/master | django/contrib/gis/serializers/__init__.py | 12133432 | |
popazerty/SDG-gui | refs/heads/master | lib/python/Components/__init__.py | 12133432 | |
marquesarthur/BugAnalysisRecommender | refs/heads/master | dataset/linguistic/pattern.py | 1 | from __future__ import division, unicode_literals
from ml.similarity import pre_process, TfidfCluster
from textblob import TextBlob as tb
import nltk, re, pprint
import nltk.chunk
from nltk.corpus import stopwords
from nltk import tag
from nltk.corpus import wordnet
from nltk.corpus.reader.wordnet import POS_LIST
impor... |
beni55/edx-platform | refs/heads/master | common/lib/xmodule/xmodule/tests/test_import.py | 12 | # -*- coding: utf-8 -*-
import datetime
import ddt
import unittest
from fs.memoryfs import MemoryFS
from lxml import etree
from mock import Mock, patch
from django.utils.timezone import UTC
from xmodule.xml_module import is_pointer_tag
from opaque_keys.edx.locations import Location
from xmodule.modulestore import o... |
ZujkisNx/django-play-1 | refs/heads/master | django-play-1/manage.py | 1 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "django-play-1.config.settings")
os.environ.setdefault("DJANGO_CONFIGURATION", "Local")
from configurations.management import execute_from_command_line
execute_from_command_line(sys.a... |
b12io/orchestra | refs/heads/autostaff-load-hours-once | orchestra/accounts/bitformfield.py | 2 | # flake8: noqa
# Copy pasted from
# https://raw.githubusercontent.com/greyside/django-bitfield/04efae91d292bffb569bd7cc13e5c941e42e8698/bitfield/forms.py
from bitfield.types import BitHandler
from django.forms import CheckboxSelectMultiple
from django.forms import IntegerField
from django.forms import ValidationError
f... |
smmribeiro/intellij-community | refs/heads/master | python/testData/typeshed/stdlib/2/collections_test.py | 12 | def test_namedtuple():
from collections import namedtuple
assert namedtuple("Point", "x y")(1, 2).x == 1
assert namedtuple(u"Point", u"x y", verbose=False, rename=False)(1, 2).x == 1
assert namedtuple(b"Point", b"x y", verbose=True, rename=True)(1, 2).x == 1
assert namedtuple("Point", ["x", "y"])(... |
djludo/navitia | refs/heads/dev | source/tyr/migrations/versions/5423986c3a51_add_app_name_on_keys.py | 21 | """add an app_name for the keys
Revision ID: 5423986c3a51
Revises: 1b1bc5bf715a
Create Date: 2014-12-05 15:54:02.680699
"""
# revision identifiers, used by Alembic.
revision = '5423986c3a51'
down_revision = '1b1bc5bf715a'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generate... |
cstipkovic/spidermonkey-research | refs/heads/master | testing/talos/talos/results.py | 2 | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
"""
objects and methods for parsing and serializing Talos results
see https://wiki.mozilla.org/Bu... |
iAMr00t/opencog | refs/heads/master | opencog/python/spatiotemporal/temporal_events/composition/__init__.py | 33 | from non_linear_least_squares import DecompositionFitter
from depth_first_search_composition import DepthFirstSearchComposition, convert_rail_to_trapezium_event
from spatiotemporal.temporal_events.composition.railway_framework import RailwaySystem
from spatiotemporal.temporal_events.relation_formulas import TemporalRel... |
Menooker/gem5_pcm | refs/heads/master | src/arch/x86/isa/insts/simd64/floating_point/__init__.py | 91 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... |
connoranderson/Speechables | refs/heads/master | mechanize-0.2.5/mechanize/_sgmllib_copy.py | 134 | # Taken from Python 2.6.4 and regexp module constants modified
"""A parser for SGML, using the derived class as a static DTD."""
# XXX This only supports those SGML features used by HTML.
# XXX There should be a way to distinguish between PCDATA (parsed
# character data -- the normal case), RCDATA (replaceable charac... |
frc2423/2015 | refs/heads/master | recycle_rush/commands/auto_move_forward.py | 1 | import wpilib
from wpilib.command.commandgroup import CommandGroup
from commands.mecanum_drive import MecanumDrive
from commands.dont_move import DontMove
from common import robot_speed as rs
class AutoMoveForward(CommandGroup):
def __init__(self, drive, gyro, time):
super().__init__()
self.dr... |
mattnenterprise/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/pytest/_pytest/skipping.py | 15 | """ support for skip/xfail functions and markers. """
from __future__ import absolute_import, division, print_function
import os
import six
import sys
import traceback
from _pytest.config import hookimpl
from _pytest.mark import MarkInfo, MarkDecorator
from _pytest.outcomes import fail, skip, xfail, TEST_OUTCOME
de... |
mancoast/CPythonPyc_test | refs/heads/master | cpython/272_test_urllib.py | 14 | """Regresssion tests for urllib"""
import urllib
import httplib
import unittest
from test import test_support
import os
import sys
import mimetools
import tempfile
import StringIO
def hexescape(char):
"""Escape char as RFC 2396 specifies"""
hex_repr = hex(ord(char))[2:].upper()
if len(hex_repr) == 1:
... |
cielly/cielly.github.io | refs/heads/master | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/tools/pretty_gyp.py | 2618 | #!/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.
"""Pretty-prints the contents of a GYP file."""
import sys
import re
# Regex to remove comments when we're counting braces.
COMMENT_RE = ... |
w1ll1am23/home-assistant | refs/heads/dev | homeassistant/components/input_select/reproduce_state.py | 3 | """Reproduce an Input select state."""
from __future__ import annotations
import asyncio
import logging
from types import MappingProxyType
from typing import Any, Iterable
from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.core import Context, HomeAssistant, State
from . import (
ATTR_OPTION,
... |
cstan11/Sick-Beard | refs/heads/torrent_1080_subtitles | lib/requests/packages/chardet/langbulgarianmodel.py | 235 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
x303597316/hue | refs/heads/master | desktop/core/ext-py/South-1.0.2/south/orm.py | 119 | """
South's fake ORM; lets you not have to write SQL inside migrations.
Roughly emulates the real Django ORM, to a point.
"""
from __future__ import print_function
import inspect
from django.db import models
from django.db.models.loading import cache
from django.core.exceptions import ImproperlyConfigured
from sout... |
BigBlueCeiling/augmentacoin | refs/heads/master | qa/rpc-tests/rpcnamedargs.py | 44 | #!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from decimal import Decimal
from test_framework.test_framework import BitcoinTestFramework
from test_framewor... |
odubno/microblog | refs/heads/master | venv/lib/python2.7/site-packages/wtforms/ext/django/orm.py | 177 | """
Tools for generating forms based on Django models.
"""
from wtforms import fields as f
from wtforms import Form
from wtforms import validators
from wtforms.compat import iteritems
from wtforms.ext.django.fields import ModelSelectField
__all__ = (
'model_fields', 'model_form',
)
class ModelConverterBase(obje... |
pythonindia/wye | refs/heads/development | manage.py | 790 | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
|
markYoungH/chromium.src | refs/heads/nw12 | tools/telemetry/telemetry/timeline/tab_id_importer_unittest.py | 12 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import json
import unittest
from telemetry.timeline import model as timeline_model
from telemetry.timeline import trace_data as trace_data_module
from telem... |
swcarpentry/website | refs/heads/gh-pages | files/2016/02/balance/bin/get-repo.py | 6 | import sys
from datetime import datetime
from github import Github
DATE_FORMAT = '%Y-%m-%d'
def main():
username = sys.argv[1]
password = sys.argv[2]
try:
start_date = datetime.strptime(sys.argv[3], DATE_FORMAT)
end_date = datetime.strptime(sys.argv[4], DATE_FORMAT)
except ValueError a... |
phalax4/CarnotKE | refs/heads/master | jyhton/lib-python/2.7/cgitb.py | 135 | """More comprehensive traceback formatting for Python scripts.
To enable this module, do:
import cgitb; cgitb.enable()
at the top of your script. The optional arguments to enable() are:
display - if true, tracebacks are displayed in the web browser
logdir - if set, tracebacks are written to fi... |
Shashank-Ojha/MakeBank | refs/heads/master | search.py | 1 | import requests
import json
from is_borrower import *
#focus on lender
#search by only amount, not interest rate
def sort_borrowers(lender_amount, borrowers):
#borrowers of type Borrower
#want a lower match score
borrowers_and_match_score={}
for borrower in borrowers:
interest_rate_score=0
... |
hubsaysnuaa/odoo | refs/heads/8.0 | addons/report_webkit/report/webkit_report_demo.py | 438 |
from openerp.addons.report_webkit.webkit_report import webkit_report_extender
from openerp import SUPERUSER_ID
@webkit_report_extender("report_webkit.webkit_demo_report")
def extend_demo(pool, cr, uid, localcontext, context):
admin = pool.get("res.users").browse(cr, uid, SUPERUSER_ID, context)
localcontext.u... |
danilito19/django | refs/heads/master | django/conf/locale/es_MX/formats.py | 504 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
DATE_FORMAT = r'j \d\e F \d\e Y'
TIME_FORMAT = 'H:i'
DATETIME_FORMAT = r'j \d\e F \d\e Y \a \l\a\s H:i'
YEAR_MONTH_FORMAT = r'F \d\e Y'
MONTH_DAY_FORMAT = r'j \d\e F'
SHORT_DATE_... |
hastexo/edx-platform | refs/heads/master | lms/djangoapps/instructor_task/exceptions.py | 30 | """
Exception classes used by Instructor tasks.
"""
class UpdateProblemModuleStateError(Exception):
"""
Error signaling a fatal condition while updating problem modules.
Used when the current module cannot be processed and no more
modules should be attempted.
"""
pass
class DuplicateTaskExc... |
alivecor/tensorflow | refs/heads/master | tensorflow/contrib/fused_conv/python/ops/fused_conv2d_bias_activation_op.py | 1 | # 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 applicab... |
absoludity/servo | refs/heads/master | tests/wpt/css-tests/tools/webdriver/webdriver/servo.py | 149 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
class ServoExtensionCommands(object):
def __init__(self, session):
self.session = session
@command
... |
avati/samba | refs/heads/master | lib/dnspython/dns/dnssec.py | 53 | # Copyright (C) 2003-2007, 2009, 2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... |
schnitzeltony/meta-qt5 | refs/heads/master | lib/recipetool/create_qt5.py | 3 | # Recipe creation tool - Qt5 support plugin
#
# Copyright (C) 2016 Intel Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that ... |
liorvh/golismero | refs/heads/master | thirdparty_libs/django/core/__init__.py | 12133432 | |
silenceli/nova | refs/heads/master | nova/tests/unit/conductor/__init__.py | 12133432 | |
pombredanne/python-devstructure | refs/heads/master | devstructure/__init__.py | 12133432 | |
illicitonion/givabit | refs/heads/master | lib/sdks/google_appengine_1.7.1/google_appengine/lib/django_1_3/django/contrib/gis/db/backends/postgis/__init__.py | 12133432 | |
rsennrich/Bleualign | refs/heads/master | bleualign/__init__.py | 12133432 | |
shubhamdhama/zulip | refs/heads/master | confirmation/management/__init__.py | 12133432 | |
nanophotonics/nplab | refs/heads/master | nplab/analysis/background_removal/Moving_Gradient_BG_Removal.py | 1 | from builtins import range
import numpy as np
"""
Author: jpg66
Module for removing SERS background in cases where Adaptive Polynomial produces too many artifacts. This may include cases with negative curvature and a low SNR.
This should be used in cases where the peaks are sparse.
Run using Run(Signal,Window=50,Ma... |
TobiasFaller/AlgoDat | refs/heads/master | Lecture-12/Code/Handout/Graph/Graph.py | 2 | class Graph:
def __init__(self):
self.vertices = []
self.edges = []
def addVertice(self, vert):
self.vertices.append(vert)
def addEdge(self, fromVert, toVert):
self.edges.append((fromVert, toVert))
def toString(self):
return '{'
+ ', '.join( \
[str(len(self.vertices)), \
str(l... |
oesteban/seaborn | refs/heads/master | seaborn/palettes.py | 4 | from __future__ import division
import colorsys
from itertools import cycle
import numpy as np
import matplotlib as mpl
from .external import husl
from .external.six import string_types
from .external.six.moves import range
from .utils import desaturate, set_hls_values, get_color_cycle
from .xkcd_rgb import xkcd_rgb... |
guptaadhip/fast | refs/heads/master | pox/lib/recoco/events.py | 42 | # Copyright 2011 James McCauley
#
# 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... |
cschnei3/forseti-security | refs/heads/master | tests/common/gcp_api/storage_test.py | 2 | # Copyright 2017 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 agreed to in writing, s... |
mwielgoszewski/osquery | refs/heads/master | tools/profile.py | 1 | #!/usr/bin/env python
# Copyright (c) 2014-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same director... |
laserson/luigi | refs/heads/master | luigi/scalding.py | 37 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... |
openstack/nova | refs/heads/master | nova/tests/unit/notifications/objects/test_flavor.py | 7 | # 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... |
aristanetworks/arista-ovs-quantum | refs/heads/master | quantum/tests/unit/linuxbridge/test_defaults.py | 4 | # Copyright (c) 2012 OpenStack, 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 agreed to in wr... |
poljeff/odoo | refs/heads/8.0 | addons/l10n_ma/__openerp__.py | 260 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2010 kazacube (http://kazacube.com).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU ... |
treemo/MoLA-security_alert_log-module | refs/heads/master | Module.py | 1 | from core import EventManager
from core import Log
import json
class Module:
def __init__(self):
EventManager.bind('security_alert', self.__event_security_alert)
def __event_security_alert(self, data):
if 'level' in data and data['level'] in [
'crash',
'critical',
... |
fbradyirl/home-assistant | refs/heads/dev | tests/components/seventeentrack/test_sensor.py | 3 | """Tests for the seventeentrack sensor."""
import datetime
from typing import Union
import pytest
import mock
from py17track.package import Package
from homeassistant.components.seventeentrack.sensor import (
CONF_SHOW_ARCHIVED,
CONF_SHOW_DELIVERED,
)
from homeassistant.const import CONF_USERNAME, CONF_PASSWO... |
randomtask1155/gpdb | refs/heads/master | gpMgmt/bin/gppylib/test/unit/test_unit_info.py | 39 | from mock import *
from gp_unittest import *
from gppylib.system.info import *
class InfoTestCase(GpTestCase):
def setUp(self):
self.vmem = Mock()
self.vmem.available = 123 * MB
STACK_SIZE = 8 * MB
self.apply_patches([
patch("psutil.virtual_memory", return_value=self.... |
satishgoda/bokeh | refs/heads/master | sphinx/source/docs/user_guide/source_examples/tools_hover_string.py | 49 | from bokeh.plotting import figure, output_file, show
output_file("toolbar.html")
# Add hover to this comma-separated string and see what changes
TOOLS = 'box_zoom,box_select,crosshair,resize,reset'
# create a new plot with the toolbar below
p = figure(plot_width=400, plot_height=400, title=None, tools=TOOLS)
p.circ... |
akretion/odoo | refs/heads/12-patch-paging-100-in-o2m | odoo/cli/command.py | 37 | from __future__ import print_function
import logging
import sys
import os
from os.path import join as joinpath, isdir
import odoo
from odoo.modules import get_modules, get_module_path
commands = {}
class CommandType(type):
def __init__(cls, name, bases, attrs):
super(CommandType, cls).__init__(name, base... |
Stavitsky/nova | refs/heads/master | nova/tests/unit/virt/xenapi/test_agent.py | 65 | # Copyright 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... |
aprefontaine/TMScheduler | refs/heads/master | djangotoolbox/auth/__init__.py | 12133432 | |
Deepakkothandan/ansible | refs/heads/devel | lib/ansible/modules/database/influxdb/__init__.py | 12133432 | |
mmauroy/SickRage | refs/heads/master | lib/hachoir_parser/program/prc.py | 86 | """
PRC (Palm resource) parser.
Author: Sebastien Ponce
Creation date: 29 october 2008
"""
from hachoir_parser import Parser
from hachoir_core.field import (FieldSet,
UInt16, UInt32, TimestampMac32,
String, RawBytes)
from hachoir_core.endian import BIG_ENDIAN
class PRCHeader(FieldSet):
static_size = 78*8... |
TNick/pylearn2 | refs/heads/master | pylearn2/linear/conv2d.py | 43 | """
.. todo::
WRITEME
"""
__authors__ = "Ian Goodfellow"
__copyright__ = "Copyright 2010-2012, Universite de Montreal"
__credits__ = ["Ian Goodfellow"]
__license__ = "3-clause BSD"
__maintainer__ = "LISA Lab"
__email__ = "pylearn-dev@googlegroups"
import functools
import numpy as np
from theano.compat.six.moves i... |
epandurski/django | refs/heads/master | tests/check_framework/test_templates.py | 288 | from copy import deepcopy
from django.core.checks.templates import E001
from django.test import SimpleTestCase
from django.test.utils import override_settings
class CheckTemplateSettingsAppDirsTest(SimpleTestCase):
TEMPLATES_APP_DIRS_AND_LOADERS = [
{
'BACKEND': 'django.template.backends.djan... |
ArtemSerga/flask-admin | refs/heads/master | flask_admin/contrib/mongoengine/filters.py | 17 | from flask_admin.babel import lazy_gettext
from flask_admin.model import filters
from .tools import parse_like_term
from mongoengine.queryset import Q
from bson.errors import InvalidId
from bson.objectid import ObjectId
class BaseMongoEngineFilter(filters.BaseFilter):
"""
Base MongoEngine filter.
"""... |
susantoj/PYPOWER-Dynamics | refs/heads/master | examples/04_Classical_Nine_Bus/test_nine_bus.py | 2 | #!python3
#
# Copyright (C) 2014-2015 Julius Susanto. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
"""
PYPOWER-Dynamics
Classical Stability Test
"""
# Dynamic model classes
from pydyn.ext_grid import ext_grid
# Simulation modules
from pydy... |
vilorious/pyload | refs/heads/stable | module/gui/XMLParser.py | 41 | # -*- coding: utf-8 -*-
"""
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 ... |
ibelem/crosswalk-test-suite | refs/heads/master | tools/atip/setup.py | 18 | # Copyright (c) 2014 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this list
# of conditions and the following disclaimer.... |
aestrivex/bctpy | refs/heads/master | docs/conf.py | 2 | # -*- coding: utf-8 -*-
#
# bct documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 21 11:30:20 2015.
#
# 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 c... |
mhils/mitmproxy | refs/heads/master | mitmproxy/contentviews/wbxml.py | 5 | from mitmproxy.contrib.wbxml import ASCommandResponse
from . import base
class ViewWBXML(base.View):
name = "WBXML"
content_types = [
"application/vnd.wap.wbxml",
"application/vnd.ms-sync.wbxml"
]
def __call__(self, data, **metadata):
try:
parser = ASCommandRespons... |
kernel-sanders/arsenic-mobile | refs/heads/master | Dependencies/Twisted-13.0.0/twisted/spread/util.py | 60 | # -*- test-case-name: twisted.test.test_pb -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Utility classes for spread.
"""
from twisted.internet import defer
from twisted.python.failure import Failure
from twisted.spread import pb
from twisted.protocols import basic
from twisted.inte... |
JamesMGreene/phantomjs | refs/heads/master | src/qt/qtwebkit/Tools/Scripts/webkitpy/style/checkers/xml_unittest.py | 124 | # Copyright (C) 2010 Apple 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:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... |
AgentVi/DIGITS | refs/heads/master | digits/dataset/images/classification/test_imageset_creator.py | 8 | #!/usr/bin/env python2
# Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
"""
Functions for creating temporary datasets
Used in test_views
"""
from __future__ import absolute_import
import argparse
from collections import defaultdict
import os
import time
import numpy as np
import PIL.Image
IMAGE_... |
rlr/fjord | refs/heads/master | vendor/packages/requests-2.7.0/requests/packages/chardet/jisfreq.py | 3130 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
mcanthony/cython | refs/heads/master | Cython/Compiler/Symtab.py | 10 | #
# Symbol Table
#
from __future__ import absolute_import
import copy
import re
try:
import __builtin__ as builtins
except ImportError: # Py3
import builtins
from .Errors import warning, error, InternalError
from .StringEncoding import EncodedString
from . import Options, Naming
from . import PyrexTypes
... |
zhanglab/psamm-import | refs/heads/master | psamm_import/excel.py | 1 | # This file is part of PSAMM.
#
# PSAMM 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.
#
# PSAMM is distributed in the hope that it wi... |
nortd/bomfu | refs/heads/master | boilerplate/external/wtforms/ext/django/orm.py | 66 | """
Tools for generating forms based on Django models.
"""
from wtforms import fields as f
from wtforms import Form
from wtforms import validators
from wtforms.compat import iteritems
from wtforms.ext.django.fields import ModelSelectField
__all__ = (
'model_fields', 'model_form',
)
class ModelConverterBase(obje... |
tgerring/go-ethereum | refs/heads/develop | Godeps/_workspace/src/github.com/nsf/termbox-go/collect_terminfo.py | 184 | #!/usr/bin/env python
import sys, os, subprocess
def escaped(s):
return repr(s)[1:-1]
def tput(term, name):
try:
return subprocess.check_output(['tput', '-T%s' % term, name]).decode()
except subprocess.CalledProcessError as e:
return e.output.decode()
def w(s):
if s == None:
return
sys.stdout.write(s)
... |
frankvdp/django | refs/heads/master | tests/validation/test_error_messages.py | 35 | from unittest import TestCase
from django.core.exceptions import ValidationError
from django.db import models
class ValidationMessagesTest(TestCase):
def _test_validation_messages(self, field, value, expected):
with self.assertRaises(ValidationError) as cm:
field.clean(value, None)
s... |
GodBlessPP/w16b_test | refs/heads/master | static/Brython3.1.3-20150514-095342/Lib/sre_parse.py | 630 | #
# Secret Labs' Regular Expression Engine
#
# convert re-style regular expression to sre pattern
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support module for sre"""
# XXX: show string offset and offending ch... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.