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 |
|---|---|---|---|---|---|
# coding: utf-8
#
# Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | prasanna08/oppia | extensions/domain.py | Python | apache-2.0 | 1,571 |
# -*- encoding: utf-8 -*-
"""
lunaport.dao.line
~~~~~~~~~~~~~~~~~
Storage interaction logic for line resource.
"""
import pprint
pp = pprint.PrettyPrinter(indent=4).pprint
from sqlalchemy import text, exc
from ..wsgi import app, db
from .. domain.line import LineBuilder, LineAdaptor
from exceptions impo... | greggyNapalm/lunaport_server | lunaport_server/dao/line.py | Python | apache-2.0 | 5,948 |
from distutils.core import setup
import py2exe
packages = ['numpy']
includes = ['matplotlib.numerix.random_array',
'pytz.zoneinfo.UTC',
'scipy.misc.info']
setup(
name="SolarViz v0.1",
version="0.1",
description = "Solar data visualizer",
author="S... | sbobovyc/LabNotes | SolarViz/setup.py | Python | gpl-3.0 | 897 |
# -*- coding: utf-8 -*-
import re
from module.plugins.internal.SimpleCrypter import SimpleCrypter
class CloudzillaToFolder(SimpleCrypter):
__name__ = "CloudzillaToFolder"
__type__ = "crypter"
__version__ = "0.09"
__status__ = "testing"
__pattern__ = r'http://(?:www\.)?cloudzilla\.to/share/folde... | rlindner81/pyload | module/plugins/crypter/CloudzillaToFolder.py | Python | gpl-3.0 | 1,409 |
# -*- coding: iso-latin-1 -*-
"""
systems specifics for sandcrawler
"""
__docformat__ = 'restructuredtext en'
__author__ = "Denis 'jawa' Pompilio"
__credits__ = "Denis 'jawa' Pompilio"
__license__ = "GPLv3"
__maintainer__ = "Denis 'jawa' Pompilio"
__email__ = "denis.pompilio@gmail.com"
__status__ = "Development"
impo... | outini/sandcrawler | libraries/sc_systems.py | Python | gpl-3.0 | 6,623 |
import razorpay
import uuid
import time
from payments.models import Payment, Order
class RazorpayPayments:
def __init__(self, key, secret):
self.key = key
self.secret = secret
self.client = razorpay.Client(auth=(self.key, self.secret))
def create_invoice(self, customer, items):
... | PyConPune/pune.pycon.org | payments/razorpay/razorpay_payments.py | Python | mit | 2,314 |
# Copyright 2016 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 httplib
import json
import os
import shutil
import sys
import tempfile
import unittest
_SRC_DIR = os.path.abspath(os.path.join(
os.path.dirname(_... | danakj/chromium | tools/android/loading/trace_test/webserver_unittest.py | Python | bsd-3-clause | 3,781 |
from jinja2 import Environment
from jinja2.loaders import FileSystemLoader
env = Environment(loader=FileSystemLoader('templates'))
tmpl = env.get_template('broken.html')
print tmpl.render(seq=range(10))
| minixalpha/SourceLearning | jinja2/jinja2-2.0/examples/basic/debugger.py | Python | apache-2.0 | 205 |
# Copyright (C) weslowskij
#
# 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 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope... | olga-weslowskij/olga.weslowskij | Gui/Screens/aViewNotesScreen.py | Python | gpl-2.0 | 10,493 |
outfile = open('ids.csv','w')
x = open('foo.txt')
j = x.readlines()
for i in j:
outfile.write(i.split('=')[1].strip())
outfile.write(',')
outfile.close()
| siramix/phrasecraze | utils/getids.py | Python | gpl-3.0 | 158 |
# -*- coding: utf-8 -*-
"""
===========================================
Sportran graphic user interface
===========================================
Version: 0.0.2
Release state: Beta
Last update: 09/2019
Main Developer: Sebastiano Bisacchi
Other developer: Riccardo Bertossa
This file ... | lorisercole/thermocepstrum | sportran_gui/main.py | Python | gpl-3.0 | 5,464 |
# Copyright (c) 2019, Matt Layman and contributors
from contextlib import contextmanager
import inspect
from io import BytesIO, StringIO
import sys
import tempfile
import unittest
from unittest import mock
from tap.parser import Parser
try:
import yaml
from more_itertools import peekable # noqa
have_ya... | mblayman/tappy | tap/tests/test_parser.py | Python | bsd-2-clause | 16,677 |
"""Test for upgrading Puppet to Puppet4
:Requirement: Puppet
:CaseAutomation: NotAutomated
:CaseLevel: System
:CaseComponent: ConfigurationManagement
:TestType: Functional
:CaseImportance: High
:Upstream: No
"""
from robottelo.config import settings
from robottelo.decorators import (
run_in_one_thread,
... | ldjebran/robottelo | tests/foreman/longrun/test_puppet_upgrade.py | Python | gpl-3.0 | 2,986 |
# Copyright 2015 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/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | jonjozwiak/openstack | director-examples/sahara-osp8/utils.py | Python | apache-2.0 | 25,989 |
import json
from splunkdj.tokens import TokenSafeString
def component_context(context, type, id, component_type, require_file, kwargs, tag="div", classes=""):
"""Returns a component template context constructed from the given args."""
options = { 'app': context['app_name'] }
options.update(kwargs)
... | splunk/splunk-webframework | server/splunkdj/templatetags/tagutils.py | Python | apache-2.0 | 910 |
import re
import logging
import threading
from datetime import timedelta, datetime
from apscheduler.schedulers.background import BackgroundScheduler
import config
import utils.sms
import utils.system
import utils.network
from garden import Garden
from records import Records
from web.web_server import web_server
# On... | Hejtman/ultraGarden | server/gardener.py | Python | gpl-2.0 | 5,537 |
##############################################################################
#
# Copyright (C) 2018-2020 Compassion CH (http://www.compassion.ch)
# @author: Théo Nikles <theo.nikles@gmail.com>
#
# The licence is in the file __manifest__.py
#
###################################################################... | CompassionCH/compassion-switzerland | website_compassion/forms/my_donations_form.py | Python | agpl-3.0 | 8,735 |
"""Flow based node and edge disjoint paths."""
import networkx as nx
from networkx.exception import NetworkXNoPath
# Define the default maximum flow function to use for the undelying
# maximum flow computations
from networkx.algorithms.flow import edmonds_karp
from networkx.algorithms.flow import preflow_push
from net... | SpaceGroupUCL/qgisSpaceSyntaxToolkit | esstoolkit/external/networkx/algorithms/connectivity/disjoint_paths.py | Python | gpl-3.0 | 14,544 |
# -*- coding: utf-8 -*-
"""
Various i18n functions.
Helper functions for both the internal translation system
and for TranslateWiki-based translations.
By default messages are assumed to reside in a package called
'scripts.i18n'. In pywikibot 2.0, that package is not packaged
with pywikibot, and pywikibot 2.0 does ... | emijrp/pywikibot-core | pywikibot/i18n.py | Python | mit | 21,745 |
import json
import threading
import unittest
import urllib2
import pytest
from django_comment_client.tests.mock_cs_server.mock_cs_server import MockCommentServiceServer
class MockCommentServiceServerTest(unittest.TestCase):
'''
A mock version of the Comment Service server that listens on a local
port an... | ahmedaljazzar/edx-platform | lms/djangoapps/django_comment_client/tests/mock_cs_server/test_mock_cs_server.py | Python | agpl-3.0 | 2,228 |
from django.conf.urls import patterns, url
from .views import HomeView
urlpatterns = [
url(r'^$', HomeView.as_view(), name='index'),
] | SafePodOrg/SafePodWeb | safepod_site/home/urls.py | Python | gpl-3.0 | 171 |
# This file is heavily inspired by django.utils.version
def get_version(version):
"""Return a PEP 440-compliant version number from VERSION."""
version = get_complete_version(version)
# Now build the two parts of the version number:
# main = X.Y[.Z]
# sub = .devN - for pre-alpha releases
# ... | wagtail/wagtail | wagtail/utils/version.py | Python | bsd-3-clause | 1,478 |
from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Line(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "sankey.link"
_path_str = "sankey.link.line"
_valid_props = {"color", "colorsrc", "width", "wid... | plotly/plotly.py | packages/python/plotly/plotly/graph_objs/sankey/link/_line.py | Python | mit | 7,566 |
#!/usr/bin/env python3
# ====================================
# Copyright (c) Microsoft Corporation. All rights reserved.
# ====================================
from optparse import OptionParser
import os
import sys
import configparser
import packagesimportutil
# append worker binary source path
sys.path.append(os.p... | MSFTOSSMgmt/WPSDSCLinux | Providers/nxOMSAutomationWorker/automationworker/3.x/scripts/require_runbook_signature3.py | Python | mit | 1,687 |
# Created by Pearu Peterson, September 2002
from numpy.testing import (assert_, assert_equal, assert_array_almost_equal,
assert_array_almost_equal_nulp, assert_array_less)
import pytest
from pytest import raises as assert_raises
from scipy.fftpack import ifft, fft, fftn, ifftn, rfft, irfft, ... | aeklant/scipy | scipy/fftpack/tests/test_basic.py | Python | bsd-3-clause | 29,856 |
import numpy as np
import pandas as pd
arts = pd.DataFrame()
# 1. Clean the dates so you only see numbers by using string manipulations
arts["execution_date"] = arts["execution_date"].str.findall(r"([0-9]+)").str[0]
arts["execution_date"] = arts["execution_date"].astype(float)
arts.head()
# 1. If a year is lower th... | versae/DH2304 | data/arts2.py | Python | mit | 1,974 |
# -*- coding: utf-8 -*-
import json
import pytz
import uuid
import http.client
from base64 import standard_b64decode
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.utils.timezone import make_aware
from github import Github
from bakery.cookies.exceptions import ... | muffins-on-dope/bakery | bakery/utils/vcs/gh.py | Python | bsd-3-clause | 9,617 |
from moviepy.editor import ImageSequenceClip
import argparse
def main():
parser = argparse.ArgumentParser(description='Create driving video.')
parser.add_argument(
'image_folder',
type=str,
default='',
help='Path to image folder. The video will be created from these images.'
... | twildhage/BehavioralCloning | video.py | Python | mit | 750 |
# Import the Blender-Python API module
import bpy
# Import other useful modules
import mathutils
import math
import random
import sys
# Helper Method to rotate an object so that it points at a target
def pointObjectToTarget(obj, targetLoc):
dx = targetLoc.x - obj.location.x;
dy = targetLoc.y - obj.location.y;... | tlian7/RenderToolbox3 | Utilities/BlenderPython/SceneUtilsV1.py | Python | mit | 32,125 |
#!/usr/bin/env python
# -*-coding: utf-8 -*-
"""
__init__.py
~~~~~~~~~~~
Configurations for iiify
:copyright: (c) 2015 by AUTHORS
:license: see LICENSE for more details
"""
import os
import types
import configparser
path = os.path.dirname(os.path.realpath(__file__))
approot = os.path.abspath(os.... | mekarpeles/iiify | niiifty/configs/__init__.py | Python | gpl-3.0 | 1,589 |
###################################################################################################\
# Diffcalc utilities
###################################################################################################
#################################################################################################... | paulscherrerinstitute/pshell | src/main/assembly/script/Lib/diffutils.py | Python | gpl-3.0 | 34,642 |
try:
import cPickle as pickle
except ImportError:
import pickle
from django.conf import settings
from django.forms import BooleanField
from django.utils.crypto import salted_hmac
from django.utils.hashcompat import md5_constructor
def security_hash(request, form, *args):
"""
Calculates a security has... | ychen820/microblog | y/google-cloud-sdk/platform/google_appengine/lib/django-1.3/django/contrib/formtools/utils.py | Python | bsd-3-clause | 2,158 |
#!/usr/bin/env python
import os
import re
from collections import OrderedDict
def read_sample_name(line_iter, clean_fn, program_name):
"""
Consumes lines from the provided line_iter and parses those lines
as a header for the picard base distribution file. The header
file is assumed to contain a line... | ewels/MultiQC | multiqc/modules/picard/util.py | Python | gpl-3.0 | 3,082 |
# encoding=utf-8
__author__ = 'Q-Whai'
# Blog: http://blog.csdn.net/lemon_tree12138
# 2016/2/25
# version: 0.0.1
| William-Hai/SimpleDemo-python | enum/__init__.py | Python | gpl-3.0 | 115 |
class Address(object):
class InvalidFormat(Exception):
pass
@staticmethod
def sanity_check(host, port):
if not isinstance(host, str):
raise Address.InvalidFormat('Host must be a string, got %s' % host)
if not isinstance(port, (int, long)):
raise Address.InvalidFormat('Port must be an inte... | foursquare/commons-old | src/python/twitter/common/rpc/address.py | Python | apache-2.0 | 2,255 |
#!/usr/bin/env python3
import sys
import ptnet.net
if __name__ == '__main__' :
n = ptnet.net.Net (True)
n.read (sys.stdin, 'pt1')
n.stubbornify ()
n.cont2plain ()
n.write (sys.stdout, 'pt1')
# vi:ts=4:sw=4:et:
| cesaro/cunf | scripts/stubbornify.py | Python | gpl-3.0 | 233 |
## @package csnLinuxCommon
# Definition of LinuxCommon csnCompiler.Compiler.
# \ingroup compiler
import csnCompiler
import platform
import csnUtility
class LinuxCommon(csnCompiler.Compiler):
""" Abstract Linux compiler. """
def __init__(self):
csnCompiler.Compiler.__init__(self)
#self.basic... | msteghofer/CSnake | src/csnLinuxCommon.py | Python | bsd-3-clause | 1,983 |
import os
import sys
import pkg_resources
from path_helpers import path
import jinja2
config_template = '''
data_dir = .
[plugins]
# directory containing microdrop plugins
directory = plugins
[microdrop.gui.experiment_log_controller]
notebook_directory = notebooks
[microdrop.gui.dmf_device_co... | wheeler-microfluidics/microdrop | microdrop/bin/create_portable_config.py | Python | bsd-3-clause | 2,107 |
# -*- coding: utf-8 -*-
# Copyright (C) 2017 Matthias Luescher
#
# Authors:
# Matthias Luescher
#
# This file is part of edi.
#
# edi 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 version 3 of... | erickeller/edi | tests/test_command_line_interface.py | Python | lgpl-3.0 | 1,344 |
"""
dj-stripe TransferReversal model tests
"""
from copy import deepcopy
from unittest.mock import PropertyMock, patch
import pytest
from django.test.testcases import TestCase
from djstripe.models import TransferReversal
from djstripe.models.connect import Transfer
from djstripe.settings import djstripe_settings
fro... | pydanny/dj-stripe | tests/test_transfer_reversal.py | Python | bsd-3-clause | 6,148 |
#!/usr/bin/env python
#coding:utf-8
import root
import j
| tonghuashuai/ODockerUI | view/_url.py | Python | mit | 60 |
class JWTValidationError(Exception):
pass
class JWTAudienceError(JWTValidationError):
pass
| uc-cdis/cdis-python-utils | cdispyutils/auth/errors.py | Python | apache-2.0 | 101 |
from datetime import datetime
from hashlib import sha1
from xml.sax.saxutils import escape as xml_escape
from .common import CHARSET
def xml_template(template, data):
"""
return template % data but with proper escaping
"""
escaped_data = {}
for key, value in data.items():
escaped_data[key] ... | hoffie/gnucash-ofx-export | gce/ofx.py | Python | gpl-2.0 | 3,118 |
import datetime
import logging
from random import normalvariate
from django.core.management.base import BaseCommand
from dbag import autodiscover, dbag_manager
from dbag.models import Metric, DataSample
logger = logging.getLogger(__name__)
class Command(BaseCommand):
args = ''
help = 'Fake 60 days worth o... | winhamwr/dbag | dbag/management/commands/dbag_fake_metrics.py | Python | mit | 1,830 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Generate and display thumbnails and selection widgets for dealing with image galleries"""
# Copyright 2004 St James Software
#
# This file is part of jToolkit.
#
# jToolkit is free software; you can redistribute it and/or modify
# it under the terms of the GNU General... | cc-archive/jtoolkit | jToolkit/widgets/thumbgallery.py | Python | gpl-2.0 | 15,507 |
##########################################################################
#
# Copyright (c) 2011-2012, John Haddon. 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 ... | hradec/gaffer | python/GafferCortexUI/ObjectReaderUI.py | Python | bsd-3-clause | 2,749 |
# (c) Nelen & Schuurmans, see LICENSE.rst.
from qgis.core import QgsProject
from ThreeDiToolbox.tool_commands.custom_command_base import CustomCommandBase
from ThreeDiToolbox.utils import constants
from ThreeDiToolbox.utils.predictions import Predictor
from ThreeDiToolbox.utils.user_messages import messagebar_message
... | nens/threedi-qgis-plugin | tool_commands/predict_calc_points/command.py | Python | gpl-3.0 | 5,075 |
import os, sys
# - good = works
# - main = useful
# - extra = not very useful
# - bad = doesn't work
EXTRA = ['console', 'helloworld']
BAD = ['shoutcast']
def scan():
all = set(f for f in os.listdir('.') if os.path.isdir(f))
bad = set(BAD)
good = all - bad
extra = set(EXTRA)
main = good - ext... | Zarokka/exaile | plugins/list.py | Python | gpl-2.0 | 568 |
from ctypes import *
from ctypes import util
from rubicon.objc import *
######################################################################
# FOUNDATION
foundation = cdll.LoadLibrary(util.find_library('Foundation'))
foundation.NSMouseInRect.restype = c_bool
foundation.NSMouseInRect.argtypes = [NSPoint, NSRect, ... | pybee-attic/toga-cocoa | toga_cocoa/libs/foundation.py | Python | bsd-3-clause | 1,443 |
from django.contrib import admin # noqa
from junction.conferences import service
from .models import ScheduleItem, ScheduleItemType
@admin.register(ScheduleItem)
class SchduleItemAdmin(admin.ModelAdmin):
list_filter = ("type", "room")
def get_queryset(self, request):
qs = super(SchduleItemAdmin, s... | pythonindia/junction | junction/schedule/admin.py | Python | mit | 648 |
#!/usr/bin/env python3
"""
There is a filter_gff3_by_id_list.py script, but it doesn't currently have support for
features which share IDs (like segmented CDS) and I need something quick. The use
case here is that you have a list of mRNA.ids and this well export them along with their
child and parent features.
WARNI... | zctea/biocode | sandbox/jorvis/hack.filter_gff3_genes_by_mRNA_ids.py | Python | gpl-3.0 | 2,464 |
# Blogger.com Related Posts Service (http://brps.appspot.com/)
#
# Copyright (C) 2008, 2009 Yu-Jie Lin
#
# 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
# (... | livibetter-backup/brps | src/brps/post.py | Python | gpl-3.0 | 7,920 |
# *****************************************************************************
# Copyright (c) 2016 IBM Corporation and other Contributors.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution,... | Lokesh-K-Haralakatta/iot-python | test/applicationTest.py | Python | epl-1.0 | 7,665 |
"""
This tutorial introduces logistic regression using Theano and stochastic
gradient descent.
Logistic regression is a probabilistic, linear classifier. It is parametrized
by a weight matrix :math:`W` and a bias vector :math:`b`. Classification is
done by projecting data points onto a set of hyperplanes, the distance... | ZiweiXU/CAPTCHA_recog | logistic_sgd.py | Python | gpl-3.0 | 17,569 |
# -*- coding: utf-8 -*-
#
# Sentry documentation build configuration file, created by
# sphinx-quickstart on Wed Oct 20 16:21:42 2010.
#
# 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 ... | imankulov/sentry | docs/conf.py | Python | bsd-3-clause | 7,824 |
#/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 The SymbiFlow Authors.
#
# Use of this source code is governed by a ISC-style
# license that can be found in the LICENSE file or at
# https://opensource.org/licenses/ISC
#
# SPDX-License-Identifier: ISC
""" This file uses the fpga_interchange to crea... | SymbiFlow/python-fpga-interchange | tests/example_netlist.py | Python | isc | 13,854 |
import os
# Django settings for bettercachedemo project.
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or... | ironfroggy/django-better-cache | bettercachedemo/settings.py | Python | mit | 4,983 |
import json
import logging
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.stream.hls import HLSStream
log = logging.getLogger(__name__)
@pluginmatcher(re.compile(
r"https?://news\.now\.com/home/live"
))
class NowNews(Plugin):
epg_re = re.compile(r'''epg.getEPG\("(\d+)"\);''')
... | amurzeau/streamlink-debian | src/streamlink/plugins/nownews.py | Python | bsd-2-clause | 2,076 |
# -*- coding: utf-8 -*-
#
# Django Extra Views documentation build configuration file, created by
# sphinx-quickstart on Sun Jan 6 03:11:50 2013.
#
# 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 fi... | AndrewIngram/django-extra-views | docs/conf.py | Python | mit | 8,483 |
# 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 wri... | henaras/sahara | sahara/plugins/vanilla/abstractversionhandler.py | Python | apache-2.0 | 1,693 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Format management.
Creating new formats
--------------------
A new format named 'foo-bar' corresponds to Python module
'tracetool/format/foo_bar.py'.
A format module should provide a docstring, whose first non-empty line will be
considered its short description.
A... | yingted/qemu | scripts/tracetool/format/__init__.py | Python | gpl-2.0 | 2,859 |
from yapsy.IPlugin import IPlugin
from scanner.util import check_call
class FallbackScsv(IPlugin):
def description(self):
return "TLS_FALLBACK_SCSV"
def check(self, url, host_info):
host_info[self.description()] = None
if host_info["ssl checked"].get():
return None
... | kotnik/scanner | scanner/checks/fallback_scsv.py | Python | mit | 713 |
#!/usr/bin/env python
# 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.
"""Embeds standalone JavaScript snippets in C++ code.
The script requires the OverridesView file from WebKit that lists the known
mobi... | s20121035/rk3288_android5.1_repo | external/chromium_org/chrome/test/chromedriver/embed_mobile_devices_in_cpp.py | Python | gpl-3.0 | 1,418 |
import sys
try:
import pep8
except ImportError:
pep8 = None
def pep8_run(args, paths, config_file=None, stream=None):
'''Programmatically run ``pep8``.
Returns a 2-elements tuple with a string message and an exit code.
'''
args.remove('--pep8')
if pep8:
stream = stream or sys.std... | Ghost-script/dyno-chat | kickchat/apps/pulsar/apps/test/pep.py | Python | gpl-2.0 | 928 |
# -*- coding: utf-8 -*-
# © 2015 Grupo ESOC Ingeniería de Servicios, S.L. - Jairo Llopis.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
"""Test default values for models."""
from openerp.tests.common import TransactionCase
from .base import MailInstalled
class PersonCase(TransactionCase):
... | Antiun/partner-contact | partner_firstname/tests/test_create.py | Python | agpl-3.0 | 2,704 |
import argparse
import gzip
import io
import os
import subprocess
from collections import Counter
import progressbar
def convert_and_filter_topk(args):
""" Convert to lowercase, count word occurrences and save top-k words to a file """
counter = Counter()
data_lower = os.path.join(args.output_dir, "lowe... | googleinterns/deepspeech-reconstruction | data/lm/generate_lm.py | Python | apache-2.0 | 6,452 |
from deterministic_encryption_utils.encryption.EncryptionExtensions import FileSaltProvider, FilenameSaltProvider
from deterministic_encryption_utils.encryption.extensions import * # Necessary for finding subclasses
class ExtensionRegistry(object):
def __init__(self):
self.fileSaltProviders = Extensio... | seiferma/deterministic_encryption_utils | deterministic_encryption_utils/encryption/extensions/ExtensionRegistry.py | Python | mit | 1,633 |
# Copyright (C) 2013,2014,2015,2016 The ESPResSo project
# Copyright (C) 2012 Olaf Lenz
#
# This file is part of ESPResSo.
#
# ESPResSo 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 L... | Marcello-Sega/espresso | src/core/gen_featureconfig.py | Python | gpl-3.0 | 3,818 |
import socket
import threading
import struct
import logging
import string
from SocketServer import UDPServer, ThreadingMixIn, BaseRequestHandler
from core.responder.fingerprinter.RAPLANMANPackets import *
mitmf_logger = logging.getLogger("mitmf")
class LANFingerprinter():
def start(self, options):
glo... | lucap91/mitmf | core/responder/fingerprinter/LANFingerprinter.py | Python | gpl-3.0 | 8,947 |
_is_python2 = False
try:
""" Running on python 3.x """
from configparser import ConfigParser
except ImportError:
""" Running on python 2.6+ """
import ConfigParser
_is_python2 = True
if _is_python2:
config = ConfigParser.SafeConfigParser()
else:
config = ConfigParser()
def get_value(file... | aalves/voomon | voomon/utils/config/myconfig.py | Python | gpl-2.0 | 984 |
__author__ = 'Brendan'
#!/usr/bin/env python
from gimpfu import *
import random
import sys
from BasicOperations import *
import traceback
def Generative() :
try:
img,layer=initalize(2000,2000)
finalize(img)
except: #if program fails, print traceback information to gimp error console
tb... | bdegrafft/GGIMPLib | new.py | Python | gpl-3.0 | 677 |
#!/usr/bin/env python
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
from __future__ import absolute_import
import os
import subprocess
import sys
import os.path as p
import glob
PY_MAJOR, PY_MINOR = sys.version_info[ 0 : 2 ]
if not ( ( PY_MAJOR == 2 and... | sunchuanleihit/vimrc | sources_non_forked/YouCompleteMe/install.py | Python | mit | 1,500 |
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-
#
# Copyright (C) 2016-2018 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in ... | elopio/snapcraft | tests/integration/plugins/test_godeps_plugin.py | Python | gpl-3.0 | 2,298 |
#!/usr/bin/env python
# Copyright 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 require... | zhaochao/fuel-web | network_checker/network_checker/net_check/api.py | Python | apache-2.0 | 25,801 |
"""CGI/FastCGI handler for Mapnik OGC WMS Server.
Requires 'jon' module.
"""
from os import environ
from tempfile import gettempdir
environ['PYTHON_EGG_CACHE'] = gettempdir()
import sys
from jon import cgi
from ogcserver.common import Version
from ogcserver.configparser import SafeConfigParser
from ogcserver.wms11... | pbabik/OGCServer | ogcserver/cgiserver.py | Python | bsd-3-clause | 5,124 |
# mopitwail.py 0.1
# piratesec.de
#!/usr/bin/python
import subprocess
import datetime
import time
from time import sleep
import os
import sys
import random
# Mail-Imports
import smtplib
from email.mime.image import MIMEImage
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
# Tweet-Im... | nullx31/mopitwail.py | mopitwail.py | Python | mit | 3,087 |
from pyautomate import trackers, hash_
states = ''
def get_initial_state():
trackers['last compiled'] = lambda: hash_('file.f')
print(trackers['last compiled'].has_changed)
return 'state'
| timdiels/pyautomate | test/texttest/stateless_automaton/filesystem_changed/file/has_changed/auto.py | Python | gpl-3.0 | 203 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Example of the EnumerateInstances operation. The execution
arguments may be either internal defaults if less than the full set of
arguments is supplied on the command line or the supplied command
line arguments.
The command line arguments are:
- serv... | zenoss/pywbem | examples/enuminstances.py | Python | lgpl-2.1 | 3,334 |
# Generated by Django 1.11.4 on 2017-08-31 00:13
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("zerver", "0102_convert_muted_topic"),
]
operations = [
migrations.RemoveField(
model_name="userprofile",
name="muted_topics"... | rht/zulip | zerver/migrations/0103_remove_userprofile_muted_topics.py | Python | apache-2.0 | 339 |
# missileExplosiveDmgBonus
#
# Used by:
# Skills named like: Missiles (5 of 7)
# Skill: Rockets
# Skill: Torpedoes
type = "passive"
def handler(fit, skill, context):
fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill(skill),
"explosiveDamage", skill.getModifie... | Ebag333/Pyfa | eos/effects/missileexplosivedmgbonus.py | Python | gpl-3.0 | 370 |
#! /usr/bin/python
'''
This program is a demo on how to generate 'packet too
big packet' and IPv6 fragmented packets.
This program can also be used as NUT side of v6LC.4.1.4.
'''
from __future__ import print_function
import sys
import getopt
import time
from scapy.all import *
def main():
opts, _ = getopt.getopt(s... | jijianwen/Learn | Linux/network/scapy/pkt_too_big.py | Python | gpl-2.0 | 1,950 |
"""The syslog component."""
| aronsky/home-assistant | homeassistant/components/syslog/__init__.py | Python | apache-2.0 | 28 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('truco', '0001_initial'),
]
opera... | emmanuel-santos/GEM | old/truco/migrations/0002_auto_20140910_1306.py | Python | mit | 833 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008-2019 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://trac.edgewall.com/license.html.
#
# This software consists ... | rbaumg/trac | trac/versioncontrol/admin.py | Python | bsd-3-clause | 19,753 |
"""SCons.Tool.mslink
Tool-specific initialization for the Microsoft linker.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy ... | lightmare/mapnik | scons/scons-local-4.1.0/SCons/Tool/mslink.py | Python | lgpl-2.1 | 14,612 |
import setuptools
if __name__ == '__main__':
setuptools.setup(
name="groupmestats",
version="0.0.1",
author="Kyle Teske",
author_email="kjteske@gmail.com",
description="Calculating and displaying groupme statistics",
packages=setuptools.find_packages(),
licen... | kjteske/groupmestats | setup.py | Python | mit | 1,136 |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-09-06 17:02
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('anagrafica', '0040_refactor_nome_cognome'),
]
operations = [
migrations.AlterModelOp... | CroceRossaItaliana/jorvik | anagrafica/migrations/0041_auto_20160906_1702.py | Python | gpl-3.0 | 2,825 |
import json
from django.views.generic import TemplateView
from resource_daily_scheduler.booking_req_views import AjaxableBookingRequestCreateView, ColorSchema
from resource_daily_scheduler.models import BookableResource
from resource_daily_scheduler.views import ResourceScheduleTemplateView
__author__ = 'weijia'
cla... | weijia/resource-daily-scheduler | resource_daily_scheduler/table_scheduler.py | Python | bsd-3-clause | 1,410 |
import socket
import pickle
import time
class GameSocket(object):
def __init__(self, socket):
self.__socket = socket
self.set_buffer_size(4096)
self.__head_size = 64
# self.set_buffer_size(65536)
# self.set_buffer_size(131072)
# self.set_buffer_size(262144)
def se... | mimi1vx/openmoo2 | oldmess/networking/game_socket.py | Python | gpl-2.0 | 2,415 |
# -*- coding: utf-8 -*-
# (c) 2012-2013, Timothy Appnel <tim@appnel.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.
#... | shepdelacreme/ansible | lib/ansible/plugins/action/synchronize.py | Python | gpl-3.0 | 19,981 |
#!/usr/bin/env python
"""
Undistort image.
(C) 2016-2018 1024jp
"""
import math
import os
import sys
import cv2
import numpy as np
from modules import argsparser
from modules.datafile import Data
from modules.undistortion import Undistorter
from modules.projection import Projector
# constants
SUFFIX = "_calib"
c... | 1024jp/LensCalibrator | createimage.py | Python | mit | 6,006 |
# -*- coding: utf-8 -*-
from utils.db import SqliteDB
from utils.rwlogging import log
from indicator import ma
def calc_macd(prices, fast = 12, slow = 26, sign = 9):
ps = [p['close'] for p in prices]
macds = {}
macds['fast'] = ma.calc_ema(ps, fast)
macds['slow'] = ma.calc_ema(ps, slow)
macds['macd'] = map(lambda ... | rolandwz/pymisc | utrader/indicator/macd.py | Python | mit | 964 |
# Copyright 2020 Google Sans Authors
# Copyright 2021 Simon Cozens
# 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 appli... | googlefonts/fontbakery | Lib/fontbakery/profiles/shaping.py | Python | apache-2.0 | 17,535 |
# -*- coding: utf-8 -*-
"""h2lily.__main__: executed when h2lily directory is called as script."""
from h2lily.h2lily import main, __doc__
from docopt import docopt
options = docopt(__doc__, version='0.1')
main(options)
| thomasfillon/h2lily | h2lily/__main__.py | Python | agpl-3.0 | 224 |
from simple_block_tag import simple_block_tag
| piha/django-simple-block-tag | simpleblocktag/__init__.py | Python | mit | 46 |
# Copyright 2017 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 ... | stackArmor/security_monkey | security_monkey/auditors/gcp/gce/firewall.py | Python | apache-2.0 | 4,717 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Database Anonymization',
'version': '1.0',
'category': 'Extra Tools',
'description': """
This module allows you to anonymize a database.
===============================================
This m... | chienlieu2017/it_management | odoo/addons/anonymization/__manifest__.py | Python | gpl-3.0 | 1,171 |
with open("spellList.yaml", "a") as output:
category = input("category: ")
output.write('- "'+category+'":\n')
while True:
spell = input("spell: ")
if spell:
output.write(' - "'+spell+'.SPELL."\n')
else:
break
| Tosh007/DnD5_CharCreator | data/character/spellCreator.py | Python | gpl-3.0 | 273 |
"""
WSGI config for fishscore project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SET... | superdachs/fishscore | fishscore/fishscore/wsgi.py | Python | gpl-3.0 | 395 |
from .generic_plugin import GenericPlugin
from nose.plugins import Plugin as NosePluginBase
from nose.failure import Failure
class NosePlugin(NosePluginBase, GenericPlugin):
name = 'snort'
def begin(self):
self._begin_run()
def addFailure(self, test, exception_tuple, *_):
self._add_failur... | vmalloc/snort | snort/nose_plugin.py | Python | bsd-3-clause | 675 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.