code
stringlengths
2
1.05M
repo_name
stringlengths
5
104
path
stringlengths
4
251
language
stringclasses
1 value
license
stringclasses
15 values
size
int32
2
1.05M
# (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...
azaghal/ansible
lib/ansible/plugins/action/fetch.py
Python
gpl-3.0
9,755
#!/usr/bin/python # 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 = {'metadata_version': '1.1', 'status': ['preview'], ...
noroutine/ansible
lib/ansible/modules/cloud/amazon/elb_target_group.py
Python
gpl-3.0
29,144
#!/usr/bin/python # # Copyright: Ansible Team # 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 = {'metadata_version': '1.0', 'status': ['preview'], ...
bearstech/ansible
lib/ansible/modules/network/aruba/aruba_command.py
Python
gpl-3.0
6,823
#!/usr/bin/python # 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 = {'metadata_version': '1.0', 'status': ['preview'], ...
bearstech/ansible
lib/ansible/modules/cloud/rackspace/rax_mon_notification.py
Python
gpl-3.0
5,164
#!/usr/bin/env python # -*- python -*- # ex: set syntax=python: # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import sys,socket,os,time,re port=None host=None if ...
adobe-flash/avmplus
build/buildbot/slaves/android/scripts/shell-client-android.py
Python
mpl-2.0
1,874
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import fields, models class MassMailingPopup(models.Model): _name = 'website.mass_mailing.popup' _description = "Mailing list popup" def _default_popup_content(self): return self.env['ir....
ddico/odoo
addons/website_mass_mailing/models/website_mass_mailing.py
Python
agpl-3.0
635
"""Models for django-nose test application. Based on the Django tutorial: https://docs.djangoproject.com/en/1.8/intro/tutorial01/ """ from django.db import models class Question(models.Model): """A poll question.""" question_text = models.CharField(max_length=200) pub_date = models.DateTimeField('date...
franciscoruiz/django-nose
testapp/models.py
Python
bsd-3-clause
729
# 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...
xuleiboy1234/autoTitle
tensorflow/tensorflow/python/estimator/model_fn.py
Python
mit
12,173
from __future__ import print_function try: import curses curses.setupterm() assert curses.tigetnum("colors") > 2 OK = "\x1b[1;%dm[ OK ]\x1b[0m" % (30 + curses.COLOR_GREEN) FAIL = "\x1b[1;%dm[FAIL]\x1b[0m" % (30 + curses.COLOR_RED) except: OK = '[ OK ]' FAIL = '[FAIL]' import sys try: i...
mhdella/scipy_2015_sklearn_tutorial
check_env.py
Python
cc0-1.0
2,301
import Base import sys import industrial_lib time_of_day='_night' (landing_platform,bar,weap) = industrial_lib.MakeCorisc (time_of_day,'bases/bartender_university.py')
vinni-au/vega-strike
data/bases/university_night.py
Python
gpl-2.0
169
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Requires Python 2.7 or later # These are tests that run only on Win32 as they use Win32 SendMessage call # to send WM_* messages to Scintilla that are not implemented on other platforms. # These help Scintilla behave like a Win32 text control and can help screen readers...
martinrotter/textilosaurus
src/libtextosaurus/3rd-party/scintilla/test/win32Tests.py
Python
gpl-3.0
5,057
#!/usr/bin/env python # -*- coding: utf-8 -*- # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # Copyright (c) 2014 Kevin B. Hendricks, John Schember, and Doug Massay # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following ...
kytvi2p/Sigil
src/Resource_Files/plugin_launchers/python/launcher.py
Python
gpl-3.0
11,319
"""XML parser package. This package parses the XML file returned by the Graffiti tracker. """ from xmlparser import XMLParser from xmlgenerator import XMLGenerator from exceptions import * __all__ = ["XMLParser", "XMLGenerator", "XMLException", "InvalidXML"]
huanchenz/STX-h-store
tests/scripts/xml2/__init__.py
Python
gpl-3.0
262
#!/usr/bin/python import urllib import httplib import time import datetime id = '123456789012345' server = 'localhost:5055' points = [ ('2017-01-01 00:00:00', 59.93211887, 30.33050537, 0.0), ('2017-01-01 00:05:00', 59.93266715, 30.33190012, 50.0), ('2017-01-01 00:10:00', 59.93329069, 30.33333778, 50.0), ...
tananaev/traccar
tools/test-trips.py
Python
apache-2.0
1,319
import os from website.addons.dropbox import model, routes, views MODELS = [model.DropboxUserSettings, model.DropboxNodeSettings, model.DropboxFile] USER_SETTINGS_MODEL = model.DropboxUserSettings NODE_SETTINGS_MODEL = model.DropboxNodeSettings ROUTES = [routes.auth_routes, routes.api_routes] SHORT_NAME = 'dropbox...
GaryKriebel/osf.io
website/addons/dropbox/__init__.py
Python
apache-2.0
961
"""Tests which check the various ways you can set DJANGO_SETTINGS_MODULE If these tests fail you probably forgot to install django-configurations. """ import pytest pytest.importorskip('configurations') try: import configurations.importer configurations except ImportError as e: if 'LaxOptionParser' in e....
davidszotten/pytest-django
tests/test_django_configurations.py
Python
bsd-3-clause
3,011
#!/usr/bin/env python # Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import optparse import os import subprocess import sys import time import build_projects import build_version import buildbot_comm...
M4sse/chromium.src
native_client_sdk/src/build_tools/test_projects.py
Python
bsd-3-clause
12,150
from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from avatar.models import Avatar from avatar.templatetags.avatar_tags import avatar class AvatarAdmin(admin.ModelAdmin): list_display = ('get_avatar', 'user', 'primary', "date_uploaded") list_filter = ('primary',) se...
ofri/django-avatar
avatar/admin.py
Python
bsd-3-clause
580
#!/usr/bin/env python2 # # Create an array of C strings with Duktape built-in strings. # Useful when using external strings. # import os import sys import json def to_c_string(x): res = '"' term = False for i, c in enumerate(x): if term: term = False res += '" "' ...
jmptrader/duktape
tools/duk_meta_to_strarray.py
Python
mit
1,076
#!/usr/bin/env python """\ Sanitize a bitbake file following the OpenEmbedded style guidelines, see http://openembedded.org/wiki/StyleGuide (C) 2006 Cyril Romain <cyril.romain@gmail.com> MIT license TODO: - add the others OpenEmbedded variables commonly used: - parse command arguments and print usage on misuse ...
schleichdi2/OPENNFR-6.0-CORE
opennfr-meta-openembedded/contrib/oe-stylize.py
Python
gpl-2.0
11,631
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # See license.txt from __future__ import unicode_literals import frappe import unittest test_records = frappe.get_test_records('Operation') class TestOperation(unittest.TestCase): pass
Zlash65/erpnext
erpnext/manufacturing/doctype/operation/test_operation.py
Python
gpl-3.0
258
# -*- coding: utf-8 -*- # # Copyright: (c) 2018, F5 Networks Inc. # 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 import os import json import pytest import sys from nose.plugins.skip i...
maartenq/ansible
test/units/modules/network/f5/test_bigip_profile_http_compression.py
Python
gpl-3.0
4,310
import sys import unittest from test import test_support from test.test_support import run_unittest, have_unicode import math L = [ ('0', 0), ('1', 1), ('9', 9), ('10', 10), ('99', 99), ('100', 100), ('314', 314), (' 314', 314), ('314 ', 314), ...
HiSPARC/station-software
user/python/Lib/test/test_int.py
Python
gpl-3.0
20,013
#!/usr/bin/env python import numpy as np import matplotlib.pyplot as plt import latex_plot_inits parameter_list = [[20, 5, 1., 1000, 1, None, 5], [100, 5, 1., 1000, 1, None, 10]] def classifier_perceptron_graphical(n=100, distance=5, learn_rate=1., max_iter=1000, num_threads=1, seed=None, nperceptrons=5): from shog...
MikeLing/shogun
examples/undocumented/python/graphical/classifier_perceptron_graphical.py
Python
gpl-3.0
2,302
# -*- coding: utf-8 -*- from odoo import api, fields, models, _ from math import copysign class AccountAnalyticLine(models.Model): _inherit = 'account.analytic.line' _description = 'Analytic Line' _order = 'date desc' amount = fields.Monetary(currency_field='company_currency_id') product_uom_id ...
Aravinthu/odoo
addons/account/models/account_analytic_line.py
Python
agpl-3.0
3,182
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
vitaly-krugl/nupic
examples/opf/experiments/multistep/hotgym_best_sp/description.py
Python
agpl-3.0
2,842
# # This file is part of Cockpit. # # Copyright (C) 2017 Red Hat, Inc. # # Cockpit is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or # (at your option) any later vers...
petervo/cockpit
pkg/lib/inotify.py
Python
lgpl-2.1
2,629
#!/usr/bin/env python3 # -*- Coding: UTF-8 -*- # --------------------------------------------------------------------------- # Open Asset Import Library (ASSIMP) # --------------------------------------------------------------------------- # # Copyright (c) 2006-2010, ASSIMP Development Team # # All rights reserved. #...
MadManRises/Madgine
shared/assimp/test/regression/run.py
Python
mit
11,801
# # Copyright 2013 ZHAW SoE # Copyright 2014 Intel Corp. # # Authors: Lucas Graf <graflu0@students.zhaw.ch> # Toni Zehnder <zehndton@students.zhaw.ch> # Lianhao Lu <lianhao.lu@intel.com> # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in complianc...
ChinaMassClouds/copenstack-server
openstack/src/ceilometer-2014.2.2/ceilometer/hardware/pollsters/cpu.py
Python
gpl-2.0
1,650
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test of the HDF storage for the Tables API. Copyright 2009-2014 Glencoe Software, Inc. All rights reserved. Use is subject to license terms supplied in LICENSE.txt """ import time import pytest import omero.columns import omero.tables import logging import ...
tp81/openmicroscopy
components/tools/OmeroPy/test/unit/tablestest/test_hdfstorage.py
Python
gpl-2.0
10,650
# 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...
karllessard/tensorflow
tensorflow/lite/testing/op_tests/greater.py
Python
apache-2.0
2,735
"""Utilities to help convert mp4s to fmp4s.""" import io def find_box(segment: io.BytesIO, target_type: bytes, box_start: int = 0) -> int: """Find location of first box (or sub_box if box_start provided) of given type.""" if box_start == 0: box_end = segment.seek(0, io.SEEK_END) segment.seek(0...
tboyce021/home-assistant
homeassistant/components/stream/fmp4utils.py
Python
apache-2.0
5,317
""" ============================================= Early stopping of Stochastic Gradient Descent ============================================= Stochastic Gradient Descent is an optimization technique which minimizes a loss function in a stochastic fashion, performing a gradient descent step sample by sample. In particu...
chrsrds/scikit-learn
examples/linear_model/plot_sgd_early_stopping.py
Python
bsd-3-clause
5,659
from setuptools import setup setup(setup_requires=["pbr>=2.0.0"], pbr=True)
chipaca/snapcraft
tests/spread/plugins/v1/python/snaps/python-pbr/python3/setup.py
Python
gpl-3.0
77
# sqlalchemy/types.py # Copyright (C) 2005-2012 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 """defines genericized SQL types, each represented by a subclass of :class:`~sqlal...
darren-rogan/CouchPotatoServer
libs/sqlalchemy/types.py
Python
gpl-3.0
81,874
# 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 required by applicable ...
mit0110/oppia
core/controllers/recent_commits.py
Python
apache-2.0
1,988
# -*- coding: utf-8 -*- # # 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...
zenodo/invenio
invenio/modules/tags/testsuite/__init__.py
Python
gpl-2.0
873
# -*- coding: 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 L...
algiopensource/l10n-spain
l10n_es_aeat_mod340/models/__init__.py
Python
agpl-3.0
971
# -*- coding: utf-8 -*- # © 2016 Lorenzo Battistini - Agile Business Group # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import stock
houssine78/addons
stock_picking_back2draft/models/__init__.py
Python
agpl-3.0
161
# Copyright 2010 Michael Murr # # This file is part of LibForensics. # # LibForensics is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ver...
306777HC/libforensics
code/lf/win/shell/link/__init__.py
Python
lgpl-3.0
1,769
def foo(): # type: () -> int print(42) return 42 res = fo<caret>o()
jwren/intellij-community
python/testData/refactoring/inlineFunction/removingTypeComment/main.py
Python
apache-2.0
81
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
Dhivyap/ansible
lib/ansible/modules/network/fortios/fortios_vpn_l2tp.py
Python
gpl-3.0
9,385
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # 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 require...
trustedanalytics/spark-tk
python/sparktk/frame/pyframe.py
Python
apache-2.0
926
from django.db.models.sql import compiler class SQLCompiler(compiler.SQLCompiler): def as_subquery_condition(self, alias, columns, compiler): qn = compiler.quote_name_unless_alias qn2 = self.connection.ops.quote_name sql, params = self.as_sql() return '(%s) IN (%s)' % (', '.join('%...
georgemarshall/django
django/db/backends/mysql/compiler.py
Python
bsd-3-clause
1,599
# The following has been generated automatically from src/core/annotations/qgsannotationitemeditoperation.h # monkey patching scoped based enum QgsAbstractAnnotationItemEditOperation.Type.MoveNode.__doc__ = "Move a node" QgsAbstractAnnotationItemEditOperation.Type.DeleteNode.__doc__ = "Delete a node" QgsAbstractAnnotat...
PeterPetrik/QGIS
python/core/auto_additions/qgsannotationitemeditoperation.py
Python
gpl-2.0
921
from django.db import models from guardian.shortcuts import get_objects_for_user from readthedocs.builds.constants import LATEST from readthedocs.builds.constants import LATEST_VERBOSE_NAME from readthedocs.builds.constants import STABLE from readthedocs.builds.constants import STABLE_VERBOSE_NAME from readthedocs.p...
VishvajitP/readthedocs.org
readthedocs/privacy/backend.py
Python
mit
6,504
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ExtractorError class Channel9IE(InfoExtractor): ''' Common extractor for channel9.msdn.com. The type of provided URL (video or playlist) is determined according to meta Search.PageType from web pa...
MiLk/youtube-dl
youtube_dl/extractor/channel9.py
Python
unlicense
11,499
# Copyright (c) 2012 Cloudera, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
brightchen/Impala
tests/benchmark/plugins/__init__.py
Python
apache-2.0
1,221
#! /usr/bin/python2.4 # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope t...
JacobJacob/pyew
jdisasm.py
Python
gpl-2.0
19,835
import unittest from ctypes import * try: WINFUNCTYPE except NameError: # fake to enable this test on Linux WINFUNCTYPE = CFUNCTYPE import _ctypes_test lib = CDLL(_ctypes_test.__file__) class CFuncPtrTestCase(unittest.TestCase): def test_basic(self): X = WINFUNCTYPE(c_int, c_int, c_int) ...
xyuanmu/XX-Net
python3.8.2/Lib/ctypes/test/test_funcptr.py
Python
bsd-2-clause
4,026
import ast import logging import os.path import ConfigParser import StringIO class ConfigError(Exception): def __init__(self, msg): self.msg = msg def __str__(self): return self.msg class ConfigNoOptionError(ConfigError): def __init__(self, option, path): self.option = option ...
autotest/virt-test
virttest/utils_config.py
Python
gpl-2.0
13,647
# 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 frappe.utils import add_days, cint, cstr, flt, getdate, nowdate, rounded from frappe.model.naming import make_autoname from frappe ...
meisterkleister/erpnext
erpnext/hr/doctype/salary_slip/salary_slip.py
Python
agpl-3.0
7,265
from unittest import mock from django.conf.global_settings import PASSWORD_HASHERS from django.contrib.auth import get_user_model from django.contrib.auth.backends import ModelBackend from django.contrib.auth.base_user import AbstractBaseUser from django.contrib.auth.hashers import get_hasher from django.contrib.auth....
wkschwartz/django
tests/auth_tests/test_models.py
Python
bsd-3-clause
21,579
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( dict_get, float_or_none, ) class PlaywireIE(InfoExtractor): _VALID_URL = r'https?://(?:config|cdn)\.playwire\.com(?:/v2)?/(?P<publisher_id>\d+)/(?:videos/v2|embed|config)/(?P<id>\d+)' _TESTS = [...
mxamin/youtube-dl
youtube_dl/extractor/playwire.py
Python
unlicense
2,407
# -*- coding: utf-8 -*- # (c) 2015 Antiun Ingeniería S.L. - Sergio Teruel # (c) 2015 Antiun Ingeniería S.L. - Carlos Dauden # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp.tests.common import TransactionCase class TestSAuthSupplier(TransactionCase): def setUp(self): super(T...
MackZxh/OCA-Choice
server-tools/auth_supplier/tests/test_auth_supplier.py
Python
lgpl-3.0
852
#!/usr/bin/env python import sys PATH_INSTALL = "./" sys.path.append(PATH_INSTALL) from androguard.core.bytecodes import dvm from androguard.core.bytecodes import apk from androguard.core.analysis import analysis from androguard.core import androconf class Nop(dvm.Instruction10x): def __init__(self): se...
code4bones/androguard
demos/crackme_dexlabs_patch.py
Python
apache-2.0
1,566
# Test cases where we spill from one frame index to another, both of which # are out of range of MVC, and both of which need emergency spill slots. # RUN: python %s | llc -mtriple=s390x-linux-gnu | FileCheck %s # CHECK: f1: # CHECK: %fallthru # CHECK-DAG: stg [[REG1:%r[0-9]+]], 8168(%r15) # CHECK-DAG: stg [[REG2:%r[0-...
chubbymaggie/asap
test/CodeGen/SystemZ/Large/spill-02.py
Python
bsd-2-clause
2,663
#!/usr/bin/python from __future__ import (absolute_import, division, print_function) # Copyright 2019 Fortinet, Inc. # # 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 Lic...
alxgu/ansible
lib/ansible/modules/network/fortios/fortios_firewall_DoS_policy.py
Python
gpl-3.0
14,026
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2017, René Moser <mail@renemoser.net> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'}...
thaim/ansible
lib/ansible/modules/cloud/cloudstack/cs_vpn_gateway.py
Python
mit
5,470
def stream_to_url(stream): stream_type = type(stream).shortname() if stream_type in ("hls", "http"): url = stream.url elif stream_type == "rtmp": params = [stream.params.pop("rtmp", "")] stream_params = dict(stream.params) if "swfVfy" in stream.params: stream_p...
ethanhlc/streamlink
src/streamlink_cli/utils/stream.py
Python
bsd-2-clause
1,050
#!/usr/bin/python -tt # -*- coding: utf-8 -*- # (c) 2013, Raul Melo # Written by Raul Melo <raulmelo@gmail.com> # Based on yum module written by Seth Vidal <skvidal at fedoraproject.org> # # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_impo...
e-gob/plataforma-kioscos-autoatencion
scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/modules/packaging/os/swdepot.py
Python
bsd-3-clause
6,161
"""The socialblade component."""
turbokongen/home-assistant
homeassistant/components/socialblade/__init__.py
Python
apache-2.0
33
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document class DepreciationSchedule(Document): pass
hassanibi/erpnext
erpnext/accounts/doctype/depreciation_schedule/depreciation_schedule.py
Python
gpl-3.0
286
import win32ras stateStrings = { win32ras.RASCS_OpenPort : "OpenPort", win32ras.RASCS_PortOpened : "PortOpened", win32ras.RASCS_ConnectDevice : "ConnectDevice", win32ras.RASCS_DeviceConnected : "DeviceConnected", win32ras.RASCS_AllDevicesConnected : "AllDevicesConnected", win32ras.RASCS_Authentica...
JulienMcJay/eclock
windows/Python27/Lib/site-packages/pywin32-218-py2.7-win32.egg/rasutil.py
Python
gpl-2.0
1,737
from __future__ import unicode_literals import copy import pickle import sys import warnings from unittest import TestCase from django.utils import six from django.utils.functional import LazyObject, SimpleLazyObject, empty from .models import Category, CategoryInfo class Foo(object): """ A simple class wi...
MounirMesselmeni/django
tests/utils_tests/test_lazyobject.py
Python
bsd-3-clause
11,862
from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import ( compat_urlparse, ) from ..utils import ( ExtractorError, get_element_by_id, ) class SlideshareIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?slideshare\.net/[^/]+?/(?P<title>....
epitron/youtube-dl
youtube_dl/extractor/slideshare.py
Python
unlicense
2,132
from nose.tools import raises import os import numpy import theano import theano.tensor as T from pylearn2.compat import OrderedDict from pylearn2.config import yaml_parse from pylearn2.models.mlp import ( MLP, Linear, CompositeLayer, ConvRectifiedLinear, SpaceConverter ) from pylearn2.models.vae import VAE from p...
JazzeYoung/VeryDeepAutoEncoder
pylearn2/pylearn2/models/tests/test_vae.py
Python
bsd-3-clause
20,236
# -*- coding: utf-8 -*- import sys import os path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'web2py') sys.path = [path] + [p for p in sys.path if not p == path] from gluon.compileapp import compile_application compile_application(os.path.join(path, 'applications', 'standard')) compile_application(o...
saturday06/FrameworkBenchmarks
frameworks/Python/web2py/compile_apps.py
Python
bsd-3-clause
368
# Copyright (C) 2013-2015 Free Software Foundation, Inc. # 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 progr...
armoredsoftware/protocol
measurer/gdb-7.9/gdb/testsuite/gdb.perf/backtrace.py
Python
bsd-3-clause
1,825
# # Copyright (C) 2008 The Android Open Source Project # # 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 la...
qingpingguo/git-repo
editor.py
Python
apache-2.0
2,620
from __future__ import unicode_literals import frappe def execute(): frappe.reload_doc('projects', 'doctype', 'timesheet_detail') frappe.reload_doc('accounts', 'doctype', 'sales_invoice_timesheet') frappe.db.sql(""" update `tabTimesheet` as ts, (select sum(billing_amount) as billing_amount, sum(billing_...
hassanibi/erpnext
erpnext/patches/v7_1/move_sales_invoice_from_parent_to_child_timesheet.py
Python
gpl-3.0
853
# Copyright (c) 2014 The Johns Hopkins University/Applied Physics Laboratory # 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/l...
ChinaMassClouds/copenstack-server
openstack/src/nova-2014.2/nova/virt/ovirt/dmcrypt.py
Python
gpl-2.0
2,226
# -*- coding: utf-8 -*- import logging import simplejson import os import openerp from openerp.addons.web.controllers.main import manifest_list, module_boot, html_template class PointOfSaleController(openerp.addons.web.http.Controller): _cp_path = '/pos' @openerp.addons.web.http.httprequest def app(self,...
jeffery9/mixprint_addons
point_of_sale/controllers/main.py
Python
agpl-3.0
5,627
""" The abstractions package contains classes that serve as interfaces for helper classes in the bearlib. """
yland/coala
coalib/bearlib/abstractions/__init__.py
Python
agpl-3.0
110
# engine/default.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 """Default implementations of per-dialect sqlalchemy.engine classes. These are semi...
jessekl/flixr
venv/lib/python2.7/site-packages/sqlalchemy/engine/default.py
Python
mit
34,917
from calendar import setfirstweekday stopped_in_user_file = True setfirstweekday(15)
akosyakov/intellij-community
python/testData/debug/test_ignore_lib.py
Python
apache-2.0
84
class Test(object): def q(self): c = 3 <selection>a = 1 b = 2 <caret></selection>
akosyakov/intellij-community
python/testData/mover/multiLineSelection_afterDown.py
Python
apache-2.0
95
exec(open("tmp<caret>.txt").read())
asedunov/intellij-community
python/testData/refactoring/introduceConstant/py1840.py
Python
apache-2.0
35
try: from urllib.parse import urlparse from urllib.request import url2pathname except ImportError: # Python 2 from urllib import url2pathname from urlparse import urlparse from django.conf import settings from django.core.handlers.base import get_path_info from django.core.handlers.wsgi import WSGI...
ychen820/microblog
y/google-cloud-sdk/platform/google_appengine/lib/django-1.5/django/contrib/staticfiles/handlers.py
Python
bsd-3-clause
2,513
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime from django.forms import ( CharField, DateField, FileField, Form, IntegerField, SplitDateTimeField, ValidationError, formsets, ) from django.forms.formsets import BaseFormSet, formset_factory from django.forms.utils import ErrorLi...
jylaxp/django
tests/forms_tests/tests/test_formsets.py
Python
bsd-3-clause
57,919
"""Metrics to assess performance on regression task Functions named as ``*_score`` return a scalar value to maximize: the higher the better Function named as ``*_error`` or ``*_loss`` return a scalar value to minimize: the lower the better """ # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr> # Ma...
beepee14/scikit-learn
sklearn/metrics/regression.py
Python
bsd-3-clause
16,953
#!/usr/bin/env python # Jonas Schnelli, 2013 # make sure the Litecoin-Qt.app contains the right plist (including the right version) # fix made because of serval bugs in Qt mac deployment (https://bugreports.qt-project.org/browse/QTBUG-21267) from string import Template from datetime import date bitcoinDir = "./"; in...
SpoonITCurrency/SpoonITCoin
spoonitcoin/share/qt/clean_mac_info_plist.py
Python
mit
897
# encoding: utf-8 import datetime from south.db import db from south.v2 import DataMigration from django.db import models class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." pass def backwards(self, orm): "Write your backwards methods here." PhiloTag = orm['philo.T...
ithinksw/philo
philo/migrations/0020_from_taggit.py
Python
isc
9,796
from flash_services.auth import BasicAuthHeaderMixin from flash_services.core import Service class BasicAuthParent(BasicAuthHeaderMixin, Service): def update(self): pass def format_data(self, data): pass def test_basic_auth(): service = BasicAuthParent(username='username', password='password') asser...
textbook/flash_services
tests/test_auth.py
Python
isc
391
from Text import Text from pprint import pprint import numpy as np class TermFrequencyInverseDocumentFrequency(object): """docstring for TermFrequencyInverseDocumentFrequency""" def __init__(self): super(TermFrequencyInverseDocumentFrequency, self).__init__() self.corpus = [] self.corpus_frequencies = {} ...
ajkannan/Classics-Research
Utilities/TermFrequencyInverseDocumentFrequency.py
Python
mit
1,955
#!/usr/bin/env python3 # Copyright (c) 2015-2021 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test processing of unrequested blocks. Setup: two nodes, node0 + node1, not connected to each other. N...
prusnak/bitcoin
test/functional/p2p_unrequested_blocks.py
Python
mit
13,045
import sys import urllib import json import requests class BingApiResult(): def __init__(self, json_result): self.response = json.loads(json_result)['SearchResponse']['Web'] self.total = self.response['Total'] def find_libraries(self): libraries = [] return self.r...
bluestemscott/librarygadget
librarygadget/librarybot/findlibraries/bing_finder.py
Python
mit
1,859
from __future__ import unicode_literals from django.apps import AppConfig class ApplicationsConfig(AppConfig): name = 'applications' def ready(self): super(ApplicationsConfig, self).ready() from applications.signals import create_draft_application, clean_draft_application, \ auto...
hackupc/backend
applications/apps.py
Python
mit
506
"""Read from /dev/input/js0 and return as dictionaries. If you have pygame it is easier and more portable to do something like:: import pygame.joystick from pygame.event import event_name pygame.init() pygame.joystick.init() js = pygame.joystick.Joystick(0) js.init() while True: ...
olemb/mido
extras/hid_joystick.py
Python
mit
6,820
#coding:utf-8 from django.shortcuts import render # Create your views here. from django.http import HttpResponse # 引入我们创建的表单类 from models import SearchForm,SearchRepoForm,ConnectForm import requests import json from chgithub import GetSearchInfo,SearchRepo,SocialConnect,SearchConnect,nonSocialConnect def index(request...
ch710798472/GithubRecommended
RecGithub/views.py
Python
mit
3,774
from marshmallow import (Schema, fields, post_load, validates_schema) from contracts.category import (GetCategoryRequest, GetCategoryResponse, DetailCategoryRequest, DetailCategoryResponse, PostCategoryRequest, PutCategoryRequest, DeleteCategoryRequest) fr...
tuanquanghpvn/rest_exam
apps/category/mappers.py
Python
mit
2,523
import unittest from classes.app import App from classes.user import User class TestAppCase(unittest.TestCase): def setUp(self): self.app = App() self.user = User('pwalukagga@gmail.com', 'pato123', 'Patrick', 'Walukagga') def test_signup_user_is_created(self): ...
PatrickCmd/Yummy-Recipes-App
tests/test_app.py
Python
mit
2,276
from setuptools import setup setup(name='commandeur', version='0.1', description='Creating commandline tools from python functions', classifiers=[ 'Development Status :: 3 - Alpha', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 2.7', ], ...
flashdagger/commandeur
setup.py
Python
mit
623
import requests import json from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from django.shortcuts import render, redirect, get_object_or_404 from django.views import generic from django.views.generic.edit import DeleteView from django.core.urlresolvers impo...
acdh-oeaw/totetiroler
places/views.py
Python
mit
4,026
# -*- coding: utf-8 -*- # Copyright (c) 2015, Frappe Technologies and contributors # For license information, please see license.txt """ # Integrating PayPal ### 1. Validate Currency Support Example: from frappe.integrations.utils import get_payment_gateway_controller controller = get_payment_gateway_controller(...
ESS-LLP/frappe
frappe/integrations/doctype/paypal_settings/paypal_settings.py
Python
mit
12,324
import sys import os import pytest sys.path.append(os.path.abspath(os.path.join(os.path.abspath(__file__), "..", ".."))) print(sys.path) import jigsaw def test_initializing_jigsaw_with_no_plugin_path_specified(): j = jigsaw.PluginLoader() assert j.plugin_paths == (os.path.join(os.getcwd(), "plugins"), ) d...
nint8835/jigsaw
tests/test_jigsaw.py
Python
mit
8,141
import logging import os from SchoolTracker import SchoolTracker from SchoolTracker.Dispatcher.TwitterDispatcher import TwitterDispatcher from SchoolTracker.Dispatcher.PushoverDispatcher import PushoverDispatcher if os.getenv("SCHOOLTRACKER_DEBUG", False): log_level = logging.DEBUG else: log_level = logging.I...
nint8835/SchoolTracker
Start.py
Python
mit
530
''' Created by auto_sdk on 2013.01.22 ''' from top.api.base import RestApi class SubuserEmployeeUpdateRequest(RestApi): def __init__(self,domain='gw.api.taobao.com',port=80): RestApi.__init__(self,domain, port) self.department_id = None self.duty_id = None self.employee_name = None self.employee_ni...
colaftc/webtool
top/api/rest/SubuserEmployeeUpdateRequest.py
Python
mit
702
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding model 'Album' db.create_table(u'photo_album', ( (u'i...
vadosl/photorganizer
photorganizer/photo/migrations/0001_initial.py
Python
mit
8,572
# Do not edit this file, pipeline versioning is governed by git tags __version__=0.2.0
wheniwork/keyme
version.py
Python
mit
86