repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
zennobjects/kivy | refs/heads/master | kivy/input/providers/mtdev.py | 6 | '''
Native support for Multitouch devices on Linux, using libmtdev.
===============================================================
The Mtdev project is a part of the Ubuntu Maverick multitouch architecture.
You can read more on http://wiki.ubuntu.com/Multitouch
To configure MTDev, it's preferable to use probesysfs p... |
napalm-automation/napalm-yang | refs/heads/develop | napalm_yang/models/openconfig/network_instances/network_instance/protocols/protocol/ospfv2/areas/area/lsdb/lsa_types/lsa_type/lsas/lsa/opaque_lsa/router_information/tlvs/tlv/segment_routing_sid_label_range/tlvs/tlv/unknown_tlv/state/__init__.py | 1 | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... |
BT-jmichaud/connector | refs/heads/8.0 | connector/unit/binder.py | 12 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... |
jeacaveo/schmebulock | refs/heads/develop | items/views.py | 1 | """ Views of items app. """
from rest_framework import viewsets
from . import models
from . import serializers
from . import metadata
class BrandViewSet(viewsets.ModelViewSet):
""" Endpoint for Brands. """
queryset = models.Brand.objects.all()
serializer_class = serializers.BrandSerializer
class Store... |
cpennington/edx-platform | refs/heads/master | pavelib/utils/envs.py | 1 | """
Helper functions for loading environment settings.
"""
import io
import json
import os
import re
import sys
from time import sleep
import memcache
import six
from lazy import lazy
from path import Path as path
from paver.easy import BuildFailure, sh
from six.moves import configparser
from pavelib.utils.cmd impo... |
AIML/scikit-learn | refs/heads/master | doc/tutorial/text_analytics/data/movie_reviews/fetch_data.py | 278 | """Script to download the movie review dataset"""
import os
import tarfile
try:
from urllib import urlopen
except ImportError:
from urllib.request import urlopen
URL = ("http://www.cs.cornell.edu/people/pabo/"
"movie-review-data/review_polarity.tar.gz")
ARCHIVE_NAME = URL.rsplit('/', 1)[1]
DATA_FOLDE... |
devs1991/test_edx_docmode | refs/heads/master | venv/lib/python2.7/site-packages/openassessment/assessment/tasks.py | 9 | """
Celery looks for tasks in this module,
so import the tasks we want the workers to implement.
"""
# pylint:disable=W0611
from .worker.training import train_classifiers, reschedule_training_tasks
from .worker.grading import grade_essay, reschedule_grading_tasks |
youtalk/mindstorms_ros | refs/heads/master | nxt/nxt_ros/scripts/nxt_ros.py | 1 | #!/usr/bin/env python
# Software License Agreement (BSD License)
#
# Copyright (c) 2010, Willow Garage, 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... |
chand3040/cloud_that | refs/heads/named-release/cypress.rc | openedx/core/djangoapps/user_api/accounts/tests/test_image_helpers.py | 124 | """
Tests for helpers.py
"""
import datetime
import hashlib
from mock import patch
from pytz import UTC
from unittest import skipUnless
from django.conf import settings
from django.test import TestCase
from ..image_helpers import get_profile_image_urls_for_user
from student.tests.factories import UserFactory
TEST_SI... |
ua-snap/downscale | refs/heads/master | snap_scripts/epscor_sc/dot_dof_logs_cmip5_decadals.py | 1 | # # # #
# CALCULATE DOF/DOT/LOGS FROM TAS TIMESERIES
# # # #
def tfg_days( x, err='off' ):
''' calculate DOF/DOT/LOGS for a vector of 12 chronological monthly values '''
import itertools
import numpy as np
# filter the div by zero and comparison with np.nan warnings from numpy
if err == 'off':
... |
guilhermebr/python-docx | refs/heads/master | docx/api.py | 1 | # encoding: utf-8
"""
Directly exposed API functions and classes, :func:`Document` for now.
Provides a syntactically more convenient API for interacting with the
OpcPackage graph.
"""
from __future__ import absolute_import, division, print_function
import os
from docx.enum.section import WD_SECTION
from docx.enum.t... |
agoravoting/agora_elections | refs/heads/master | admin/cycle.py | 1 | #!/usr/bin/env python
# This file is part of agora_elections.
# Copyright (C) 2014-2016 Agora Voting SL <agora@agoravoting.com>
# agora_elections 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, eithe... |
liqd/adhocracy3.mercator | refs/heads/master | src/adhocracy_spd/adhocracy_spd/resources/test_root.py | 4 | from pytest import fixture
from pytest import mark
@fixture
def integration(integration):
integration.include('pyramid_mailer.testing')
return integration
def test_root_meta():
from adhocracy_core.resources.root import root_meta
from adhocracy_core.resources.root import \
create_initial_cont... |
arkem/pyflag | refs/heads/main | src/plugins/MemoryForensics/Volatility-1.3_Linux_rc.1/memory_plugins/address_spaces/ewf.py | 7 | """ This Address Space allows us to open ewf files """
import standard
try:
## We must have this module or we dont activate ourselves
import pyewf
class EWFAddressSpace(standard.FileAddressSpace):
""" An EWF capable address space.
In order for us to work we need:
1) There must... |
sriramvenkatapathy/pyswip | refs/heads/master | test/test_prolog.py | 9 | # -*- coding: utf-8 -*-
# pyswip -- Python SWI-Prolog bridge
# Copyright (c) 2007-2012 Yüce Tekol
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without ... |
frederick-masterton/django | refs/heads/master | django/utils/module_loading.py | 60 | from __future__ import absolute_import # Avoid importing `importlib` from this package.
import copy
import imp
from importlib import import_module
import os
import sys
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.utils import six
from django.utils.deprecation import RemovedInDj... |
macieksk/sagenb | refs/heads/works_with_sage-6.3 | sagenb/notebook/user.py | 2 | # -*- coding: utf-8 -*
import copy
import crypt
import cPickle
import random
import hashlib
import os
SALT = 'aa'
import user_conf
def User_from_basic(basic):
"""
Create a user from a basic data structure.
"""
user = User(basic['username'])
user.__dict__.update(dict([('_' + x, y) for x, y in basi... |
EMResearch/EMB | refs/heads/master | jdk_8_maven/cs/rest/original/languagetool/languagetool-language-modules/ar/src/main/resources/org/languagetool/resource/ar/grammar_csv2xml.py | 3 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# test.py
# Convert a file which contains grammar rules into grammar xml format for LanguageTool
# The text file contains linguistic rules from book of "Guide of Commons errors" by Marwan Albawab
# الملف معالج يدويا ومجهز للبرمجة
# الملف فيه الأعمدة التالية:
# * styl... |
oasiswork/odoo | refs/heads/8.0 | addons/website_event/controllers/main.py | 209 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
droidlabour/git_intgrtn_aws_s3 | refs/heads/master | CreateSSHKey/Crypto/SelfTest/Hash/test_HMAC.py | 117 | # -*- coding: utf-8 -*-
#
# SelfTest/Hash/HMAC.py: Self-test for the HMAC module
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedication to th... |
yaybu/touchdown | refs/heads/master | touchdown/aws/iam/__init__.py | 1 | # Copyright 2014 Isotoma Limited
#
# 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... |
the-zebulan/CodeWars | refs/heads/master | katas/kyu_7/dna_gc_content.py | 1 | def gc_content(seq):
if not seq:
return 0
gc_cnt = total_chars = 0
for a in seq:
if a in 'GC':
gc_cnt += 1
total_chars += 1
return round(100.0 * gc_cnt / total_chars, 2)
|
kikocorreoso/brython | refs/heads/master | www/src/Lib/test/support/testresult.py | 2 | '''Test runner and result class for the regression test suite.
'''
import functools
import io
import sys
import time
import traceback
import unittest
# Brython: xml is not available
# import xml.etree.ElementTree as ET
from datetime import datetime
class RegressionTestResult(unittest.TextTestResult):
separator... |
cromambo/pythonIntro | refs/heads/master | fizzbuzz/test_fizzbuzz.py | 1 | from fizzbuzz import fizzbuzz
import pytest
def test_fizzbuzz_2_9():
assert fizzbuzz(9, 2, 9) == 'buzz'
assert fizzbuzz(17, 2, 9) == 17
assert fizzbuzz(18, 2, 9) == 'fizzbuzz'
assert fizzbuzz(19, 2, 9) == 19
assert fizzbuzz(20, 2, 9) == 'fizz'
def test_fizzbuzz_divzero():
assert fizzbuzz(20, 0, 9) == 'e... |
cortedeltimo/SickRage | refs/heads/master | lib/fanart/items.py | 61 | import json
import os
import requests
from fanart.core import Request
from fanart.immutable import Immutable
class LeafItem(Immutable):
KEY = NotImplemented
@Immutable.mutablemethod
def __init__(self, id, url, likes):
self.id = int(id)
self.url = url
self.likes = int(likes)
... |
javierriveracastro/descargador | refs/heads/master | trunk/Descargador.py | 1 | # coding=utf-8
"""
Descargardor de Umbria, programa para descargar partidas de:
http://www.comunidadumbria.com
(c) 2013 Javier Rivera
"""
import sys
from PyQt4 import QtGui, QtCore
from UmbriaDescargar.DescargarUi import Ui_MainWindow
from UmbriaDescargar.Umbria import Partida, PartidaPruebas
from UmbriaDescargar.... |
ondrokrc/gramps | refs/heads/master | gramps/gen/plug/report/_paper.py | 2 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2010 Jakim Friant
#
# 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; eithe... |
flotre/sickbeard-vfvo | refs/heads/master | lib/html5lib/sanitizer.py | 805 | from __future__ import absolute_import, division, unicode_literals
import re
from xml.sax.saxutils import escape, unescape
from .tokenizer import HTMLTokenizer
from .constants import tokenTypes
class HTMLSanitizerMixin(object):
""" sanitization of XHTML+MathML+SVG and of inline style attributes."""
accepta... |
a10networks/a10sdk-python | refs/heads/master | a10sdk/core/version/__init__.py | 12133432 | |
ismk/Python-Examples | refs/heads/master | learn python the hard way/ex40.py | 12133432 | |
j-carl/ansible | refs/heads/devel | test/units/galaxy/__init__.py | 12133432 | |
cwolferh/heat-scratch | refs/heads/master | heat/api/openstack/v1/views/__init__.py | 12133432 | |
StackPointCloud/libcloud | refs/heads/trunk | docs/examples/dns/list_zone_records.py | 64 | from libcloud.dns.providers import get_driver
from libcloud.dns.types import Provider
CREDENTIALS_ZERIGO = ('email', 'api key')
ZONE_ID = 'example.myzone.com'
Cls = get_driver(Provider.ZERIGO)
driver = Cls(*CREDENTIALS_ZERIGO)
zone = driver.get_zone(zone_id=ZONE_ID)
records = driver.list_records(zone=zone)
|
hifly/OpenUpgrade | refs/heads/8.0 | addons/fetchmail/fetchmail.py | 64 | # -*- 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... |
SerCeMan/intellij-community | refs/heads/master | python/helpers/pydev/pydevd_attach_to_process/linux/lldb_threads_settrace.py | 88 | # This file is meant to be run inside lldb as a command after
# the attach_linux.dylib dll has already been loaded to settrace for all threads.
def __lldb_init_module(debugger, internal_dict):
# Command Initialization code goes here
# print('Startup LLDB in Python!')
import lldb
try:
show_debug... |
adaur/SickRage | refs/heads/master | lib/github/PullRequestMergeStatus.py | 74 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... |
CiscoSystems/vespa | refs/heads/master | neutron/plugins/midonet/common/net_util.py | 20 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2013 Midokura PTE LTD
# 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.apach... |
TeutoNet-Netzdienste/ansible | refs/heads/devel | lib/ansible/__init__.py | 92 | # (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... |
paranoiasystem/Patterns | refs/heads/master | codice/prototype/cookie/cookie.py | 1 | import copy
#
# Prototype Class
#
class Cookie:
def __init__(self, name):
self.name = name
def clone(self):
return copy.deepcopy(self)
#
# Concrete Prototypes to clone
#
class CoconutCookie(Cookie):
def __init__(self):
Cookie.__init__(self, 'Coconut')
#
# Client Class
#
class... |
WSDC-NITWarangal/django | refs/heads/master | tests/migrations/test_deprecated_fields.py | 504 | from django.core.management import call_command
from django.test import override_settings
from .test_base import MigrationTestBase
class Tests(MigrationTestBase):
"""
Deprecated model fields should still be usable in historic migrations.
"""
@override_settings(MIGRATION_MODULES={"migrations": "migrat... |
JordanReiter/django-mailer | refs/heads/master | mailer/backend.py | 104 | from django.core.mail.backends.base import BaseEmailBackend
from mailer.models import Message
class DbBackend(BaseEmailBackend):
def send_messages(self, email_messages):
num_sent = 0
for email in email_messages:
msg = Message()
msg.email = email
msg.save()... |
nikolas/edx-platform | refs/heads/master | lms/djangoapps/edxnotes/__init__.py | 12133432 | |
lvgilmore/Luke | refs/heads/master | Luke/API/__init__.py | 12133432 | |
fcole90/ubuntu-make | refs/heads/master | tests/small/__init__.py | 12133432 | |
scriptnull/coala | refs/heads/master | coalib/collecting/__init__.py | 12133432 | |
philanthropy-u/edx-platform | refs/heads/master | openedx/core/djangoapps/course_groups/management/__init__.py | 12133432 | |
oswalpalash/remoteusermgmt | refs/heads/master | RUM/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/__init__.py | 1730 | """A collection of modules for building different kinds of tree from
HTML documents.
To create a treebuilder for a new type of tree, you need to do
implement several things:
1) A set of classes for various types of elements: Document, Doctype,
Comment, Element. These must implement the interface of
_base.treebuilders... |
BT-rmartin/odoo | refs/heads/BT_2900 | openerp/addons/test_new_api/tests/test_attributes.py | 394 | # -*- coding: utf-8 -*-
from openerp.tests import common
ANSWER_TO_ULTIMATE_QUESTION = 42
class TestAttributes(common.TransactionCase):
def test_we_can_add_attributes(self):
Model = self.env['test_new_api.category']
instance = Model.create({'name': 'Foo'})
# assign an unknown attribute
... |
pwarren/AGDeviceControl | refs/heads/master | agdevicecontrol/thirdparty/site-packages/win32/twisted/test/test_paths.py | 3 |
import os, time, pickle
from twisted.python import filepath
from twisted.python.runtime import platform
from twisted.trial import unittest
class FilePathTestCase(unittest.TestCase):
f1content = "file 1"
f2content = "file 2"
def setUp(self):
self.now = time.time()
cmn = self.mktemp()
... |
GhostofGoes/ADLES | refs/heads/master | adles/vsphere/__main__.py | 2 | #!/usr/bin/env python3
import argparse
import sys
from adles.utils import setup_logging
from adles.vsphere.vsphere_scripts import VSPHERE_SCRIPTS
def main():
# Parse CLI arguments
# TODO: generalize this between other scripts and adles main?
args = parse_args()
# Set if console output should be col... |
slogan621/tscharts | refs/heads/master | tools/covidinsert/covidinsert.py | 1 | #(C) Copyright Syd Logan 2021
#(C) Copyright Thousand Smiles Foundation 2021
#
#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 a... |
jkbockstael/adventofcode-2015 | refs/heads/master | day07_part1.py | 1 | # Advent of Code 2015 - Day 7 - Some Assembly Required
# http://adventofcode.com/2015/day/7
import sys
GATE_INPUT = 0
GATE_NOT = 1
GATE_AND = 2
GATE_OR = 3
GATE_RSHIFT = 4
GATE_LSHIFT = 5
GATE_CONNECT = 6
# Parse the input and return a map
def parse_input(s):
circuit = {}
for line in s:
gate, output ... |
j08lue/poppy | refs/heads/master | scripts/save_annual_max_timeseries.py | 1 | #!/usr/bin/env python
from __future__ import print_function
import numpy as np
import pandas as pd
import argparse
import glob
import poppy.metrics
regionlims = {
'Global' : dict(lonlim=(-90,90),latlim=(-180,180)),
'Atlantic' : dict(lonlim=(-80,40),latlim=(-70,70)),
'PolarNorthAtlantic': dict... |
burnpanck/chaco | refs/heads/master | chaco/polar_line_renderer.py | 3 | """ Defines the PolarLineRenderer class.
"""
from __future__ import with_statement
# Major library imports
from numpy import array, cos, pi, sin, transpose
# Enthought library imports
from enable.api import black_color_trait, LineStyle
from traits.api import Float
# Local, relative imports
from abstract_plot_render... |
malaterre/serna-free-backup | refs/heads/master | serna/dist/plugins/xhtml/__init__.py | 12133432 | |
coder-james/mxnet | refs/heads/master | example/ssd/train/__init__.py | 12133432 | |
devs1991/test_edx_docmode | refs/heads/master | venv/lib/python2.7/site-packages/networkx/external/__init__.py | 12133432 | |
flavour/RedHat | refs/heads/master | modules/tests/roles/DRRPP/__init__.py | 12133432 | |
iandees/all-the-places | refs/heads/master | locations/__init__.py | 12133432 | |
MM1nd/worldengine | refs/heads/master | tests/cli_test.py | 4 | import os
import sys
from tests.draw_test import TestBase
import unittest
from worldengine import __main__
from worldengine.cli.main import main
class TestCLI(TestBase):
def setUp(self):
super(TestCLI, self).setUp()
self.world = "%s/seed_28070.world" % self.tests_data_dir
def test__main__(se... |
elkingtonmcb/django | refs/heads/master | django/contrib/gis/db/backends/mysql/introspection.py | 700 | from MySQLdb.constants import FIELD_TYPE
from django.contrib.gis.gdal import OGRGeomType
from django.db.backends.mysql.introspection import DatabaseIntrospection
class MySQLIntrospection(DatabaseIntrospection):
# Updating the data_types_reverse dictionary with the appropriate
# type for Geometry fields.
... |
martinwicke/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/kernel_tests/beta_test.py | 11 | # 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... |
Pluto-tv/chromium-crosswalk | refs/heads/master | tools/telemetry/third_party/gsutilz/third_party/boto/boto/sdb/db/sequence.py | 153 | # Copyright (c) 2010 Chris Moyer http://coredumped.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, ... |
maurerpe/FreeCAD | refs/heads/master | src/Mod/Material/InitGui.py | 57 | #***************************************************************************
#* *
#* Copyright (c) 2013 - Juergen Riegel <FreeCAD@juergen-riegel.net> *
#* *
#* This ... |
hhirsch/dnt_rpg | refs/heads/master | blend/blendercal/bcobject.py | 1 | # -*- indent-tabs-mode: t -*-
# $Id: bcobject.py,v 1.2 2007/12/31 12:30:17 farpro Exp $
import Blender
import blendercal
import bcconf
import bcgui
# We use immutable sets in the LOD algorithm
# to identify unique edges and faces. Immutable
# sets are handy for identification because they're
# hashable and unordered.... |
benfinkelcbt/CPD200 | refs/heads/master | CPD200-Lab13-Python/rsa/cli.py | 81 | # -*- coding: utf-8 -*-
#
# Copyright 2011 Sybren A. Stüvel <sybren@stuvel.eu>
#
# 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
#
# Un... |
ArnossArnossi/django | refs/heads/master | tests/apps/__init__.py | 12133432 | |
slayerjain/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/pytest/_pytest/vendored_packages/__init__.py | 12133432 | |
bgris/ODL_bgris | refs/heads/master | lib/python3.5/site-packages/prompt_toolkit/keys.py | 20 | from __future__ import unicode_literals
__all__ = (
'Key',
'Keys',
)
class Key(object):
def __init__(self, name):
#: Descriptive way of writing keys in configuration files. e.g. <C-A>
#: for ``Control-A``.
self.name = name
def __repr__(self):
return '%s(%r)' % (self.... |
sevansahumIlovemuhammad/grit-i18n | refs/heads/master | grit/format/resource_map.py | 27 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''This file contains item formatters for resource_map_header and
resource_map_source files. A resource map is a mapping between r... |
zac1st1k/CodeIgniter | refs/heads/master | user_guide_src/source/_themes/sphinx_rtd_theme/__init__.py | 1504 | """Sphinx ReadTheDocs theme.
From https://github.com/ryan-roemer/sphinx-bootstrap-theme.
"""
import os
VERSION = (0, 1, 5)
__version__ = ".".join(str(v) for v in VERSION)
__version_full__ = __version__
def get_html_theme_path():
"""Return list of HTML theme paths."""
cur_dir = os.path.abspath(os.path.dirn... |
oihane/odoo | refs/heads/8.0 | addons/project_timesheet/project_timesheet.py | 237 | # -*- 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... |
damianmoore/django-filer | refs/heads/develop | filer/admin/tools.py | 43 | #-*- coding: utf-8 -*-
from django.core.exceptions import PermissionDenied
def check_files_edit_permissions(request, files):
for f in files:
if not f.has_edit_permission(request):
raise PermissionDenied
def check_folder_edit_permissions(request, folders):
for f in folders:
if not... |
EmreAtes/spack | refs/heads/develop | lib/spack/external/yaml/lib3/yaml/events.py | 986 |
# Abstract classes.
class Event(object):
def __init__(self, start_mark=None, end_mark=None):
self.start_mark = start_mark
self.end_mark = end_mark
def __repr__(self):
attributes = [key for key in ['anchor', 'tag', 'implicit', 'value']
if hasattr(self, key)]
argu... |
michaelgallacher/intellij-community | refs/heads/master | python/testData/refactoring/move/usagesOfUnqualifiedOldStyleRelativeImportsInsideMovedModule/after/src/pkg/__init__.py | 12133432 | |
jonyroda97/redbot-amigosprovaveis | refs/heads/develop | lib/matplotlib/compat/__init__.py | 12133432 | |
samuel1208/scikit-learn | refs/heads/master | sklearn/mixture/tests/__init__.py | 12133432 | |
joequery/django | refs/heads/master | tests/forms_tests/widget_tests/__init__.py | 12133432 | |
nimbis/django-cms | refs/heads/master | cms/test_utils/project/placeholderapp/migrations/__init__.py | 12133432 | |
svenstaro/ansible | refs/heads/devel | lib/ansible/modules/network/vyos/vyos_command.py | 20 | #!/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... |
lrdawg99/bigbyte | refs/heads/master | bigbyte/node_modules/cordova/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input.py | 64 | # 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.
from compiler.ast import Const
from compiler.ast import Dict
from compiler.ast import Discard
from compiler.ast import List
from compiler.ast import Module
from co... |
xuecai/OpenCC | refs/heads/master | deps/gtest-1.7.0/scripts/gen_gtest_pred_impl.py | 2538 | #!/usr/bin/env python
#
# Copyright 2006, 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... |
isandlaTech/cohorte-devtools | refs/heads/master | org.cohorte.eclipse.runner.basic/files/jython/Lib/_abcoll.py | 17 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
DON'T USE THIS MODULE DIRECTLY! The classes here should be imported
via collections; they are defined here only to alleviate certain
bootstrappin... |
alsrgv/tensorflow | refs/heads/master | tensorflow/python/distribute/numpy_dataset_test.py | 32 | # Copyright 2019 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... |
ftomassetti/intellij-community | refs/heads/master | python/testData/refactoring/move/module/after/src/p1/p2/__init__.py | 12133432 | |
runekaagaard/django-contrib-locking | refs/heads/master | tests/migrations/test_migrations/__init__.py | 12133432 | |
Viderl/test-gae | refs/heads/master | appengine-try-python-django/hello/__init__.py | 12133432 | |
fidomason/kbengine | refs/heads/master | kbe/src/lib/python/Tools/demo/rpythond.py | 107 | #!/usr/bin/env python3
"""
Remote python server.
Execute Python commands remotely and send output back.
WARNING: This version has a gaping security hole -- it accepts requests
from any host on the Internet!
"""
import sys
from socket import socket, AF_INET, SOCK_STREAM
import io
import traceback
PORT = 4127
BUFSIZE... |
marco-lancini/Showcase | refs/heads/master | djangoappengine/tests/transactions.py | 36 | from django.db.models import F
from django.test import TestCase
from .testmodels import EmailModel
class TransactionTest(TestCase):
emails = ['app-engine@scholardocs.com', 'sharingan@uchias.com',
'rinnengan@sage.de', 'rasengan@naruto.com']
def setUp(self):
EmailModel(email=self.emails[... |
Pablo126/SSBW | refs/heads/master | Tarea4/tarea4/lib/python3.5/site-packages/setuptools/__init__.py | 130 | """Extensions to the 'distutils' for large or complex distributions"""
import os
import functools
import distutils.core
import distutils.filelist
from distutils.util import convert_path
from fnmatch import fnmatchcase
from six.moves import filter, map
import setuptools.version
from setuptools.extension import Extens... |
mlyundin/scrapy | refs/heads/master | tests/mocks/__init__.py | 12133432 | |
campbe13/openhatch | refs/heads/master | vendor/packages/Django/django/conf/locale/sk/__init__.py | 12133432 | |
ahmadiga/min_edx | refs/heads/master | common/test/acceptance/tests/lms/test_lms_cohorted_courseware_search.py | 36 | """
Test courseware search
"""
import os
import json
import uuid
from ..helpers import remove_file
from ...pages.common.logout import LogoutPage
from ...pages.studio.overview import CourseOutlinePage
from ...pages.lms.courseware_search import CoursewareSearchPage
from ...pages.lms.staff_view import StaffPage
from ...f... |
crate/crate | refs/heads/master | blackbox/test_jmx.py | 1 | # -*- coding: utf-8; -*-
#
# Licensed to Crate.io GmbH ("Crate") under one or more contributor
# license agreements. See the NOTICE file distributed with this work for
# additional information regarding copyright ownership. Crate licenses
# this file to you under the Apache License, Version 2.0 (the "License");
# you... |
theguardian/KodiDB | refs/heads/master | cherrypy/_cpnative_server.py | 41 | """Native adapter for serving CherryPy via its builtin server."""
import logging
import sys
import cherrypy
from cherrypy._cpcompat import BytesIO
from cherrypy._cperror import format_exc, bare_error
from cherrypy.lib import httputil
from cherrypy import wsgiserver
class NativeGateway(wsgiserver.Gateway):
recu... |
laufercenter/meld | refs/heads/master | meld/test/functional/comm/broadcast_states.py | 1 | #
# Copyright 2015 by Justin MacCallum, Alberto Perez, Ken Dill
# All rights reserved
#
import numpy as np
from meld import comm
from meld.system.state import SystemState
N_ATOMS = 500
N_REPLICAS = 4
def generate_state(index):
coords = index * np.ones((N_ATOMS, 3))
vels = index * np.ones((N_ATOMS, 3))
a... |
bosstb/YGY60W | refs/heads/master | Test.py | 2 | #coding=utf-8
from datetime import datetime
import random
#生成100个随机0,1之间的浮点数序列l
l=0.1
l = random.randint(1, 100)
l=float(l)/100
print datetime.today() |
Vegasvikk/django-cms | refs/heads/develop | cms/tests/plugins.py | 7 | # -*- coding: utf-8 -*-
from __future__ import with_statement
import base64
import datetime
import json
import os
from django import http
from django.conf import settings
from django.conf.urls import url
from django.contrib import admin
from django.core import urlresolvers
from django.core.cache import cache
from djan... |
rmcgibbo/msmbuilder3 | refs/heads/master | tests/test_pca.py | 1 | import numpy as np
from msmbuilder3 import PCA
import sklearn.decomposition
def test_pca():
X = np.random.randn(10,10)
skpca = sklearn.decomposition.PCA(n_components=4)
skpca.fit(X)
pca = PCA(n_components=4)
pca.fit(X)
reference = skpca.components_
result = pca.components_
# make sur... |
lbogdan/czl-scrape | refs/heads/master | sanatate/scrapy_proj/pipelines/__init__.py | 5 | # -*- coding: utf-8 -*-
from scrapy_proj.pipelines.extrameta import *
from scrapy_proj.pipelines.post import *
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.