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 |
|---|---|---|---|---|---|
greyhwndz/rethinkdb | external/v8_3.30.33.16/tools/presubmit.py | 35 | 14090 | #!/usr/bin/env python
#
# Copyright 2012 the V8 project 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:
#
# * Redistributions of source code must retain the above copyright
# noti... | agpl-3.0 |
ribeiro-ucl/viewflow | tests/unit/tests/test_db_fields.py | 2 | 2790 | from django.test import TestCase
from viewflow.token import Token
from viewflow.fields import ClassValueWrapper
from ..models import FlowReferencedModel, TokenModel
from ..flows import SingleTaskFlow, AllTaskFlow
class TestReferenceFields(TestCase):
"""
Custom db field for store referencies to class
"""
... | agpl-3.0 |
yanheven/cinder | cinder/api/views/backups.py | 8 | 3833 | # Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# 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/LICEN... | apache-2.0 |
ffu/DSA-3.2.2 | gnuradio-core/src/python/gnuradio/gr/qa_interleave.py | 6 | 2818 | #!/usr/bin/env python
#
# Copyright 2004,2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio 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, or (at your opt... | gpl-3.0 |
perlygatekeeper/glowing-robot | google_test/free_the_bunny_prisoners/solution_5_fails.py | 1 | 1090 | import itertools
def solution(bunnies,keys_required):
answer = []
for i in range(bunnies):
answer.append([])
# if keys_required > bunnies:
# return None
if keys_required == 0:
return [[0]]
elif keys_required == 1:
key = 0
for group in range(bunnies):
... | artistic-2.0 |
techdragon/nikola | nikola/plugins/compile/pandoc.py | 9 | 2903 | # -*- coding: utf-8 -*-
# Copyright © 2012-2015 Roberto Alsina and others.
# 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 t... | mit |
mdespriee/spark | examples/src/main/python/sql/streaming/structured_network_wordcount_windowed.py | 51 | 4086 | #
# 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 |
adamncasey/servo | tests/wpt/web-platform-tests/css/tools/w3ctestlib/Suite.py | 80 | 4441 | #!/usr/bin/python
# CSS Test Suite Manipulation Library
# Initial code by fantasai, joint copyright 2010 W3C and Microsoft
# Licensed under BSD 3-Clause: <http://www.w3.org/Consortium/Legal/2008/03-bsd-license>
import OutputFormats
import Utils
from Groups import TestGroup, excludeDirs
from Sources import SourceTree, ... | mpl-2.0 |
mrjmad/nagademon_2014 | nagademon2014/maingame/models/history_elements.py | 1 | 6460 | # -*- coding: utf-8 -*-
from __future__ import (print_function, division, absolute_import, unicode_literals)
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from django.db import models
USER_MODEL = settings.AUTH_U... | mit |
Evilsmevil/Tinderbox | lib/werkzeug/contrib/securecookie.py | 318 | 12204 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.securecookie
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module implements a cookie that is not alterable from the client
because it adds a checksum the server checks for. You can use it as
session replacement if all you have is a user id or something to mark
... | apache-2.0 |
synergeticsedx/deployment-wipro | common/test/acceptance/pages/lms/login_and_register.py | 8 | 13114 | """Login and Registration pages """
from urllib import urlencode
from bok_choy.page_object import PageObject, unguarded
from bok_choy.promise import Promise, EmptyPromise
from common.test.acceptance.pages.lms import BASE_URL
from common.test.acceptance.pages.lms.dashboard import DashboardPage
class RegisterPage(Page... | agpl-3.0 |
rohitwaghchaure/erpnext_develop | erpnext/setup/doctype/currency_exchange/test_currency_exchange.py | 12 | 3584 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe, unittest
from erpnext.setup.utils import get_exchange_rate
test_records = frappe.get_test_records('Currency Exchange')
def save_new_rec... | gpl-3.0 |
s1n4/django-categories | categories/migrations/0011_move_category_fks.py | 14 | 3989 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import DataMigration
from django.db import models
class Migration(DataMigration):
def forwards(self, orm):
"Write your forwards methods here."
orm.CategoryRelation.objects.update(category=models.F('story'))
def backwards(... | apache-2.0 |
byt3bl33d3r/Empire | lib/modules/powershell/privesc/bypassuac_fodhelper.py | 12 | 4031 | from lib.common import helpers
class Module:
def __init__(self, mainMenu, params=[]):
self.info = {
'Name': 'Invoke-FodHelperBypass',
'Author': ['Petr Medonos'],
'Description': ("Bypasses UAC by performing an registry modification for FodHelper (based on"
... | bsd-3-clause |
marcsans/cnn-physics-perception | phy/lib/python2.7/site-packages/sklearn/utils/linear_assignment_.py | 67 | 9524 | """
Solve the unique lowest-cost assignment problem using the
Hungarian algorithm (also known as Munkres algorithm).
"""
# Based on original code by Brain Clapper, adapted to NumPy by Gael Varoquaux.
# Heavily refactored by Lars Buitinck.
#
# TODO: a version of this algorithm has been incorporated in SciPy; use that
#... | mit |
vitale232/ves | ves/VESinverse_vectorized.py | 1 | 12839 | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 28 16:32:48 2016
@author: jclark
this code uses the Ghosh method to determine the apparent resistivities
for a layered earth model. Either schlumberger or Wenner configurations
can be used
"""
import numpy as np
import random
import matplotlib
matplotlib... | lgpl-3.0 |
cluckmaster/MissionPlanner | Lib/locale.py | 50 | 90840 | """ Locale support.
The module provides low-level access to the C lib's locale APIs
and adds high level number formatting APIs as well as a locale
aliasing engine to complement these.
The aliasing engine includes support for many commonly used locale
names and maps them to values suitable f... | gpl-3.0 |
mikoim/funstuff | null/crawler/tt2db.py | 1 | 1709 | # -*- coding: utf-8 -*-
import urllib.request
import time
import pymongo
import http.client
import re
def httpWrapper(url):
try:
data_raw = urllib.request.urlopen(url).read().decode('utf-8')
except:
return "NULL"
return data_raw
def getGirlName(data_raw):
matches = re.findall('名前[ ]+... | mit |
sencha/chromium-spacewalk | tools/auto_bisect/bisect_utils.py | 6 | 16659 | # 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.
"""Utility functions used by the bisect tool.
This includes functions related to checking out the depot and outputting
annotations for the Buildbot waterfal... | bsd-3-clause |
jdobes/cobbler | cobbler/item.py | 1 | 13896 | """
An Item is a serializable thing that can appear in a Collection
Copyright 2006-2009, Red Hat, Inc
Michael DeHaan <mdehaan@redhat.com>
This software may be freely redistributed under the terms of the GNU
general public license.
You should have received a copy of the GNU General Public License
along with this prog... | gpl-2.0 |
bwp/SeleniumWebDriver | py/test/selenium/webdriver/common/cookie_tests.py | 28 | 3282 | import calendar
import time
import unittest
import random
import pytest
from selenium.test.selenium.webdriver.common import utils
class CookieTest(unittest.TestCase):
def setUp(self):
self._loadPage("simpleTest")
# Set the cookie to expire in 30 minutes
timestamp = calendar.timegm(time.gm... | apache-2.0 |
abhikumar22/MYBLOG | blg/Lib/site-packages/pip/_vendor/requests/packages/chardet/euctwprober.py | 2994 | 1676 | ######################## 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... | gpl-3.0 |
Jannes123/inasafe | safe/utilities/test/test_printing.py | 10 | 1055 | __author__ = 'timlinux'
import unittest
from safe.utilities.printing import (
mm_to_points,
points_to_mm,
dpi_to_meters)
class TestPrinting(unittest.TestCase):
def test_mm_to_points(self):
"""Test that conversions between pixel and page dimensions work."""
dpi = 300
pixels =... | gpl-3.0 |
yac/packstack | tests/installer/test_processors.py | 5 | 1621 | # -*- coding: utf-8 -*-
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LI... | apache-2.0 |
Tetpay/cjdns | node_build/dependencies/libuv/build/gyp/test/mac/gyptest-xcode-env-order.py | 75 | 3463 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies that dependent Xcode settings are processed correctly.
"""
import TestGyp
import subprocess
import sys
def XcodeVersion():
... | gpl-3.0 |
Antiun/server-tools | module_prototyper/models/module_prototyper.py | 26 | 20598 | # -*- encoding: utf-8 -*-
# #############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2010 - 2014 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it ... | agpl-3.0 |
digifant/eMonitor | tools/update-osm-data.py | 1 | 10402 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import logging
import logging.handlers
import traceback
import os
import time
from optparse import OptionParser
import MySQLdb
import codecs
import requests
import sys
import pdb
import argparse
from pprint import pprint
def osmWebUrl (lat,lng):
return "http://www.openstr... | bsd-3-clause |
graingert/ansible | lib/ansible/plugins/connections/winrm.py | 12 | 12782 | # (c) 2014, Chris Church <chris@ninemoreminutes.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) any lat... | gpl-3.0 |
ntuecon/server | pyenv/Lib/site-packages/pip/commands/completion.py | 343 | 2453 | from __future__ import absolute_import
import sys
from pip.basecommand import Command
BASE_COMPLETION = """
# pip %(shell)s completion start%(script)s# pip %(shell)s completion end
"""
COMPLETION_SCRIPTS = {
'bash': """
_pip_completion()
{
COMPREPLY=( $( COMP_WORDS="${COMP_WORDS[*]}" \\
CO... | bsd-3-clause |
suma12/asterix | asterix/APDU.py | 1 | 31348 | """ asterix/APDU.py
__author__ = "Petr Tobiska"
Author: Petr Tobiska, mailto:petr.tobiska@gmail.com
This file is part of asterix, a framework for communication with smartcards
based on pyscard. This file implements handfull APDU commands.
asterix is free software; you can redistribute it and/or modify
it under th... | lgpl-2.1 |
linglung/ytdl | youtube_dl/extractor/playtvak.py | 36 | 6794 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
compat_urllib_parse_urlencode,
)
from ..utils import (
ExtractorError,
int_or_none,
parse_iso8601,
qualities,
)
class PlaytvakIE(InfoExtractor):
IE_DESC = 'Pla... | unlicense |
xkcd1253/SocialNetworkforTwo | flask/lib/python2.7/site-packages/pip-1.4.1-py2.7.egg/pip/vendor/html5lib/treewalkers/genshistream.py | 1730 | 2278 | from __future__ import absolute_import, division, unicode_literals
from genshi.core import QName
from genshi.core import START, END, XML_NAMESPACE, DOCTYPE, TEXT
from genshi.core import START_NS, END_NS, START_CDATA, END_CDATA, PI, COMMENT
from . import _base
from ..constants import voidElements, namespaces
class ... | gpl-2.0 |
Split-Screen/android_kernel_lge_gee | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
maljac/odoomrp-wip | mrp_bom_by_percentage/__openerp__.py | 18 | 1240 | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the... | agpl-3.0 |
xerond/lucia | ledEditor/cfilegen.py | 1 | 2560 | from effectgroup import EffectGroup
from effectdescriptions import EffectDescriptions
from myutils import Utils
def generateFile(fileName,ledCount,effectGroups):
f = open(fileName,'w')
f.write("#ifndef H_SONG_INSTRUCTIONS\n#define H_SONG_INSTRUCTIONS\n#include \"avr/pgmspace.h\"\n#include \"song_instructions.h\"\nco... | mit |
initNirvana/Easyphotos | env/lib/python3.4/site-packages/IPython/core/tests/test_extension.py | 36 | 3025 | import os.path
import nose.tools as nt
import IPython.testing.tools as tt
from IPython.utils.syspathcontext import prepended_to_syspath
from IPython.utils.tempdir import TemporaryDirectory
ext1_content = """
def load_ipython_extension(ip):
print("Running ext1 load")
def unload_ipython_extension(ip):
print("... | mit |
notepadqq/NotepadqqApi_Python | notepadqq_api/notepadqq_api.py | 1 | 3531 | import asyncio
import sys
from notepadqq_api.message_channel import MessageChannel
from notepadqq_api.message_interpreter import MessageInterpreter
from notepadqq_api.stubs import Stubs
class NotepadqqApi():
"""Provides access to the Notepadqq Api."""
_NQQ_STUB_ID = 1
def __init__(self, socket_path=None... | mit |
deepsrijit1105/edx-platform | scripts/release.py | 37 | 20364 | #!/usr/bin/env python
"""
a release-master multitool
"""
from __future__ import print_function, unicode_literals
import sys
import argparse
from datetime import date, timedelta
import re
import collections
import functools
import textwrap
import json
import getpass
try:
from path import Path as path
from git i... | agpl-3.0 |
VinceZK/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/checkout.py | 119 | 9383 | # Copyright (c) 2010 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | bsd-3-clause |
bartolkaruza/selenium | py/test/selenium/webdriver/common/proxy_tests.py | 65 | 5759 | # 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 |
Kamik423/uni_plan | plan/plan/lib64/python3.4/site-packages/flask/ctx.py | 170 | 14739 | # -*- coding: utf-8 -*-
"""
flask.ctx
~~~~~~~~~
Implements the objects required to keep the context.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
from functools import update_wrapper
from werkzeug.exceptions import HTTPException
from .globa... | apache-2.0 |
ksmit799/Toontown-Source | toontown/minigame/MazeBase.py | 2 | 5514 | from pandac.PandaModules import VBase3
from direct.showbase.RandomNumGen import RandomNumGen
class MazeBase:
def __init__(self, model, mazeData, cellWidth, parent = None):
if parent is None:
parent = render
self.width = mazeData['width']
self.height = mazeData['height']
... | mit |
srm912/servo | components/script/dom/bindings/codegen/ply/ply/yacc.py | 319 | 128492 | # -----------------------------------------------------------------------------
# ply: yacc.py
#
# Copyright (C) 2001-2009,
# David M. Beazley (Dabeaz LLC)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | mpl-2.0 |
brendandburns/tensorflow | tensorflow/python/kernel_tests/pooling_ops_test.py | 5 | 36678 | """Functional tests for pooling operations."""
from __future__ import print_function
import tensorflow.python.platform
import numpy as np
import tensorflow as tf
from tensorflow.python.kernel_tests import gradient_checker as gc
from tensorflow.python.ops import gen_nn_ops
def GetInceptionMaxPoolShapes():
"""Itera... | apache-2.0 |
rackerlabs/deuce-valere | deucevalere/common/validation.py | 1 | 1337 | """
Deuce Valere - Common - Validation
"""
import datetime
from deuceclient.api import *
from deuceclient.auth.base import AuthenticationBase
from deuceclient.client.deuce import DeuceClient
from deuceclient.common.validation import *
from deuceclient.common.validation_instance import *
from stoplight import Rule, Val... | apache-2.0 |
KokareIITP/django | django/template/loaders/base.py | 137 | 3887 | import warnings
from django.template import Origin, Template, TemplateDoesNotExist
from django.utils.deprecation import RemovedInDjango20Warning
from django.utils.inspect import func_supports_parameter
class Loader(object):
# Only used to raise a deprecation warning. Remove in Django 1.10.
is_usable = False
... | bsd-3-clause |
hkhamm/django_rest_tutorial_2 | env/lib/python2.7/site-packages/pip/_vendor/requests/packages/charade/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 |
ehashman/oh-mainline | vendor/packages/requests/requests/packages/chardet/compat.py | 2943 | 1157 | ######################## BEGIN LICENSE BLOCK ########################
# Contributor(s):
# Ian Cordasco - port to Python
#
# 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; either
# versio... | agpl-3.0 |
tedder/ansible | lib/ansible/plugins/action/assemble.py | 60 | 6409 | # (c) 2013-2016, Michael DeHaan <michael.dehaan@gmail.com>
# Stephen Fromm <sfromm@gmail.com>
# Brian Coca <briancoca+dev@gmail.com>
# Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under t... | gpl-3.0 |
alx-eu/django | django/contrib/localflavor/se/utils.py | 104 | 2430 | import datetime
from django.utils import six
def id_number_checksum(gd):
"""
Calculates a Swedish ID number checksum, using the
"Luhn"-algoritm
"""
n = s = 0
for c in (gd['year'] + gd['month'] + gd['day'] + gd['serial']):
tmp = ((n % 2) and 1 or 2) * int(c)
if tmp > 9:
... | bsd-3-clause |
alvaroaleman/ansible | lib/ansible/modules/network/f5/bigip_pool_member.py | 21 | 16787 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2013, Matt Hite <mhite@hotmail.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 Licens... | gpl-3.0 |
lmprice/ansible | lib/ansible/modules/windows/win_certificate_store.py | 16 | 6975 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCU... | gpl-3.0 |
gchinellato/Self-Balance-Robot | examples/Adafruit-Raspberry-Pi-Python-Code/Adafruit_LEDpixels/Adafruit_LEDpixels.py | 5 | 2078 | #!/usr/bin/env python
# Test code for Adafruit LED Pixels, uses hardware SPI
import RPi.GPIO as GPIO, time, os
DEBUG = 1
GPIO.setmode(GPIO.BCM)
def slowspiwrite(clockpin, datapin, byteout):
GPIO.setup(clockpin, GPIO.OUT)
GPIO.setup(datapin, GPIO.OUT)
for i in range(8):
if (byteout & 0x80):
GPIO.output(datap... | gpl-3.0 |
foodszhang/kbengine | kbe/res/scripts/common/Lib/tkinter/test/test_ttk/test_style.py | 94 | 2900 | import unittest
import tkinter
from tkinter import ttk
from test.support import requires, run_unittest
from tkinter.test.support import AbstractTkTest
requires('gui')
class StyleTest(AbstractTkTest, unittest.TestCase):
def setUp(self):
super().setUp()
self.style = ttk.Style(self.root)
def t... | lgpl-3.0 |
adlius/osf.io | osf/migrations/0150_fix_deleted_preprints.py | 11 | 1216 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-12-14 19:31
from __future__ import unicode_literals
import datetime as dt
from django.db import connection
from django.db import migrations
import pytz
dummy_datetime = dt.datetime(1970, 1, 1, tzinfo=pytz.UTC)
def forward(state, *args, **kwargs):
Prep... | apache-2.0 |
dhenrygithub/QGIS | python/ext-libs/future/past/types/oldstr.py | 62 | 4300 | """
Pure-Python implementation of a Python 2-like str object for Python 3.
"""
from collections import Iterable
from numbers import Integral
from past.utils import PY2, with_metaclass
_builtin_bytes = bytes
class BaseOldStr(type):
def __instancecheck__(cls, instance):
return isinstance(instance, _buil... | gpl-2.0 |
hemebond/kapua | courses/views.py | 1 | 4832 | # Copyright 2011 James O'Neill
#
# This file is part of Kapua.
#
# Kapua 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.
#
# Kapua is d... | gpl-3.0 |
Pikl/PiklBot | cogs/pikl.py | 1 | 1281 | import discord
from discord.ext import commands
class Pikl:
"""Super pikly commands."""
def __init__(self, bot):
self.bot = bot
@commands.command(hidden=False)
async def helloworld(self):
"""Hello, world!"""
await self.bot.say("Hello, world!")
@commands.command(hidden=False)
async def postraidembed(sel... | gpl-3.0 |
CharlesMcKinnis/stack-recon | stack-recon/mysql/connector/conversion.py | 15 | 19710 | # MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptio... | apache-2.0 |
keyurpatel076/MissionPlannerGit | Lib/site-packages/scipy/optimize/zeros.py | 55 | 16072 |
import warnings
import _zeros
from numpy import finfo
_iter = 100
_xtol = 1e-12
# not actually used at the moment
_rtol = finfo(float).eps * 2
__all__ = ['newton', 'bisect', 'ridder', 'brentq', 'brenth']
CONVERGED = 'converged'
SIGNERR = 'sign error'
CONVERR = 'convergence error'
flag_map = {0 : CONVERGED, -1 : SI... | gpl-3.0 |
lotosbin/weixin_sogou | weixin_sogou.py | 8 | 5775 | from selenium import webdriver
import selenium
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from bs4 import BeautifulSoup
import requests
import logging
import re
import time
from urllib.parse import quote
import random
BASE_URL = 'http://weixin.sogou.com'
UA = "Mozilla/5.0 (Windows ... | mit |
anryko/ansible | test/units/plugins/lookup/test_avi.py | 23 | 3126 | # -*- coding: utf-8 -*-
# (c) 2019, Sandeep Bandi <sandeepb@avinetworks.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
# (... | gpl-3.0 |
EHRI/rspub-core | rspub/util/resourcefilter.py | 2 | 1207 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import re
import dateutil.parser
def hidden_file_predicate():
# in Python 3.5 this should work
# return lambda file_path : bool(os.stat(file_path).st_file_attributes & os.stat.FILE_ATTRIBUTE_HIDDEN)
return lambda file_path: isinstance(file_path, s... | apache-2.0 |
hsluo/youtube-dl | youtube_dl/extractor/eighttracks.py | 121 | 5868 | # coding: utf-8
from __future__ import unicode_literals
import json
import random
from .common import InfoExtractor
from ..compat import (
compat_str,
)
from ..utils import (
ExtractorError,
)
class EightTracksIE(InfoExtractor):
IE_NAME = '8tracks'
_VALID_URL = r'https?://8tracks\.com/(?P<user>[^/]+... | unlicense |
noba3/KoTos | addons/script.module.pyamf/lib/pyamf/tests/gateway/test_django.py | 26 | 6094 | # -*- coding: utf-8 -*-
#
# Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Django gateway tests.
@since: 0.1.0
"""
import unittest
import sys
import os
try:
from django import http
from pyamf.remoting.gateway import django
except ImportError:
django = None
import pyamf
from pyamf i... | gpl-2.0 |
devs1991/test_edx_docmode | venv/lib/python2.7/site-packages/subunit/tests/__init__.py | 2 | 2599 | #
# subunit: extensions to python unittest to get test results from subprocesses.
# Copyright (C) 2005 Robert Collins <robertc@robertcollins.net>
#
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
# license at the users choice. A copy of both licenses are available in the
# project sour... | agpl-3.0 |
Teagan42/home-assistant | homeassistant/components/tradfri/switch.py | 4 | 1789 | """Support for IKEA Tradfri switches."""
from homeassistant.components.switch import SwitchDevice
from .base_class import TradfriBaseDevice
from .const import CONF_GATEWAY_ID, KEY_API, KEY_GATEWAY
async def async_setup_entry(hass, config_entry, async_add_entities):
"""Load Tradfri switches based on a config entr... | apache-2.0 |
ThomasFeher/audacity | lib-src/lv2/lilv/waflib/Tools/xlc.py | 330 | 1175 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from waflib.Tools import ccroot,ar
from waflib.Configure import conf
@conf
def find_xlc(conf):
cc=conf.find_program(['xlc_r','xlc'],var='CC')
cc=conf.cmd_to_list(cc)
conf.g... | gpl-2.0 |
jtwaleson/decrypt | decrypt/decrypt.py | 1 | 1745 | #!/usr/bin/env python
import curses
import time
import fileinput
import random
import string
screen = curses.initscr()
lines = []
chance = 0.1
confirmed_per_line = []
def main():
curses.noecho()
try:
curses.curs_set(0)
except:
pass
screen.keypad(1)
try:
for line in fileinp... | mit |
unindented/streamcode | client/static/jsrepl/extern/python/unclosured/lib/python2.7/shlex.py | 306 | 11137 | # -*- coding: iso-8859-1 -*-
"""A lexical analyzer class for simple shell-like syntaxes."""
# Module and documentation by Eric S. Raymond, 21 Dec 1998
# Input stacking and error message cleanup added by ESR, March 2000
# push_source() and pop_source() made explicit by ESR, January 2001.
# Posix compliance, split(), st... | mit |
SMALLplayer/smallplayer-image-creator | storage/.xbmc/addons/script.module.requests/lib/requests/packages/charade/jpcntx.py | 151 | 19323 | ######################## 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 Ri... | gpl-2.0 |
JacerOmri/PokemonGo-Bot-Desktop | pywin/Lib/pydoc_data/topics.py | 8 | 663244 | # -*- coding: utf-8 -*-
# Autogenerated by Sphinx on Sat Jun 11 14:41:12 2016
topics = {'assert': '\n'
'The "assert" statement\n'
'**********************\n'
'\n'
'Assert statements are a convenient way to insert debugging '
'assertions\n'
'into a program... | mit |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/selenium/webdriver/firefox/firefox_profile.py | 2 | 14867 | # 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... | gpl-3.0 |
acsone/Arelle | arelle/RenderingEvaluator.py | 2 | 16837 | '''
Created on Jun 6, 2012
@author: Mark V Systems Limited
(c) Copyright 2012 Mark V Systems Limited, All rights reserved.
'''
from arelle import XPathContext, XbrlConst, XmlUtil
from arelle.ModelFormulaObject import (aspectModels, aspectStr, Aspect)
from arelle.ModelRenderingObject import (CHILD_ROLLUP_FIRST, CHILD_R... | apache-2.0 |
SteveHNH/ansible | lib/ansible/modules/windows/win_stat.py | 26 | 7647 | #!/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 distributed... | gpl-3.0 |
moraesnicol/scrapy | tests/test_downloadermiddleware_cookies.py | 116 | 10382 | import re
import logging
from unittest import TestCase
from testfixtures import LogCapture
from scrapy.http import Response, Request
from scrapy.spiders import Spider
from scrapy.utils.test import get_crawler
from scrapy.exceptions import NotConfigured
from scrapy.downloadermiddlewares.cookies import CookiesMiddleware... | bsd-3-clause |
sajeeshcs/nested_quota_final | nova/compute/monitors/cpu_monitor.py | 63 | 2132 | # Copyright 2013 Intel Corporation.
# 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 requir... | apache-2.0 |
Impactstory/total-impact-webapp | test/unit_tests/providers/test_altmetric_com.py | 2 | 3833 | from test.unit_tests.providers import common
from test.unit_tests.providers.common import ProviderTestCase
from totalimpact.providers.provider import Provider, ProviderContentMalformedError
from test.utils import http
import os
import collections
import pprint
from nose.tools import assert_equals, assert_items_equal, ... | mit |
vdrhtc/Measurement-automation | drivers/pyspcm.py | 1 | 7735 | import os
import platform
import sys
from ctypes import *
# load registers for easier access
from drivers.py_header.regs import *
# load registers for easier access
from drivers.py_header.spcerr import *
SPCM_DIR_PCTOCARD = 0
SPCM_DIR_CARDTOPC = 1
SPCM_BUF_DATA = 1000 # main data buffer for acquired or genera... | gpl-3.0 |
Dev-Cloud-Platform/Dev-Cloud | dev_cloud/web_service/urls/user/environment.py | 1 | 5340 | # -*- coding: utf-8 -*-
# @COPYRIGHT_begin
#
# Copyright [2015] Michał Szczygieł, M4GiK Software
#
# 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 |
Yuriy-Leonov/nova | nova/tests/api/openstack/compute/contrib/test_flavor_swap.py | 11 | 3422 | # Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | apache-2.0 |
yinquan529/platform-external-chromium_org | third_party/closure_linter/closure_linter/fixjsstyle_test.py | 135 | 7371 | #!/usr/bin/env python
#
# Copyright 2008 The Closure Linter 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
#... | bsd-3-clause |
vahgar/mutagen | tests/test_easyid3.py | 4 | 12780 | import os
import shutil
import pickle
from tests import TestCase
from mutagen.id3 import ID3FileType, ID3
from mutagen.easyid3 import EasyID3, error as ID3Error
from mutagen._compat import PY3
from tempfile import mkstemp
class TEasyID3(TestCase):
def setUp(self):
fd, self.filename = mkstemp('.mp3')
... | gpl-2.0 |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_06_01/aio/operations/_peer_express_route_circuit_connections_operations.py | 1 | 9352 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
PTDreamer/dRonin | python/ins/cins.py | 11 | 3838 |
from sympy import symbols, lambdify, sqrt
from sympy import MatrixSymbol, Matrix
from numpy import cos, sin, power
from sympy.matrices import *
from quaternions import *
import numpy
import ins
# this is the set of (currently) recommend INS settings. modified from
# https://raw.githubusercontent.com/wiki/TauLabs/TauL... | gpl-3.0 |
jnerin/ansible | lib/ansible/plugins/callback/stderr.py | 59 | 3194 | # (c) 2017, Frederic Van Espen <github@freh.be>
# (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = '''
callbac... | gpl-3.0 |
googleapis/googleapis-gen | google/cloud/aiplatform/v1beta1/aiplatform-v1beta1-py/google/cloud/aiplatform_v1beta1/services/vizier_service/transports/__init__.py | 1 | 1185 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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 |
googleapis/googleapis-gen | google/cloud/translate/v3beta1/translation-v3beta1-py/google/cloud/translate/__init__.py | 1 | 5300 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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 |
OfficialMan/Sark | sark/core.py | 3 | 4468 | import idaapi
import idc
import string
from . import exceptions
def get_func(func_ea):
"""get_func(func_t or ea) -> func_t
Take an IDA function (``idaapi.func_t``) or an address (EA) and return
an IDA function object.
Use this when APIs can take either a function or an address.
Args:
fu... | mit |
rancher/rancher | tests/validation/tests/v3_api/test_create_ha.py | 2 | 20647 | from python_terraform import * # NOQA
from .common import * # NOQA
from .test_boto_create_eks import get_eks_kubeconfig
from .test_import_k3s_cluster import create_multiple_control_cluster
from .test_rke_cluster_provisioning import rke_config
# RANCHER_HA_KUBECONFIG and RANCHER_HA_HOSTNAME are provided
# when instal... | apache-2.0 |
onyxfish/agate-dbf | docs/conf.py | 2 | 7302 | # -*- coding: utf-8 -*-
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import os
impo... | mit |
giggsey/SickRage | lib/guessit/transfo/split_explicit_groups.py | 28 | 2804 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2013 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
wdv4758h/ZipPy | lib-python/3/test/test_htmlparser.py | 2 | 29466 | """Tests for HTMLParser.py."""
import html.parser
import pprint
import unittest
from test import support
class EventCollector(html.parser.HTMLParser):
def __init__(self, *args, **kw):
self.events = []
self.append = self.events.append
html.parser.HTMLParser.__init__(self, *args, **kw)
... | bsd-3-clause |
q1ang/scikit-learn | examples/decomposition/plot_pca_vs_fa_model_selection.py | 142 | 4467 | """
===============================================================
Model selection with Probabilistic PCA and Factor Analysis (FA)
===============================================================
Probabilistic PCA and Factor Analysis are probabilistic models.
The consequence is that the likelihood of new data can be u... | bsd-3-clause |
borysiasty/inasafe | safe_extras/simplejson/tool.py | 262 | 1136 | r"""Command-line tool to validate and pretty-print JSON
Usage::
$ echo '{"json":"obj"}' | python -m simplejson.tool
{
"json": "obj"
}
$ echo '{ 1.2:3.4}' | python -m simplejson.tool
Expecting property name: line 1 column 2 (char 2)
"""
from __future__ import with_statement
import sys
impo... | gpl-3.0 |
vertexproject/synapse | synapse/tests/test_tools_csvtool.py | 1 | 6295 | import csv
from unittest import mock
import synapse.common as s_common
import synapse.telepath as s_telepath
import synapse.tests.utils as s_t_utils
import synapse.tools.csvtool as s_csvtool
csvfile = b'''ipv4,fqdn,notes
1.2.3.4,vertex.link,malware
8.8.8.8,google.com,whitelist
'''
csvstorm = b'''
for ($ipv4, $... | apache-2.0 |
ntent-ad/avro | lang/py3/avro/tool.py | 21 | 5293 | #!/usr/bin/env python3
# -*- mode: python -*-
# -*- coding: utf-8 -*-
# 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... | apache-2.0 |
indashnet/InDashNet.Open.UN2000 | android/external/wpa_supplicant_8/wpa_supplicant/examples/p2p/p2p_invite.py | 29 | 5237 | #!/usr/bin/python
# Tests p2p_invite
######### MAY NEED TO RUN AS SUDO #############
import dbus
import sys, os
import time
import gobject
import getopt
import threading
from dbus.mainloop.glib import DBusGMainLoop
def usage():
print "Usage:"
print " %s -i <interface_name> -a <addr> \ " \
% sys.argv[0]
print " ... | apache-2.0 |
google-research/social_cascades | news/google/launch_optimizer_main.py | 1 | 7283 | # Copyright 2020 Google LLC
#
# 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 |
Jumpscale/jumpscale_core8 | lib/JumpScale/tools/issuemanager/models/repoCollection.py | 1 | 2535 | from JumpScale import j
base = j.data.capnp.getModelBaseClassCollection()
class RepoCollection(base):
"""
This class represent a collection of Issues
"""
def list(self, owner=0, name='', id=0, source="", returnIndex=False):
"""
List all keys of repo model with specified params.
... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.