text
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
231
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
score
float64
0
0.34
import sys, csv, string def generate_R_input(report_path, output_path): confidence_values = [] report_file = open(report_path, 'r') first_line = True for line in report_file: if first_line: first_line = False continue line = line.strip().split(',') if line[5] == 'Yes'...
emvecchi/mss
src/utils/crowdflower/retrieve_stats.py
Python
apache-2.0
925
0.025946
import requests,sys from config_helper import get_proxies def get_pem(): if get_proxies()==None: return None pem_resp = requests.get('http://curl.haxx.se/ca/cacert.pem', proxies=get_proxies()) if pem_resp.status_code != 200: print "ERROR: Received bad response from api: %d" % pem_resp.statu...
nramanan/nellie-bot
libs/rest.py
Python
mit
833
0.016807
#!/usr/bin/env python """Transform a CSV file exported from the Recorded Future UI into Maltego entities.""" import json import sys import csv import Tkinter, tkFileDialog from MaltegoTransform import * mt = MaltegoTransform() # Use Tkinter to open up a file dialog. root = Tkinter.Tk() root.lift() root.withdraw() s...
cmlh/Maltego-Recorded_Future
src/RF_Maltego_Package_1.0/rf_csv_maltegoload.py
Python
apache-2.0
2,043
0.040137
# -*- coding: utf-8 -*- # # amsn - a python client for the WLM Network # # Copyright (C) 2008 Dario Freddi <drf54321@gmail.com> # # 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...
kakaroto/amsn2
amsn2/protocol/events/addressbook.py
Python
gpl-2.0
2,240
0.000893
""" XVM (c) www.modxvm.com 2013-2017 """ # PUBLIC def initialize(): return _contacts.initialize() def isAvailable(): return _contacts.is_available def getXvmContactData(uid): return _contacts.getXvmContactData(uid) def setXvmContactData(uid, value): return _contacts.setXvmContactData(uid, value)...
peterbartha/ImmunoMod
res_mods/mods/packages/xvm_contacts/python/contacts.py
Python
mit
4,916
0.00773
# coding=utf-8 """Select users to be notified.""" __author__ = 'Christian Christelis <christian@kartoza.com>' __project_name = 'watchkeeper' __date__ = '27/05/15' __copyright__ = 'kartoza.com' __doc__ = '' from celery import shared_task from notifications.tasks.send_email import send_email_message from notification...
timlinux/watchkeeper
django_project/event_mapper/tasks/notify_priority_users.py
Python
bsd-2-clause
3,622
0.003313
#!/usr/bin/env python import os, sys, fcntl, socket, subprocess, struct, signal, time, logging import datetime from glob import glob from ConfigParser import ConfigParser ####################################################################### # CONFIG ##################################################################...
buzzdev/udpwatch
udpwatch.py
Python
gpl-2.0
6,405
0.012646
# -*- coding: utf-8 -*- # Generated by Django 1.10.4 on 2018-03-11 17:04 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('board', '0006_merge_20180311_1702'), ] operations ...
hangpark/kaistusc
apps/board/migrations/0007_auto_20180311_1704.py
Python
bsd-2-clause
1,864
0.003476
#!/usr/bin/env python # # Copyright 2021 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Delete files from the temporary directory on a Swarming bot.""" import os import sys if sys.platform == 'win32': os.system(r'forfiles /P c:\users\chro...
google/skia-buildbot
scripts/run_on_swarming_bots/delete_tmp_dirs.py
Python
bsd-3-clause
562
0.003559
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2007 by Kai Blin # # Plunger is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. # # This program is distributed in the hop...
kblin/plunger
plunger/plugins/md3.py
Python
gpl-2.0
7,657
0.004963
from mpi4py import MPI from cplpy import CPL comm = MPI.COMM_WORLD CPL = CPL() CFD_COMM = CPL.init(CPL.CFD_REALM) cart_comm = CFD_COMM.Create_cart([1, 1, 1]) CPL.setup_cfd(cart_comm, xyzL=[1.0, 1.0, 1.0], xyz_orig=[0.0, 0.0, 0.0], ncxyz=[32, 32, 32]) recv_array, send_array = CPL.get_arrays(recv_size=4, ...
Crompulence/cpl-library
examples/multi_send_recv/minimal_CFD.py
Python
gpl-3.0
946
0.015856
import logging import traceback from functools import wraps import os import re from django.conf import settings from django.db import connection from django.db.models import ManyToManyField logger = logging.getLogger(__name__) def debug_pg_notices(f): @wraps(f) def wrapped(*args, **kwargs): r = No...
GeotrekCE/Geotrek-admin
geotrek/common/utils/postgresql.py
Python
bsd-2-clause
6,597
0.001516
"""This is just a playing around module. Please ignore it""" import json import six from randomload.log import logging from six.moves.urllib import parse logger = logging.getLogger('randomload.actions.glance.usage') class Controller(object): def __init__(self, http_client): self.http_client = http_clien...
absalon-james/randomload
randomload/actions/glance/usage.py
Python
apache-2.0
2,200
0
import sys import xbmc,xbmcaddon,xbmcvfs import sqlite3 from subprocess import Popen import datetime,time # from vpnapi import VPNAPI channel = sys.argv[1] start = sys.argv[2] ADDON = xbmcaddon.Addon(id='script.stargate.guide') def adapt_datetime(ts): # http://docs.python.org/2/library/sqlite3.html#registering-a...
TheWardoctor/Wardoctors-repo
script.stargate.guide/resources/playwith/playwithchannel.py
Python
apache-2.0
2,920
0.008562
""" hybrid.py: IRCD-Hybrid protocol module for PyLink. """ import time from pylinkirc import conf from pylinkirc.classes import * from pylinkirc.log import log from pylinkirc.protocols.ts6 import TS6Protocol __all__ = ['HybridProtocol'] # This protocol module inherits from the TS6 protocol. class HybridProtocol(TS...
GLolol/PyLink
protocols/hybrid.py
Python
mpl-2.0
12,742
0.003375
#! /usr/bin/python # Copyright 2004-2008 Roman Yakovenko. # Distributed under the Boost Software License, Version 1.0. (See # accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import autoconfig import pygccxml from pygccxml.utils import * from pygccxml.parse...
avaitla/Haskell-to-C---Bridge
pygccxml-1.0.0/unittests/call_invocation_tester.py
Python
bsd-3-clause
4,057
0.027114
# -*- coding: UTF-8 -*- # /* # * Copyright (C) 2015 Libor Zoubek + jondas # * # * # * 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, or (at your option) # * any lat...
bbaronSVK/plugin.video.sosac.ph
resources/lib/sosac.py
Python
gpl-2.0
25,065
0.003152
import matplotlib.pyplot as plt import numpy as np import scattering import scipy.constants as consts import quantities as pq def plot_csec(scatterer, d, var, name): lam = scatterer.wavelength.rescale('cm') plt.plot(d, var, label='%.1f %s' % (lam, lam.dimensionality)) plt.xlabel('Diameter (%s)'...
dopplershift/Scattering
scripts/test_delta_units.py
Python
bsd-2-clause
1,224
0.011438
# Copyright 2018 Tecnativa - David Vidal # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). { 'name': 'Stock Picking Procure Method', 'summary': 'Allows to force the procurement method from the picking', 'version': '12.0.1.0.0', 'category': 'Warehouse', 'author': 'Tecnativa,' ...
Vauxoo/stock-logistics-warehouse
stock_picking_procure_method/__manifest__.py
Python
agpl-3.0
587
0
from django.utils.translation import ugettext as _ from rest_framework.authentication import BaseAuthentication from rest_framework.exceptions import AuthenticationFailed from allauth_api.account.rest_framework import authentication as account_auth from allauth_api.settings import allauth_api_settings from allauth_ap...
jannon/django-allauth-api
src/allauth_api/socialaccount/rest_framework/authentication.py
Python
bsd-2-clause
1,984
0.00252
#! /usr/bin/env python """ This program is for renaming files (through symbolic links) using a file conversion table. The columns should be ordered as so: new directory, new id, old directory, old file name. Columns can be separated using any standard ASCII character. If files are paired-end and follow the standard co...
Brazelton-Lab/system
rename.py
Python
gpl-2.0
5,082
0.007674
__author__ = 'xubinggui' class Student(object): def __init__(self, name, score): self.name = name self.score = score def print_score(self): print(self.score) bart = Student('Bart Simpson', 59) bart.print_score()
xu6148152/Binea_Python_Project
oop/student/student.py
Python
mit
246
0.012195
from django.contrib import admin from django.utils.translation import ugettext_lazy as _ from tendenci.apps.perms.admin import TendenciBaseModelAdmin from tendenci.apps.news.models import News from tendenci.apps.news.forms import NewsForm class NewsAdmin(TendenciBaseModelAdmin): list_display = ['headline', 'updat...
alirizakeles/tendenci
tendenci/apps/news/admin.py
Python
gpl-3.0
1,737
0.01209
import argparse import os import subprocess import sys SCRIPT_DIR = os.path.dirname(__file__) class ExecException(Exception): pass class Exec(object): @staticmethod def run(cmd, workingdir=None): p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=workingdir) ...
sh4d0/openvix
manage.py
Python
gpl-3.0
3,933
0.003051
# 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 ...
lmazuel/azure-sdk-for-python
azure-mgmt-compute/azure/mgmt/compute/v2016_03_30/models/storage_profile_py3.py
Python
mit
2,421
0.000413
#!/usr/bin/env python # 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. """ A collator for Mojo Application Manifests """ import argparse import json import shutil import sys import urlparse def ParseJSONF...
junhuac/MQUIC
src/mojo/public/tools/manifest/manifest_collator.py
Python
mit
1,675
0.017313
from gevent import monkey monkey.patch_all(subprocess=True) import os import sys cwd = os.path.dirname(os.path.abspath(__file__)) scalrpy_dir = os.path.normpath(os.path.join(cwd, '../../..')) sys.path.insert(0, scalrpy_dir) scalrpytests_dir = os.path.join(cwd, '../..') sys.path.insert(0, scalrpytests_dir) import tim...
kikov79/scalr
app/python/tests/scalrpytests/load_statistics_cleaner/steps.py
Python
apache-2.0
3,146
0.005086
#!/usr/bin/env python ############################################################################### # $Id: paux.py 32163 2015-12-13 17:44:50Z goatbar $ # # Project: GDAL/OGR Test Suite # Purpose: Test read/write functionality for PAux driver. # Author: Frank Warmerdam <warmerdam@pobox.com> # #####################...
nextgis-extra/tests
lib_gdal/gdrivers/paux.py
Python
gpl-2.0
2,669
0.010116
__author__ = 'Anatoli Kalysch'
anatolikalysch/VMAttack
ui/__init__.py
Python
mit
31
0
#!/usr/bin/python # -*- coding: utf-8 -*- ''' script.skin.helper.service Helper service and scripts for Kodi skins mainmodule.py All script methods provided by the addon ''' import xbmc import xbmcvfs import xbmcgui import xbmcaddon from skinsettings import SkinSettings from simplecache import SimpleC...
mrquim/mrquimrepo
script.skin.helper.service/resources/lib/main_module.py
Python
gpl-2.0
31,819
0.002326
import logging import pprint import requests logger = logging.getLogger(__name__) class RocketChatBase(object): settings = None endpoint = None headers = {} method = 'get' auth_token = None auth_user_id = None files = None def __init__(self, settings=None, *args, **kwargs): ...
dstegelman/rocket-python
rocketchat/calls/base.py
Python
mit
3,656
0
#!/usr/bin/python3 # # progress.py # # Author: Billy Wilson Arante # Created: 2016/02/05 PHT # Modified: 2016/08/19 PHT # def progress(): """Progress icon The Python 3 version of loading_icon.py. """ while True: for i in ["/", "-", "|", "\\", "|"]: print("%s\r" % i, end="") def...
arantebillywilson/python-snippets
py3/abw-things/progress.py
Python
mit
399
0.002506
#!/usr/bin/env python # # Copyright (C) 2009-2020 the sqlparse authors and contributors # <see AUTHORS file> # # This module is part of python-sqlparse and is released under # the BSD License: https://opensource.org/licenses/BSD-3-Clause """Module that contains the command line app. Why does this file exist, and why ...
andialbrecht/sqlparse
sqlparse/cli.py
Python
bsd-3-clause
5,712
0
from django.db import models class Log(models.Model): entry = models.CharField(max_length=255) comments = models.TextField() device_name = models.CharField(max_length=200) classification = models.CharField(max_length=200) pub_date = models.DateTimeField('date published') def __unicode__(self): return self.dev...
fiquett/SupportLogger
logs/models.py
Python
gpl-2.0
623
0.020867
# -*- coding: utf-8 -*- # ########################################################################### # # Author: Luis Felipe Mileo # Fernando Marcato Rodrigues # Daniel Sadamo Hirayama # Copyright 2015 KMEE - www.kmee.com.br # # This program is free software: you can redistribute it and/...
fernandomr/odoo-brazil-banking
l10n_br_account_banking_payment_cnab/wizard/payment_order_create.py
Python
gpl-3.0
5,746
0.000696
#!/usr/bin/env python # -*- coding: utf-8 -*- """ **remote_updater.py** **Platform:** Windows, Linux, Mac Os X. **Description:** Defines the :class:`RemoteUpdater` class and others online update related objects. **Others:** """ from __future__ import unicode_literals import os import platform from PyQt4....
KelSolaar/sIBL_GUI
sibl_gui/components/addons/online_updater/remote_updater.py
Python
gpl-3.0
31,337
0.003893
import sys import re import numpy as np from keras.models import Sequential from keras.layers import Dense, TimeDistributed, Dropout, Activation, LSTM, BatchNormalization from keras.optimizers import RMSprop, Adam from keras.layers.advanced_activations import LeakyReLU from keras.utils import np_utils #from seq2seq.mod...
b29308188/Deep-Generative-Model-for-Text-Data
src/basic_sentiment.py
Python
mit
8,591
0.014317
"""Test functions for simbad.util.pdb_util""" __author__ = "Adam Simpkin" __date__ = "19 Jan 2018" import os import tempfile import unittest import simbad.util class Test(unittest.TestCase): """Unit test""" def test_result_by_score_from_csv_1(self): """Test case for simbad.util.result_by_score_from...
rigdenlab/SIMBAD
simbad/util/tests/test_util.py
Python
bsd-3-clause
2,611
0.000766
from ..base import ParametrizedValue class BalancingAlgorithm(ParametrizedValue): name_separator = '' class BalancingAlgorithmWithBackup(BalancingAlgorithm): def __init__(self, backup_level=None): self.backup_level = backup_level super().__init__() class WeightedRoundRobin(BalancingAlgor...
idlesign/uwsgiconf
uwsgiconf/options/subscriptions_algos.py
Python
bsd-3-clause
863
0
#!python3 # -*- coding:utf-8 -*- import os import sys import time import ctypes import shutil import subprocess IsPy3 = sys.version_info[0] >= 3 if IsPy3: import winreg else: import codecs import _winreg as winreg BuildType = 'Release' IsRebuild = True Build = 'Rebuild' Update = False C...
xylsxyls/xueyelingshuang
src/storageMysql/scripts/rebuild_storage.py
Python
mit
13,961
0.008547
"""Compare Pulsar and HabCat coordinates""" import csv import astropy.units as u from astropy.coordinates import SkyCoord, Angle from astropy import coordinates as coord def flipra(coordinate): """Flips RA coordinates by 180 degrees""" coordinate = coordinate + 180 if coordinate > 360: ...
hippke/Pulsar-HabCat
matchATNF-full.py
Python
mit
3,210
0.002181
# -*- coding: utf-8 -*- import re import urllib.parse from ..base.simple_downloader import SimpleDownloader def decode_cloudflare_email(value): email = "" key = int(value[:2], 16) for i in range(2, len(value), 2): email += chr(int(value[i : i + 2], 16) ^ key) return email class UpleaCom(...
vuolter/pyload
src/pyload/plugins/downloaders/UpleaCom.py
Python
agpl-3.0
2,715
0.001842
""" discover and run doctests in modules and test files.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import inspect import platform import sys import traceback from contextlib import contextmanager import pytest from _pytest._code.code import Excepti...
hackebrot/pytest
src/_pytest/doctest.py
Python
mit
18,770
0.001332
# coding=utf-8 import numpy as np from numpy import random # a=np.array([[2,3,4,1,2],[1,3,4,5,4],[4,2,3,10,2],[3,5,6,7,9],[10,3,4,2,9]]) # # for i in xrange(5): # # a[i,i]=1000 # #b=a.argmin(axis=1) # print a # a=random.randint(1,100,size=(8,8)) MAX = 1000 MIN = 0 CARSEATS = 6 distMat = np.array([[0, 1, 15, 1...
Octoberr/swmcdh
Schedul/unceshi.py
Python
apache-2.0
1,831
0.013318
# -*- coding: utf-8 -*- """ *************************************************************************** FixedDistanceBuffer.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com *******************...
nirvn/QGIS
python/plugins/processing/algs/qgis/FixedDistanceBuffer.py
Python
gpl-2.0
5,246
0.002859
from JumpScale import j descr = """ remove old redis cache from system """ organization = "jumpscale" author = "deboeckj@codescalers.com" license = "bsd" version = "1.0" category = "redis.cleanup" period = 300 # always in sec timeout = period * 0.2 # max runtime = 20% of period order = 1 enable = True async = True ...
Jumpscale/jumpscale6_core
apps/agentcontroller/jumpscripts/core/cleanup/cleanupredisac.py
Python
bsd-2-clause
1,530
0.004575
""" Run target checks using snactor """ from generic_runner import run, pprint, get_actor def check_target(): """ Run multiple checks at target machine """ targetinfo = {} get_actor('check_target_group').execute(targetinfo) get_actor('check_target').execute(targetinfo) pprint(targetinfo['targetin...
leapp-to/snactor
examples/scripts/checktarget.py
Python
apache-2.0
400
0
# -*- coding: utf-8 -*- # # Copyright © 2014-2017 Red Hat, Inc. # # This copyrighted material is made available to anyone wishing to use, # modify, copy, or redistribute it subject to the terms and conditions # of the GNU General Public License v.2, or (at your option) any later # version. This program is distributed...
pombredanne/anitya
anitya/tests/base.py
Python
gpl-2.0
6,973
0.001291
# Copyright 2016-2017 Christian Shtarkov # # This file is part of Autobump. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later ver...
cshtarkov/autobump
autobump/handlers/python.py
Python
gpl-3.0
8,380
0.000955
""" Helpers for making some things in PIL easier """ from PIL import ImageDraw, ImageFont, ImageStat from math import ceil def drawTextWithBorder(draw, text, coords, fontname="Impact", fontsize=80, color="#fff", strokecolor="#000"): """ Draw text with a border. Althou...
The-Penultimate-Defenestrator/memefarm
memefarm/pilutil.py
Python
mit
2,924
0
import bpy from bpy.props import * from mathutils import Vector from ... base_types.node import AnimationNode from . spline_evaluation_base import SplineEvaluationBase class EvaluateSplineNode(bpy.types.Node, AnimationNode, SplineEvaluationBase): bl_idname = "an_EvaluateSplineNode" bl_label = "Evaluate Spline"...
Thortoise/Super-Snake
Blender/animation_nodes-master/nodes/spline/evaluate_spline.py
Python
gpl-3.0
1,278
0.007042
# This file is part of kernelconfig. # -*- coding: utf-8 -*- import abc import errno import os import shutil from ...abc import loggable from ...util import fs from ...util import fspath from . import _eclass __all__ = ["TemporaryOverlay", "TemporaryOverlayUnion"] class AbstractTemporaryOverlayBase(loggable.Abst...
dywisor/kernelconfig
kernelconfig/pm/portagevdb/overlay.py
Python
gpl-2.0
14,668
0
#!/usr/bin/env python3 # This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 import argparse import itertools import sys from benchexec import...
ultimate-pa/benchexec
contrib/plots/quantile-generator.py
Python
apache-2.0
5,188
0.001542
# -*- coding: utf-8 -*- from __future__ import unicode_literals from csacompendium.utils.abstractmodels import ( AuthUserDetail, CreateUpdateTime, ) from csacompendium.utils.createslug import create_slug from csacompendium.utils.modelmanagers import ( model_instance_filter, model_foreign_key_qs, mo...
nkoech/csacompendium
csacompendium/csa_practice/models.py
Python
mit
9,828
0.001933
#*************************************************************************** #* * #* Copyright (c) 2011, 2016 * #* Jose Luis Cercos Pita <jlcercos@gmail.com> * #* ...
bblacey/FreeCAD-MacOS-CI
src/Mod/Ship/WeightInstance.py
Python
lgpl-2.1
12,814
0.001795
# Collection of adjectives # September 19 2014 # Christian Bauer d = { } drev = { } num = 0 def ins(x): global num,d,drev d[num] = x drev[x] = num num = num + 1 ins('abandoned') ins('able') ins('absolute') ins('adorable') ins('adventurous') ins('academic') ins('acceptable') ins('acclaimed') ins('acco...
cjbauer/brainphrase
adjectives.py
Python
agpl-3.0
20,322
0.000295
"""Loading, parsing and storing of completion configurations.""" from __future__ import annotations import abc import dataclasses import os import typing as t from .constants import ( CONTROLLER_PYTHON_VERSIONS, SUPPORTED_PYTHON_VERSIONS, ) from .util import ( ANSIBLE_TEST_DATA_ROOT, read_lines_witho...
nitzmahone/ansible
test/lib/ansible_test/_internal/completion.py
Python
gpl-3.0
8,217
0.003529
#!../../../.env/bin/python import os import numpy as np import time a = np.array([ [1,0,3], [0,2,1], [0.1,0,0], ]) print a row = 1 col = 2 print a[row][col] assert a[row][col] == 1 expected_max_rows = [0, 1, 0] expected_max_values = [1, 2, 3] print 'expected_max_rows:', expected_max_rows print 'expected_...
chrisspen/homebot
src/test/max_column/test_max_column.py
Python
mit
690
0.008696
""" pyNEAT Copyright (C) 2007-2008 Brian Greer 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 ...
liquidkarma/pyneat
pyNEAT/Mutator.py
Python
gpl-2.0
790
0.005063
from OpenGL.GL import * from OpenGL.GLUT import * from OpenGL.GLU import * from OpenGL.GLUT.freeglut import * import GlutWrapper import math ESCAPE = b'\033' class GlutViewController(GlutWrapper.GlutWrapper): """docstring for GlutViewController""" def __init__(self): super(GlutViewController, self)._...
kosystem/PythonGlutWrapper
GlutViewController.py
Python
mit
2,389
0.000837
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2010, 2degrees Limited <egoddard@tech.2degreesnetwork.com>. # All Rights Reserved. # # This file is part of djangoaudit <https://launchpad.net/django-audit/>, # which is subject to the provisions of ...
rdkls/django-audit-mongodb
tests/test_models.py
Python
bsd-3-clause
25,093
0.009923
import numpy as np from pySDC.core.Sweeper import sweeper from pySDC.implementations.collocation_classes.gauss_lobatto import CollGaussLobatto class verlet(sweeper): """ Custom sweeper class, implements Sweeper.py Second-order sweeper using velocity-Verlet as base integrator Attributes: QQ:...
Parallel-in-Time/pySDC
pySDC/implementations/sweeper_classes/verlet.py
Python
bsd-2-clause
7,323
0.002048
#!/usr/bin/env python import numpy as np import scipy.optimize as spo def integer_optimize(): x = np.arange(1,101) f = (x % 6)**2 % 7 - np.sin(x) return x[np.argmax(f)] def f(x): return -x**4 + 1000 * x**3 - 20 * x**2 + 4*x -6 if __name__ == '__main__': print("Integer optimium: x = {}\n".format(...
tleonhardt/machine_learning
optimize_me.py
Python
apache-2.0
437
0.011442
from rest_framework import permissions from . import models class IsOwnerOrPublic(permissions.IsAuthenticatedOrReadOnly): message = "Not object owner or public" def has_object_permission(self, request, view, obj): if request.user == obj.owner: return True if request.meth...
kfdm/django-simplestats
quickstats/permissions.py
Python
mit
1,370
0.00073
#!/usr/bin/env python3.4 # -*- 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 under the Apache License...
sebbASF/infrastructure-puppet
modules/git_self_serve/files/githubcron.py
Python
apache-2.0
4,335
0.00692
# -*- coding: utf-8 -*- """Generate graphs with a given degree sequence or expected degree sequence. """ # Copyright (C) 2004-2016 by # Aric Hagberg <hagberg@lanl.gov> # Dan Schult <dschult@colgate.edu> # Pieter Swart <swart@lanl.gov> # All rights reserved. # BSD license. import heapq from itertools i...
SanketDG/networkx
networkx/generators/degree_seq.py
Python
bsd-3-clause
27,099
0.005573
import sys import warnings from setuptools import setup, find_packages, Extension import numpy if 'develop' not in sys.argv: raise NotImplementedError("since Pylearn2 is under rapid, active " "development, `python setup.py install` is " "intentionally dis...
ml-lab/pylearn2
setup.py
Python
bsd-3-clause
3,408
0
from matchers import ( linear_match as html_match, prune_unmatched_elements ) from spec import ( a, accordion, acc_body, acc_group, acc_heading, div, elem, heading, html, img, input, option, option_xhtml, select, text, ) from formatters import ( ...
thomasdunton/python-html-assert
pha/__init__.py
Python
mit
351
0
# Copyright 2015 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
Avinash-Raj/appengine-django-skeleton
todo/tests.py
Python
bsd-3-clause
692
0
import uuid from google.appengine.api import memcache class CollectionCache: def __init__(self, timeout=480, hash=None): self.contents = []; if hash: self.contents = memcache.get(hash) self.timeout = timeout def add(self, item): hash = uuid.uuid1().hex mem...
rmoskal/e-springpad
collection_cache.py
Python
mit
845
0.014201
from pygame import * ''' The music must be in the same folder/project to work You have to install pygame command: pip install pygame ''' mixer.init() msc = input('Song Name: ') mixer.music.load('{}.mp3'.format(msc)) mixer.music.play() while mixer.music.get_busy(): time.Clock().tick(10) if inpu...
HoussemCharf/FunUtils
Fun Scripts/Player.py
Python
mit
351
0.005698
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
roadmapper/ansible
lib/ansible/modules/network/cloudengine/ce_mlag_interface.py
Python
gpl-3.0
36,992
0.001892
""" Support for particulate matter sensors connected to a serial port. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.serial_pm/ """ import logging import voluptuous as vol from homeassistant.const import CONF_NAME from homeassistant.helpers.ent...
jamespcole/home-assistant
homeassistant/components/serial_pm/sensor.py
Python
apache-2.0
2,805
0
from django.http import HttpResponse from django.conf import settings import json def javascript_variables(request): variables = { 'STATIC_PREFIX': settings.STATIC_URL } var_catalog = "// VARIABLE CATALOG FOR DJANGO VARIABLES\n\n" var_catalog += "\n".join(("%s = %s;" % (key, json.dumps(va...
Mezgrman/mezgrmanDE
mezgrman/views.py
Python
agpl-3.0
434
0.013825
# Copyright 2017 Kevin Howell # # This file is part of sixoclock. # # sixoclock 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. # # six...
kahowell/sixoclock
sixoclock/cli.py
Python
gpl-3.0
6,455
0.003098
import os import random import time from flask import Flask, request, render_template, session, flash, redirect, \ url_for, jsonify from flask.ext.mail import Mail, Message from flask.ext.sqlalchemy import SQLAlchemy from celery import Celery app = Flask(__name__) app.config['SECRET_KEY'] = 'top-secret!' # Flask...
bdh1011/wau
app.py
Python
mit
4,092
0.000244
# # 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...
lukecwik/incubator-beam
sdks/python/apache_beam/io/gcp/gcsio_overrides.py
Python
apache-2.0
2,063
0.003393
#!/usr/bin/python from fsm import parse_automaton, accept import re __author__ = 'Roland' import sys keywords = ['float', 'char', 'print', 'input', 'break', 'continue', 'return', 'def', 'if', 'elif', 'else', 'while', 'or', 'and', 'not'] operators = ['=', '<', '>', '==', '>=', '<=', '!=', '+', '-', '*', '...
rolisz/hw3
LFTC/L2/lexer.py
Python
bsd-3-clause
6,145
0.002929
import logging from ..directives import directives_by_section logger = logging.getLogger(__name__) class Stanza(object): """ Subclass for config file stanzas. In an HAProxy config file, a stanza is in the form of:: stanza header directive directive directive S...
wglass/lighthouse
lighthouse/haproxy/stanzas/stanza.py
Python
apache-2.0
2,087
0
# -*- coding: utf-8 -*- """ @author: Fabio Erculiani <lxnay@sabayon.org> @contact: lxnay@sabayon.org @copyright: Fabio Erculiani @license: GPL-2 B{Entropy Transceivers Fetchers submodule}. """ import os import errno import sys import time try: import httplib except ImportError: # python 3...
mudler/entropy
lib/entropy/fetchers.py
Python
gpl-2.0
52,462
0.003298
""" KaraCos - web platform engine - http://karacos.org/ Copyright (C) 2009-2010 Nicolas Karageuzian - Cyril Gratecis 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...
karacos/karacos-wsgi
py/karacos/core/mail.py
Python
lgpl-3.0
2,688
0.007068
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
vegitron/ansible
lib/ansible/executor/task_executor.py
Python
gpl-3.0
31,968
0.003191
__author__ = 'sandro' from distutils.core import setup setup( author='Sandro Covo', author_email="sandro@covo.ch", packages=['brainfuck'], scripts=['scripts/pyfuck'], name="Pyfuck", description="Brainfuck interpreter written in python" )
sacovo/brainfuck
setup.py
Python
gpl-2.0
262
0.003817
#-*- coding: utf-8 -*-
hzlf/openbroadcast
website/shop/shop_ajax/admin.py
Python
gpl-3.0
24
0.083333
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- __author__ = 'Florents Tselai' from datetime import datetime from urllib.request import urlopen, Request from bs4 import BeautifulSoup from fake_useragent import UserAgent from pycargr.model import Car class SearchResultPageParser: def __init__(self, search_pag...
Florents-Tselai/PyCarGr
pycargr/parser.py
Python
mit
5,387
0.000931
import requests import time from selenium import webdriver # file path import os BASE_DIR = os.path.dirname(__file__) phjs_path = os.path.join(BASE_DIR,'login.phjs.js') print ('*******'+phjs_path+'*******') driver = webdriver.PhantomJS(executable_path=phjs_path) driver.get('http://autoinsights.autodmp.com/user/login')...
Veblin/pythonDemo
spiders/logins.py
Python
mit
401
0.009975
# Copyright 2016 Casey Jaymes # This file is part of PySCAP. # # PySCAP 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. # # PySCAP is ...
cjaymes/pyscap
src/scap/model/xccdf_1_2/ModelType.py
Python
gpl-3.0
6,764
0.003999
__author__ = 'Archana V Menon, Sujith V'
sujithvm/skynet
code/__init__.py
Python
mit
41
0
"""This file implements the gym environment of minitaur. """ import math import random import os, inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(os.path.dirname(currentdir)) os.sys.path.insert(0, parentdir) from gym import spaces import nump...
MadManRises/Madgine
shared/bullet3-2.89/examples/pybullet/gym/pybullet_envs/minitaur/envs/minitaur_ball_gym_env.py
Python
mit
5,864
0.00648
import os import pytest from pyleus.cli.storm_cluster import _get_storm_cmd_env from pyleus.cli.storm_cluster import STORM_JAR_JVM_OPTS from pyleus.cli.storm_cluster import StormCluster from pyleus.cli.storm_cluster import TOPOLOGY_BUILDER_CLASS from pyleus.testing import mock class TestGetStormCmdEnd(object): ...
jirafe/pyleus
tests/cli/storm_cluster_test.py
Python
apache-2.0
1,989
0.001508
# # The Multiverse Platform is made available under the MIT License. # # Copyright (c) 2012 The Multiverse Foundation # # 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 restrict...
longde123/MultiversePlatform
tools/Machinima/sendXmlJobs.py
Python
mit
4,886
0.00614
# Ant # # Copyright (c) 2012, Gustav Tiger <gustav@tiger.name> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, m...
ddboline/Garmin-Forerunner-610-Extractor_fork
ant/easy/node.py
Python
mit
4,653
0.004083
# -*- coding: latin-1 -*- # Author: adaur <adaur.underground@gmail.com> # URL: http://code.google.com/p/sickbeard/ # # This file is part of SickRage. # # SickRage 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...
giggsey/SickRage
sickbeard/providers/xthor.py
Python
gpl-3.0
8,500
0.004471
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Softwa...
toofar/qutebrowser
tests/unit/utils/test_urlmatch.py
Python
gpl-3.0
17,880
0
""" PASSIVE Plugin for Testing_for_SSL-TLS_(OWASP-CM-001) """ from framework.dependency_management.dependency_resolver import ServiceLocator DESCRIPTION = "Third party resources" def run(PluginInfo): # Vuln search box to be built in core and resued in different plugins: resource = ServiceLocator.get_compon...
DarKnight24/owtf
plugins/web/passive/Testing_for_SSL-TLS@OWTF-CM-001.py
Python
bsd-3-clause
489
0.00409
#!/usr/bin/python # -*- coding: utf-8 -*- """ This file is part of XBMC Mega Pack Addon. Copyright (C) 2014 Wolverine (xbmcmegapack@gmail.com) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Softwar...
xbmcmegapack/plugin.video.megapack.dev
resources/lib/menus/home_countries_greece.py
Python
gpl-3.0
1,109
0.00271
# -*- coding: utf-8 -*- # vim: set ts=4 et import cgi import requests from six.moves.html_parser import HTMLParser from plugin import * content_types = ( 'text/html', 'text/xml', 'application/xhtml+xml', 'application/xml' ) class TitleParser(HTMLParser): def __init__(self): HTMLParser._...
jrspruitt/jkent-pybot
pybot/plugins/anyurl.py
Python
mit
2,136
0.004682
# Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # https://developers.google.com/protocol-buffers/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redi...
meghana0507/grpc-java-poll
lib/netty/protobuf/python/google/protobuf/internal/api_implementation.py
Python
bsd-3-clause
4,621
0.004112
"""The test for binary_sensor device automation.""" from datetime import timedelta import pytest from unittest.mock import patch from homeassistant.components.binary_sensor import DOMAIN, DEVICE_CLASSES from homeassistant.components.binary_sensor.device_condition import ENTITY_CONDITIONS from homeassistant.const impor...
joopert/home-assistant
tests/components/binary_sensor/test_device_condition.py
Python
apache-2.0
8,656
0.001733
from PyQt4.QtGui import QFileDialog def get_pcv_filename(): """Opens the PCV file with a QFileDialog.""" return QFileDialog.getOpenFileName(None, "Open Pcoords graph", "", "Pcoords Files (*.pgdl *.pcv)")
mike-perdide/pcoords-gui
pcoordsgui/utils.py
Python
gpl-3.0
292
0