repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
VillageAlliance/django-cms | refs/heads/develop | tests/project/pluginapp/__init__.py | 12133432 | |
Ensembles/ert | refs/heads/master | python/tests/ert/analysis/__init__.py | 12133432 | |
philipbl/home-assistant | refs/heads/dev | homeassistant/components/binary_sensor/bloomsky.py | 18 | """
Support the binary sensors of a BloomSky weather station.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.bloomsky/
"""
import logging
import voluptuous as vol
from homeassistant.components.binary_sensor import (
BinarySensorDevic... |
subutai/htmresearch | refs/heads/master | projects/sequence_prediction/discrete_sequences/plotReberGrammar.py | 12 | #!/usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions ... |
julianprabhakar/eden_car | refs/heads/master | modules/webkit_url2png.py | 53 | #!/usr/bin/env python
import sys
import signal
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import QWebPage
def save_webpage_screenshot(url, width, height, file_name = None):
"""Saves a screenshot of the webpage given in url into filename+".png"
width and height, if given, ar... |
pattisdr/osf.io | refs/heads/develop | osf/models/notifications.py | 11 | from django.contrib.postgres.fields import ArrayField
from django.db import models
from osf.models import Node
from osf.models import OSFUser
from osf.models.base import BaseModel, ObjectIDMixin
from osf.models.validators import validate_subscription_type
from osf.utils.fields import NonNaiveDateTimeField
from website.... |
sidmitra/django_nonrel_testapp | refs/heads/master | django/contrib/auth/backends.py | 230 | from django.db import connection
from django.contrib.auth.models import User, Permission
class ModelBackend(object):
"""
Authenticates against django.contrib.auth.models.User.
"""
supports_object_permissions = False
supports_anonymous_user = True
supports_inactive_user = True
# TODO: Mode... |
OTWillems/GEO1005 | refs/heads/master | TwisterSolutions/test/test_init.py | 121 | # coding=utf-8
"""Tests QGIS plugin init."""
__author__ = 'Tim Sutton <tim@linfiniti.com>'
__revision__ = '$Format:%H$'
__date__ = '17/10/2010'
__license__ = "GPL"
__copyright__ = 'Copyright 2012, Australia Indonesia Facility for '
__copyright__ += 'Disaster Reduction'
import os
import unittest
import logging
import ... |
isrohutamahopetechnik/MissionPlanner | refs/heads/master | Lib/site-packages/numpy/polynomial/setup.py | 95 |
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('polynomial',parent_package,top_path)
config.add_data_dir('tests')
return config
if __name__ == '__main__':
from numpy.distutils.core import setup
setup(configuration... |
longman694/youtube-dl | refs/heads/mod | youtube_dl/extractor/hbo.py | 40 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
xpath_text,
xpath_element,
int_or_none,
parse_duration,
)
class HBOBaseIE(InfoExtractor):
_FORMATS_INFO = {
'pro7': {
'wid... |
itghisi/simplewidgets | refs/heads/master | simplewidgets/PyQt/QtGui.py | 1 | try:
from PySide.QtGui import *
except ImportError:
try:
from PyQt5.QtGui import *
except ImportError:
raise RuntimeError("No Python-Qt bindings found")
|
kingsamchen/Eureka | refs/heads/master | crack-data-structures-and-algorithms/leetcode/python-impl/roman_to_integer_q13.py | 1 | # 核心思路
# 因为罗马数字的拼写规则,如果value(s[i]) < value(s[i+1])
# 那么数值需要 -value(s[i]) + value(s[i+1])
# 可以利用这点一次遍历完成
class Solution(object):
def romanToInt(self, s):
"""
:type s: str
:rtype: int
"""
alphabet = {
'I': 1, 'V': 5, 'X': 10, 'L': 50, 'C': 100, 'D': 500, 'M': 1000
... |
eduNEXT/edunext-ecommerce | refs/heads/master | ecommerce/extensions/voucher/migrations/0003_orderlinevouchers.py | 1 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('order', '0009_auto_20150709_1205'),
('voucher', '0002_couponvouchers'),
]
operations = [
migrations... |
eclipse-ease-addons/engines | refs/heads/master | jython/org.jython/Lib/tabnanny.py | 394 | #! /usr/bin/env python
"""The Tab Nanny despises ambiguous indentation. She knows no mercy.
tabnanny -- Detection of ambiguous indentation
For the time being this module is intended to be called as a script.
However it is possible to import it into an IDE and use the function
check() described below.
Warning: The ... |
phpython/phpython | refs/heads/master | demo/phpython/exec/script1.py | 2 |
print "module1 body" |
Eficent/odoomrp-wip | refs/heads/8.0 | procurement_sale_forecast/wizard/__init__.py | 24 | # -*- encoding: utf-8 -*-
##############################################################################
#
# 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 the... |
django-nonrel/django | refs/heads/nonrel-1.6 | django/contrib/admin/views/main.py | 47 | import sys
import warnings
from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured
from django.core.paginator import InvalidPage
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models.fields import FieldDoesNotExist
from django.utils import six
from django.... |
Gregory-Howard/spaCy | refs/heads/master | spacy/tests/serialize/__init__.py | 12133432 | |
dagurval/bitcoinxt | refs/heads/master | qa/rpc-tests/test_framework/__init__.py | 12133432 | |
bufferapp/buffer-django-nonrel | refs/heads/master | tests/modeltests/user_commands/management/commands/__init__.py | 12133432 | |
michel-slm/obnam | refs/heads/fix-py26-compat | obnamlib/__init__.py | 1 | # Copyright (C) 2009-2014 Lars Wirzenius
#
# 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 distribu... |
brandonlogan/octavia | refs/heads/master | octavia/common/utils.py | 1 | # Copyright 2011, VMware, Inc., 2014 A10 Networks
# 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
#
# ... |
nikitasingh981/scikit-learn | refs/heads/master | sklearn/neighbors/approximate.py | 14 | """Approximate nearest neighbor search"""
# Author: Maheshakya Wijewardena <maheshakya.10@cse.mrt.ac.lk>
# Joel Nothman <joel.nothman@gmail.com>
import numpy as np
import warnings
from scipy import sparse
from .base import KNeighborsMixin, RadiusNeighborsMixin
from ..base import BaseEstimator
from ..utils.va... |
octopus-platform/joern | refs/heads/dev | python/joern-tools/joern/shelltool/PlotConfiguration.py | 1 | #!/usr/bin/env python3
import re
class PlotConfiguration:
def __init__(self):
self.config = []
def _matchRulePattern(self,pattern_type,pattern_rule,element_properties):
if pattern_rule == '*': return True
k,v = pattern_rule.split('.',maxsplit=1)
prop = element_properties.get(k)... |
ZhangXinNan/tensorflow | refs/heads/master | tensorflow/python/kernel_tests/fractional_avg_pool_op_test.py | 18 | # 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... |
mollstam/UnrealPy | refs/heads/master | UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/requests-2.7.0/requests/packages/chardet/euctwprober.py | 2993 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... |
wiltonlazary/arangodb | refs/heads/devel | 3rdParty/boost/1.61.0/tools/build/src/tools/types/__init__.py | 61 | __all__ = [
'asm',
'cpp',
'exe',
'html',
'lib',
'obj',
'preprocessed',
'rsp',
]
def register_all ():
for i in __all__:
m = __import__ (__name__ + '.' + i)
reg = i + '.register ()'
#exec (reg)
# TODO: (PF) I thought these would be imported automatically. Anyo... |
titansgroup/python-phonenumbers | refs/heads/dev | python/phonenumbers/shortdata/region_SL.py | 11 | """Auto-generated file, do not edit by hand. SL metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_SL = PhoneMetadata(id='SL', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='[069]\\d{2,4}', possible_number_pattern... |
Qirky/PyKinectTk | refs/heads/master | PyKinectTk/utils/Env.py | 1 | """
Env.py
This module sets up the intial work environment and database
"""
from SQL import *
import Skeleton
from os.path import realpath, abspath, join
from os.path import isdir, isfile, dirname
def local(filename):
""" Returns the realpath for a file in THIS directory """
return abspath(... |
10clouds/edx-platform | refs/heads/dev | common/lib/xmodule/xmodule/tests/test_fields.py | 78 | """Tests for classes defined in fields.py."""
import datetime
import unittest
from django.utils.timezone import UTC
from xmodule.fields import Date, Timedelta, RelativeTime
from xmodule.timeinfo import TimeInfo
class DateTest(unittest.TestCase):
date = Date()
def compare_dates(self, dt1, dt2, expected_del... |
allotria/intellij-community | refs/heads/master | python/testData/refactoring/inlineFunction/removeTypingOverrides/main.py | 12 | from typing import overload
class MyClass:
def __init__(self, my_val):
self.my_val = my_val
@overload
def method(self, x: int) -> int:
pass
@overload
def method(self, x: str) -> str:
pass
def method(self, x):
print(self.my_val)
print(x)
return... |
kant/inasafe | refs/heads/develop | safe/impact_functions/generic/classified_raster_building/impact_function.py | 2 | # coding=utf-8
"""InaSAFE Disaster risk tool by Australian Aid - Generic Impact function on
Building for Classified Hazard.
Contact : ole.moller.nielsen@gmail.com
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
... |
geometalab/Vector-Tiles-Reader-QGIS-Plugin | refs/heads/dev-qgis3 | ext-libs/shapely/geometry/multilinestring.py | 16 | """Collections of linestrings and related utilities
"""
import sys
if sys.version_info[0] < 3:
range = xrange
from ctypes import c_double, c_void_p, cast, POINTER
from shapely.geos import lgeos
from shapely.geometry.base import BaseMultipartGeometry, geos_geom_from_py
from shapely.geometry import linestring
fro... |
dkubiak789/OpenUpgrade | refs/heads/8.0 | addons/google_drive/__init__.py | 437 | import google_drive
|
TRox1972/youtube-dl | refs/heads/master | youtube_dl/extractor/fusion.py | 39 | from __future__ import unicode_literals
from .common import InfoExtractor
from .ooyala import OoyalaIE
class FusionIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?fusion\.net/video/(?P<id>\d+)'
_TESTS = [{
'url': 'http://fusion.net/video/201781/u-s-and-panamanian-forces-work-together-to-stop-a-v... |
meabsence/python-for-android | refs/heads/master | python3-alpha/extra_modules/gdata/tlslite/BaseDB.py | 46 | """Base class for SharedKeyDB and VerifierDB."""
import dbm
import _thread
class BaseDB:
def __init__(self, filename, type):
self.type = type
self.filename = filename
if self.filename:
self.db = None
else:
self.db = {}
self.lock = _thread.allocate_lo... |
wdv4758h/ZipPy | refs/heads/master | edu.uci.python.benchmark/src/benchmarks/spectralnorm2t.py | 1 | # The Computer Language Benchmarks Game
# http://shootout.alioth.debian.org/
#
# Contributed by Sebastien Loisel
# Fixed by Isaac Gouy
# Sped up by Josh Goldfoot
# Dirtily sped up by Simon Descarpentries
# Sped up by Joseph LaFata
from array import array
from math import sqrt
from sys import argv
import... |
synasius/django | refs/heads/master | tests/view_tests/tests/test_static.py | 337 | from __future__ import unicode_literals
import mimetypes
import unittest
from os import path
from django.conf.urls.static import static
from django.http import FileResponse, HttpResponseNotModified
from django.test import SimpleTestCase, override_settings
from django.utils.http import http_date
from django.views.stat... |
sarvex/django | refs/heads/master | tests/gis_tests/geos_tests/__init__.py | 12133432 | |
paurosello/frappe | refs/heads/develop | frappe/patches/v6_15/__init__.py | 12133432 | |
helldorado/ansible | refs/heads/devel | lib/ansible/module_utils/remote_management/lxca/__init__.py | 12133432 | |
Chilledheart/chromium | refs/heads/master | tools/telemetry/third_party/gsutilz/third_party/boto/tests/unit/dynamodb/__init__.py | 12133432 | |
Don42/youtube-dl | refs/heads/master | youtube_dl/extractor/radiojavan.py | 124 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import(
unified_strdate,
str_to_int,
)
class RadioJavanIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?radiojavan\.com/videos/video/(?P<id>[^/]+)/?'
_TEST = {
'url': 'http://www.radiojavan.c... |
addition-it-solutions/project-all | refs/heads/master | addons/auth_signup/controllers/__init__.py | 7372 | import main
|
Elettronik/SickRage | refs/heads/master | lib/github/Stargazer.py | 25 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Christopher Gilbert <christopher.john.gilbert@gmail.com> #
# Copyright 2012 Steve English <steve.english@naveta... |
Antiun/server-tools | refs/heads/8.0 | base_suspend_security/models/ir_model_access.py | 26 | # -*- coding: utf-8 -*-
##############################################################################
#
# This module copyright (C) 2015 Therp BV (<http://therp.nl>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# ... |
tcatut/plugin.video.youtube | refs/heads/master | resources/lib/youtube/helper/tv.py | 1 | __author__ = 'bromix'
from resources.lib import kodion
from resources.lib.youtube.helper import utils
from resources.lib.kodion.items.video_item import VideoItem
def my_subscriptions_to_items(provider, context, json_data):
result = []
video_id_dict = {}
items = json_data.get('items', [])
for item in... |
javalovelinux/SparkGroovyScript | refs/heads/master | dist/examples/src/main/python/mllib/multi_class_metrics_example.py | 98 | #
# 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 us... |
derDavidT/sympy | refs/heads/master | sympy/assumptions/tests/test_sathandlers.py | 50 | from sympy import Mul, Basic, Q, Expr, And, symbols, Equivalent, Implies, Or
from sympy.assumptions.sathandlers import (ClassFactRegistry, AllArgs,
UnevaluatedOnFree, AnyArgs, CheckOldAssump, ExactlyOneArg)
from sympy.utilities.pytest import raises
x, y, z = symbols('x y z')
def test_class_handler_registry():... |
pprett/scikit-learn | refs/heads/master | examples/neighbors/plot_kde_1d.py | 60 | """
===================================
Simple 1D Kernel Density Estimation
===================================
This example uses the :class:`sklearn.neighbors.KernelDensity` class to
demonstrate the principles of Kernel Density Estimation in one dimension.
The first plot shows one of the problems with using histogram... |
marcore/edx-platform | refs/heads/master | common/djangoapps/config_models/decorators.py | 179 | """Decorators for model-based configuration. """
from functools import wraps
from django.http import HttpResponseNotFound
def require_config(config_model):
"""View decorator that enables/disables a view based on configuration.
Arguments:
config_model (ConfigurationModel subclass): The class of the co... |
mahak/cinder | refs/heads/master | cinder/volume/drivers/huawei/huawei_utils.py | 2 | # Copyright (c) 2016 Huawei Technologies Co., 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.apache.org/licenses/LICENSE-2.0
#
# ... |
ramitalat/odoo | refs/heads/8.0 | openerp-wsgi.py | 363 | # WSGI Handler sample configuration file.
#
# Change the appropriate settings below, in order to provide the parameters
# that would normally be passed in the command-line.
# (at least conf['addons_path'])
#
# For generic wsgi handlers a global application is defined.
# For uwsgi this should work:
# $ uwsgi_python --... |
Maspear/odoo | refs/heads/8.0 | addons/account/test/test_parent_structure.py | 432 | # -*- 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... |
dkubiak789/odoo | refs/heads/8.0 | addons/sale_mrp/sale_mrp.py | 225 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
rafaelfccg/taia_final_project | refs/heads/master | KH.py | 1 | import random
import math
import benchmarkFunctions
import copy
NUM_DIMENSIONS = 20
NUM_ITERATIONS = 1000
POPULATION_SIZE = 50
random_range_value = 1
INERTIA_NEIGHBORS = 0.9
INERTIA_FOOD = 0.9
CT = 0.5
N_MAX = 0.02
FORAGING_SPEED = 0.02
DIFUSION_SPEED = 0.005
EPSILON = 10**-5
CONVERGENCE_PRECISION = 10**-3
X_MAX... |
Open-Transport/synthese | refs/heads/master | server/utils/udf_proxy/dummy_synthese_server.py | 1 | #!/usr/bin/env python
#
# Simulates a Synthese server that just prints requests made to it.
# @file dummy_synthese_server.py
# @author Sylvain Pasche
#
# This file belongs to the SYNTHESE project (public transportation specialized software)
# Copyright (C) 2002 Hugues Romain - RCSmobility <contact@rcsmob... |
Bryan792/dotfiles | refs/heads/master | vim/vim.symlink/eclim/autoload/eclim/python/rope/refactor/importutils/importinfo.py | 58 | class ImportStatement(object):
"""Represent an import in a module
`readonly` attribute controls whether this import can be changed
by import actions or not.
"""
def __init__(self, import_info, start_line, end_line,
main_statement=None, blank_lines=0):
self.start_line = st... |
houzhenggang/hiwifi-openwrt-HC5661-HC5761 | refs/heads/master | staging_dir/target-mipsel_r2_uClibc-0.9.33.2/usr/lib/python2.7/dumbdbm.py | 251 | """A dumb and slow but simple dbm clone.
For database spam, spam.dir contains the index (a text file),
spam.bak *may* contain a backup of the index (also a text file),
while spam.dat contains the data (a binary file).
XXX TO DO:
- seems to contain a bug when updating...
- reclaim free space (currently, space once o... |
jsirois/pants | refs/heads/master | src/python/pants/util/dirutil.py | 4 | # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import atexit
import errno
import os
import shutil
import stat
import tempfile
import threading
import uuid
from collections import defaultdict
from con... |
cledio66/pyglet | refs/heads/master | tests/image/PYPNG_LA_SAVE.py | 29 | #!/usr/bin/env python
'''Test LA save using PyPNG. You should see la.png reference image
on the left, and saved (and reloaded) image on the right. The saved image
may have larger dimensions due to texture size restrictions.
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import unittest
impo... |
emirot/codefights | refs/heads/master | the_core/reverseOnDiagonals.py | 1 | def reverseOnDiagonals(matrix):
diag_left = []
diag_right = []
z = len(matrix)-1
for i in range(len(matrix)):
diag_left.append(matrix[i][i])
i = 0
while z >= 0:
diag_right.append(matrix[z][i])
z -=1
i +=1
diag_left = list(reversed(diag_left))
diag_... |
shubhdev/edxOnBaadal | refs/heads/master | lms/djangoapps/courseware/testutils.py | 10 | """
Common test utilities for courseware functionality
"""
from abc import ABCMeta, abstractmethod
from datetime import datetime
import ddt
from mock import patch
from lms.djangoapps.courseware.url_helpers import get_redirect_url
from student.tests.factories import AdminFactory, UserFactory, CourseEnrollmentFactory
f... |
fduraffourg/servo | refs/heads/master | tests/wpt/web-platform-tests/websockets/handlers/echo-query_v13_wsh.py | 266 | #!/usr/bin/python
from mod_pywebsocket import msgutil, util
def web_socket_do_extra_handshake(request):
pass
def web_socket_transfer_data(request):
while True:
msgutil.send_message(request, request.unparsed_uri.split('?')[1] or '')
return
|
LLNL/spack | refs/heads/develop | var/spack/repos/builtin/packages/fca/package.py | 2 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Fca(Package):
"""Legacy interface for Mellanox Fabric Collective Accelerator (FCA). FCA
... |
anatm/administrator | refs/heads/master | git-1.8.1/git_remote_helpers/git/repo.py | 45 | import os
import subprocess
from git_remote_helpers.util import check_call
def sanitize(rev, sep='\t'):
"""Converts a for-each-ref line to a name/value pair.
"""
splitrev = rev.split(sep)
branchval = splitrev[0]
branchname = splitrev[1].strip()
if branchname.startswith("refs/heads/"):
... |
nirmeshk/oh-mainline | refs/heads/master | vendor/packages/Django/django/core/context_processors.py | 232 | """
A set of request processors that return dictionaries to be merged into a
template context. Each function takes the request object as its only parameter
and returns a dictionary to add to the context.
These are referenced from the setting TEMPLATE_CONTEXT_PROCESSORS and used by
RequestContext.
"""
from __future__ i... |
pystruct/pystruct | refs/heads/master | pystruct/tests/test_learners/test_subgradient_latent_svm.py | 5 | import numpy as np
from numpy.testing import (assert_array_equal, assert_array_almost_equal,
assert_almost_equal)
from pystruct.models import LatentGridCRF, LatentDirectionalGridCRF, GridCRF
from pystruct.learners import SubgradientLatentSSVM, SubgradientSSVM
from pystruct.inference import g... |
freddiebarrsmith/phpmongobuildpackcf | refs/heads/master | tests/test_compile_helpers.py | 9 | import os
import os.path
import tempfile
import shutil
from nose.tools import eq_
from build_pack_utils import utils
from compile_helpers import setup_webdir_if_it_doesnt_exist
from compile_helpers import convert_php_extensions
from compile_helpers import is_web_app
from compile_helpers import find_stand_alone_app_to_r... |
Juniper/nova | refs/heads/master | nova/console/serial.py | 10 | # All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... |
sstruct/flasky | refs/heads/master | migrations/versions/51f5ccfba190_comments.py | 113 | """comments
Revision ID: 51f5ccfba190
Revises: 2356a38169ea
Create Date: 2014-01-01 12:08:43.287523
"""
# revision identifiers, used by Alembic.
revision = '51f5ccfba190'
down_revision = '2356a38169ea'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - pleas... |
hassoon3/odoo | refs/heads/8.0 | addons/crm/wizard/crm_phonecall_to_meeting.py | 381 | # -*- 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... |
nicobustillos/odoo | refs/heads/8.0 | addons/hr_contract/__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... |
cjhak/b2share | refs/heads/master | invenio/modules/formatter/views.py | 8 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... |
AlericInglewood/3p-colladadom | refs/heads/singularity | projects/vc8to9.py | 2 | import sys, os, xml, string, getopt, StringIO
from os import path
from os.path import join
from xml.dom import minidom, Node
def slnToVC9(vc8Sln, vc9Sln):
vc8File = open(vc8Sln, 'r')
vc9File = open(vc9Sln, 'w')
if not vc8File or not vc9File:
return False
for line in vc8File:
if line.fin... |
fedspendingtransparency/data-act-broker-backend | refs/heads/development | dataactcore/migrations/versions/807a203713a4_add_dates_to_tas_index.py | 1 | """Add dates to tas index
Revision ID: 807a203713a4
Revises: bb33cc8f0a3e
Create Date: 2016-11-09 19:47:52.671178
"""
# revision identifiers, used by Alembic.
revision = '807a203713a4'
down_revision = 'bb33cc8f0a3e'
branch_labels = None
depends_on = None
from alembic import op
def upgrade(engine_name):
global... |
andrey-utkin/linux | refs/heads/master | scripts/gdb/linux/lists.py | 509 | #
# gdb helper commands and functions for Linux kernel debugging
#
# list tools
#
# Copyright (c) Thiebaud Weksteen, 2015
#
# Authors:
# Thiebaud Weksteen <thiebaud@weksteen.fr>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
from linux import utils
list_head = utils.CachedType("st... |
danmackinlay/pelican-plugins | refs/heads/master | liquid_tags/vimeo.py | 25 | """
Vimeo Tag
---------
This implements a Liquid-style vimeo tag for Pelican,
based on the youtube tag which is in turn based on
the jekyll / octopress youtube tag [1]_
Syntax
------
{% vimeo id [width height] %}
Example
-------
{% vimeo 10739054 640 480 %}
Output
------
<span style="width:640px; height:480px;">
... |
anhstudios/swganh | refs/heads/develop | data/scripts/templates/object/static/structure/general/shared_debris_deathstar_small_tube.py | 2 | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Static()
result.template = "object/static/structure/general/shared_debris_deathstar_small_tube.iff"
result.attrib... |
ader1990/cloudbase-init | refs/heads/master | cloudbaseinit/tests/plugins/common/userdataplugins/test_parthandler.py | 7 | # Copyright 2013 Cloudbase Solutions Srl
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... |
Jgarcia-IAS/SITE | refs/heads/master | openerp/tools/mail.py | 38 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2012-TODAY OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
nicolargo/intellij-community | refs/heads/master | python/testData/completion/exceptName.after.py | 83 | try:
import foo
except ImportError, bar: |
amyvmiwei/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/sre_constants.py | 106 | #
# Secret Labs' Regular Expression Engine
#
# various symbols used by the regular expression engine.
# run this script to update the _sre include files!
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# See the sre.py file for information on usage and redistribution.
#
"""Internal support modul... |
HyperManTT/ECommerceSaleor | refs/heads/master | saleor/registration/views.py | 2 | from django.conf import settings
from django.contrib import messages, auth
from django.contrib.auth import views as django_views
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect
from django.utils.translation import ugettext_lazy as _
from django.template.response import Te... |
hdmetor/scikit-learn | refs/heads/master | sklearn/kernel_approximation.py | 258 | """
The :mod:`sklearn.kernel_approximation` module implements several
approximate kernel feature maps base on Fourier transforms.
"""
# Author: Andreas Mueller <amueller@ais.uni-bonn.de>
#
# License: BSD 3 clause
import warnings
import numpy as np
import scipy.sparse as sp
from scipy.linalg import svd
from .base im... |
openstack/tooz | refs/heads/master | examples/coordinator.py | 1 | # Copyright (C) 2020 Red Hat, 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 writ... |
sjlehtin/django | refs/heads/master | django/contrib/gis/gdal/raster/source.py | 9 | import json
import os
import sys
import uuid
from ctypes import (
addressof, byref, c_buffer, c_char_p, c_double, c_int, c_void_p, string_at,
)
from django.contrib.gis.gdal.driver import Driver
from django.contrib.gis.gdal.error import GDALException
from django.contrib.gis.gdal.prototypes import raster as capi
fro... |
darkwing/kuma | refs/heads/master | vendor/packages/pygments/lexers/graph.py | 72 | # -*- coding: utf-8 -*-
"""
pygments.lexers.graph
~~~~~~~~~~~~~~~~~~~~~
Lexers for graph query languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygroups, using, this... |
adafruit/Adafruit_Python_SSD1306 | refs/heads/master | setup.py | 1 | import os
import io
from setuptools import setup, find_packages
here = os.path.abspath(os.path.dirname(__file__))
# Import the README and use it as the long-description.
with io.open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = '\n' + f.read()
classifiers = ['Development Status :: ... |
ohnoimdead/horizon | refs/heads/master | django-openstack/django_openstack/tests/view_tests/dash/port_tests.py | 5 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2011 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# no... |
samrocketman/ekeyfinder | refs/heads/main | docs/chm/generate_doc.py | 1 | #!/usr/bin/env python
'''
Created by Sam Gleske
Created 02-28-2011 (mm-dd-yyyy)
MIT License (http://www.opensource.org/licenses/mit-license.php)
This python script parses mediawiki xml schema exported from the
MediaWiki wiki interface (admin function). During parsing it
utilizes documentation.py to gene... |
anandpdoshi/frappe | refs/heads/develop | frappe/model/docfield.py | 61 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""docfield utililtes"""
import frappe
def rename(doctype, fieldname, newname):
"""rename docfield"""
df = frappe.db.sql("""select * from tabDocField where parent=%s and field... |
oktie/linkedct | refs/heads/master | ctdjango/geosearch/views.py | 1 | import math
from django.shortcuts import render_to_response
from django.conf import settings
from linkedct.models import *
import databrowse
from databrowse.datastructures import *
from geopy import geocoders, distance
def map_view(request):
databrowse.site.root_url = settings.CONFIG['ROOT']
countries = Count... |
alexissmirnov/donomo | refs/heads/master | donomo_archive/lib/offlineimap/imapserver.py | 1 | # IMAP server support
# Copyright (C) 2002 - 2007 John Goerzen
# <jgoerzen@complete.org>
#
# 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 y... |
egabancho/invenio | refs/heads/pu | invenio/modules/previewer/previewerext/zip.py | 1 | ## This file is part of Invenio.
## Copyright (C) 2013, 2014 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) any later version.
##
... |
sudhirmohanraj/python_koans | refs/heads/master | python2/libs/colorama/ansi.py | 527 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
'''
This module generates ANSI character codes to printing colors to terminals.
See: http://en.wikipedia.org/wiki/ANSI_escape_code
'''
CSI = '\033['
def code_to_chars(code):
return CSI + str(code) + 'm'
class AnsiCodes(object):
def __... |
WSDC-NITWarangal/django | refs/heads/master | django/db/backends/utils.py | 430 | from __future__ import unicode_literals
import datetime
import decimal
import hashlib
import logging
from time import time
from django.conf import settings
from django.utils.encoding import force_bytes
from django.utils.timezone import utc
logger = logging.getLogger('django.db.backends')
class CursorWrapper(object... |
seem-sky/kbengine | refs/heads/master | kbe/res/scripts/common/Lib/xml/sax/saxutils.py | 76 | """\
A library of useful helper classes to the SAX classes, for the
convenience of application and driver writers.
"""
import os, urllib.parse, urllib.request
import io
import codecs
from . import handler
from . import xmlreader
def __dict_replace(s, d):
"""Replace substrings of a string using a dictionary."""
... |
adamjmcgrath/glancydesign | refs/heads/master | django/views/generic/detail.py | 154 | import re
from django.core.exceptions import ImproperlyConfigured, ObjectDoesNotExist
from django.http import Http404
from django.utils.encoding import smart_str
from django.utils.translation import ugettext as _
from django.views.generic.base import TemplateResponseMixin, View
class SingleObjectMixin(object):
"... |
GPNMilano/PyPRPImporter | refs/heads/master | PyPRPImport/__init__.py | 12133432 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.