repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
mengxn/tensorflow | tensorflow/contrib/distributions/python/ops/transformed_distribution.py | 8 | 22377 | # 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... | apache-2.0 |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive2/production_ml/labs/samples/contrib/azure-samples/kfp-azure-databricks/databricks/_cluster_op.py | 3 | 10940 | import json
from kfp.dsl import ResourceOp
class CreateClusterOp(ResourceOp):
"""Represents an Op which will be translated into a Databricks Cluster creation resource
template.
Examples:
import databricks
databricks.CreateClusterOp(
name="createcluster",
cluster_n... | apache-2.0 |
avedaee/DIRAC | FrameworkSystem/private/logging/backends/RemoteBackend.py | 1 | 2903 | # $HeadURL$
__RCSID__ = "$Id$"
"""This Backend sends the Log Messages to a Log Server
It will only report to the server ERROR, EXCEPTION, FATAL
and ALWAYS messages.
"""
import threading
import Queue
from DIRAC.Core.Utilities import Time, Network
from DIRAC.FrameworkSystem.private.logging.backends.BaseBackend import Bas... | gpl-3.0 |
axinging/chromium-crosswalk | tools/perf/measurements/measurement_smoke_test.py | 9 | 2471 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import optparse
import os
import unittest
from telemetry import benchmark as benchmark_module
from telemetry.core import discover
from teleme... | bsd-3-clause |
xaowoodenfish/python-1 | bigml/tests/delete_project_steps.py | 1 | 1383 | # -*- coding: utf-8 -*-
#!/usr/bin/env python
#
# Copyright 2014-2015 BigML
#
# 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... | apache-2.0 |
jaruba/chromium.src | tools/telemetry/telemetry/core/backends/chrome_inspector/inspector_websocket.py | 11 | 6437 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import collections
import json
import logging
import socket
import time
from telemetry.core.backends.chrome_inspector import websocket
_DomainHandler = co... | bsd-3-clause |
Livefyre/agency_tools | streamhub_app_generator.py | 2 | 9031 | import sys, itertools, os, argparse, urllib2, json, re
class Application_Type(object):
LIST = "list"
WALL = "wall"
class Application(object):
LIST_TYPE = "list"
WALL_TYPE = "wall"
def __init__(self, network, site_id, article_id, instance_type):
self.network = network
self.site_id ... | mit |
gnuhub/intellij-community | python/lib/Lib/encodings/mac_croatian.py | 593 | 13889 | """ Python Character Mapping Codec mac_croatian generated from 'MAPPINGS/VENDORS/APPLE/CROATIAN.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,inp... | apache-2.0 |
cloudera/hue | apps/search/src/search/controller.py | 2 | 1827 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
ArneBab/pypyjs | website/demo/home/rfk/repos/pypy/lib-python/2.7/curses/__init__.py | 46 | 1817 | """curses
The main package for curses support for Python. Normally used by importing
the package, and perhaps a particular module inside it.
import curses
from curses import textpad
curses.initwin()
...
"""
__revision__ = "$Id$"
from _curses import *
from curses.wrapper import wrapper
import os as _os... | mit |
BRCDcomm/pynos | pynos/versions/ver_7/ver_7_0_0/yang/brocade_terminal.py | 4 | 2453 | #!/usr/bin/env python
import xml.etree.ElementTree as ET
class brocade_terminal(object):
"""Auto generated class.
"""
def __init__(self, **kwargs):
self._callback = kwargs.pop('callback')
def terminal_cfg_line_sessionid(self, **kwargs):
"""Auto Generated Code
"""
... | apache-2.0 |
gylian/headphones | lib/unidecode/x0cb.py | 253 | 5012 | data = (
'jjwaels', # 0x00
'jjwaelt', # 0x01
'jjwaelp', # 0x02
'jjwaelh', # 0x03
'jjwaem', # 0x04
'jjwaeb', # 0x05
'jjwaebs', # 0x06
'jjwaes', # 0x07
'jjwaess', # 0x08
'jjwaeng', # 0x09
'jjwaej', # 0x0a
'jjwaec', # 0x0b
'jjwaek', # 0x0c
'jjwaet', # 0x0d
'jjwaep', # 0x0e
'jjw... | gpl-3.0 |
lociii/googleads-python-lib | examples/adspygoogle/adwords/v201309/basic_operations/add_keywords.py | 2 | 2787 | #!/usr/bin/python
#
# Copyright 2013 Google 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 b... | apache-2.0 |
ds-hwang/chromium-crosswalk | chromecast/tools/trace.py | 19 | 2980 | #!/usr/bin/env python
#
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# This script was originally written by Alok Priyadarshi (alokp@)
# with some minor local modifications.
import contextlib
import j... | bsd-3-clause |
aioue/ansible | test/units/modules/network/junos/test_junos_rpc.py | 43 | 3370 | # (c) 2017 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
# (at your option) any later version.
#
# Ansible is dis... | gpl-3.0 |
felixma/nova | nova/tests/unit/scheduler/filters/test_core_filters.py | 17 | 4514 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | apache-2.0 |
srvg/ansible | test/units/template/test_safe_eval.py | 58 | 1820 | # (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... | gpl-3.0 |
sinkuri256/python-for-android | python-build/python-libs/gdata/src/gdata/analytics/service.py | 213 | 13293 | #!/usr/bin/python
#
# Copyright (C) 2006 Google Inc.
# Refactored in 2009 to work for Google Analytics by Sal Uryasev at Juice 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
#
# ht... | apache-2.0 |
SlashRoot/WHAT | what_apps/main/models.py | 1 | 2208 | from django.db import models
from itertools import chain
BUBBLE_ACTIONS = (
(1, 'link'),
(2, 'pop'),
(3, 'modal'),
(4, 'ajax_crumb'),
)
class Bubble(models.Model):
url=models.CharField... | mit |
hufsm/tu_gen2_libsigrokdecode | decoders/cfp/__init__.py | 7 | 1583 | ##
## This file is part of the libsigrokdecode project.
##
## Copyright (C) 2018 Elias Oenal <sigrok@eliasoenal.com>
## 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... | gpl-3.0 |
amanuel/bigcouch | couchjs/scons/scons-local-2.0.1/SCons/Tool/f77.py | 61 | 2056 | """engine.SCons.Tool.f77
Tool-specific initialization for the generic Posix f77 Fortran compiler.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2... | apache-2.0 |
quom/google-cloud-python | docs/logging_snippets.py | 6 | 12290 | # Copyright 2016 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | apache-2.0 |
spunkmars/ProFTPD-Admin | src/proftpd/ftpadmin/models/ftpacl.py | 1 | 4142 | #coding=utf-8
from django.db import models
from proftpd.ftpadmin.lib.common import set_hexdigest, fix_path, check_safe_range
from proftpd.ftpadmin.settings import DISABLED_CHOICES, SHELL_CHOICES, FILE_PATH, FTP_GROUP_DEFAULT_GID, FTP_USER_SAFE_HOMEDIR, FTP_ACL_CHOICES
from proftpd.ftpadmin import signals
from proftp... | bsd-3-clause |
Splo0sh/3DCT | test/test_TDCT_correlation.py | 2 | 6800 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
# @Title : test_TDCT_correlation
# @Project : 3DCTv2
# @Description : pytest test
# @Author : Jan Arnold
# @Email : jan.arnold (at) coraxx.net
# @Copyright : Copyright (C) 2016 Jan Arnold
# @License : GPLv3 (see LICENSE file)
# @Credits :
# @Maintainer ... | gpl-3.0 |
samvarankashyap/googlecloudutility2 | lib/simplejson/simplejson/compat.py | 155 | 1036 | """Python 3 compatibility shims
"""
import sys
if sys.version_info[0] < 3:
PY3 = False
def b(s):
return s
def u(s):
return unicode(s, 'unicode_escape')
import cStringIO as StringIO
StringIO = BytesIO = StringIO.StringIO
text_type = unicode
binary_type = str
string_types =... | apache-2.0 |
tprrt/linux-stable | tools/perf/python/tracepoint.py | 291 | 1504 | #! /usr/bin/env python
# SPDX-License-Identifier: GPL-2.0
# -*- python -*-
# -*- coding: utf-8 -*-
import perf
class tracepoint(perf.evsel):
def __init__(self, sys, name):
config = perf.tracepoint(sys, name)
perf.evsel.__init__(self,
type = perf.TYPE_TRACEPOINT,
... | gpl-2.0 |
liujinliu/squirrel | src/squirrel/controllers/worker.py | 1 | 1946 | # -*- coding: utf-8 -*-
import logging
from datetime import datetime
from tornado import gen
from tornado.queues import Queue
from concurrent.futures import ThreadPoolExecutor
from db.cache import Cache
from db.persis import Persis
from squirrel.utils import USER_CACHE_MAX, DAY_FMT
q = Queue(maxsize=1000)
LOG = logging... | apache-2.0 |
jendap/tensorflow | tensorflow/python/kernel_tests/scatter_ops_test.py | 6 | 12310 | # 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... | apache-2.0 |
fortes/Rfugee | lib/requests-2.7.0-py2.7.egg/requests/packages/chardet/langcyrillicmodel.py | 2762 | 17725 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | mit |
ch3lo/zookeeper | src/contrib/rest/src/python/demo_master_election.py | 115 | 2920 | #! /usr/bin/env python
# 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
# "... | apache-2.0 |
Erethon/synnefo | snf-branding/distribute_setup.py | 82 | 15757 | #!python
"""Bootstrap distribute installation
If you want to use setuptools in your package's setup.py, just include this
file in the same directory with it, and add this to the top of your setup.py::
from distribute_setup import use_setuptools
use_setuptools()
If you want to require a specific version of se... | gpl-3.0 |
Edraak/edraak-platform | lms/djangoapps/mobile_api/users/tests.py | 9 | 20141 | """
Tests for users API
"""
# pylint: disable=no-member
import datetime
import ddt
import pytz
from django.conf import settings
from django.template import defaultfilters
from django.test import RequestFactory, override_settings
from django.utils import timezone
from milestones.tests.utils import MilestonesTestCaseMix... | agpl-3.0 |
ilyes14/scikit-learn | sklearn/utils/class_weight.py | 63 | 7227 | # Authors: Andreas Mueller
# Manoj Kumar
# License: BSD 3 clause
import warnings
import numpy as np
from ..externals import six
from ..utils.fixes import in1d
from .fixes import bincount
def compute_class_weight(class_weight, classes, y):
"""Estimate class weights for unbalanced datasets.
Paramete... | bsd-3-clause |
rest-of/the-deck | lambda/lib/python2.7/site-packages/setuptools/command/install.py | 496 | 4685 | from distutils.errors import DistutilsArgError
import inspect
import glob
import warnings
import platform
import distutils.command.install as orig
import setuptools
# Prior to numpy 1.9, NumPy relies on the '_install' name, so provide it for
# now. See https://bitbucket.org/pypa/setuptools/issue/199/
_install = orig.... | mit |
frank10704/DF_GCS_W | MissionPlanner-master/packages/IronPython.StdLib.2.7.5-beta1/content/Lib/ftplib.py | 50 | 36764 | """An FTP client class and some helper functions.
Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Reynolds
Example:
>>> from ftplib import FTP
>>> ftp = FTP('ftp.python.org') # connect to host, default port
>>> ftp.login() # default, i.e.: user anonymous, passwd anonymous@
'230 Guest log... | gpl-3.0 |
BlueBrain/NeuroM | neurom/features/__init__.py | 1 | 6149 | # Copyright (c) 2020, Ecole Polytechnique Federale de Lausanne, Blue Brain Project
# All rights reserved.
#
# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | bsd-3-clause |
ionelmc/django-easyfilters | tests/test_app/tests/test_ranges.py | 2 | 3677 | from decimal import Decimal
import unittest
from django_easyfilters.ranges import auto_ranges
class TestRanges(unittest.TestCase):
def test_auto_ranges_simple(self):
"""
Test that auto_ranges produces 'nice' looking automatic ranges.
"""
# An easy case - max_items is just what we... | mit |
transifex/openformats | openformats/tests/formats/structuredkeyvaluejson/test_keyvaluejson.py | 1 | 19720 | # -*- coding: utf-8 -*-
import unittest
import six
from openformats.formats.json import StructuredJsonHandler
from openformats.exceptions import ParseError
from openformats.strings import OpenString
from openformats.tests.formats.common import CommonFormatTestMixin
from openformats.tests.utils.strings import (gener... | gpl-3.0 |
DARKPOP/external_chromium_org | ppapi/generators/idl_thunk.py | 44 | 20936 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Generator for C++ style thunks """
import glob
import os
import re
import sys
from idl_log import ErrOut, InfoOut, WarnOut
fr... | bsd-3-clause |
jaor/bigmler | bigmler/options/execute.py | 2 | 7974 | # -*- coding: utf-8 -*-
#
# Copyright 2015 BigML
#
# 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 ag... | apache-2.0 |
coteyr/home-assistant | homeassistant/components/switch/wink.py | 1 | 1109 | """
homeassistant.components.switch.wink
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Support for Wink switches.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/switch.wink/
"""
import logging
from homeassistant.components.wink import WinkToggleDevice
from homea... | mit |
alon/polinax | libs/external_libs/markdown-1.7/markdown.py | 21 | 61612 | #!/usr/bin/env python
version = "1.7"
version_info = (1,7,0,"rc-2")
__revision__ = "$Rev: 72 $"
"""
Python-Markdown
===============
Converts Markdown to HTML. Basic usage as a module:
import markdown
md = Markdown()
html = md.convert(your_text_string)
See http://www.freewisdom.org/projects/python-mark... | gpl-2.0 |
KamranMackey/readthedocs.org | fabfile.py | 35 | 1521 | from fabric.api import lcd, local
from fabric.decorators import runs_once
import os
fabfile_dir = os.path.dirname(__file__)
def update_theme():
theme_dir = os.path.join(fabfile_dir, 'readthedocs', 'templates', 'sphinx')
if not os.path.exists('/tmp/sphinx_rtd_theme'):
local('git clone https://github.... | mit |
keyser84/android_kernel_motorola_msm8226 | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
niun/motty | motty/com.py | 1 | 7626 | import logging
from logging import debug, info, warning, error, critical
import serial
from serial.tools import list_ports
import time
import threading
from collections.abc import Iterable
from motty.config import Config
class HistoryObserver(object):
def __init__(self):
pass
def onNewHistoryEntry(se... | mit |
Donkyhotay/MoonPy | twisted/mail/maildir.py | 4 | 15496 | # -*- test-case-name: twisted.mail.test.test_mail -*-
# Copyright (c) 2001-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Maildir-style mailbox support
"""
import os
import stat
import socket
import time
from zope.interface import implements
try:
import cStringIO as StringIO
except ImportErro... | gpl-3.0 |
coreos/depot_tools | third_party/boto/roboto/awsqueryrequest.py | 70 | 18654 | # Copyright (c) 2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# withou... | bsd-3-clause |
won0089/oppia | core/domain/recommendations_jobs_continuous.py | 1 | 4744 | # coding: utf-8
#
# Copyright 2015 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... | apache-2.0 |
tanjot/trimfilename | create_test_directory.py | 1 | 1235 | #!/usr/bin/python3
import os
def main():
test_folder = 'tmp'
for file_name in get_file_structure():
create(os.path.join(test_folder, file_name))
list_files(test_folder)
def get_file_structure():
simple_files = ['123abc.txt', '123xyz.txt', 'fooabc.barmp3', 'abc.abc', '00000000.txt']
level... | gpl-3.0 |
tlakshman26/cinder-new-branch | cinder/volume/drivers/dothill/dothill_client.py | 4 | 12185 | # Copyright 2014 Objectif Libre
# Copyright 2015 DotHill Systems
#
# 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
#
# U... | apache-2.0 |
loco-odoo/localizacion_co | openerp/addons-extra/odoo-pruebas/odoo-server/addons/report_webkit/convert.py | 322 | 2581 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com)
# All Right Reserved
#
# Author : Nicolas Bessi (Camptocamp)
#
# WARNING: This program as such is intended to be used by professional
# programmers who ... | agpl-3.0 |
araines/moto | tests/test_sns/test_application.py | 15 | 8932 | from __future__ import unicode_literals
import boto
from boto.exception import BotoServerError
from moto import mock_sns
import sure # noqa
@mock_sns
def test_create_platform_application():
conn = boto.connect_sns()
platform_application = conn.create_platform_application(
name="my-application",
... | apache-2.0 |
cathyyul/sumo-0.18 | tests/complex/traci/pythonApi/lane/runner.py | 1 | 2329 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, subprocess, sys
sys.path.append(os.path.join(os.path.dirname(sys.argv[0]), "..", "..", "..", "..", "..", "tools"))
import traci, sumolib
sumoBinary = sumolib.checkBinary('sumo')
sumoProcess = subprocess.Popen("%s -c sumo.sumocfg" % (sumoBinary), shell=True, std... | gpl-3.0 |
dipspb/ardupilot | mk/VRBRAIN/Tools/genmsg/src/genmsg/msg_loader.py | 51 | 20963 | # Software License Agreement (BSD License)
#
# Copyright (c) 2008, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code must retain ... | gpl-3.0 |
stupidnetizen/selenium | py/selenium/webdriver/firefox/extension_connection.py | 66 | 2846 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
jkandasa/integration_tests | artifactor/plugins/filedump.py | 6 | 4156 | """ FileDump plugin for Artifactor
Add a stanza to the artifactor config like this,
artifactor:
log_dir: /home/username/outdir
per_run: test #test, run, None
overwrite: True
plugins:
filedump:
enabled: True
plugin: filedump
"""
from artifactor import ArtifactorBasePlugi... | gpl-2.0 |
ehealthafrica-ci/onadata | onadata/apps/viewer/management/commands/sync_mongo.py | 8 | 1981 | #!/usr/bin/env python
from optparse import make_option
from django.contrib.auth.models import User
from django.core.management.base import BaseCommand, CommandError
from django.utils.translation import ugettext_lazy
from onadata.apps.logger.models import XForm
from onadata.libs.utils.logger_tools import mongo_sync_st... | bsd-2-clause |
BeDjango/intef-openedx | cms/djangoapps/contentstore/utils.py | 22 | 15660 | """
Common utility functions useful throughout the contentstore
"""
import logging
import re
from datetime import datetime
from pytz import UTC
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils.translation import ugettext as _
from django_comment_common.models import assi... | agpl-3.0 |
zxtstarry/src | user/karl/display1.py | 5 | 8972 | from traits.api import HasTraits, Instance, Button, Enum, Int, Float, Range
from traitsui.api import View, Item, Group
from chaco.api import HPlotContainer, Plot, ArrayPlotData, DataRange1D
from chaco.tools.api import PanTool, ZoomTool
from enable.api import ColorTrait
from enable.component_editor import ComponentEdito... | gpl-2.0 |
kool79/intellij-community | python/lib/Lib/site-packages/django/contrib/contenttypes/views.py | 295 | 3025 | from django import http
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site, get_current_site
from django.core.exceptions import ObjectDoesNotExist
def shortcut(request, content_type_id, object_id):
"Redirect to an object's page based on a content-type ID and an ... | apache-2.0 |
secdev/scapy | scapy/contrib/spbm.py | 5 | 2442 | # This file is part of Scapy
# Scapy 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
# any later version.
#
# Scapy is distributed in the hope that it will be useful,
# but ... | gpl-2.0 |
chienlieu2017/it_management | odoo/addons/payment_paypal/controllers/main.py | 1 | 4633 | # -*- coding: utf-8 -*-
import json
import logging
import pprint
import urllib2
import werkzeug
from odoo import http
from odoo.http import request
_logger = logging.getLogger(__name__)
class PaypalController(http.Controller):
_notify_url = '/payment/paypal/ipn/'
_return_url = '/payment/paypal/dpn/'
_c... | gpl-3.0 |
pixelgremlins/ztruck | dj/lib/python2.7/site-packages/django/contrib/sitemaps/__init__.py | 84 | 6499 | import warnings
from django.apps import apps as django_apps
from django.conf import settings
from django.core import urlresolvers, paginator
from django.core.exceptions import ImproperlyConfigured
from django.utils import translation
from django.utils.deprecation import RemovedInDjango19Warning
from django.utils.six.m... | apache-2.0 |
Dancore/SubTrigger | SubTrigger.py | 1 | 2599 | import sublime, sublime_plugin
class MytestCommand(sublime_plugin.TextCommand):
def run(self, edit):
# self.view.insert(edit, 0, "Hello, World! ")
self.view.run_command("show_panel", {"panel": "console"}) # "toggle": 0})
# print self.view.file_name(), "is now the active view"
class SublimeOnSave(sublime_plugin... | gpl-3.0 |
prds21/barrial-movie | lib/atom/http.py | 27 | 10236 | #!/usr/bin/python
#
# Copyright (C) 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | gpl-3.0 |
odooindia/odoo | addons/project_issue_sheet/__openerp__.py | 120 | 1851 | # -*- encoding: 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
# ... | agpl-3.0 |
yuvipanda/zulip | puppet/zulip_internal/files/postgresql/pg_backup_and_purge.py | 114 | 1575 | #!/usr/bin/python
import subprocess
import sys
import logging
import dateutil.parser
import pytz
from datetime import datetime, timedelta
logging.basicConfig(format="%(asctime)s %(levelname)s: %(message)s")
logger = logging.getLogger(__name__)
def run(args, dry_run=False):
if dry_run:
print "Would have r... | apache-2.0 |
adalke/rdkit | rdkit/ML/DecTree/UnitTestQuantTree.py | 3 | 7680 | ## Automatically adapted for numpy.oldnumeric Jun 27, 2008 by -c
#
# Copyright (C) 2001,2003 greg Landrum and Rational Discovery LLC
#
""" unit tests for the QuantTree implementation """
from __future__ import print_function
import unittest
import io
from rdkit import RDConfig
from rdkit.ML.DecTree import BuildQuan... | bsd-3-clause |
mraduldubey/webpage2kindle | webpage2kindle.py | 1 | 3273 | #!/usr/bin/python
import os,os.path,sys,pdfkit,requests,re
import getpass
import pynotify
import smtplib
from email.MIMEMultipart import MIMEMultipart
from email.MIMEText import MIMEText
from email.MIMEBase import MIMEBase
from email import encoders
#IMPORTANT--Make sure your gmail settings' access to 'less-secure ap... | gpl-3.0 |
tigerbunny/bitmessage | src/class_objectHashHolder.py | 15 | 2004 | # objectHashHolder is a timer-driven thread. One objectHashHolder thread is used
# by each sendDataThread. The sendDataThread uses it whenever it needs to
# advertise an object to peers in an inv message, or advertise a peer to other
# peers in an addr message. Instead of sending them out immediately, it must
# wait a ... | mit |
asimshankar/tensorflow | tensorflow/python/kernel_tests/padding_fifo_queue_test.py | 1 | 59357 | # 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... | apache-2.0 |
hangzhang925/WhereHows | wherehows-etl/src/main/resources/jython/LdapTransform.py | 3 | 9171 | #
# Copyright 2015 LinkedIn Corp. 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 ... | apache-2.0 |
ibuler/jumpserver | connect.py | 1 | 33558 | #!/usr/bin/env python
# coding: utf-8
import sys
reload(sys)
sys.setdefaultencoding('utf8')
import os
import re
import time
import datetime
import textwrap
import getpass
import readline
import django
import paramiko
import errno
import struct, fcntl, signal, socket, select
from io import open as copen
import uuid
... | gpl-2.0 |
jmacmahon/invenio | modules/websession/lib/webuser_config.py | 16 | 1790 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2011 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... | gpl-2.0 |
tswast/google-cloud-python | trace/google/cloud/trace_v1/gapic/trace_service_client_config.py | 1 | 1368 | config = {
"interfaces": {
"google.devtools.cloudtrace.v1.TraceService": {
"retry_codes": {
"idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"],
"non_idempotent": [],
},
"retry_params": {
"default": {
"ini... | apache-2.0 |
Achuth17/scikit-bio | skbio/io/_base.py | 1 | 7700 | # ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | bsd-3-clause |
home-assistant/home-assistant | tests/components/mfi/test_switch.py | 5 | 3581 | """The tests for the mFi switch platform."""
import unittest.mock as mock
import pytest
import homeassistant.components.mfi.switch as mfi
import homeassistant.components.switch as switch_component
from homeassistant.setup import async_setup_component
PLATFORM = mfi
COMPONENT = switch_component
THING = "switch"
GOOD_... | apache-2.0 |
COCS4950G7/COSC4950 | Source/Network/Obsolete/NetworkServer_r13B.py | 1 | 56657 | __author__ = 'chris hamm'
#NetworkServer_r13B
#Created: 2/19/2015
#DEsigned to run with NetworkClient_r13B
#Changes from previous revision:
#(Implemented) Replace the stackOfChunksThatNeedToBeReassigned with the queue of chunks
#changed receive chunk from controller setup to have chunk stored in the queue... | gpl-3.0 |
Mitame/YRS2014-Death-Game | data/settings.py | 2 | 1586 | '''
Created on 28 Jul 2014
@author: Levi Wright
'''
import os
if os.getcwd()[-4:] == "data":
os.chdir("..")
running = True
imported = False
import data
import pygame
import time
class level():
pixelsToGrid = 10
fillGaps = True
originLatLong = ([52, 56, 23.44],[0,4,10.75])
origi... | gpl-2.0 |
hbiyik/tribler | src/tribler-core/tribler_core/tests/test_bootstrap.py | 1 | 1532 | from binascii import unhexlify
from ipv8.keyvault.crypto import ECCrypto
from tribler_core.modules.bootstrap import Bootstrap
from tribler_core.tests.tools.base_test import MockObject
from tribler_core.tests.tools.test_as_server import TestAsServer
from tribler_core.utilities.utilities import succeed
class FakeDHT(... | lgpl-3.0 |
blackye/luscan-devel | thirdparty_libs/dns/rdtypes/IN/NSAP.py | 100 | 2181 | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | gpl-2.0 |
etxc/namebench | tools/check_nameserver_popularity.py | 174 | 2456 | #!/usr/bin/env python
import os
import re
import sys
import pickle
import time
import traceback
import yahoo.search
from yahoo.search.web import WebSearch
APP_ID = 'P5ihFKzV34G69QolFfb3nN7p0rSsYfC9tPGq.IUS.NLWEeJ14SG9Lei0rwFtgwL8cDBrA6Egdw--'
QUERY_MODIFIERS = '-site:txdns.net -site:sitedossier.com -mx -site:dataopedi... | apache-2.0 |
trafi/djinni | test-suite/generated-src/python/map_record_helper.py | 1 | 2803 | # AUTOGENERATED FILE - DO NOT MODIFY!
# This file generated by Djinni from map.djinni
from djinni.support import MultiSet # default imported in all files
from djinni.exception import CPyException # default imported in all files
from djinni.pycffi_marshal import CPyObject, CPyObjectProxy, CPyPrimitive, CPyRecord, CPySt... | apache-2.0 |
Scotchester/owning-a-home | test/browser_testing/features/steps/steps_rate_checker_loan_details.py | 11 | 4431 | from behave import given, when, then
from hamcrest.core import assert_that
from hamcrest.core.core.isequal import equal_to
from hamcrest.library.number.ordering_comparison import greater_than, less_than
from hamcrest.library.text.stringcontains import contains_string
from pages.base import Base
from pages.rate_checker... | cc0-1.0 |
IronLanguages/ironpython2 | Src/StdLib/Lib/site-packages/win32/lib/rasutil.py | 38 | 1737 | 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... | apache-2.0 |
lyoniionly/django-cobra | src/cobra/apps/svnkit/abstract_models.py | 1 | 20237 | from __future__ import absolute_import, print_function
import datetime
import mimetypes
import os
import posixpath
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.db import transaction
from django.utils.encoding import python_2_unicode_... | apache-2.0 |
danielharbor/openerp | addons/account_check_writing/wizard/__init__.py | 437 | 1082 | # -*- 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... | agpl-3.0 |
ZeitOnline/zeit.ldap | bootstrap.py | 299 | 5686 | ##############################################################################
#
# Copyright (c) 2006 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... | bsd-3-clause |
davidzchen/tensorflow | tensorflow/python/distribute/ps_values.py | 6 | 10000 | # Copyright 2020 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... | apache-2.0 |
levkar/odoo | addons/point_of_sale/models/pos_order.py | 2 | 46267 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import logging
from datetime import timedelta
from functools import partial
import psycopg2
from odoo import api, fields, models, tools, _
from odoo.tools import float_is_zero
from odoo.exceptions import UserError
from ... | agpl-3.0 |
ThiagoGarciaAlves/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/gdal/prototypes/geom.py | 315 | 4821 | import re
from datetime import date
from ctypes import c_char, c_char_p, c_double, c_int, c_ubyte, c_void_p, POINTER
from django.contrib.gis.gdal.envelope import OGREnvelope
from django.contrib.gis.gdal.libgdal import lgdal, GEOJSON
from django.contrib.gis.gdal.prototypes.errcheck import check_bool, check_envelope
from... | apache-2.0 |
openrisc/or1k-src | gdb/contrib/exsummary.py | 33 | 5735 | # Copyright 2011, 2013 Free Software Foundation, Inc.
#
# This 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 pro... | gpl-2.0 |
dksr/REMIND | python/base/utils/Logging.py | 1 | 8007 | import os
import sys
import logging
import logging.handlers
from Singleton import Singleton
class attrdict(dict):
""" Dictionary with attribute like access """
def __init__(self, *args, **kwargs):
dict.__init__(self, *args, **kwargs)
self.__dict__ = self
class Logging_Manager(Singlet... | mit |
adcomp/super-fruit-pie | tuto/04_platform.py | 1 | 5701 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# David Art <david.madbox@gmail.com>
# Program Arcade Games With Python And Pygame - Build a Platformer
# http://programarcadegames.com
import pygame
import random
# Define some colors
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
YELLOW = (255, 255, 0)
WIDTH, HEIG... | mit |
jeffbryner/configlib | tests/test_configlib.py | 1 | 1147 |
class TestConfigLib(object):
def setup(self):
self.config_path = 'tests/fixture/fqdnblocklist.conf'
def test_current_behavior(self):
from configlib import getConfig
res = getConfig('mongohost', 'defaultvalue', self.config_path)
assert res == 'mongodb'
def test_option_pars... | mpl-2.0 |
rahul67/hue | desktop/libs/hadoop/java/scripts/jobtracker_test.py | 38 | 1768 | # Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file ex... | apache-2.0 |
NRGunby/UCONGA | linalg.py | 1 | 2541 | import math
import numpy
def normalise(a):
'''
Normalises a vector
Accepts: a numpy vector
Returns: a numpy vector pointing in the same direction with magnitude 1
'''
a_norm = numpy.linalg.norm(a)
return numpy.array([float(each)/a_norm for each in a])
def rotation_axis_angle(axis, angle)... | bsd-3-clause |
shuggiefisher/django-on-google-app-engine-base | django/contrib/gis/db/backends/oracle/introspection.py | 388 | 1777 | import cx_Oracle
from django.db.backends.oracle.introspection import DatabaseIntrospection
class OracleIntrospection(DatabaseIntrospection):
# Associating any OBJECTVAR instances with GeometryField. Of course,
# this won't work right on Oracle objects that aren't MDSYS.SDO_GEOMETRY,
# but it is the only o... | bsd-3-clause |
simzacks/jjb | jenkins_jobs/modules/project_workflow.py | 3 | 2543 | # -*- coding: utf-8 -*-
# Copyright (C) 2015 David Caro <david@dcaro.es>
#
# Based on jenkins_jobs/modules/project_flow.py by
# Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
... | apache-2.0 |
GbalsaC/bitnamiP | venv/lib/python2.7/site-packages/newrelic-2.46.0.37/newrelic/core/application.py | 2 | 72779 | """This module implements data recording and reporting for an application.
"""
import logging
import sys
import threading
import time
import os
import traceback
import imp
from functools import partial
import newrelic.packages.six as six
from newrelic.samplers.data_sampler import DataSampler
from newrelic.core.co... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.