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
tayebzaidi/PPLL_Spr_16
chat/client3.py
1
1260
from multiprocessing.connection import Client from random import random from time import sleep from multiprocessing.connection import Listener from multiprocessing import Process local_listener = (('127.0.0.1', 5003),'secret client 3 password') def client_listener(): cl = Listener(address=local_listener[0], auth...
gpl-3.0
wang1986one/SPlayer
Test/Update_Unittest/web/basic/code.py
18
1665
import web urls = ( '/(.*)/', 'redirect', '/', 'index', '/Latest', 'Latest', '/Update', 'Update', ) app = web.application(urls, globals()) class index: def GET(self): web.header("Content-Type", "text/html; charset=utf-8") doc = '<form method="POST" accept-charset="u...
gpl-2.0
RJRandell79/RJRStudios
node_modules/node-gyp/gyp/pylib/gyp/win_tool.py
1417
12751
#!/usr/bin/env python # Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility functions for Windows builds. These functions are executed via gyp-win-tool when using the ninja generator. """ import os impor...
gpl-2.0
andrewleech/SickRage
tests/api_v1_tests.py
27
5515
# coding=utf-8 """ Test the SR API """ import unittest class APITestEpisodes(unittest.TestCase): """ Test episode commands for API This tests all episode related commands from the legacy api. """ @unittest.skip('Not yet implemented') def test_episode(self): """ Test getting ...
gpl-3.0
wuhengzhi/chromium-crosswalk
third_party/logilab/logilab/astroid/node_classes.py
20
29767
# copyright 2003-2013 LOGILAB S.A. (Paris, FRANCE), all rights reserved. # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr # # This file is part of astroid. # # astroid 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 #...
bsd-3-clause
chirayudesai/linux-msm-fusion3
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (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 import sys sys.path.append(os.envir...
gpl-2.0
xq262144/hue
desktop/core/ext-py/tablib-0.10.0/tablib/packages/openpyxl3/writer/worksheet.py
55
8672
# file openpyxl/writer/worksheet.py # Copyright (c) 2010 openpyxl # # 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, cop...
apache-2.0
wavelets/zulip
zerver/lib/logging_util.py
124
1529
from __future__ import absolute_import import logging from datetime import datetime, timedelta # Adapted http://djangosnippets.org/snippets/2242/ by user s29 (October 25, 2010) class _RateLimitFilter(object): last_error = datetime.min def filter(self, record): from django.conf import settings ...
apache-2.0
laalaguer/gae-blog-module
gaesession/handlers.py
1
7633
import webapp2 from webapp2_extras import sessions class MainHandler(webapp2.RequestHandler): def get(self): # Session is stored on both client browser and our database session_1 = self.session_store.get_session(name='dbcookie',backend='datastore') previous_value_1 = session_1.get("my_attr_...
apache-2.0
fluxcapacitor/pipeline
libs/pipeline_model/tensorflow/core/framework/tensor_slice_pb2.py
1
4870
# Generated by the protocol buffer compiler. DO NOT EDIT! # source: tensorflow/core/framework/tensor_slice.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.proto...
apache-2.0
double12gzh/nova
nova/tests/unit/api/openstack/compute/contrib/test_extended_ips.py
19
5551
# Copyright 2013 Nebula, 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 ...
apache-2.0
TheWardoctor/Wardoctors-repo
script.module.fantastic/lib/resources/lib/sources/ko/drama4u.py
7
5842
# -*- coding: utf-8 -*- """ Covenant Add-on 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 prog...
apache-2.0
DirtyPiece/dancestudio
Build/Tools/Python27/Lib/test/test_mmap.py
26
25113
from test.test_support import (TESTFN, run_unittest, import_module, unlink, requires, _2G, _4G, gc_collect, cpython_only) import unittest import os, re, itertools, socket, sys mmap = import_module('mmap') PAGESIZE = mmap.PAGESIZE class MmapTests(unittest.TestCase): def setUp(self)...
mit
indashnet/InDashNet.Open.UN2000
android/external/llvm/copy-diff.py
2
1970
#!/usr/bin/env python import os import shutil import sys BUFFER_SIZE = 1024 def is_file_different(a, b): if os.path.getsize(a) != os.path.getsize(b): # If the file size is different, the content must be different. return True # Read the content of the files, and compare them. result = Fa...
apache-2.0
nrz/ylikuutio
external/bullet3/examples/pybullet/gym/pybullet_envs/minitaur/envs_v2/sensors/sensor.py
2
15551
# Lint as: python3 """A sensor prototype class. The concept is explained in: go/minitaur-gym-redesign-1.1 """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from typing import Any, Iterable, Optional, Sequence, Text, Tuple, Union import gin import gym im...
agpl-3.0
pgmillon/ansible
lib/ansible/modules/network/aci/mso_role.py
24
5541
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Dag Wieers (@dagwieers) <dag@wieers.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_METADATA = {'metadata_ve...
gpl-3.0
tectronics/wot-xvm
src/xpm/xvmstat/xvm.py
4
5839
""" xvm (c) sirmax 2013-2014 """ import os import glob import traceback import simplejson as json import BigWorld import GUI from xpm import * from constants import * from logger import * from gameregion import * from pinger import * from stats import getBattleStat, getBattleResultsStat, getUserData from dossier i...
gpl-3.0
apel/ssm
setup.py
2
2958
"""A setup script for APEL SSM. This script installs the APEL SSM library, sender and reciever. This should be similar to installing the RPM apel-ssm, although there may be some differences. Known differences are: - the RPM installs pyc and pyo files, whereas this script does not. - this script will not install syste...
apache-2.0
CentroGeo/geonode
geonode/upload/models.py
4
14343
# -*- coding: utf-8 -*- ######################################################################### # # Copyright (C) 2016 OSGeo # # 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 ...
gpl-3.0
hyesun03/k-board
kboard/accounts/views.py
5
1049
from django.shortcuts import render, redirect from django.contrib.auth.decorators import login_required from registration.backends.hmac.views import RegistrationView as BaseRegistrationView from .forms import RegistrationForm from .models import Account class RegistrationView(BaseRegistrationView): form_class = ...
mit
betoesquivel/fil2014
filenv/lib/python2.7/site-packages/tornado/stack_context.py
58
12723
#!/usr/bin/env python # # Copyright 2010 Facebook # # 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 a...
mit
ewolinetz/openshift-ansible
roles/lib_openshift/src/class/oc_adm_manage_node.py
18
8790
# pylint: skip-file # flake8: noqa class ManageNodeException(Exception): ''' manage-node exception class ''' pass class ManageNodeConfig(OpenShiftCLIConfig): ''' ManageNodeConfig is a DTO for the manage-node command.''' def __init__(self, kubeconfig, node_options): super(ManageNodeConfig, se...
apache-2.0
JT5D/Alfred-Popclip-Sublime
PopClip 2/PopClippins-master/source/mdtohtml/markdown/extensions/rss.py
23
3675
import markdown from markdown.util import etree DEFAULT_URL = "http://packages.python.org/Markdown/" DEFAULT_CREATOR = "Yuri Takhteyev" DEFAULT_TITLE = "Markdown in Python" GENERATOR = "http://packages.python.org/Markdown/extensions/rss.html" month_map = { "Jan" : "01", "Feb" : "02", "Marc...
gpl-2.0
winklerand/pandas
asv_bench/benchmarks/replace.py
1
2171
from .pandas_vb_common import * class replace_fillna(object): goal_time = 0.2 def setup(self): self.N = 1000000 try: self.rng = date_range('1/1/2000', periods=self.N, freq='min') except NameError: self.rng = DatetimeIndex('1/1/2000', periods=self.N, offset=date...
bsd-3-clause
naresh21/synergetics-edx-platform
openedx/core/djangoapps/oauth_dispatch/dot_overrides.py
10
4252
""" Classes that override default django-oauth-toolkit behavior """ from __future__ import unicode_literals from .models import RestrictedApplication from datetime import datetime from django.contrib.auth import authenticate, get_user_model from django.db.models.signals import pre_save from django.dispatch import rec...
agpl-3.0
samthor/intellij-community
python/testData/MockSdk3.4/python_stubs/sys.py
100
17611
# encoding: utf-8 # module sys # from (built-in) # by generator 1.135 """ This module provides access to some objects used or maintained by the interpreter and to functions that interact strongly with the interpreter. Dynamic objects: argv -- command line arguments; argv[0] is the script pathname if known path -- mod...
apache-2.0
DarioGT/OMS-PluginXML
org.modelsphere.sms/lib/jython-2.2.1/Lib/encodings/cp737.py
1
7357
""" Python Character Mapping Codec generated from 'CP737.TXT' with gencodec.py. Written by Marc-Andre Lemburg (mal@lemburg.com). (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. (c) Copyright 2000 Guido van Rossum. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(s...
gpl-3.0
Alwnikrotikz/pyglet
pyglet/media/riff.py
42
8107
# ---------------------------------------------------------------------------- # pyglet # Copyright (c) 2006-2008 Alex Holkner # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistribu...
bsd-3-clause
brad-kaiser/spark
python/pyspark/mllib/regression.py
24
30672
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
40223119/w16b_test
static/Brython3.1.0-20150301-090019/Lib/collections/abc.py
739
16026
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) for collections, according to PEP 3119. Unit tests are in test_collections. """ from abc import ABCMeta, abstractmethod import sys __all__ = ["Hashable", "Iterable", "Iterator", ...
gpl-3.0
GladeRom/android_external_chromium_org
tools/telemetry/telemetry/web_perf/timeline_based_measurement_unittest.py
28
11375
# 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 os import unittest from telemetry import benchmark from telemetry.core import platform from telemetry.core import wpr_modes from telemetry.page impor...
bsd-3-clause
mmbtba/odoo
addons/subscription/subscription.py
337
8906
# -*- 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...
agpl-3.0
jimkmc/micropython
tests/bytecode/pylib-tests/wave.py
22
18093
"""Stuff to parse WAVE files. Usage. Reading WAVE files: f = wave.open(file, 'r') where file is either the name of a file or an open file pointer. The open file pointer must have methods read(), seek(), and close(). When the setpos() and rewind() methods are not used, the seek() method is not necessary. This ...
mit
PeterVH/Arduino
arduino-core/src/processing/app/i18n/python/requests/packages/charade/codingstatemachine.py
2931
2318
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
lgpl-2.1
tiny4579/tinykernel-gnex
tools/perf/scripts/python/syscall-counts.py
11181
1522
# system call counts # (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 import sys sys.path.append(os.envir...
gpl-2.0
sebastiaangroot/kmaldetect
tools/build/gen_syscall_table.py
1
1860
""" A simple python script to generate a sh table that takes the name of a syscall as input and translates it to the number corrosponding with that syscall. This function is used in the sig_gen.sh script, used to generate an application signature for detection in kmaldetect. Keep in mind that the '\n' characters used h...
gpl-2.0
GiedriusM/openthread
tools/harness-automation/cases/ed_6_4_1.py
16
1867
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notic...
bsd-3-clause
msabramo/ansible
lib/ansible/modules/cloud/vmware/vmware_local_user_manager.py
70
6582
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright IBM Corp. 2016 # Author(s): Andreas Nafpliotis <nafpliot@de.ibm.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 Found...
gpl-3.0
mistercrunch/panoramix
superset/db_engine_specs/hana.py
4
2299
# 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
sajuptpm/magnum
magnum/common/paths.py
17
2156
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2012 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the ...
apache-2.0
drmrd/ansible
lib/ansible/playbook/base.py
6
24853
# Copyright: (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # Copyright: (c) 2017, 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 import itertools import oper...
gpl-3.0
cdgallahue/atomic-turbine
web/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/contrib/appengine.py
360
7937
from __future__ import absolute_import import logging import os import warnings from ..exceptions import ( HTTPError, HTTPWarning, MaxRetryError, ProtocolError, TimeoutError, SSLError ) from ..packages.six import BytesIO from ..request import RequestMethods from ..response import HTTPResponse ...
mit
MIPS/external-chromium_org-tools-grit
grit/gather/policy_json.py
56
9480
#!/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. '''Support for "policy_templates.json" format used by the policy template generator as a source for generating ADM,ADMX,etc files.'...
bsd-2-clause
ravindrapanda/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/bijectors/exp_test.py
73
2307
# 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
ultimateprogramer/formhub
main/registration_views.py
7
1205
from main.models import UserProfile from registration.backends.default.views import RegistrationView class FHRegistrationView(RegistrationView): def register(self, request, **cleaned_data): def _get_first_last_names(name): name_split = name.split() first_name = name_split[0] ...
bsd-2-clause
Nick-OpusVL/odoo
addons/hr_timesheet_invoice/__openerp__.py
260
2403
# -*- 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
nodermann/holdem_poker_combinations
tests.py
1
1924
__author__ = 'Lucian' from poker_combinations import get_combo_name from sort import sort_high_to_low, sort_by_color from const import values, colors, color_names import time def get_deck(): deck = [] for i, color in enumerate(colors): for value in list(reversed(values)): deck.a...
mit
khara914/cf-phpbuildpack
extensions/composer/extension.py
6
16424
# 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
ramineni/myironic
ironic/nova/scheduler/ironic_host_manager.py
11
1678
# Copyright (c) 2012 NTT DOCOMO, INC. # Copyright (c) 2011-2014 OpenStack Foundation # Copyright 2014 Red Hat, 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 Licens...
apache-2.0
Kalyzee/edx-platform
openedx/core/djangoapps/credit/tests/test_signals.py
93
3943
""" Tests for minimum grade requirement status """ import pytz import ddt from datetime import timedelta, datetime from django.conf import settings from django.test.client import RequestFactory from unittest import skipUnless from openedx.core.djangoapps.credit.api import ( set_credit_requirements, get_credit_re...
agpl-3.0
lijoantony/django-oscar-api
oscarapi/basket/operations.py
1
3871
"This module contains operation on baskets and lines" from django.conf import settings from oscar.core.loading import get_model, get_class from oscar.core.utils import get_default_currency from oscar.core.prices import Price __all__ = ( 'apply_offers', 'assign_basket_strategy', 'prepare_basket', 'get_b...
bsd-3-clause
mtils/ems
ems/qt/graphics/scene_manager.py
1
7140
from ems.typehint import accepts from ems.qt.event_hook_proxy import SignalEventHookProxy from ems.qt import QtWidgets, QtGui, QtCore, QtPrintSupport from ems.qt.graphics.graphics_scene import GraphicsScene, BackgroundCorrector from ems.qt.graphics.graphics_widget import GraphicsWidget from ems.qt.graphics.storage.int...
mit
sinbazhou/odoo
openerp/cli/start.py
240
2748
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import glob import os import sys from . import Command from .server import main from openerp.modules.module import get_module_root, MANIFEST from openerp.service.db import _create_empty_database, DatabaseExists class Start(Command): """Quick start the...
agpl-3.0
pgmillon/ansible
lib/ansible/modules/database/postgresql/postgresql_tablespace.py
1
16280
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Flavien Chantelot (@Dorn-) # Copyright: (c) 2018, Antoine Levy-Lambert (@antoinell) # Copyright: (c) 2019, Andrew Klychkov (@Andersson007) <aaklychkov@mail.ru> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ...
gpl-3.0
cawka/pybindgen
examples/std_shared_ptr/modulegen.py
6
1387
#! /usr/bin/env python import sys, os sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..')) #import pybindgen #import pybindgen.utils #from pybindgen.typehandlers import base as typehandlers from pybindgen import Module, FileCodeSink, param, retval #f...
lgpl-2.1
Foxfanmedium/python_training
OnlineCoursera/mail_ru/Python_1/env/Lib/site-packages/traitlets/utils/importstring.py
13
1266
# encoding: utf-8 """ A simple utility to import something by its string name. """ # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from ipython_genutils.py3compat import cast_bytes_py2 from six import string_types def import_item(name): """Import and return ``b...
apache-2.0
inspirehep/invenio-formatter
invenio_formatter/models.py
1
1670
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2013, 2015 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...
gpl-2.0
Wolkabout/WolkConnect-Python-
wolk/models/__init__.py
1
1275
from .ActuatorCommand import ActuatorCommand from .ActuatorCommandType import ActuatorCommandType from .ActuatorState import ActuatorState from .ActuatorStatus import ActuatorStatus from .Alarm import Alarm from .ConfigurationCommand import ConfigurationCommand from .ConfigurationCommandType import ConfigurationCommand...
apache-2.0
nichung/wwwflaskBlogrevA
env/lib/python2.7/site-packages/pip/log.py
143
6371
"""Logging """ import sys import logging from pip import backwardcompat class Logger(object): """ Logging object for use in command-line script. Allows ranges of levels, to avoid some redundancy of displayed information. """ VERBOSE_DEBUG = logging.DEBUG - 1 DEBUG = logging.DEBUG INFO =...
mit
frdb194/django
tests/csrf_tests/tests.py
78
23643
# -*- coding: utf-8 -*- from __future__ import unicode_literals import logging from django.conf import settings from django.http import HttpRequest, HttpResponse from django.middleware.csrf import ( CSRF_KEY_LENGTH, CsrfViewMiddleware, get_token, ) from django.template import RequestContext, Template from django....
bsd-3-clause
neuroidss/bitcoin
qa/rpc-tests/walletbackup.py
132
7263
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Exercise the wallet backup code. Ported from walletbackup.sh. Test case is: 4 nodes. 1 2 and 3 send tran...
mit
carlosperate/mu
mu/modes/pyboard.py
3
6750
""" A mode for working with Adafuit's line of Circuit Python boards. Copyright (c) 2015-2017 Nicholas H.Tollervey and others (see the AUTHORS file). 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, e...
gpl-3.0
goshan/PokemonGo-Bot
pokemongo_bot/cell_workers/camp_fort.py
4
9108
# -*- coding: utf-8 -*- from __future__ import unicode_literals import math import time from geopy.distance import great_circle from pokemongo_bot.base_task import BaseTask from pokemongo_bot.cell_workers.utils import coord2merc, merc2coord from pokemongo_bot.constants import Constants from pokemongo_bot.walkers.poly...
mit
hzy001/ansible
lib/ansible/parsing/vault/__init__.py
40
20086
# (c) 2014, James Tanner <tanner.jc@gmail.com> # # 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 distributed i...
gpl-3.0
petermat/phantomjs
src/breakpad/src/third_party/protobuf/protobuf/python/google/protobuf/internal/text_format_test.py
252
22615
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
bsd-3-clause
Polytechnique-org/xorgauth
xorgauth/accounts/migrations/0012_make_user_names_blank.py
1
1028
# -*- coding: utf-8 -*- # Generated by Django 1.11.9 on 2018-01-04 13:41 from __future__ import unicode_literals from django.db import migrations, models import xorgauth.utils.fields class Migration(migrations.Migration): dependencies = [ ('accounts', '0011_make_user_ids_blank'), ] operations =...
agpl-3.0
utamaro/youtube-dl
youtube_dl/extractor/techtalks.py
170
2432
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( get_element_by_attribute, clean_html, ) class TechTalksIE(InfoExtractor): _VALID_URL = r'https?://techtalks\.tv/talks/[^/]*/(?P<id>\d+)/' _TEST = { 'url': 'http://techtalks.tv/talks/lea...
unlicense
Coxxs/shadowsocks
shadowsocks/crypto/rc4_md5.py
1042
1339
#!/usr/bin/env python # # Copyright 2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
wrouesnel/ansible
lib/ansible/modules/notification/pushover.py
70
3231
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2012, Jim Richardson <weaselkeeper@gmail.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_METADATA = {'metadata_vers...
gpl-3.0
forumber/temiz_kernel_g2
toolchain/share/gdb/python/gdb/__init__.py
83
3452
# Copyright (C) 2010-2014 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...
gpl-2.0
rkashapov/buildbot
master/buildbot/www/hooks/gitorious.py
3
2932
# This file is part of Buildbot. Buildbot 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, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
fanout/mongrel2
examples/python/mongrel2/config/model.py
92
7490
from storm.locals import * database = None store = None TABLES = ["server", "host", "route", "proxy", "directory", "handler", "setting"] def load_db(spec): global database global store if not store: database = create_database(spec) store = Store(database) return st...
bsd-3-clause
hehongliang/tensorflow
tensorflow/contrib/learn/python/learn/estimators/stability_test.py
25
6445
# 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
grilo/ansible-1
lib/ansible/modules/network/a10/a10_service_group.py
27
13230
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Mischa Peters <mpeters@a10networks.com>, # Eric Chou <ericc@a10networks.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__ = t...
gpl-3.0
Souloist/Audio-Effects
Effects/Amplitude_Modulation/AM_example.py
1
1911
# Play a wave file with amplitude modulation. # Assumes wave file is mono. # This implementation reads and plays a one frame (sample) at a time (no blocking) """ Read a signal from a wave file, do amplitude modulation, play to output Original: pyrecplay_modulation.py by Gerald Schuller, Octtober 2013 Modified to read ...
mit
andrewleech/WeasyPrint
weasyprint/urls.py
4
10964
# coding: utf8 """ weasyprint.utils ---------------- Various utility functions and classes. :copyright: Copyright 2011-2014 Simon Sapin and contributors, see AUTHORS. :license: BSD, see LICENSE for details. """ from __future__ import division, unicode_literals import io import re import sys imp...
bsd-3-clause
mattpitkin/GraWIToNStatisticsLectures
figures/scripts/pvalue.py
1
1242
#!/usr/bin/env python """ Make plots showing how to calculate the p-value """ import matplotlib.pyplot as pl from scipy.stats import norm from scipy.special import erf import numpy as np mu = 0. # the mean, mu sigma = 1. # standard deviation x = np.linspace(-4, 4, 1000) # x # set plot to render labels using latex ...
mit
4Quant/tensorflow
tensorflow/python/summary/event_accumulator_test.py
4
24047
# Copyright 2015 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 a...
apache-2.0
helldorado/ansible
lib/ansible/modules/network/nxos/nxos_overlay_global.py
84
5899
#!/usr/bin/python # # 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 distribut...
gpl-3.0
asdfsx/chardet
chardet/mbcsgroupprober.py
343
2012
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
lgpl-2.1
Alphadelta14/ansible
v1/ansible/runner/lookup_plugins/subelements.py
174
2860
# (c) 2013, Serge van Ginderachter <serge@vanginderachter.be> # # 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)...
gpl-3.0
mozvip/Sick-Beard
sickbeard/logger.py
1
6374
# Author: Nic Wolfe <nic@wolfeden.ca> # URL: http://code.google.com/p/sickbeard/ # # This file is part of Sick Beard. # # Sick Beard 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 t...
gpl-3.0
RuiNascimento/krepo
script.module.lambdascrapers/lib/lambdascrapers/sources_notworking/lambdascrapers(11_9)/rajahoki88.py
3
5921
# -*- coding: UTF-8 -*- ####################################################################### # ---------------------------------------------------------------------------- # "THE BEER-WARE LICENSE" (Revision 42): # @Daddy_Blamo wrote this file. As long as you retain this notice you # can do whatever you want wi...
gpl-2.0
dabiboo/youtube-dl
youtube_dl/extractor/rutv.py
106
7702
# encoding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( ExtractorError, int_or_none ) class RUTVIE(InfoExtractor): IE_DESC = 'RUTV.RU' _VALID_URL = r'''(?x) https?://player\.(?:rutv\.ru|vgtrk\.com)/ (?P<path>flas...
unlicense
pixbuffer/django-cms
cms/tests/placeholder.py
3
33277
# -*- coding: utf-8 -*- from __future__ import with_statement from cms import constants from cms.api import add_plugin, create_page from cms.exceptions import DuplicatePlaceholderWarning from cms.models.fields import PlaceholderField from cms.models.placeholdermodel import Placeholder from cms.plugin_pool import plugin...
bsd-3-clause
tomjelinek/pcs
pcs_test/tier0/lib/corosync/test_qdevice_net.py
3
29866
import base64 import os.path from textwrap import dedent from unittest import mock, TestCase from pcs_test.tools.assertions import assert_raise_library_error from pcs_test.tools.misc import get_test_resource, get_tmp_dir from pcs import settings from pcs.common import reports from pcs.common.reports import ReportItem...
gpl-2.0
dpshelio/scikit-image
skimage/io/_plugins/qt_plugin.py
15
5534
from .util import prepare_for_display, window_manager import numpy as np # We try to aquire the gui lock first or else the gui import might # trample another GUI's PyOS_InputHook. window_manager.acquire('qt') try: from PyQt4.QtGui import (QApplication, QImage, QLabel, QMainWindow, QPi...
bsd-3-clause
c2corg/v6_api
c2corg_api/search/mappings/image_mapping.py
1
1144
from c2corg_api.models.image import IMAGE_TYPE, Image from c2corg_api.search.mapping import SearchDocument, BaseMeta from c2corg_api.search.mapping_types import QueryableMixin, QEnumArray, \ QInteger, QDate class SearchImage(SearchDocument): class Meta(BaseMeta): doc_type = IMAGE_TYPE activities ...
agpl-3.0
amrdraz/kodr
app/brython/www/src/Lib/test/test_importlib/import_/test_relative_imports.py
33
8883
"""Test relative imports (PEP 328).""" from .. import util from . import util as import_util import sys import unittest class RelativeImports(unittest.TestCase): """PEP 328 introduced relative imports. This allows for imports to occur from within a package without having to specify the actual package name. ...
mit
michaelhowden/eden
controllers/event.py
4
9574
# -*- coding: utf-8 -*- """ Event Module - Controllers http://eden.sahanafoundation.org/wiki/BluePrintScenario """ module = request.controller resourcename = request.function if not settings.has_module(module): raise HTTP(404, body="Module disabled: %s" % module) # -------------------------------------...
mit
alexkolar/Wooey
wooey/tests/scripts/fetch_cats.py
3
2360
#!/usr/bin/env python __author__ = 'Chris Mitchell' # Code modified from http://stackoverflow.com/questions/20718819/downloading-images-from-google-search-using-python-gives-error import argparse import sys import os import imghdr from urllib import FancyURLopener import urllib2 import json description = """ This wi...
bsd-3-clause
mwmuni/LIGGGHTS_GUI
networkx/algorithms/traversal/edgedfs.py
33
6860
""" =========================== Depth First Search on Edges =========================== Algorithms for a depth-first traversal of edges in a graph. """ FORWARD = 'forward' REVERSE = 'reverse' __all__ = ['edge_dfs'] def helper_funcs(G, orientation): """ These are various G-specific functions that help us im...
gpl-3.0
mahak/ansible
test/units/playbook/test_block.py
58
2714
# (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
vivekanand1101/stanford-corenlp-python
corenlp/progressbar.py
30
13562
#!/usr/bin/python # -*- coding: iso-8859-1 -*- # # progressbar - Text progressbar library for python. # Copyright (c) 2005 Nilton Volpato # # This library 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...
gpl-2.0
ar4s/django
django/forms/widgets.py
1
32506
""" HTML Widget classes """ from __future__ import unicode_literals import copy from itertools import chain import warnings from django.conf import settings from django.forms.utils import flatatt, to_current_timezone from django.utils.datastructures import MultiValueDict, MergeDict from django.utils.html import cond...
bsd-3-clause
rvalyi/geraldo
site/newsite/site-geraldo/django/db/backends/oracle/creation.py
13
11940
import sys, time from django.conf import settings from django.core import management from django.db.backends.creation import BaseDatabaseCreation TEST_DATABASE_PREFIX = 'test_' PASSWORD = 'Im_a_lumberjack' class DatabaseCreation(BaseDatabaseCreation): # This dictionary maps Field objects to their associated Oracl...
lgpl-3.0
gangadharkadam/johnerp
erpnext/stock/doctype/packing_slip/packing_slip.py
10
6100
# Copyright (c) 2013, Web Notes 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 flt, cint from frappe import _ from frappe.model.document import Document class PackingSlip(Document): def...
agpl-3.0
suntopo/shadowsocks
shadowsocks/crypto/openssl.py
1038
5414
#!/usr/bin/env python # # Copyright 2015 clowwindy # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
jupierce/openshift-tools
scripts/monitoring/cron-send-usage-pv.py
3
4617
#!/usr/bin/env python """ Report the usage of the pv """ # We just want to see any exception that happens # don't want the script to die under any cicumstances # script must try to clean itself up # pylint: disable=broad-except # main() function has a lot of setup and error handling # pylint: disable=too-many-stateme...
apache-2.0
stamhe/facebook_mysql
xtrabackup/test/kewpie/lib/util/randgen_methods.py
26
2365
#! /usr/bin/env python # -*- mode: python; indent-tabs-mode: nil; -*- # vim:expandtab:shiftwidth=2:tabstop=2:smarttab: # # Copyright (C) 2011 Patrick Crews # # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Softwar...
gpl-2.0