repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
ThiagoGarciaAlves/intellij-community | python/testData/inspections/PyCompatibilityInspection/warningAboutAsyncAndAwaitInPy35.py | 26 | 1159 | class <warning descr="'async' and 'await' are not recommended to be used as variable, class, function or module names. They will become proper keywords in Python 3.7.">async</warning>(object):
pass
class <warning descr="'async' and 'await' are not recommended to be used as variable, class, function or module names... | apache-2.0 |
gangadharkadam/saloon_frappe | frappe/modules/__init__.py | 39 | 3313 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
"""
Utilities for using modules
"""
import frappe, os
import frappe.utils
from frappe import _
lower_case_files_for = ['DocType', 'Page', 'Report',
"Workflow", 'Module Def', 'D... | mit |
tometaro/ah | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py | 2485 | 5536 | # This file comes from
# https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py
# Do not edit! Edit the upstream one instead.
"""Python module for generating .ninja files.
Note that this is emphatically not a required piece of Ninja; it's
just a helpful utility for build-file-generation systems that alr... | gpl-2.0 |
mike-tr-adamson/cassandra | pylib/cqlshlib/test/run_cqlsh.py | 14 | 12062 | # 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 u... | apache-2.0 |
krakensden/mongrel2 | examples/chat/chat.py | 94 | 1233 | import simplejson as json
from mongrel2 import handler
sender_id = "82209006-86FF-4982-B5EA-D1E29E55D481"
conn = handler.Connection(sender_id, "tcp://127.0.0.1:9999",
"tcp://127.0.0.1:9998")
users = {}
user_list = []
while True:
try:
req = conn.recv_json()
except:
p... | bsd-3-clause |
infobloxopen/infoblox-netmri | infoblox_netmri/api/broker/v3_3_0/issue_detail_broker.py | 12 | 78423 | from ..broker import Broker
class IssueDetailBroker(Broker):
controller = "issue_details"
def show(self, **kwargs):
"""Shows the details for the specified issue detail.
**Inputs**
| ``api version min:`` None
| ``api version max:`` None
| ``required... | apache-2.0 |
ladarat/python_koans | python3/koans/about_none.py | 79 | 1473 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Based on AboutNil in the Ruby Koans
#
from runner.koan import *
class AboutNone(Koan):
def test_none_is_an_object(self):
"Unlike NULL in a lot of languages"
self.assertEqual(__, isinstance(None, object))
def test_none_is_universal(self):
... | mit |
utkarsh-goswami/erpnext | erpnext/accounts/doctype/pricing_rule/pricing_rule.py | 1 | 13027 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import json
import copy
from frappe import throw, _
from frappe.utils import flt, cint
from frappe.model.document ... | gpl-3.0 |
deployed/django | tests/wsgi/tests.py | 12 | 3338 | from __future__ import unicode_literals
import unittest
from django.core.exceptions import ImproperlyConfigured
from django.core.servers.basehttp import get_internal_wsgi_application
from django.core.signals import request_started
from django.core.wsgi import get_wsgi_application
from django.db import close_old_conne... | bsd-3-clause |
talhajaved/nyuadmarket | flask/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langthaimodel.py | 2930 | 11275 | ######################## 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 |
galactics/space-api | tests/frames/test_iau1980.py | 2 | 1615 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from pytest import fixture, yield_fixture
from unittest.mock import patch
from numpy.testing import assert_almost_equal
from beyond.dates.date import Date
from beyond.dates.eop import Eop
from beyond.frames.iau1980 import _earth_orientation, _precesion,... | gpl-3.0 |
openstack/designate | designate/tests/test_hookpoints.py | 1 | 4338 | # Copyright 2015 Rackspace Hosting.
#
# Author: Eric Larson <eric.larson@rackspace.com>
#
# 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
#
#... | apache-2.0 |
angela278/UPDream | lib/pytz/gae.py | 74 | 3068 | """
A pytz version that runs smoothly on Google App Engine.
Based on http://appengine-cookbook.appspot.com/recipe/caching-pytz-helper/
To use, add pytz to your path normally, but import it from the gae module:
from pytz.gae import pytz
Applied patches:
- The zoneinfo dir is removed fr... | apache-2.0 |
mrquim/repository.mrquim | script.module.liveresolver/lib/liveresolver/modules/f4mproxy/utils/cryptomath.py | 135 | 8356 | # Authors:
# Trevor Perrin
# Martin von Loewis - python 3 port
# Yngve Pettersen (ported by Paul Sokolovsky) - TLS 1.2
#
# See the LICENSE file for legal information regarding use of this file.
"""cryptomath module
This module has basic math/crypto code."""
from __future__ import print_function
import os
impor... | gpl-2.0 |
yangsensen/Crawler | X500/bson/tz_util.py | 20 | 1518 | # Copyright 2010-2014 MongoDB, 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 writin... | gpl-2.0 |
saleemjaveds/https-github.com-openstack-nova | nova/virt/hyperv/driver.py | 1 | 9980 | # Copyright (c) 2010 Cloud.com, Inc
# Copyright (c) 2012 Cloudbase Solutions Srl
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | apache-2.0 |
the-adrian/KernotekV2.0 | venv/lib/python2.7/site-packages/pip/_vendor/colorama/initialise.py | 484 | 1297 | # Copyright Jonathan Hartley 2013. BSD 3-Clause license, see LICENSE file.
import atexit
import sys
from .ansitowin32 import AnsiToWin32
orig_stdout = sys.stdout
orig_stderr = sys.stderr
wrapped_stdout = sys.stdout
wrapped_stderr = sys.stderr
atexit_done = False
def reset_all():
AnsiToWin32(orig_stdout).rese... | gpl-3.0 |
GoogleChromeLabs/chromeos_smart_card_connector | third_party/closure-library/src/closure/bin/build/depstree.py | 455 | 6375 | # Copyright 2009 The Closure Library 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 a... | apache-2.0 |
CARPEM/GalaxyDocker | config/configShinyApp/checkContainerTime.py | 1 | 1124 | import sys
import datetime
from subprocess import Popen, PIPE
import json
#container ID extraction
container_id = sys.argv[1]
print("Check :"+container_id)
cmd=['docker', 'inspect', "--format='{{json .State}}'", container_id]
print(cmd)
process = Popen(cmd, stdout=PIPE, stderr=PIPE)
stdout, stderr = process.communic... | mit |
Alwnikrotikz/los-cocos | utest/test_p_ba_Spawn_Action.py | 6 | 6851 | from __future__ import division, print_function, unicode_literals
# important: set cocos_utest=1 in the environment before run.
# that simplifies the pyglet mockup needed
# remember to erase or set to zero for normal runs
import os
assert os.environ['cocos_utest']
# set the desired pyglet mockup
import sys
sys.path.i... | bsd-3-clause |
onceuponatimeforever/oh-mainline | vendor/packages/Django/django/conf/locale/id/formats.py | 355 | 1818 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j N Y'
DATETIME_FORMAT = "j N Y, G.i.s"
TIME_FORMAT = 'G.i.s'
YEAR_MONTH_... | agpl-3.0 |
mnick/qutebrowser | qutebrowser/browser/commands.py | 1 | 39927 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2015 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
soldag/home-assistant | homeassistant/components/mobile_app/sensor.py | 14 | 1999 | """Sensor platform for mobile_app."""
from functools import partial
from homeassistant.const import CONF_WEBHOOK_ID
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from .const import (
ATTR_SENSOR_STATE,
ATTR_SENSOR_TYPE_SENSOR as ENTITY_TYPE,
... | apache-2.0 |
openstack/taskflow | taskflow/persistence/backends/sqlalchemy/tables.py | 2 | 4207 | # -*- coding: utf-8 -*-
# Copyright (C) 2014 Yahoo! 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... | apache-2.0 |
kutenai/django | django/core/management/base.py | 23 | 21797 | # -*- coding: utf-8 -*-
"""
Base classes for writing management commands (named commands which can
be executed through ``django-admin`` or ``manage.py``).
"""
from __future__ import unicode_literals
import os
import sys
from argparse import ArgumentParser
import django
from django.core import checks
from django.core.... | bsd-3-clause |
hammerhorn/hammerhorn-jive | dice/prefs.py | 6 | 2807 | #!/usr/bin/env python
"""
Reads from and write to the config file, 'config.json'.
"""
import argparse
from cjh.cli import Cli
from cjh.config import Config
__author__ = 'Chris Horn <hammerhorn@gmail.com>'
def _parse_args():
"""
Parse command-line arguments
"""
parser = argparse.ArgumentParser()
... | gpl-2.0 |
stuartbfox/Diamond | src/collectors/websitemonitor/websitemonitor.py | 28 | 2759 | # coding=utf-8
"""
Gather HTTP Response code and Duration of HTTP request
#### Dependencies
* urllib2
"""
import urllib2
import time
from datetime import datetime
import diamond.collector
class WebsiteMonitorCollector(diamond.collector.Collector):
"""
Gather HTTP response code and Duration of HTTP reques... | mit |
thaim/ansible | lib/ansible/modules/network/meraki/meraki_firewalled_services.py | 17 | 8289 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Kevin Breit (@kbreit) <kevin.breit@kevinbreit.net>
# 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 = {
... | mit |
wuyuewen/libcloud | libcloud/common/dnsimple.py | 37 | 2030 | # 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 use ... | apache-2.0 |
cuboxi/android_external_chromium_org | tools/telemetry/telemetry/core/backends/chrome/tab_list_backend.py | 23 | 4765 | # Copyright 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 json
import urllib2
import weakref
from telemetry.core import util
from telemetry.core import tab
from telemetry.core.backends.chrome import inspector... | bsd-3-clause |
sambitgaan/nupic | src/nupic/frameworks/opf/two_gram_model.py | 40 | 6927 | # ----------------------------------------------------------------------
# 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... | agpl-3.0 |
prataprc/tayra | tayra/test/stdttl/ref/useinterface.ttl.py | 1 | 2558 | import imp
from io import StringIO
from pluggdapps.plugin import Plugin, implements
from tayra import BaseTTLPlugin
def __traceback_decorator__( frames ):
from copy import deepcopy
from os.path import basename
def _map2ttl( frame ):
filename = frame.fil... | gpl-3.0 |
asiersarasua/QGIS | python/plugins/db_manager/layer_preview.py | 1 | 5023 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... | gpl-2.0 |
swayf/pyLoad | module/plugins/accounts/FilesonicCom.py | 1 | 2796 | # -*- coding: utf-8 -*-
"""
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License,
or (at your option) any later version.
This program is distributed in... | agpl-3.0 |
BRAINSia/ITK | Modules/Filtering/ImageFeature/wrapping/test/CannyEdgeDetectionImageFilterTest.py | 7 | 1437 | # ==========================================================================
#
# Copyright NumFOCUS
#
# 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/... | apache-2.0 |
Imperat/SSU-Courses | ssu-formal-languages/pda/pda.py | 1 | 1105 | import pda_exceptions as e
class PDA(object):
def __init__(self, rules, input_alphabet, states,
initial_state, terminate_states):
self.rules = rules
self.input_alphabet = input_alphabet
self.states = states
self.state = initial_state
self.terminate_states =... | apache-2.0 |
rowemoore/odoo | addons/sale/report/invoice_report.py | 336 | 1680 | # -*- 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 |
caedesvvv/pynoded | pynoded/graph.py | 1 | 4291 | """
Base graph objects
"""
from evh.base import EvHandler,EvStack
from math import *
class Drawable(object):
"""
Base class for drawable objects.
"""
def __init__(self,x,y,scale=1.0):
self.x=x
self.y=y
self.scale=scale
def Draw(self,ctx):
ctx.save()
ctx.sca... | gpl-3.0 |
wadobo/congressus | congressus/tickets/templatetags/tickets.py | 1 | 1531 | import re
from django import template
from django.utils.translation import ugettext as _
from django.utils.html import mark_safe
register = template.Library()
@register.simple_tag
def ticket_seat_class(session, layout, seat, row, col):
row = str(row)
col = str(col)
if seat == 'R':
return 'seat... | agpl-3.0 |
michaelkirk/QGIS | python/plugins/processing/algs/lidar/lastools/lasnoise.py | 1 | 3645 | # -*- coding: utf-8 -*-
"""
***************************************************************************
lasnoise.py
---------------------
Date : September 2013
Copyright : (C) 2013 by Martin Isenburg
Email : martin near rapidlasso point com
****************... | gpl-2.0 |
geekboxzone/lollipop_external_chromium_org | chrome/browser/web_dev_style/html_checker.py | 36 | 1536 | # 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... | bsd-3-clause |
tareqalayan/ansible | test/units/modules/network/junos/test_junos_scp.py | 48 | 3579 | # (c) 2018 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 |
renyi533/tensorflow | tensorflow/python/keras/layers/preprocessing/categorical_crossing.py | 3 | 10171 | # 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 |
openmb/openblackhole-enigma2 | lib/python/Components/Sources/FrontendStatus.py | 25 | 1592 | from Source import Source
from enigma import eTimer
class FrontendStatus(Source):
def __init__(self, service_source = None, frontend_source = None, update_interval = 1000):
Source.__init__(self)
self.update_interval = update_interval
self.service_source = service_source
self.frontend_source = frontend_source
... | gpl-2.0 |
pirate/bookmark-archiver | archivebox/extractors/readability.py | 1 | 4294 | __package__ = 'archivebox.extractors'
from pathlib import Path
from tempfile import NamedTemporaryFile
from typing import Optional
import json
from ..index.schema import Link, ArchiveResult, ArchiveError
from ..system import run, atomic_write
from ..util import (
enforce_types,
download_url,
is_static_fi... | mit |
tysonholub/twilio-python | twilio/rest/taskrouter/v1/workspace/workspace_statistics.py | 1 | 10107 | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import InstanceResource
from twilio.base.l... | mit |
benspaulding/django | tests/modeltests/tablespaces/models.py | 150 | 1819 | from django.db import models
# Since the test database doesn't have tablespaces, it's impossible for Django
# to create the tables for models where db_tablespace is set. To avoid this
# problem, we mark the models as unmanaged, and temporarily revert them to
# managed during each test. We also set them to use the same... | bsd-3-clause |
ChenJunor/hue | desktop/core/ext-py/boto-2.38.0/boto/plugin.py | 150 | 2711 | # Copyright 2010 Google 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
# without limitation the rights to use, copy, modify, merge, publish, dis-
# trib... | apache-2.0 |
awsdocs/aws-doc-sdk-examples | python/example_code/rekognition/rekognition_collections.py | 1 | 13421 | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""
Purpose
Shows how to use the AWS SDK for Python (Boto3) with Amazon Rekognition to
create a collection that contains faces indexed from a series of images. The
collection is then searched for faces that matc... | apache-2.0 |
CongSmile/tp-qemu | qemu/tests/monitor_cmds_check.py | 9 | 1276 | import logging
from autotest.client.shared import error
from virttest import qemu_monitor
@error.context_aware
def run(test, params, env):
"""
monitor_cmds_check test:
1). bootup vm with human and qmp monitor
2). check commands in black_list is unavaliable in monitor
:param test: Qemu test obje... | gpl-2.0 |
GDGND/evm | allauth/socialaccount/providers/twitter/south_migrations/0003_tosocialaccount.py | 83 | 8228 | # encoding: utf-8
from south.v2 import DataMigration
class Migration(DataMigration):
depends_on = (('socialaccount', '0002_genericmodels'),)
def forwards(self, orm):
# Migrate apps
app_id_to_sapp = {}
for app in orm.TwitterApp.objects.all():
sapp = orm['socialaccount.Socia... | mit |
pdellaert/ansible | lib/ansible/modules/storage/netapp/_na_ontap_gather_facts.py | 21 | 21721 | #!/usr/bin/python
# (c) 2018 Piotr Olczak <piotr.olczak@redhat.com>
# (c) 2018-2019, NetApp, 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
ANSIBLE_METADATA = {'metadata_version': '... | gpl-3.0 |
jfrank1500/curso_nodejs | bin/node_modules/cordova/node_modules/cordova-lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/SCons.py | 253 | 5848 | # 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.
"""
SCons generator.
This contains class definitions and supporting functions for generating
pieces of SCons files for the different types of GYP targets.
"""
im... | mit |
pigeonflight/strider-plone | docker/appengine/lib/django-1.3/django/contrib/messages/tests/base.py | 152 | 17772 | import warnings
from django import http
from django.test import TestCase
from django.conf import settings
from django.utils.translation import ugettext_lazy
from django.utils.unittest import skipIf
from django.contrib.messages import constants, utils, get_level, set_level
from django.contrib.messages.api import Messag... | mit |
VagrantApe/flaskMicroblog | venv/lib/python2.7/site-packages/sqlalchemy/connectors/mysqldb.py | 21 | 5556 | """Define behaviors common to MySQLdb dialects.
Currently includes MySQL and Drizzle.
"""
from . import Connector
from ..engine import base as engine_base, default
from ..sql import operators as sql_operators
from .. import exc, log, schema, sql, types as sqltypes, util, processors
import re
# the subclassing of C... | bsd-3-clause |
CSC-ORG/Dynamic-Dashboard-2015 | engine/lib/python2.7/site-packages/rest_framework/settings.py | 3 | 6205 | """
Settings for REST framework are all namespaced in the REST_FRAMEWORK setting.
For example your project's `settings.py` file might look like this:
REST_FRAMEWORK = {
'DEFAULT_RENDERER_CLASSES': (
'rest_framework.renderers.JSONRenderer',
'rest_framework.renderers.YAMLRenderer',
)
'DEFAULT... | mit |
atarax82/lotto-project | project/monitor.py | 1 | 2948 | import os
import sys
#import time
import signal
import threading
import atexit
import queue
_interval = 1.0
_times = {}
_files = []
_running = False
_queue = queue.Queue()
_lock = threading.Lock()
def _restart(path):
_queue.put(True)
prefix = 'monitor (pid=%d):' % os.getpid()
print('%s Change detected to... | gpl-3.0 |
utamaro/youtube-dl | youtube_dl/extractor/kanalplay.py | 113 | 3283 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
float_or_none,
srt_subtitles_timecode,
)
class KanalPlayIE(InfoExtractor):
IE_DESC = 'Kanal 5/9/11 Play'
_VALID_URL = r'https?://(?:www\.)?kanal(?P<channel_id... | unlicense |
eduNEXT/edx-platform | lms/djangoapps/commerce/models.py | 4 | 1937 | """
Commerce-related models.
"""
from config_models.models import ConfigurationModel
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
@python_2_unicode_compatible
class CommerceConfiguration(ConfigurationModel):
""... | agpl-3.0 |
igemsoftware/SYSU-Software2013 | project/Python27_32/Lib/test/test_module.py | 16 | 2729 | # Test the module type
import unittest
from test.test_support import run_unittest, gc_collect
import sys
ModuleType = type(sys)
class ModuleTests(unittest.TestCase):
def test_uninitialized(self):
# An uninitialized module has no __dict__ or __name__,
# and __doc__ is None
foo = ModuleType.... | mit |
madelynfreed/rlundo | venv/lib/python2.7/site-packages/IPython/utils/ipstruct.py | 34 | 11864 | # encoding: utf-8
"""A dict subclass that supports attribute style access.
Authors:
* Fernando Perez (original)
* Brian Granger (refactoring to a dict subclass)
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed... | gpl-3.0 |
PerlaTroncosoRey/tgac-galaxytools | tools/Ensembl-REST/get_genetree.py | 2 | 2642 | # A simple tool to connect to the Ensembl server and retrieve genetree using
# the Ensembl REST API.
from __future__ import print_function
import optparse
import requests
from six.moves.urllib.parse import urljoin
parser = optparse.OptionParser()
parser.add_option('--id_type', type='choice', default='gene_id',
... | mit |
ESSolutions/ESSArch_Core | ESSArch_Core/agents/documents.py | 1 | 1455 | from elasticsearch_dsl import Date, InnerDoc, Keyword, Nested, Text
from ESSArch_Core.agents.models import Agent
from ESSArch_Core.search.documents import DocumentBase
from ESSArch_Core.tags.documents import autocomplete_analyzer
class AgentNameDocument(InnerDoc):
main = Text()
part = Text()
description ... | gpl-3.0 |
praveen-pal/edx-platform | lms/urls.py | 3 | 22904 | from django.conf import settings
from django.conf.urls import patterns, include, url
from ratelimitbackend import admin
from django.conf.urls.static import static
import django.contrib.auth.views
# Uncomment the next two lines to enable the admin:
if settings.DEBUG or settings.MITX_FEATURES.get('ENABLE_DJANGO_ADMIN_S... | agpl-3.0 |
naparuba/shinken | shinken/objects/servicegroup.py | 9 | 7000 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (C) 2009-2014:
# Gabes Jean, naparuba@gmail.com
# Gerhard Lausser, Gerhard.Lausser@consol.de
# Gregory Starck, g.starck@gmail.com
# Hartmut Goebel, h.goebel@goebel-consult.de
#
# This file is part of Shinken.
#
# Shinken is free software: you can redist... | agpl-3.0 |
anve8004/trading-with-python | cookbook/ib_placeOrder.py | 77 | 2550 | # -*- coding: utf-8 -*-
"""
Demonstrate order submission with ibpy
"""
from time import sleep
from ib.ext.Contract import Contract
from ib.opt import ibConnection
from ib.ext.Order import Order
def createContract(symbol):
''' create contract object '''
c = Contract()
c.m_symbol = symbol
... | bsd-3-clause |
gridpp/cvmfs-test-001-00-00 | lib/python2.6/site-packages/python_dateutil-2.2-py2.6.egg/dateutil/tz.py | 217 | 32988 | """
Copyright (c) 2003-2007 Gustavo Niemeyer <gustavo@niemeyer.net>
This module offers extensions to the standard Python
datetime module.
"""
__license__ = "Simplified BSD"
from six import string_types, PY3
import datetime
import struct
import time
import sys
import os
relativedelta = None
parser = None
rrule = No... | mit |
nocvp/python-google-places | googleplaces/types.py | 5 | 4566 | """
Valid types to be optionally used in Google Place query api calls.
@author: sam@slimkrazy.com
"""
TYPE_ACCOUNTING = 'accounting'
TYPE_AIRPORT = 'airport'
TYPE_AMUSEMENT_PARK = 'amusement_park'
TYPE_AQUARIUM = 'aquarium'
TYPE_ART_GALLERY = 'art_gallery'
TYPE_ATM = 'atm'
TYPE_BAKERY = 'bakery'
TYPE_BANK = 'bank'
TY... | mit |
IONISx/edx-platform | common/djangoapps/enrollment/tests/test_views.py | 18 | 45236 | """
Tests for user enrollment.
"""
import json
import itertools
import unittest
import datetime
import ddt
from django.core.cache import cache
from mock import patch
from django.test import Client
from django.core.handlers.wsgi import WSGIRequest
from django.core.urlresolvers import reverse
from rest_framework.test im... | agpl-3.0 |
x303597316/hue | desktop/core/ext-py/markdown/markdown/extensions/meta.py | 131 | 2607 | #!usr/bin/python
"""
Meta Data Extension for Python-Markdown
=======================================
This extension adds Meta Data handling to markdown.
Basic Usage:
>>> import markdown
>>> text = '''Title: A Test Doc.
... Author: Waylan Limberg
... John Doe
... Blank_Data:
...
.... | apache-2.0 |
perezg/infoxchange | BASE/lib/python2.7/site-packages/django/contrib/gis/db/backends/base.py | 104 | 11139 | """
Base/mixin classes for the spatial backend database operations and the
`SpatialRefSys` model the backend.
"""
import re
from django.contrib.gis import gdal
from django.utils import six
from django.utils.encoding import python_2_unicode_compatible
class BaseSpatialOperations(object):
"""
This module holds t... | apache-2.0 |
MasterGowen/moonrain | moonrain/projects/views.py | 1 | 3432 | import json
from django.shortcuts import render, redirect
from django.views.generic.edit import UpdateView, DeleteView
from .models import Project
from ..videos.models import Video, VideosSequence
from ..videos.views import new_sequence, get_sequence
from django.contrib.auth.decorators import login_required
from django... | gpl-2.0 |
modulexcite/chromium-dashboard | scripts/httplib2/test/miniserver.py | 303 | 3327 | import logging
import os
import select
import SimpleHTTPServer
import SocketServer
import threading
HERE = os.path.dirname(__file__)
logger = logging.getLogger(__name__)
class ThisDirHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def translate_path(self, path):
path = path.split('?', 1)[0].split('#'... | bsd-3-clause |
harisbal/pandas | pandas/tests/arrays/categorical/test_missing.py | 1 | 3078 | # -*- coding: utf-8 -*-
import collections
import numpy as np
import pytest
from pandas.compat import lrange
from pandas.core.dtypes.dtypes import CategoricalDtype
from pandas import Categorical, Index, isna
import pandas.util.testing as tm
class TestCategoricalMissing(object):
def test_na_flags_int_categori... | bsd-3-clause |
tbetcke/PyBEM2D | examples/circscatt.py | 1 | 1272 | import pybem2d.core.bases as pcb
import pybem2d.core.segments as pcs
import pybem2d.core.quadrules as pcq
import pybem2d.core.kernels as pck
import pybem2d.core.mesh as pcm
import pybem2d.core.assembly as pca
import pybem2d.core.evaluation as pce
import pybem2d.core.visualization as pcv
import numpy as np
k=10
nelem... | mit |
ujvl/ray-ng | rllib/tests/test_perf.py | 2 | 1075 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import gym
import time
import unittest
import ray
from ray.rllib.evaluation.rollout_worker import RolloutWorker
from ray.rllib.tests.test_rollout_worker import MockPolicy
class TestPerf(unittest.TestCase):
... | apache-2.0 |
elventear/ansible-modules-extras | database/misc/redis.py | 41 | 10582 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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.
#... | gpl-3.0 |
akretion/rma | __unported__/crm_claim_ext/__openerp__.py | 6 | 2730 | # -*- coding: utf-8 -*-
#########################################################################
# #
# #
#########################################################################
... | agpl-3.0 |
jswope00/griffinx | lms/djangoapps/shoppingcart/tests/test_pdf.py | 6 | 11044 | """
Tests for Pdf file
"""
from datetime import datetime
from django.test.utils import override_settings
from django.conf import settings
import unittest
from io import BytesIO
from shoppingcart.pdf import PDFInvoice
from shoppingcart.utils import parse_pages
PDF_RECEIPT_DISCLAIMER_TEXT = "THE SITE AND ANY INFORMATION... | agpl-3.0 |
le9i0nx/ansible | lib/ansible/modules/cloud/amazon/redshift.py | 4 | 17628 | #!/usr/bin/python
# Copyright 2014 Jens Carl, Hothead Games 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
ANSIBLE_METADATA = {'metadata_version': '1.1',
'stat... | gpl-3.0 |
tedder/ansible | lib/ansible/modules/cloud/scaleway/scaleway_lb.py | 34 | 10334 | #!/usr/bin/python
#
# Scaleway Load-balancer management module
#
# Copyright (C) 2018 Online SAS.
# https://www.scaleway.com
#
# 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_MET... | gpl-3.0 |
sertansenturk/tomato | tests/test_converter.py | 1 | 1334 | import numpy as np
import pytest
from tomato.converter import Converter
def test_hz_to_cent_negative_hz_track():
# GIVEN
hz_track = np.array([-50])
ref_freq = np.float(25.0)
# WHEN; THEN
with pytest.raises(ValueError):
Converter.hz_to_cent(hz_track, ref_freq)
def test_hz_to_cent_negati... | agpl-3.0 |
nanolearningllc/edx-platform-cypress-2 | lms/djangoapps/certificates/migrations/0004_auto__add_field_generatedcertificate_graded_certificate_id__add_field_.py | 188 | 7955 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'GeneratedCertificate.graded_certificate_id'
db.add_column('certificates_generatedcertificate', 'g... | agpl-3.0 |
marqueedev/django | django/contrib/gis/geos/prototypes/errcheck.py | 103 | 2974 | """
Error checking functions for GEOS ctypes prototype functions.
"""
from ctypes import c_void_p, string_at
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc
# Getting the `free` routine used to free the memory allocated for
# string pointers ... | bsd-3-clause |
orangepole/Snoopy | snoopy/server/bin/ssid_to_loc.py | 4 | 3268 | #!/usr/bin/python
# coding=utf-8
# glenn@sensepost.com
# Snoopy // 2012
# By using this code you agree to abide by the supplied LICENSE.txt
# Uses wigle_api to query SSIDs from the MySQL database
from wigle_api_lite import fetchLocations
import time
import stawk_db
import sys
import re
import logging
from warnings ... | mit |
alonisser/Open-Knesset | video/management/commands/sub_commands/tests/UpdateMembersAboutVideo.py | 14 | 6011 | #encoding: utf-8
import datetime
from django.test import TestCase
from video.management.commands.sub_commands.UpdateMembersAboutVideo import UpdateMembersAboutVideo
class UpdateMembersAboutVideo_test(UpdateMembersAboutVideo):
def __init__(self,members,testCase,getYoutubeVideosReturn,getVideosReturn):
sel... | bsd-3-clause |
DeMille/emailhooks | django_nonrel/django/contrib/comments/views/moderation.py | 210 | 5204 | from __future__ import absolute_import
from django import template
from django.conf import settings
from django.contrib import comments
from django.contrib.auth.decorators import login_required, permission_required
from django.contrib.comments import signals
from django.contrib.comments.views.utils import next_redirec... | mit |
aerophile/django | django/contrib/admin/bin/compress.py | 100 | 2075 | #!/usr/bin/env python
import argparse
import os
import subprocess
import sys
js_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'static', 'admin', 'js')
def main():
description = """With no file paths given this script will automatically
compress all jQuery-based files of the admin app. Requires ... | bsd-3-clause |
achang97/YouTunes | lib/python2.7/site-packages/oauth2client/service_account.py | 40 | 28195 | # Copyright 2014 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 by applicable law or ... | mit |
bcferrycoder/holideck | requests/packages/urllib3/packages/six.py | 119 | 11151 | """Utilities for writing code that runs on Python 2 and 3"""
#Copyright (c) 2010-2011 Benjamin Peterson
#Permission is hereby granted, free of charge, to any person obtaining a copy of
#this software and associated documentation files (the "Software"), to deal in
#the Software without restriction, including without l... | mit |
apple/llvm-project | lldb/test/API/macosx/save_crashlog/TestSaveCrashlog.py | 7 | 2415 | """
Test that the save_crashlog command functions
"""
import os
import lldb
import lldbsuite.test.lldbutil as lldbutil
from lldbsuite.test.lldbtest import *
from lldbsuite.test.decorators import *
class TestSaveCrashlog(TestBase):
mydir = TestBase.compute_mydir(__file__)
# If your test case doesn't stress... | apache-2.0 |
michael-borisov/python-social-auth | social/backends/strava.py | 70 | 1850 | """
Strava OAuth2 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/strava.html
"""
from social.backends.oauth import BaseOAuth2
class StravaOAuth(BaseOAuth2):
name = 'strava'
AUTHORIZATION_URL = 'https://www.strava.com/oauth/authorize'
ACCESS_TOKEN_URL = 'https://www.strava.com/oauth/token... | bsd-3-clause |
DorRosenblum/tf_flstm_f-lm | language_model_test.py | 4 | 1667 | import random
import numpy as np
import tensorflow as tf
from language_model import LM
from hparams import HParams
def get_test_hparams():
return HParams(
batch_size=21,
num_steps=12,
num_shards=2,
num_layers=1,
learning_rate=0.2,
max_grad_norm=1.0,
vocab_s... | mit |
Batterfii/django | django/utils/ipv6.py | 208 | 7967 | # This code was mostly based on ipaddr-py
# Copyright 2007 Google Inc. https://github.com/google/ipaddr-py
# Licensed under the Apache License, Version 2.0 (the "License").
from django.core.exceptions import ValidationError
from django.utils.six.moves import range
from django.utils.translation import ugettext_lazy as _... | bsd-3-clause |
mjafin/bcbio-nextgen | bcbio/variation/bedutils.py | 1 | 7691 | """Utilities for manipulating BED files.
"""
import os
import shutil
import sys
import subprocess
import toolz as tz
from bcbio import utils
from bcbio.bam import ref
from bcbio.distributed.transaction import file_transaction
from bcbio.pipeline import config_utils
from bcbio.pipeline import datadict as dd
from bcbio... | mit |
nachandr/cfme_tests | scripts/encrypt_conf.py | 2 | 1448 | #!/usr/bin/env python3
"""Script to encrypt config files.
Usage:
scripts/encrypt_conf.py confname1 confname2 ... confnameN
scripts/encrypt_conf.py credentials
"""
import argparse
import yaycl_crypt
from cfme.utils import conf
def parse_cmd_line():
parser = argparse.ArgumentParser(argument_default=None)
... | gpl-2.0 |
openqt/algorithms | leetcode/python/lc331-verify-preorder-serialization-of-a-binary-tree.py | 1 | 1578 | # coding=utf-8
import unittest
"""331. Verify Preorder Serialization of a Binary Tree
https://leetcode.com/problems/verify-preorder-serialization-of-a-binary-tree/description/
One way to serialize a binary tree is to use pre-order traversal. When we
encounter a non-null node, we record the node's value. If it is a nu... | gpl-3.0 |
alanljj/oca_server-tools | __unported__/import_odbc/__openerp__.py | 42 | 3848 | # -*- coding: utf-8 -*-
##############################################################################
#
# Daniel Reis
# 2011
#
# 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 Foundati... | agpl-3.0 |
lightcn/odoo | addons/mrp_operations/report/mrp_workorder_analysis.py | 312 | 3336 | # -*- 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 |
justincassidy/scikit-learn | examples/covariance/plot_outlier_detection.py | 235 | 3891 | """
==========================================
Outlier detection with several methods.
==========================================
When the amount of contamination is known, this example illustrates two
different ways of performing :ref:`outlier_detection`:
- based on a robust estimator of covariance, which is assumin... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.