code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
# encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: Kyle Lahnakoski ([email protected])
#
from __future__ import absolute_import
from __f... | klahnakoski/MySQL-to-S3 | vendor/mo_json/encoder.py | Python | mpl-2.0 | 16,343 |
# ##########################################################################
# (C) Vrije Universiteit, Amsterdam (the Netherlands) #
# #
# This file is part of AmCAT - The Amsterdam Content Analysis Toolkit #
# ... | amcat/amcat | amcat/forms/__init__.py | Python | agpl-3.0 | 2,701 |
# Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved
#
# 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 ... | Nexenta/s3-tests | virtualenv/lib/python2.7/site-packages/boto/cloudtrail/layer1.py | Python | mit | 14,656 |
#! /usr/bin/env python
import ppplot
import numpy as np
from optparse import OptionParser ### TBR by argparse
# inputs and options
parser = OptionParser()
parser.usage = \
'''
asciiplot.py [options] text file(s)
-- default is col2 for field and col1 for coord
-- this can be set with -x and -y options
(or use --swap... | aymeric-spiga/planetoplot | bin/asciiplot.py | Python | gpl-2.0 | 1,508 |
#! /usr/bin/env python
import matplotlib.pyplot as plt
x = [3.2, 3.4, 3.6, 3.8, 4.0, 4.2, 4.4, 4.6, 4.8, 5.0, 5.2, 5.4, 5.6, 5.8, 6.0, 6.2, 6.4, 6.6, 6.8, 7.0]
y = [2.968677, 3.143741, 2.906839, 2.510553, 1.684038, 1.373736, 1.357269, 1.721942, 1.803851, 1.256614, 0.353246, -0.075401, -0.199493, -0.207986, -0.628273,... | fraser-lab/EMRinger | Figures/S4/S4.py | Python | bsd-3-clause | 780 |
# -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
import unitt... | mdhaman/superdesk-aap | server/aap/macros/remove_breaks_in_pars_test.py | Python | agpl-3.0 | 1,232 |
from __future__ import absolute_import
from flask_xuanzang.extension import Xuanzang
from flask_xuanzang.extension import NumberFormatError
from flask_xuanzang.extension import gettext, ngettext
from flask_xuanzang.extension import ugettext, ungettext
from flask_xuanzang.extension import pgettext, npgettext
from flask... | timothyqiu/Flask-Xuanzang | flask_xuanzang/__init__.py | Python | mit | 895 |
from mrjob.job import MRJob
from mrjob.step import MRStep
import re
WORD_RE = re.compile(r"[\w]+")
class MRAvgUniqWordLen(MRJob):
def mapper_find_words(self, _, line):
for word in WORD_RE.findall(line):
yield word, None
def combiner_find_words(self, word, _):
yield word, None
def reducer_fi... | EmilyWebber/Algos-At-Scale | Lab-01/avg_unique_word_length.py | Python | mit | 874 |
"""Util functions."""
import sys
from .enums import RESULT
from .exceptions import FmodError
def ckresult(result):
"""Check if the result of our C API call is OK.
:param RESULT result: C API call return code.
:raises FmodError: when return code from C API call is not OK.
"""
result = RESULT(res... | tyrylu/pyfmodex | pyfmodex/utils.py | Python | mit | 1,353 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Search Architecture:
- Have a list of accounts
- Create an "overseer" thread
- Search Overseer:
- Tracks incoming new location values
- Tracks "paused state"
- During pause or new location will clears current search queue
- Starts search_worker threads
- Se... | simonhashadenough/PokemonGo-Map | pogom/search.py | Python | agpl-3.0 | 24,442 |
from django.views.generic.edit import CreateView
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib import messages
from ideas.models import Idea
from ideas.forms import PostIdeaForm
class IdeaCreateView(LoginRequiredMixin, CreateView):
model = Idea
template_name = "idea_create_vi... | paulsoh/moxie | moxie/ideas/views/idea_create_view.py | Python | mit | 801 |
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import sys
from nose.plugins.skip import SkipTest
i... | Azulinho/ansible | test/units/modules/network/f5/test_bigip_hostname.py | Python | gpl-3.0 | 3,211 |
from .bookmark import EmulatorAddBookmarkFactory, EmulatorRemoveBookmarkFactory
from .dialog import EmulatorShowRomDialogFactory
from .launch import EmulatorLaunchFactory
from .run import EmulatorRunCommandFactory
from .screen import EmulatorConsoleSelectFactory
from .search import (EmulatorSearchDialogRunnerFactory,
... | dstenb/pylaunchr-emulator | emulator/actions/__init__.py | Python | mit | 1,172 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014-2017 Vincent Noel ([email protected])
#
# This file is part of libSigNetSim.
#
# libSigNetSim 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 Fou... | vincent-noel/libSigNetSim | libsignetsim/numl/tests/test_experiment.py | Python | gpl-3.0 | 1,484 |
import pexpect
def test_interactive_command_line():
p = pexpect.spawn("telnet localhost 4555")
p.expect("Login id:")
p.sendline("root")
p.expect("Password:")
p.sendline("root")
p.expect("Welcome root. HELP for a list of commands")
p.sendline("listusers")
p.expect("Existing accounts (\d... | barancev/testautomation_training | testautomation_py/lesson1/module10/lesson1_module10_sample2.py | Python | apache-2.0 | 412 |
# The Computer Language Benchmarks Game
# $Id: planB.py,v 1.4 2008-09-02 04:20:08 igouy-guest Exp $
"""
measure with libgtop2 but not CPU affinity
"""
__author__ = 'Isaac Gouy'
from domain import Record
import os, sys, cPickle, time, threading, signal, gtop
from errno import ENOENT
from subprocess import Popen
d... | kragen/shootout | nanobench/bin/planB.py | Python | bsd-3-clause | 4,228 |
from django.db import connection, models
from django.contrib.contenttypes.models import ContentType
from voting import settings
qn = connection.ops.quote_name
class VoteManager(models.Manager):
def get_score(self, obj):
"""
Get a dictionary containing the total score for ``obj`` and
the n... | pielgrzym/django-minishop | voting/managers.py | Python | gpl-3.0 | 5,718 |
#
# Copyright (c) 2009-2015 Tom Keffer <[email protected]>
#
# See the file LICENSE.txt for your full rights.
#
"""Middleware that sits above DBAPI and makes it a little more database independent.
Weedb generally follows the MySQL exception model. Specifically:
- Operations on a non-existent database result in... | tony-rasskazov/meteo | weewx/bin/weedb/__init__.py | Python | mit | 5,597 |
#! /usr/bin/env python3
import locale
import backend
from dialog import Dialog
__author__ = 'lesik'
class Game:
global game_backend
global game_dialog
empty = ''
def __init__(self):
locale.setlocale(locale.LC_ALL, '')
print('lala')
self.game_backend = backend.Backend()
self.game_dialog = Dialog(dialog=... | pidgornyy/mastermind | game.py | Python | gpl-2.0 | 1,440 |
#!/usr/bin/env python
from setuptools import setup
import os
import re
import codecs
base_path = os.path.dirname(__file__)
# Get the version (borrowed from SQLAlchemy)
with open(os.path.join(base_path, 'urllib3', '__init__.py')) as fp:
VERSION = re.compile(r".*__version__ = '(.*?)'",
re... | Disassem/urllib3 | setup.py | Python | mit | 2,624 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""SerpScrap.UrlScrape"""
import chardet
import hashlib
import html2text
import json
import re
import urllib.request
import os
from bs4 import BeautifulSoup
class UrlScrape():
meta_robots_pattern = re.compile(
r'<meta\sname=["\']robots["\']\scontent=["\'](.*?)["... | ecoron/SerpScrap | serpscrap/urlscrape.py | Python | mit | 6,702 |
#-*- coding: utf-8 -*-
from setuptools import setup, find_packages
setup(
name='testcmd',
version='1',
license='BSD',
author='TakesxiSximada',
author_email='[email protected]',
packages=find_packages(),
entry_points = """\
[console_scripts]
examplecmd = testcmd.command:main
... | TakesxiSximada/jumon | examples/setup.py | Python | apache-2.0 | 333 |
from itertools import count
from .utils.decorators import gitlog
from scipy.misc import imresize
import datajoint as dj
from datajoint.jobs import key_hash
from tqdm import tqdm
import cv2
import numpy as np
import json
import os
from commons import lab
from datajoint.autopopulate import AutoPopulate
from .utils.eye_... | fabiansinz/pipeline | python/pipeline/pupil.py | Python | lgpl-3.0 | 21,850 |
#!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | Kazade/NeHe-Website | google_appengine/google/appengine/tools/devappserver2/watcher_common.py | Python | bsd-3-clause | 1,254 |
# Copyright 2016-2017 Tecnativa - Sergio Teruel
# Copyright 2019 Ignacio Ibeas <[email protected]>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
import logging
import pprint
import werkzeug
from odoo import http
from odoo.http import request
_logger = logging.getLogger(__name__)
class RedsysCo... | cubells/l10n-spain | payment_redsys/controllers/main.py | Python | agpl-3.0 | 1,478 |
import logging
import random
import threading
import time
from abc import ABCMeta, abstractmethod
from collections import defaultdict
from typing import Any, Callable, Dict, Generic, List, Mapping, Optional, Set, TypeVar, Union
import orjson
import pika
import pika.adapters.tornado_connection
import pika.connection
im... | rht/zulip | zerver/lib/queue.py | Python | apache-2.0 | 16,619 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for twisted.python.modules, abstract access to imported or importable
objects.
"""
import sys
import itertools
import zipfile
import compileall
import twisted
from twisted.trial.unittest import TestCase
from twisted.python import modu... | mzdaniel/oh-mainline | vendor/packages/twisted/twisted/test/test_modules.py | Python | agpl-3.0 | 15,268 |
# run scripts/jobslave-nodatabase.py
import os
os.environ["SEAMLESS_COMMUNION_ID"] = "simple-remote"
os.environ["SEAMLESS_COMMUNION_INCOMING"] = "localhost:8602"
import seamless
seamless.set_ncores(0)
from seamless import communion_server
communion_server.configure_master(
buffer=True,
transformation_job=Tru... | sjdv1982/seamless | tests/lowlevel/simple-remote.py | Python | mit | 1,438 |
#!/usr/bin/env python
#############################################################################
##
## Copyright (C) 2013 Riverbank Computing Limited.
## Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
## All rights reserved.
##
## This file is part of the examples of PyQt.
##
## $QT_BEGIN_LICENS... | baoboa/pyqt5 | examples/itemviews/simpledommodel.py | Python | gpl-3.0 | 7,035 |
import copy
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.ticker as mticker
import matplotlib.gridspec as gridspec
import scipy.stats as stats
import seaborn.apionly as seaborn
from . import misc
def _check_ax(ax):
""" Checks if a value if an Axes. If None, a new one is ... | lucashtnguyen/wqio | wqio/utils/figutils.py | Python | bsd-3-clause | 18,863 |
# -*- coding: utf-8 -*-
###############################################################################
#
# LeadershipPACs
# Retrieve a list of PACs that have been designated by the FEC as "leadership PACs".
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Versio... | jordanemedlock/psychtruths | temboo/core/Library/NYTimes/CampaignFinance/Committees/LeadershipPACs.py | Python | apache-2.0 | 3,659 |
from __future__ import unicode_literals
import os
import fcntl
import select
import signal
import errno
import threading
from ..terminal.vt100_input import InputStream
from .base import EventLoop, INPUT_TIMEOUT
from .callbacks import EventLoopCallbacks
from .inputhook import InputHookContext
from .posix_utils import P... | jaseg/python-prompt-toolkit | prompt_toolkit/eventloop/posix.py | Python | bsd-3-clause | 6,559 |
#! /usr/bin/env python
"""
The :py:mod:`ArchWiki.lang` submodule contains multiple functions related to
ArchWiki specific way of setting localized page titles, handling of categories
for localized pages etc.
See the documentation on `Help:i18n`_ on ArchWiki for the specification.
.. _`Help:i18n`: https://wiki.archli... | kynikos/wiki-scripts | ws/ArchWiki/lang.py | Python | gpl-3.0 | 9,213 |
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under ... | shahankhatch/aurora | src/test/python/apache/aurora/executor/test_http_lifecycle.py | Python | apache-2.0 | 3,819 |
"""
Base classes for writing management commands (named commands which can
be executed through ``django-admin`` or ``manage.py``).
"""
import os
import sys
from argparse import ArgumentParser
from contextlib import suppress
from io import TextIOBase
import django
from django.core import checks
from django.core.excepti... | tysonclugg/django | django/core/management/base.py | Python | bsd-3-clause | 20,357 |
#
# -*- coding: utf-8 -*-
# Copyright 2019 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
The vyos_firewall_global class
It is in this file where the current configuration (as dict)
is compared to the provided configuration (as dict) and the command set
necess... | roadmapper/ansible | lib/ansible/module_utils/network/vyos/config/firewall_global/firewall_global.py | Python | gpl-3.0 | 24,350 |
import datetime
import time
import os
import json
import re
import psycopg2 as dbapi2
from flask import Flask
from flask import redirect
from flask import request
from flask import render_template
from flask.helpers import url_for
from store import Store
from fixture import *
from sponsors import *
from championship i... | itucsdb1509/itucsdb1509 | server.py | Python | gpl-3.0 | 27,509 |
"""
Use lldb Python API to verify that expression evaluation for property references uses the correct getters and setters
"""
import os, time
import re
import unittest2
import lldb, lldbutil
from lldbtest import *
class ObjCPropertyTestCase(TestBase):
mydir = os.path.join("lang", "objc", "objc-property")
@u... | s20121035/rk3288_android5.1_repo | external/lldb/test/lang/objc/objc-property/TestObjCProperty.py | Python | gpl-3.0 | 5,463 |
# 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... | Laurawly/tvm-1 | python/tvm/topi/unique.py | Python | apache-2.0 | 12,249 |
#!/usr/bin/env python3
# I was pretty sure that the code was just straightforward binary but
# also I was tired and not firing on all cylinders so I figured I'd
# just mindlessly type out the directions and hope that would be fast
# enough. It almost was: 103 on **. Sigh. Should have just used my
# brain.
import sys
... | msullivan/advent-of-code | 2020/5b.py | Python | mit | 1,101 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) Camptocamp SA
# Author: Arnaud WÃŒst
#
#
# This file is part of the c2c_timesheet_report module
#
#
# WARNING: This program as such is intended to be used by professional
# programmers who take th... | VitalPet/c2c-rd-addons | c2c_timesheet_reports/reminder.py | Python | agpl-3.0 | 14,276 |
#!/usr/bin/env python
# Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | GoogleCloudPlatform/esp-v2 | tests/e2e/client/apiproxy_client.py | Python | apache-2.0 | 5,960 |
'''
TestPyRAMmp unit test class.
Uses configuration file TestPyRAMmp_Config.xml.
Computational range and depth steps and number of repetitions are configurable.
Number of PyRAM runs = number of frequencies * number of repetitions.
Tests should always pass but speedup will depend upon computing environment.
'''
import ... | marcuskd/pyram | pyram/Tests/TestPyRAMmp.py | Python | bsd-3-clause | 4,888 |
# 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 ... | adhintz/password-alert | server/auth.py | Python | apache-2.0 | 7,353 |
from __future__ import absolute_import
import errno
import os
from rpython.rlib.rarithmetic import intmask
from rpython.rlib import rtime
from rpython.rtyper.lltypesystem import rffi, lltype
from topaz.gateway import Coerce
from topaz.module import ModuleDef
from topaz.modules.signal import SIGNALS
from topaz.system... | babelsberg/babelsberg-r | topaz/modules/process.py | Python | bsd-3-clause | 6,195 |
# coding=UTF-8
#
# This file contains the text that constitute the documentation of
# Autopoweroff.
aDocument = \
{
"config-IdleTime" :
{ "default" :
"""
IdleTime parameter (expressed in minutes):
Like a screensaver, Autopoweroff detects keyboard and mouse
activity, and if there is any activi... | deragon/autopoweroff | python/modules/ApoDocumentation.py | Python | gpl-2.0 | 2,282 |
from distutils.core import setup
setup(
name='django-pipeline-typescript',
packages=['pipeline_typescript'],
version='0.2',
description='Django Pipeline Compiler for Typescript',
author='Bogdan I. Bursuc',
author_email='[email protected]',
url='https://github.com/Bogh/django-pipeline-typescript', ... | Bogh/django-pipeline-typescript | setup.py | Python | mit | 773 |
#!/usr/bin/env python
'''
useful extra functions for use by mavlink clients
Copyright Andrew Tridgell 2011
Released under GNU GPL version 3 or later
'''
import os, sys
from math import *
from .quaternion import Quaternion
try:
# rotmat doesn't work on Python3.2 yet
from .rotmat import Vector3, Matrix3
except... | DougFirErickson/mavlink | pymavlink/mavextra.py | Python | lgpl-3.0 | 31,679 |
#!/usr/bin/env python
def mi_funcion():
print "una funcion"
class MiClase:
def __init__(self):
print "una clase"
print "un modulo"
print "Se muestra siempre"
if __name__ == "__main__":
print "Se muestra si no es importacion"
# Se muestra el print si el modulo se invoc como programa y no
# como ... | MGautier/Programacion | Python/modulo.py | Python | mit | 359 |
import numpy as np
from operator import or_
from migen import *
from migen.fhdl.verilog import convert
from artiq.gateware.rtio.phy.sawg import Channel
from .tools import rtio_xfer
def pack_tri(port, *v):
r = 0
w = 0
for vi, p in zip(v, port.payload.flatten()):
w += len(p)
r |= int(vi*(1... | JQIamo/artiq | artiq/gateware/test/dsp/test_sawg_phy.py | Python | lgpl-3.0 | 1,507 |
__import__('inventory_context')
from systems.models import System
from slurpee.models import ExternalData
import datetime
import csv
import sys
def wimport(reader, lookups, date_format):
total_records = 0
updated = 0
missing = 0
external = 0
for row in reader:
total_records += 1
wa... | mozilla/inventory | scripts/import_warranty_info.py | Python | bsd-3-clause | 3,059 |
#pamutils init.py
import pam2nest
import nest_vis
import network
__version__ = '0.1.0'
| MartinPyka/Pam-Utils | pamutils/__init__.py | Python | gpl-2.0 | 88 |
#!/usr/bin/env python
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013,2015,2016,2018 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with... | quattor/aquilon | tests/broker/test_update_network.py | Python | apache-2.0 | 3,647 |
from sparkle.gui.plotting.raster_bounds_dlg import RasterBoundsDialog
class TestRasterDialog():
def test_dlg(self):
dlg = RasterBoundsDialog(bounds=(0.1, 0.33))
assert dlg.values() == (0.1, 0.33)
| Joel-U/sparkle | test/tests/gui/plotting/test_raster_dlg.py | Python | gpl-3.0 | 218 |
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2014 Compassion CH (http://www.compassion.ch)
# Releasing children from poverty in Jesus' name
# @author: Emanuel Cino <[email protected]>
#
# The licence is in the file __open... | emgirardin/compassion-modules | crm_compassion/models/contract_origin.py | Python | agpl-3.0 | 2,542 |
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public L... | gdgellatly/OCB1 | addons/sale_margin/sale_margin.py | Python | agpl-3.0 | 4,513 |
from core.himesis import Himesis
import uuid
class HCompositeState2ProcDef(Himesis):
def __init__(self):
"""
Creates the himesis graph representing the DSLTrans rule CompositeState2ProcDef.
"""
# Flag this instance as compiled now
self.is_compiled = True
... | levilucio/SyVOLT | UMLRT2Kiltera_MM/transformation/handbuilt/HCompositeState2ProcDef.py | Python | mit | 14,159 |
from __future__ import division
import itertools
import sys
from signal import SIGINT, default_int_handler, signal
from pip._vendor import six
from pip._vendor.progress.bar import Bar, FillingCirclesBar, IncrementalBar
from pip._vendor.progress.spinner import Spinner
from pip._internal.utils.compat import WINDOWS
fr... | RalfBarkow/Zettelkasten | venv/lib/python3.9/site-packages/pip/_internal/cli/progress_bars.py | Python | gpl-3.0 | 9,121 |
import pytest
def test_encrypt_default():
from ringo.lib.security import encrypt_password, verify_password
password = "secret"
result = encrypt_password(password)
assert verify_password(password, result)
def test_verify():
from ringo.lib.security import verify_password
plain_password = "secr... | toirl/ringo | ringo/tests/unit/test_security.py | Python | gpl-2.0 | 3,187 |
# Copyright (C) 2020 OpenMotics BV
#
# 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
# License, or (at your option) any later version.
#
# This program is distribu... | openmotics/gateway | testing/cicd/tests/mode_test.py | Python | agpl-3.0 | 4,776 |
"""
test_NeuronUpdate.py
This file is part of ANNarchy.
Copyright (C) 2016-2018 Helge Uelo Dinkelbach <[email protected]>
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 Found... | vitay/ANNarchy | tests/Unittests/test_SynapseUpdate.py | Python | gpl-2.0 | 2,005 |
from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.db import models
from django.conf import settings
import os.path
from bootcamp.activities.models import Notification
import urllib, hashlib
class Profile(models.Model):
user = models.OneToOneField(User)
locat... | jroqueweb/bootcamp | bootcamp/auth/models.py | Python | mit | 4,763 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from ..model.attack import Attack
from ..config import Configuration
from ..tools.hashcat import HcxDumpTool, HcxPcapTool, Hashcat
from ..util.color import Color
from ..util.timer import Timer
from ..model.pmkid_result import CrackResultPMKID
from threading import Thread
... | derv82/wifite2 | wifite/attack/pmkid.py | Python | gpl-2.0 | 7,652 |
# pylint: disable=C0111
# pylint: disable=W0621
# Disable the "wildcard import" warning so we can bring in all methods from
# course helpers and ui helpers
# pylint: disable=W0401
# Disable the "Unused import %s from wildcard import" warning
# pylint: disable=W0614
# Disable the "unused argument" warning because let... | jswope00/GAI | common/djangoapps/terrain/steps.py | Python | agpl-3.0 | 6,709 |
"""
The :mod:`sklearn.model_selection._validation` module includes classes and
functions to validate the model.
"""
# Author: Alexandre Gramfort <[email protected]>,
# Gael Varoquaux <[email protected]>,
# Olivier Grisel <[email protected]>
# License: BSD 3 clause
from __... | dwettstein/pattern-recognition-2016 | mlp/model_selection/_validation.py | Python | mit | 35,756 |
# -*- coding: UTF-8 -*-
try: from sqlite3 import dbapi2 as database
except: from pysqlite2 import dbapi2 as database
from resources.lib.modules import control
def addView(content):
try:
skin = control.skin
record = (skin, content, str(control.getCurrentViewId()))
control.makeFile(contro... | repotvsupertuga/tvsupertuga.repository | script.module.streamtvsupertuga/lib/resources/lib/modules/views.py | Python | gpl-2.0 | 1,864 |
# -*- coding: utf-8 -*-
class Charset(object):
common_name = 'NotoSansDevanagari-Bold'
native_name = ''
def glyphs(self):
glyphs = []
glyphs.append(0x0065) #uni0961
glyphs.append(0x0178) #glyph00376
glyphs.append(0x02D8) #glyph00728
glyphs.append(0x0179) #glyph... | davelab6/pyfontaine | fontaine/charsets/noto_glyphs/notosansdevanagari_bold.py | Python | gpl-3.0 | 38,351 |
from distutils.core import setup
import pygiphy
VERSION = pygiphy.__version__
AUTHOR = pygiphy.__author__
setup_kwargs = {
'name': 'pygiphy',
'version': VERSION,
'url': 'https://github.com/MichaelYusko/PyGiphy',
'license': 'MIT',
'author': AUTHOR,
'author_email': '[email protected]',
... | MichaelYusko/PyGiphy | setup.py | Python | mit | 871 |
# Under MIT license, see LICENSE.txt
from Util.constant import KEEPOUT_DISTANCE_FROM_BALL
from Util.role import Role
from ai.STA.Strategy.strategy import Strategy
from ai.STA.Tactic.stay_away_from_ball import StayAwayFromBall
# noinspection PyTypeChecker
class StayAway(Strategy):
def __init__(self, p_game_state)... | RoboCupULaval/StrategyIA | ai/STA/Strategy/stay_away.py | Python | mit | 993 |
def __bootstrap__():
global __bootstrap__, __loader__, __file__
import sys, pkg_resources, imp
__file__ = pkg_resources.resource_filename(__name__,'authorization.pyd')
__loader__ = None; del __bootstrap__, __loader__
imp.load_dynamic(__name__,__file__)
__bootstrap__()
| JulienMcJay/eclock | windows/Python27/Lib/site-packages/pywin32-218-py2.7-win32.egg/win32comext/authorization/authorization.py | Python | gpl-2.0 | 284 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | tsdmgz/ansible | lib/ansible/modules/network/aci/aci_bd.py | Python | gpl-3.0 | 12,055 |
from .samplearray import SampleArray
from .sample import Sample, TimeBasedSample
from .spectrum import Spectrum, TimeBasedSpectrum
| nocarryr/rtlsdr-wwb-scanner | wwb_scanner/scan_objects/__init__.py | Python | gpl-2.0 | 131 |
from . import *
class TestBasics(TestCase):
def setUp(self):
call(['git', 'init', self.sandbox])
def test_tests_run(self):
self.assert_(1)
| mikeboers/git-xblob | tests/test_basics.py | Python | bsd-3-clause | 168 |
__copyright__ = 'Copyright(c) Gordon Elliott 2017'
from datetime import date, datetime
"""
"""
def strip_commas(value, _):
return value.replace(',', '') if value else None
def strip_commas_and_spaces(value, _):
return value.replace(',', '').strip() if value else None
def cast_dmy_date_from_string(value... | gordon-elliott/glod | src/glod/in_out/casts.py | Python | mit | 406 |
# -*- coding: utf-8 -*-
PLACE_HOLDER = '-'
DEFAULT_TOO_BUSY_ERROR_CODE = -1
DEFAULT_TOO_BUSY_EXC_NAME = 'TOO_BUSY_ERROR'
DEFAULT_TOO_BUSY_MSG = u"SOME THING TOO BUSY"
DEFAULT_BACKOFF_ERROR_CODE = -3
DEFAULT_BACKOFF_EXC_NAME = 'BACKOFF_ERROR'
SHIELDED_API_KEY = 'shielded_apis'
DEFAULT_STATSD = ""
| MrKiven/REST_ARCH | rest_arch/consts.py | Python | mit | 301 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2011 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists... | superdesk/Live-Blog | distribution/libraries/Babel-1.0dev-py3.2/babel/messages/catalog.py | Python | agpl-3.0 | 33,066 |
#!/usr/bin/env python
# http://trac.secdev.org/scapy/ticket/353
# scapy.contrib.description = IKEv2
# scapy.contrib.status = loads
from scapy.all import *
import logging
## Modified from the original ISAKMP code by Yaron Sheffer <[email protected]>, June 2010.
import struct
from scapy.packet import *
from sca... | Bioh4z4rd/scapy | scapy/contrib/ikev2.py | Python | gpl-2.0 | 17,758 |
# Copyright (c) 2014 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the License);
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | mgrygoriev/CloudFerry | cloud/cloud_ferry.py | Python | apache-2.0 | 1,514 |
import sys
import glob
import os
import shutil
name = sys.argv[1]
app = sys.argv[2]
dest = sys.argv[3]
a = glob.glob(
'applications/%(app)s/*/plugin_%(name)s.*' % dict(app=app, name=name))
b = glob.glob(
'applications/%(app)s/*/plugin_%(name)s/*' % dict(app=app, name=name))
for f in a:
print 'cp %s ...' % ... | pouyana/teireader | webui/scripts/cpplugin.py | Python | mit | 855 |
import numpy as np
from matplotlib import pyplot as plt
from scipy.optimize import curve_fit
import utils
# Read the original data from file
data = open("../data/curve1.dat","r").read().split("\n")
data.pop()
data = [float(x) for x in data]
# Remove the anomaly in data points, data[63]=500, so it doesn't affect optim... | assamite/itm_project | src/modelfitting2.py | Python | gpl-2.0 | 1,871 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 OpenStack Foundation
# 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.a... | Brocade-OpenSource/OpenStack-DNRM-Nova | nova/tests/test_hooks.py | Python | apache-2.0 | 3,535 |
#quick serial port test
import serial
import time
import os
#from PySide import QtGui, QtDeclarative
from PySide.QtCore import QCoreApplication, QSocketNotifier, QTimer, SIGNAL
serport=serial.Serial(port='/dev/ttyUSB0', baudrate=115200, bytesize=8, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=0.0... | dougalf/openslot | lib/serial_test.py | Python | gpl-3.0 | 1,174 |
from ..extinction import *
import numpy as np
def basic_tests():
wa = np.arange(900, 22000, 5)
MW_Cardelli89(wa, EBmV=0.05)
starburst_Calzetti00(wa, EBmV=0.05)
# test regime in which interpolation from MW to Calzetti occurs
starburst_Calzetti00([3000], EBmV=0.05)
LMC_Gordon03(wa, EBmV=0.05)
... | nhmc/Barak | barak/tests/test_extinction.py | Python | bsd-3-clause | 382 |
def url_for(catalog, service_type, endpoint_type="publicURL", region="regionOne"):
service = get_service_from_catalog(catalog, service_type)
if service:
url = get_url_for_service(service,
region,
endpoint_type)
if url:
... | VDI-Stack/Platform-Dev | dashboard/api/base.py | Python | gpl-2.0 | 2,022 |
from . import config
from .document import Document
import requests
from time import time
def perform_search(**params):
response = requests.get(
config.GOVUK_SEARCH_API,
params=params,
auth=config.AUTH,
)
return response.json()
def fetch_documents(scope):
documents = perform_... | alphagov/govuk-content-explorer | explorer/search.py | Python | mit | 1,652 |
import os
from collections import namedtuple
from sortedcontainers import SortedDict
from fudge.object import Object, get_object_path, load_object, store_object
from fudge.parsing.builder import Builder
from fudge.parsing.parser import Parser
from fudge.repository import get_repository_path, get_working_tree_path
fro... | bovarysme/fudge | fudge/index.py | Python | mit | 6,537 |
__source__ = 'https://leetcode.com/problems/equal-tree-partition/discuss/'
# Time: O()
# Space: O()
#
# Description: Leetcode # 663. Equal Tree Partition
#
# Given a binary tree with n nodes,
# your task is to check if it's possible to partition the tree to two trees
# which have the equal sum of values after removing... | JulyKikuAkita/PythonPrac | cs15211/EqualTreePartition.py | Python | apache-2.0 | 2,676 |
from __future__ import print_function, unicode_literals
import unittest
from praw.decorators import restrict_access
class DecoratorTest(unittest.TestCase):
def test_require_access_failure(self):
self.assertRaises(TypeError, restrict_access, scope=None,
oauth_only=True)
| julianwachholz/praw | tests/test_decorators.py | Python | gpl-3.0 | 311 |
"""
UK-specific Form helpers
"""
import re
from django.newforms.fields import CharField, Select
from django.newforms import ValidationError
from django.utils.translation import ugettext
class UKPostcodeField(CharField):
"""
A form field that validates its input is a UK postcode.
The regular expression u... | rawwell/django | django/contrib/localflavor/uk/forms.py | Python | bsd-3-clause | 1,954 |
import numpy as np
import sw_data as da
import time
def gen_scores_lin(db_seq, q_seq, fn_sub, Wgp, dbg = False):
# fn_sub is / int fn_sub(a,b) /
H = np.zeros((len(q_seq)+1, len(db_seq)+1), dtype = np.int32)
orig = np.zeros((len(q_seq)+1, len(db_seq)+1), dtype = np.int8)
for col in range(1, len(db_seq)... | kyflores/OSS-GPGPU | prj2/src/sw.py | Python | mit | 4,330 |
#!/usr/bin/python
""" README
This script is deprecated. Please use https://github.com/device42/servicenow_device42_mapping
This script reads CIs from Servicenow and uploads them to Device42.
It has 2 modes:
1. Full migration - when the TIMEFRAME is set to 0
2. Synchronization - when the TIMEFRAME... | device42/servicenow_to_device42_sync | starter.py | Python | mit | 2,360 |
#!/usr/bin/env python
#
# A library that provides a Python interface to the OCBC API
# Copyright (C) 2016
# Naveen Sanmane <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
# the Free Software Foundat... | connect2ocbc/pyocbc | ocbc/base.py | Python | lgpl-3.0 | 1,714 |
"""
conversion/neuron.py
Functions to import cells, synapses and networks from NEURON
Contributors: salvador [email protected]
"""
from __future__ import print_function
from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
from builtins import range
from builtins... | thekerrlab/netpyne | netpyne/conversion/neuronPyHoc.py | Python | mit | 19,072 |
#coding=utf-8
__author__ = 'samsung'
import threading
import thread
import time
mylock = 1
class MyThread(threading.Thread):
def __init__(self, name):
threading.Thread.__init__(self)
self.name = name
self.stopstatus = False
def run(self):
global ticket
global mylock
... | deepbluech/leetcode | MultiThread.py | Python | mit | 953 |
# MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2012, 2014, 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... | YelaSeamless/mysql-connector-python | tests/test_errorcode.py | Python | gpl-2.0 | 2,311 |
#!/usr/bin/python
import argparse
import cmd
import logging
import sys
import os
from reform.index.load import Loader
LANGUAGES = ["java", "python", "javascript"]
COMMANDS = ["index", "reform"]
class InteractiveReform(cmd.Cmd):
'''
Interactive reformulation with pre-loaded storage
'''
def do_reform... | LudditeLabs/query-reform | reformulation.py | Python | apache-2.0 | 8,558 |
# -*- coding: utf-8 -*-
# Copyright 2016 Stein & Gabelgaard ApS
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'CampOS Jobber Final',
'description': """
Final registration for jobbers""",
'version': '8.0.1.0.0',
'license': 'AGPL-3',
'author': 'Stein & Gabelgaard A... | sl2017/campos | campos_jobber_final/__openerp__.py | Python | agpl-3.0 | 1,212 |
#!/usr/bin/env python3
import os
import sys
import json
in_file = sys.argv[1]
git_repo = os.path.join(os.path.dirname(in_file), '.git')
output = sys.argv[2]
manifest = json.load(open(in_file, encoding='utf-8'))
manifest['modules'][0]['sources'][0]['url'] = git_repo
json.dump(manifest, open(output, 'w', encoding='utf... | GabMus/razerCommander | scripts/make_local_manifest.py | Python | gpl-3.0 | 326 |
#! /usr/bin/env python
#
# This file is part of TournamentMaster.
# Copyright (C) 2017 Simon Chen
#
# TournamentMaster 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... | Khold6458/TournamentMaster | roundrobin.py | Python | gpl-3.0 | 2,656 |
from django.apps import AppConfig
from django.utils.translation import ugettext_lazy as l_
class DjpayConfig(AppConfig):
name = 'djpay'
verbose_name= l_("Payment & remuneration models")
| rivasd/djPsych | djpay/apps.py | Python | gpl-3.0 | 195 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.