repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
MihaiMoldovanu/ansible | refs/heads/devel | lib/ansible/modules/cloud/ovirt/ovirt_tags.py | 75 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... |
hndrewaall/league | refs/heads/master | app/league/admin/__init__.py | 4 | # -*- coding: utf-8 -*-
"""The admin module."""
from . import views, utils # noqa
|
Gateworks/platform-external-chromium_org | refs/heads/imx_kk4.4.3_2.0.0-beta | tools/telemetry/telemetry/page/page_test.py | 23 | # 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.
import logging
from telemetry.page import test_expectations
from telemetry.page.actions import all_page_actions
from telemetry.page.actions import intera... |
durai145/youtube-dl | refs/heads/master | youtube_dl/extractor/tvplay.py | 86 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
parse_iso8601,
qualities,
)
class TVPlayIE(InfoExtractor):
IE_DESC = 'TV3Play and related services'
_VALID_URL = r'''(?x)http://(?:www\.)?
... |
tanmaykm/edx-platform | refs/heads/master | lms/djangoapps/verified_track_content/views.py | 26 | """
View methods for verified track content.
"""
from util.json_request import expect_json, JsonResponse
from django.contrib.auth.decorators import login_required
from opaque_keys.edx.keys import CourseKey
from courseware.courses import get_course_with_access
from verified_track_content.models import VerifiedTrackCo... |
jejimenez/django | refs/heads/master | tests/utils_tests/test_numberformat.py | 307 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
from decimal import Decimal
from sys import float_info
from unittest import TestCase
from django.utils.numberformat import format as nformat
class TestNumberFormat(TestCase):
def test_format_number(self):
self.assertEqual(nformat(1234, '... |
vjmac15/Lyilis | refs/heads/master | lib/emoji/core.py | 1 | # -*- coding: UTF-8 -*-
"""
emoji.core
~~~~~~~~~~
Core components for emoji.
"""
import re
import sys
from emoji import unicode_codes
__all__ = ['emojize', 'demojize', 'get_emoji_regexp']
PY2 = sys.version_info[0] is 2
_EMOJI_REGEXP = None
_DEFAULT_DELIMITER = ":"
def emojize(string, use_aliases=False, del... |
40223136/2015w11 | refs/heads/master | static/Brython3.1.1-20150328-091302/Lib/xml/etree/__init__.py | 1200 | # $Id: __init__.py 3375 2008-02-13 08:05:08Z fredrik $
# elementtree package
# --------------------------------------------------------------------
# The ElementTree toolkit is
#
# Copyright (c) 1999-2008 by Fredrik Lundh
#
# By obtaining, using, and/or copying this software and/or its
# associated documentation, you ... |
fnavarrogonzalez/RankingEmpresas | refs/heads/master | rankingempresas/tests.py | 1 | # -*- coding: utf-8 -*-
from django.test import TestCase
from django.contrib.auth.models import Permission, User
from django.contrib.auth import authenticate, login
from rankingempresas.models import *
from django.test import Client
# Create your tests here.
class SomeViewsTest(TestCase):
def setUp(self):
... |
Stanford-Online/edx-platform | refs/heads/master | openedx/core/djangoapps/content/course_overviews/migrations/0001_initial.py | 13 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
import model_utils.fields
from opaque_keys.edx.django.models import CourseKeyField, UsageKeyField
class Migration(migrations.Migration):
dependencies = [
]
operations = ... |
sbidoul/odoo | refs/heads/8.0 | addons/survey/wizard/__init__.py | 385 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... |
mozvip/CouchPotatoServer | refs/heads/develop | libs/requests/packages/chardet/mbcsgroupprober.py | 236 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
ayoubserti/winpty | refs/heads/master | build-gyp/test/mac/gyptest-non-strs-flattened-to-env.py | 34 | #!/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.
"""
Verifies that list xcode_settings are flattened before being exported to the
environment.
"""
import TestGyp
import sys
if sys.platfo... |
frouty/odoo_oph | refs/heads/dev_70 | openerp/tools/import_email.py | 105 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the... |
AxelDelmas/ansible | refs/heads/devel | lib/ansible/vars/__init__.py | 15 | # (c) 2012-2014, Michael DeHaan <[email protected]>
#
# 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... |
netaccess0/kernel_lge_msm8974 | refs/heads/L5 | Documentation/target/tcm_mod_builder.py | 4981 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: [email protected]
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... |
chirilo/remo | refs/heads/master | vendor-local/lib/python/unidecode/x061.py | 252 | data = (
'Qiao ', # 0x00
'Chou ', # 0x01
'Bei ', # 0x02
'Xuan ', # 0x03
'Wei ', # 0x04
'Ge ', # 0x05
'Qian ', # 0x06
'Wei ', # 0x07
'Yu ', # 0x08
'Yu ', # 0x09
'Bi ', # 0x0a
'Xuan ', # 0x0b
'Huan ', # 0x0c
'Min ', # 0x0d
'Bi ', # 0x0e
'Yi ', # 0x0f
'Mian ', # 0x10
'Yon... |
mhoffma/micropython | refs/heads/master | tests/basics/andor.py | 115 | # test short circuit expressions outside if conditionals
print(() or 1)
print((1,) or 1)
print(() and 1)
print((1,) and 1)
|
gangadharkadam/saloon_erp_install | refs/heads/master | erpnext/setup/page/setup_wizard/test_setup_wizard.py | 45 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from erpnext.setup.page.setup_wizard.test_setup_data import args
from erpnext.setup.page.setup_wizard.setup_wizard import setup_account
i... |
MatthewShao/mitmproxy | refs/heads/master | test/mitmproxy/addons/test_termstatus.py | 3 | from mitmproxy import proxy
from mitmproxy.addons import termstatus
from mitmproxy.test import taddons
def test_configure():
ts = termstatus.TermStatus()
with taddons.context() as ctx:
ctx.master.server = proxy.DummyServer()
ctx.configure(ts, server=False)
ts.running()
assert n... |
pdellaert/ansible | refs/heads/devel | lib/ansible/module_utils/network/ios/argspec/facts/facts.py | 20 | #
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The arg spec for the ios facts module.
"""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
class FactsArgs(object):
""" The a... |
baozoumanhua/elk-rtf | refs/heads/master | kibana-4-darwin-x64/node/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py | 505 | # 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.
"""Xcode project file generator.
This module is both an Xcode project file generator and a documentation of the
Xcode project file format. Knowledge of the proje... |
edunham/servo | refs/heads/master | tests/wpt/harness/wptrunner/tests/__init__.py | 621 | # 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/.
|
asandyz/oppia | refs/heads/develop | extensions/triggers/trigger_classes.py | 15 | # coding: utf-8
#
# Copyright 2014 The Oppia 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 requi... |
codeofdusk/ProjectMagenta | refs/heads/master | src/audio_services/__init__.py | 3 | from functools import wraps
def matches_url(url):
def url_setter(func):
@wraps(func)
def internal_url_setter(*args, **kwargs):
return func(*args, **kwargs)
internal_url_setter.url = url
return internal_url_setter
return url_setter
def find_url_transformer(url):
from audio_services import services
funcs... |
annarev/tensorflow | refs/heads/master | tensorflow/python/training/saver.py | 8 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
orbitfp7/nova | refs/heads/master | nova/db/sqlalchemy/migrate_repo/versions/232_drop_dump_tables.py | 47 | # Copyright 2014, 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 agr... |
hbldh/pymetawear | refs/heads/master | examples/led.py | 1 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:mod:`led`
==================
Created by hbldh <[email protected]>
Created on 2016-04-02
"""
from __future__ import division
from __future__ import print_function
from __future__ import absolute_import
import time
from pymetawear.discover import select_dev... |
myzj/dop | refs/heads/master | dop/dop/debug_settings.py | 1 | import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = ['*']
# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
# DATABASES = {
# 'default': {
# #'ENGINE': 'django.db.backends.... |
piotroxp/scibibscan | refs/heads/master | scib/lib/python3.5/site-packages/numpy/f2py/f2py_testing.py | 148 | from __future__ import division, absolute_import, print_function
import sys
import re
from numpy.testing.utils import jiffies, memusage
def cmdline():
m = re.compile(r'\A\d+\Z')
args = []
repeat = 1
for a in sys.argv[1:]:
if m.match(a):
repeat = eval(a)
else:
... |
sdpython/cvxpy | refs/heads/master | examples/extensions/ncvx/boolean.py | 12 | from cvxpy.expressions.variables import Variable
from cvxpy.expressions.constants import Parameter
import cvxopt
import numpy as np
class Boolean(Variable):
def __init__(self, rows=1, cols=1, *args, **kwargs):
self._LB = Parameter(rows, cols)
self._LB.value = cvxopt.matrix(0,(rows, cols), tc='d')
... |
Sweetgrassbuffalo/ReactionSweeGrass-v2 | refs/heads/master | .meteor/local/dev_bundle/python/Lib/encodings/tis_620.py | 593 | """ Python Character Mapping Codec tis_620 generated from 'python-mappings/TIS-620.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='st... |
desirable-objects/hotwire-shell | refs/heads/master | hotwire_ui/completion.py | 2 | # This file is part of the Hotwire Shell user interface.
#
# Copyright (C) 2007 Colin Walters <[email protected]>
#
# 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 Li... |
Teagan42/home-assistant | refs/heads/dev | tests/components/zha/test_lock.py | 4 | """Test zha lock."""
from unittest.mock import patch
import zigpy.zcl.clusters.closures as closures
import zigpy.zcl.clusters.general as general
import zigpy.zcl.foundation as zcl_f
from homeassistant.components.lock import DOMAIN
from homeassistant.const import STATE_LOCKED, STATE_UNAVAILABLE, STATE_UNLOCKED
from .... |
ForgottenKahz/CloudOPC | refs/heads/master | venv/Lib/site-packages/werkzeug/posixemulation.py | 148 | # -*- coding: utf-8 -*-
r"""
werkzeug.posixemulation
~~~~~~~~~~~~~~~~~~~~~~~
Provides a POSIX emulation for some features that are relevant to
web applications. The main purpose is to simplify support for
systems such as Windows NT that are not 100% POSIX compatible.
Currently this only imple... |
ehudmagal/robotqcapp | refs/heads/master | dojango/decorators.py | 6 | from django.http import HttpResponseNotAllowed, HttpResponseServerError
from django.utils import simplejson as json
from util import to_json_response
from util import to_dojo_data
try:
from functools import wraps
except ImportError:
from django.utils.functional import wraps # Python 2.3, 2.4 fallback.
def e... |
xrg/django-static-gitified | refs/heads/master | django/contrib/staticfiles/storage.py | 66 | from __future__ import with_statement
import hashlib
import os
import posixpath
import re
from urllib import unquote
from urlparse import urlsplit, urlunsplit, urldefrag
from django.conf import settings
from django.core.cache import (get_cache, InvalidCacheBackendError,
cache as default_... |
asanfilippo7/osf.io | refs/heads/develop | scripts/github/migrate_to_external_accounts.py | 18 | import logging
import os
import sys
import urlparse
from modularodm import Q
from framework.mongo import database
from framework.transactions.context import TokuTransaction
from website import settings
from website.app import init_app
from website.models import User, Node
from website.oauth.models import ExternalAcc... |
OptiPop/external_chromium_org | refs/heads/opti-5.1 | chrome/browser/web_dev_style/html_checker.py | 36 | # 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.
"""
Presubmit for Chromium HTML resources. See chrome/browser/PRESUBMIT.py.
"""
import regex_check
class HtmlChecker(object):
def __init__(self, input_a... |
beni55/olympia | refs/heads/master | apps/pages/tests.py | 14 | from django.conf import settings
from nose.tools import eq_
import amo
import amo.tests
from amo.urlresolvers import reverse
class TestPages(amo.tests.TestCase):
def _check(self, url, status):
resp = self.client.get(reverse(url))
eq_(resp.status_code, status)
def test_status(self):
... |
LUTAN/tensorflow | refs/heads/master | tensorflow/python/training/server_lib_multiple_containers_test.py | 133 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
ChameleonCloud/horizon | refs/heads/chameleoncloud/train | openstack_dashboard/test/selenium/selenium_tests.py | 7 | # Copyright 2012 Nebula, 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 agree... |
CrazyGamerGR/CrazySuperKernel-CM14.1-G5 | refs/heads/master | tools/perf/util/setup.py | 989 | #!/usr/bin/python2
from distutils.core import setup, Extension
from os import getenv
from distutils.command.build_ext import build_ext as _build_ext
from distutils.command.install_lib import install_lib as _install_lib
class build_ext(_build_ext):
def finalize_options(self):
_build_ext.finalize_optio... |
mmagnus/rna-pdb-tools | refs/heads/master | rna_tools/SecondaryStructure.py | 2 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Secondary structure analysis"""
import os
import tempfile
import shutil
import subprocess
from rna_tools.rna_tools_config import VARNA_JAR_NAME, VARNA_PATH
class ExceptionOpenPairsProblem(Exception):
pass
def draw_ss(title, seq, ss, img_out, resolution=4, verbo... |
lordzuko/DeepEduVision | refs/heads/master | classroom_analyst/urls.py | 1 | """DeepEduVision URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cl... |
lento/cortex | refs/heads/master | test/IECore/All.py | 2 | ##########################################################################
#
# Copyright (c) 2007-2014, Image Engine Design Inc. All rights reserved.
#
# Copyright (c) 2010, John Haddon. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provide... |
nhicher/ansible | refs/heads/devel | lib/ansible/modules/cloud/digital_ocean/digital_ocean_sshkey_facts.py | 52 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'status': ['preview'],
'... |
midori1/midorinoblog | refs/heads/master | site-packages/django/db/backends/postgresql_psycopg2/introspection.py | 81 | from __future__ import unicode_literals
from django.db.backends import BaseDatabaseIntrospection, FieldInfo
from django.utils.encoding import force_text
class DatabaseIntrospection(BaseDatabaseIntrospection):
# Maps type codes to Django Field types.
data_types_reverse = {
16: 'BooleanField',
... |
ClearCorp-dev/odoo-clearcorp | refs/heads/9.0 | TODO-9.0/report_xls_template/ir_actions_report_xml.py | 2 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Addons modules by CLEARCORP S.A.
# Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>).
#
# This program is free software: you can redistribute... |
mdkent/percona-xtrabackup | refs/heads/master | test/kewpie/lib/util/mysqlBaseTestCase.py | 19 | #! /usr/bin/env python
# -*- mode: python; indent-tabs-mode: nil; -*-
# vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
#
# Copyright (C) 2011 Patrick Crews
#
#
# 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 Softwar... |
eli-b/pytest | refs/heads/master | _pytest/compat.py | 4 | """
python version compatibility code
"""
import sys
import inspect
import types
import re
import functools
import py
import _pytest
try:
import enum
except ImportError: # pragma: no cover
# Only available in Python 3.4+ or as a backport
enum = None
_PY3 = sys.version_info > (3, 0)
_PY2 = not _PY3
... |
ar7z1/ansible | refs/heads/devel | lib/ansible/modules/network/avi/avi_gslbapplicationpersistenceprofile.py | 20 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi ([email protected])
# Eric Anderson ([email protected])
# module_check: supported
# Avi Version: 17.1.1
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... |
bernardopires/django-tenant-schemas | refs/heads/master | tenant_schemas/models.py | 3 | from django.core.management import call_command
from django.db import connection, models
from tenant_schemas.postgresql_backend.base import _check_schema_name
from tenant_schemas.signals import post_schema_sync
from tenant_schemas.utils import get_public_schema_name, schema_exists
class TenantQueryset(models.QuerySe... |
sergio-incaser/odoo | refs/heads/8.0 | addons/mass_mailing/models/mail_thread.py | 66 | # -*- 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 o... |
namhyung/uftrace | refs/heads/master | tests/t106_report_time.py | 2 | #!/usr/bin/env python
from runtest import TestBase
class TestCase(TestBase):
def __init__(self):
TestBase.__init__(self, 'sleep', """
Total time Self time Calls Function
========== ========== ========== ====================================
2.103 ms 0.910 us 1 main
2.1... |
nickvandewiele/RMG-Py | refs/heads/master | rmgpy/molecule/group.py | 3 | #!/usr/bin/env python
# encoding: utf-8
################################################################################
#
# RMG - Reaction Mechanism Generator
#
# Copyright (c) 2009-2011 by the RMG Team ([email protected])
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of thi... |
esrille/ibus-replace-with-kanji | refs/heads/master | dic_tools/okuri.py | 1 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 Esrille 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 r... |
chenc10/Spark-PAF | refs/heads/master | python/pyspark/statcounter.py | 130 | #
# 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... |
thast/EOSC513 | refs/heads/master | DC/SparseGN/DCT_withW_rad/DCT_withW.py | 1 | from SimPEG import Mesh, Regularization, Maps, Utils, EM
from SimPEG.EM.Static import DC
import numpy as np
import matplotlib.pyplot as plt
#%matplotlib inline
import copy
import pandas as pd
from scipy.sparse import csr_matrix, spdiags, dia_matrix,diags
from scipy.sparse.linalg import spsolve
from scipy.stats import... |
ilyes14/scikit-learn | refs/heads/master | examples/cluster/plot_adjusted_for_chance_measures.py | 286 | """
==========================================================
Adjustment for chance in clustering performance evaluation
==========================================================
The following plots demonstrate the impact of the number of clusters and
number of samples on various clustering performance evaluation me... |
adamncasey/servo | refs/heads/master | tests/wpt/css-tests/tools/pytest/testing/test_pytester.py | 203 | import pytest
import os
from _pytest.pytester import HookRecorder
from _pytest.config import PytestPluginManager
from _pytest.main import EXIT_OK, EXIT_TESTSFAILED
def test_make_hook_recorder(testdir):
item = testdir.getitem("def test_func(): pass")
recorder = testdir.make_hook_recorder(item.config.pluginmana... |
sklprogs/mclient | refs/heads/master | src/plugins/multitrancom/utils/utils.py | 1 | #!/usr/bin/python3
# -*- coding: UTF-8 -*-
import re
import os
import html
import operator
import urllib.request
from skl_shared.localize import _
import skl_shared.shared as sh
''' It seems to be highly difficult to extract short-full title pairs
since, unlike multitran.ru, there are no '<a title' tags, such
... |
noba3/KoTos | refs/heads/master | addons/script.module.youtube.dl/lib/youtube_dl/extractor/ultimedia.py | 106 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_urllib_parse_urlparse
from ..utils import (
ExtractorError,
qualities,
unified_strdate,
clean_html,
)
class UltimediaIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.... |
AlexaProjects/Alexa2 | refs/heads/master | ALEXA-IDE/core/ninja_ide/core/filesystem_notifications/windows.py | 2 | # -*- coding: utf-8 -*-
#
# This file is part of NINJA-IDE (http://ninja-ide.org).
#
# NINJA-IDE 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
# any later version.
#
# NIN... |
devendermishrajio/nova_test_latest | refs/heads/master | nova/api/openstack/compute/plugins/v3/networks.py | 21 | # Copyright 2011 Grid Dynamics
# Copyright 2011 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... |
Arable/old-www-do-not-use | refs/heads/master | lib/python2.7/site-packages/flask/blueprints.py | 773 | # -*- coding: utf-8 -*-
"""
flask.blueprints
~~~~~~~~~~~~~~~~
Blueprints are the recommended way to implement larger or more
pluggable applications in Flask 0.7 and later.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from functools import update_wrap... |
Julian/Verge | refs/heads/master | setup.py | 1 | import os
from setuptools import find_packages, setup
from verge import __version__
BIN_DIR = os.path.join(os.path.dirname(__file__), "bin")
with open(os.path.join(os.path.dirname(__file__), "README.rst")) as readme:
long_description = readme.read()
classifiers = [
"Development Status :: 3 - Alpha",
"... |
greenoaktree/MissionPlanner | refs/heads/master | Lib/dis.py | 65 | """Disassembler of Python byte code into mnemonics."""
import sys
import types
from opcode import *
from opcode import __all__ as _opcodes_all
__all__ = ["dis", "disassemble", "distb", "disco",
"findlinestarts", "findlabels"] + _opcodes_all
del _opcodes_all
_have_code = (types.MethodType, typ... |
tboyce021/home-assistant | refs/heads/dev | homeassistant/components/nissan_leaf/binary_sensor.py | 21 | """Plugged In Status Support for the Nissan Leaf."""
import logging
from homeassistant.components.binary_sensor import BinarySensorEntity
from . import DATA_CHARGING, DATA_LEAF, DATA_PLUGGED_IN, LeafEntity
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_entities, discovery_info=None):
... |
mccarrion/python-practice | refs/heads/master | crash_course/chapter10/alice.py | 1 | filename = 'alice.txt'
try:
with open(filename) as f_obj:
contents = f_obj.read()
except FileNotFoundError:
msg = "Sorry, the file " + filename + " does not exist."
print(msg)
else:
# Count the approximate number of words in the file.
words = contents.split()
num_words = len(words)
... |
Hiwr/hiwr_screen | refs/heads/master | src/screen.py | 1 | #!/usr/bin/env python
# encoding: utf-8
#############################################################################
# #
# #
# Copyright 2014 Worldline ... |
ryfx/gyp | refs/heads/master | test/ninja/empty-and-non-empty-duplicate-name/gyptest-empty-and-non-empty-duplicate-name.py | 100 | #!/usr/bin/env python
# Copyright (c) 2014 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies a phony target isn't output if a target exists with the same name that
was output.
"""
import TestGyp
test = TestGyp.TestGyp(... |
xNovax/SickRage | refs/heads/master | lib/github/IssueEvent.py | 74 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <[email protected]> #
# Copyright 2012 Zearin <[email protected]> ... |
anisyonk/pilot | refs/heads/master | saga/adaptors/redis/redis_1.py | 10 |
__author__ = "Andre Merzky"
__copyright__ = "Copyright 2013, The SAGA Project"
__license__ = "MIT"
import redis
r = redis.Redis (host='localhost', password='securedis')
print "------------------ set / get ------------------"
print r.set ("name", "DeGizmo")
print r.get ("name")
print "------------------ set /... |
suzp1984/shadowsocks | refs/heads/master | shadowsocks/tcprelay.py | 922 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... |
tbeadle/django | refs/heads/master | tests/aggregation/tests.py | 31 | from __future__ import unicode_literals
import datetime
import re
from decimal import Decimal
from django.core.exceptions import FieldError
from django.db import connection
from django.db.models import (
Avg, Count, DecimalField, DurationField, F, FloatField, Func, IntegerField,
Max, Min, Sum, Value,
)
from d... |
Hamza-Megahed/des-calculator | refs/heads/master | des-decryption.py | 1 | #!/usr/bin/python3
# ============================================================================
# Name : des-decryption.py
# Author : Hamza Megahed
# Version : 1.0
# Copyright : Copyright 2014 Hamza Megahed
# Description : DES Decryption Algorithm
# ===========================================... |
mycodeday/crm-platform | refs/heads/master | l10n_si/__init__.py | 439 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright: (C) 2012 - Mentis d.o.o., Dravograd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affe... |
ya-mouse/python-opcua | refs/heads/master | opcua/binary_server.py | 2 | """
Socket server forwarding request to internal server
"""
import logging
try:
import socketserver
except ImportError:
import SocketServer as socketserver
from threading import Thread
from threading import Condition
from opcua import ua
from opcua.uaprocessor import UAProcessor
logger = logging.getLogger(__n... |
aperigault/ansible | refs/heads/devel | test/units/modules/network/netscaler/test_netscaler_cs_policy.py | 68 |
# Copyright (c) 2017 Citrix Systems
#
# 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.
#
# ... |
dieface/erpnext | refs/heads/develop | erpnext/selling/page/sales_browser/sales_browser.py | 52 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
@frappe.whitelist()
def get_children():
ctype = frappe.local.form_dict.get('ctype')
frappe.local.form_dict['parent_field'] = 'parent_'... |
adfernandes/mbed | refs/heads/master | tools/test/toolchains/api_test.py | 13 | """
Copyright (c) 2017-2019 ARM Limited
SPDX-License-Identifier: Apache-2.0
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 appli... |
ignatenkobrain/dnf | refs/heads/master | dnf/automatic/main.py | 9 | # __init__.py
# dnf.automatic CLI
#
# Copyright (C) 2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distr... |
IndraVikas/scikit-learn | refs/heads/master | sklearn/neighbors/tests/test_nearest_centroid.py | 305 | """
Testing for the nearest centroid module.
"""
import numpy as np
from scipy import sparse as sp
from numpy.testing import assert_array_equal
from numpy.testing import assert_equal
from sklearn.neighbors import NearestCentroid
from sklearn import datasets
from sklearn.metrics.pairwise import pairwise_distances
# t... |
LosFuzzys/CTFd | refs/heads/losctf | migrations/versions/1093835a1051_add_default_email_templates.py | 4 | """Add default email templates
Revision ID: 1093835a1051
Revises: a03403986a32
Create Date: 2020-02-15 01:32:10.959373
"""
from alembic import op
from sqlalchemy.sql import column, table
from CTFd.models import db
from CTFd.utils.email import (
DEFAULT_PASSWORD_RESET_BODY,
DEFAULT_PASSWORD_RESET_SUBJECT,
... |
edxzw/edx-platform | refs/heads/master | cms/urls_dev.py | 201 | """
URLconf for development-only views.
This gets imported by urls.py and added to its URLconf if we are running in
development mode; otherwise, it is ignored.
"""
from django.conf.urls import url
urlpatterns = (
url(r'^dev_mode$', 'contentstore.views.dev.dev_mode', name='dev_mode'),
url(r'^template/(?P<templa... |
FlyLu/rt-thread | refs/heads/master | bsp/imxrt/imxrt1052-nxp-evk/rtconfig.py | 5 | import os
import sys
# toolchains options
ARCH='arm'
CPU='cortex-m7'
CROSS_TOOL='gcc'
if os.getenv('RTT_CC'):
CROSS_TOOL = os.getenv('RTT_CC')
if os.getenv('RTT_ROOT'):
RTT_ROOT = os.getenv('RTT_ROOT')
# cross_tool provides the cross compiler
# EXEC_PATH is the compiler execute path, for example, CodeSourcer... |
dukhlov/oslo.messaging | refs/heads/master | oslo_messaging/tests/notify/test_logger.py | 1 | # Copyright 2013 eNovance
#
# 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... |
wroersma/volatility | refs/heads/master | volatility/renderers/html.py | 9 | import StringIO
from volatility.renderers.basic import Renderer
try:
import ujson as json
except ImportError:
import json
__author__ = 'mike'
class HTMLRenderer(Renderer):
def __init__(self):
pass
def render(self, outfd, data):
"""Renders the treegrid to HTML"""
column_title... |
Azure/azure-sdk-for-python | refs/heads/sync-eng/common-js-nightly-docs-2-1768-ForTestPipeline | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2016_09_01/aio/_configuration.py | 1 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... |
jonhadfield/ansible-modules-core | refs/heads/devel | system/seboolean.py | 50 | #!/usr/bin/python
# (c) 2012, Stephen Fromm <[email protected]>
#
# 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 optio... |
nagyistoce/odoo-dev-odoo | refs/heads/8.0 | addons/document/__init__.py | 434 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
tonysyu/scrappyr-app | refs/heads/master | scrappyr/scraps/serializers.py | 1 | from rest_framework import serializers
from . import models
from ..utils.serializers import JSONMixin
class ScrapSerializer(JSONMixin, serializers.ModelSerializer):
class Meta:
model = models.Scrap
fields = ('id', 'raw_title', 'markup_type', 'html_title', 'modified', 'created')
read_only_... |
ZuluPro/libcloud | refs/heads/trunk | docs/examples/container/kubernetes/instantiate_driver.py | 26 | from libcloud.container.types import Provider
from libcloud.container.providers import get_driver
cls = get_driver(Provider.KUBERNETES)
conn = cls(key='my_username',
secret='THIS_IS)+_MY_SECRET_KEY+I6TVkv68o4H',
host='126.32.21.4')
for container in conn.list_containers():
print(container.na... |
EricNeedham/assignment-1 | refs/heads/master | venv/lib/python2.7/site-packages/sqlalchemy/dialects/mysql/pyodbc.py | 32 | # mysql/pyodbc.py
# Copyright (C) 2005-2014 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: mysql+pyodbc
:name: PyODBC
:dbapi: pyodbc
:connectstr... |
abhisheklolage/ttgen2 | refs/heads/master | src/core/subject.py | 2 | #!/usr/bin/env python3
class Subject(object):
def __init__(self, name):
self.name = name
def __unicode__(self):
return self.name
def __str__(self):
return self.name
def __repr__(self):
return __name__ + ".Subject({name})".format(name=repr(self.name))
|
gg7/diamond | refs/heads/master | src/collectors/ksm/ksm.py | 69 | # coding=utf-8
"""
This class collects 'Kernel Samepage Merging' statistics.
KSM is a memory de-duplication feature of the Linux Kernel (2.6.32+).
It can be enabled, if compiled into your kernel, by echoing 1 to
/sys/kernel/mm/ksm/run. You can find more information about KSM at
[http://www.linux-kvm.org/page/KSM](htt... |
yiannist/ganeti | refs/heads/master | lib/storage/drbd.py | 3 | #
#
# Copyright (C) 2006, 2007, 2010, 2011, 2012, 2013 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:
#
# 1. Redistributions of source code must retain the above copyright notice,
... |
NoahFlowa/glowing-spoon | refs/heads/master | venv/lib/python2.7/site-packages/pip/_vendor/html5lib/treeadapters/genshi.py | 356 | from __future__ import absolute_import, division, unicode_literals
from genshi.core import QName, Attrs
from genshi.core import START, END, TEXT, COMMENT, DOCTYPE
def to_genshi(walker):
text = []
for token in walker:
type = token["type"]
if type in ("Characters", "SpaceCharacters"):
... |
ortylp/scipy | refs/heads/master | scipy/misc/tests/test_pilutil.py | 46 | from __future__ import division, print_function, absolute_import
import os.path
import tempfile
import shutil
import numpy as np
import warnings
from numpy.testing import (assert_, assert_equal, dec, decorate_methods,
TestCase, run_module_suite, assert_allclose)
from scipy import misc
try... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.