code
stringlengths
6
947k
repo_name
stringlengths
5
100
path
stringlengths
4
226
language
stringclasses
1 value
license
stringclasses
15 values
size
int64
6
947k
from CommonServerPython import * ''' STANDALONE FUNCTION ''' def get_threat_indicator_list(args: Dict[str, Any]) -> list: """ Executes cofense-threat-indicator-list command for given arguments. :type args: ``Dict[str, Any]`` :param args: The script arguments provided by the user. :return: List ...
VirusTotal/content
Packs/CofenseTriage/Scripts/CofenseTriageThreatEnrichment/CofenseTriageThreatEnrichment.py
Python
mit
1,197
""" syntax entity ::= {id(utc millisecond), type, id_from, id_to, status, data, source, note} data example1: search wikipedia { "id":1378327851001, "type":"name-name", "id-from":"MIT", "id-to":"Massachusetts Institute of Technology", "status":"auto", "date":"2013-09-04", "source":"wikipedia...
lidingpku/open-conference-data
iswc-metadata/src/mu/lib_entity.py
Python
mit
3,860
from . import strip class Segment(strip.Strip): """Represents an offset, length segment within a strip.""" def __init__(self, strip, length, offset=0): if offset < 0 or length < 0: raise ValueError('Segment indices are non-negative.') if offset + length > len(strip): ...
rec/BiblioPixel
bibliopixel/layout/geometry/segment.py
Python
mit
1,539
# Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file acc...
LockScreen/Backend
venv/lib/python2.7/site-packages/awscli/customizations/codedeploy/systems.py
Python
mit
7,661
from .. import x64dbg class HardwareType: HardwareAccess = x64dbg.HardwareAccess HardwareWrite = x64dbg.HardwareWrite HardwareExecute = x64dbg.HardwareExecute def Wait(): x64dbg.Wait() def Run(): x64dbg.Run() def Stop(): x64dbg.Stop() def StepIn(): x64dbg.StepIn() def StepOver(): ...
x64dbg/x64dbgpy
swig/x64dbgpy/pluginsdk/_scriptapi/debug.py
Python
mit
744
# -*- coding: utf-8 -*- from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('crowdsourcing', '0007_auto_20151208_1957'), ] operations = [ migrations.RunSQL(''' CREATE OR REPLACE FUNCTION get_requester_ratings(IN worker_profile_id INTEGER) ...
aginzberg/crowdsource-platform
crowdsourcing/migrations/0000_get_requester_ratings_fn.py
Python
mit
3,733
from rest_framework import status, views from rest_framework.response import Response from waldur_core.core.utils import get_lat_lon_from_address from . import serializers class GeocodeViewSet(views.APIView): def get(self, request): serializer = serializers.GeoCodeSerializer(data=request.query_params) ...
opennode/nodeconductor-assembly-waldur
src/waldur_geo_ip/views.py
Python
mit
706
""" Support for monitoring the local system.. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.systemmonitor/ """ import logging import homeassistant.util.dt as dt_util from homeassistant.const import STATE_OFF, STATE_ON from homeassistant.helpers....
aoakeson/home-assistant
homeassistant/components/sensor/systemmonitor.py
Python
mit
5,755
from __future__ import absolute_import, unicode_literals import pytest import logging from psd_tools.psd.effects_layer import ( CommonStateInfo, ShadowInfo, InnerGlowInfo, OuterGlowInfo, BevelInfo, SolidFillInfo, ) from ..utils import check_write_read, check_read_write logger = logging.getLog...
kmike/psd-tools
tests/psd_tools/psd/test_effects_layer.py
Python
mit
859
#!/usr/bin/env python3 # Copyright (c) 2015-2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test behavior of -maxuploadtarget. * Verify that getdata requests for old blocks (>1week) are dropped ...
nlgcoin/guldencoin-official
test/functional/feature_maxuploadtarget.py
Python
mit
6,606
#!/usr/bin/env python """ Goal: Implement the application entry point. @authors: Andrei Sura <sura.andrei@gmail.com> """ import argparse from olass.olass_client import OlassClient from olass.version import __version__ DEFAULT_SETTINGS_FILE = 'config/settings.py' def main(): """ Read args """ parser = arg...
indera/olass-client
olass/run.py
Python
mit
1,316
import subprocess import unittest import urllib2 import shutil import json import ast import os from flask import Flask from flask.ext.testing import LiveServerTestCase from lwp.app import app from lwp.utils import connect_db token = 'myrandomapites0987' class TestApi(LiveServerTestCase): db = None type_js...
romses/LXC-Web-Panel
tests/api.py
Python
mit
2,899
#! /usr/bin/env python '''Make sure the Riak client is sane''' import unittest from test import BaseTest from simhash_db import Client class RiakTest(BaseTest, unittest.TestCase): '''Test the Riak client''' def make_client(self, name, num_blocks, num_bits): return Client('riak', name, num_blocks, nu...
seomoz/simhash-db-py
test/test_riak.py
Python
mit
377
import boto3 import logging import time from string import Template from pyhocon import ConfigTree from botocore.exceptions import ClientError from typing import List, Any, Tuple, Dict from . import Instance from .instancemanager import InstanceManager from ..utils import random_str, random_int log = logging.getLogg...
d53dave/cgopt
csaopt/instancemanager/awstools.py
Python
mit
13,839
from flask import Blueprint, render_template, request from werkzeug.exceptions import NotFound from grano.lib.pager import Pager from grano.model import Relation relations = Blueprint('relations', __name__, static_folder='../static', template_folder='../templates') @relations.route('/relations/<id>') def view(id):...
IuliiSe/openinterests.eu
openinterests/views/relations.py
Python
mit
468
# 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-machinelearningcompute/azure/mgmt/machinelearningcompute/models/__init__.py
Python
mit
3,596
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/ship/crafted/weapon/shared_quick_shot_upgrade_mk4.iff" result.attri...
anhstudios/swganh
data/scripts/templates/object/tangible/ship/crafted/weapon/shared_quick_shot_upgrade_mk4.py
Python
mit
484
from setuptools import setup setup(name='awstools', version='0.1', description='Simple API for AWS IoT', url='https://github.com/h314to/awstools', author='Filipe Agapito', author_email='filipe.agapito@gmail.com', license='MIT', packages=['awstools'], install_requires=[ ...
h314to/awstools
setup.py
Python
mit
455
# coding=utf-8 """ The SNMPRawCollector is designed for collecting data from SNMP-enables devices, using a set of specified OIDs #### Configuration Below is an example configuration for the SNMPRawCollector. The collector can collect data any number of devices by adding configuration sections under the *devices* hea...
disqus/Diamond
src/collectors/snmpraw/snmpraw.py
Python
mit
6,089
""" Test compiling and executing using the dmd tool. """ # # __COPYRIGHT__ # # 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...
timj/scons
test/D/HSTeoh/sconstest-singleStringCannotBeMultipleOptions_dmd.py
Python
mit
1,396
import re import os import errno import shutil import hashlib from collections import namedtuple from uuid import uuid4 import psycopg2 import core.db.query_rewriter from psycopg2.extensions import AsIs from psycopg2.pool import ThreadedConnectionPool from psycopg2 import errorcodes from core.db.licensemanager import L...
datahuborg/datahub
src/core/db/backend/pg.py
Python
mit
45,439
import sys sys.path = ['../src/'] + sys.path import unittest from mlab.mlabwrap import MatlabReleaseNotFound class TestMlabUnix(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def test_version_discovery(self): import mlab instances = mlab.releases.Matl...
codypiersall/mlab
tests/test_mlab_on_unix.py
Python
mit
753
# Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/ # Copyright 2012-2014 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http...
arnavd96/Cinemiezer
myvenv/lib/python3.4/site-packages/botocore/retryhandler.py
Python
mit
13,631
""" The provider bits of TileStache. A Provider is the part of TileStache that actually renders imagery. A few default providers are found here, but it's possible to define your own and pull them into TileStache dynamically by class name. Built-in providers: - mapnik (Mapnik.ImageProvider) - proxy (Proxy) - vector (T...
kartta-labs/mapwarper
lib/tilestache/TileStache-1.51.5/TileStache/Providers.py
Python
mit
12,088
#This python script is modified from oneyear_data_layer_subset_good.pro #This routine open one year files defined in file lists, stack these file, subset, and fill bad data with -2000 #input arguments are flist_ndvi, flist_bq, ul_lon,ul_lat,lr_lon,lr_lat #;inputs: yyyy_flist_ndvi----file list for one year *ndvi.tif,...
gina-alaska/emodis_ndvi_python-docker
emodis_ndvi_python/pycodes/oneyear_data_layer_subset_good.py
Python
mit
5,054
import contextlib import sqlite3 @contextlib.contextmanager def sqlite3_connection(db_name): connection = sqlite3.connect(db_name) yield connection connection.close() with sqlite3_connection('dhcp_snooping.db') as conn: for row in conn.execute('select * from dhcp'): print(row) try: conn....
emilgaripov/emilgaripov.github.io
code_examples/python_with/with_sqlite3_conn_contextmanager.py
Python
mit
403
from twilio.twiml.voice_response import Gather, VoiceResponse response = VoiceResponse() response.gather() print(response)
TwilioDevEd/api-snippets
twiml/voice/gather/gather-2/gather-2.6.x.py
Python
mit
125
from .namespace import RBoxNameSpaceListener from .completion import RBoxCompletionListener, RBoxAutoComplete from .popup import RBoxPopupListener, RBoxShowPopup from .main_menu import RBoxMainMenuListener, RBoxPackageSendCodeCommand from .render import RBoxRenderRmarkdownCommand, RBoxSweaveRnwCommand, RBoxKnitRnwComma...
hafen/R-Box
box/__init__.py
Python
mit
565
# -*- coding: utf-8 -*- class DataType(object): def __init__(self, type, preprocessor=None): self.type = type self.preprocessor = preprocessor def preprocess(self, value): return self.preprocessor(value) if self.preprocessor else value def serialize(self, value): return ...
aa403/betfair.py
betfair/meta/datatype.py
Python
mit
514
"""Module to help with parsing and generating configuration files.""" import asyncio import logging import os import shutil from types import MappingProxyType # pylint: disable=unused-import from typing import Any, Tuple # NOQA import voluptuous as vol from homeassistant.const import ( CONF_LATITUDE, CONF_LONGI...
dmeulen/home-assistant
homeassistant/config.py
Python
mit
11,390
# -*- coding: utf-8 -*- # daemon/runner.py # Part of python-daemon, an implementation of PEP 3143. # # Copyright © 2009–2010 Ben Finney <ben+python@benfinney.id.au> # Copyright © 2007–2008 Robert Niederreiter, Jens Klein # Copyright © 2003 Clark Evans # Copyright © 2002 Noah Spurrier # Copyright © 2001 Jürgen Hermann ...
numa-engineering/python-daemon
daemon/runner.py
Python
gpl-2.0
7,204
from Components.Pixmap import MovingPixmap, MultiPixmap from Tools.Directories import resolveFilename, SCOPE_SKIN from xml.etree.ElementTree import ElementTree from Components.config import config, ConfigInteger from Components.RcModel import rc_model from boxbranding import getBoxType config.misc.rcused = Config...
kingvuplus/boom
lib/python/Screens/Rc.py
Python
gpl-2.0
3,561
#! /usr/bin/env python # Originally by Dave Goodger, from the docutils, distribution. # # Modified for Bazaar to accommodate options containing dots # # This file is in the public domain. """ A minimal front end to the Docutils Publisher, producing HTML. """ try: import locale locale.setlocale(locale.LC_ALL,...
Distrotech/bzr
tools/rst2html.py
Python
gpl-2.0
1,883
from xcrawler.compatibility.string_converter.compatible_string_converter import CompatibleStringConverter class StringConverterPython3(CompatibleStringConverter): """A Python 3 compatible class for converting a string to a specified type. """ def convert_to_string(self, string): string = self.tr...
lucdom/xCrawler
xcrawler/compatibility/string_converter/string_converter_python3.py
Python
gpl-2.0
509
#!/usr/bin/env python # -*- coding:UTF-8 __author__ = 'shenshijun' import copy class Queue(object): """ 使用Python的list快速实现一个队列 """ def __init__(self, *arg): super(Queue, self).__init__() self.__queue = list(copy.copy(arg)) self.__size = len(self.__queue) def enter(self, val...
NoSmartNoMan/algorithm-1
lib/queue.py
Python
gpl-2.0
833
# -*- coding: utf-8 -*- """Module for parsing main configuration file (nagios.cfg).""" from pynag.Utils import paths class MainConfig(object): """ Generic parser for files in the format of key=value. This is the format used by nagios.cfg and many other unix configuration files. """ def __init__(sel...
llange/pynag
pynag/Parsers/main.py
Python
gpl-2.0
1,566
# Copyright (c) 2012 Hesky Fisher # See LICENSE.txt for details. # # processlock.py - Cross platform global lock to ensure plover only runs once. """Global lock to ensure plover only runs once.""" import sys class LockNotAcquiredException(Exception): pass if sys.platform.startswith('win32'): from ctypes ...
nimble0/plover
plover/oslayer/processlock.py
Python
gpl-2.0
2,400
# Copyright (C) 2008 LibreSoft # # 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 ...
SoftwareIntrospectionLab/MininGit
pycvsanaly2/extensions/FileTypes.py
Python
gpl-2.0
6,480
# -*- coding: utf-8 -*- ''' script.matchcenter - Football information for Kodi A program addon that can be mapped to a key on your remote to display football information. Livescores, Event details, Line-ups, League tables, next and previous matches by team. Follow what others are saying about the match ...
hwoods723/script.gamescenter
resources/lib/eventdetails.py
Python
gpl-2.0
22,677
# -*- coding: utf-8 -*- import copy import json import math from functools import partial from PyQt4.QtCore import QSettings, QTranslator, qVersion, QCoreApplication, pyqtSignal, QObject, pyqtSlot, Qt, QUrl, \ QRectF, SIGNAL, QPointF, QLineF from PyQt4.QtGui import QAction, QIcon, QPainter, QPen, QBrush, QColor, ...
michaelborck/earthmine-qgis
qgisplugin/earthmine/earthmine_qgis.py
Python
gpl-2.0
33,806
# -*- coding: utf-8 -*- """ Created on Wed Mar 2 12:13:32 2016 @author: Zahari Kassabov """
NNPDF/reportengine
src/reportengine/tests/__init__.py
Python
gpl-2.0
95
from devassistant.command_runners import CommandRunner from devassistant.logger import logger class CR1(CommandRunner): @classmethod def matches(cls, c): return c.comm_type == 'barbarbar' @classmethod def run(cls, c): logger.info('CR1: Doing something ...') x = c.input_res + 'b...
phracek/devassistant
test/fixtures/files/crt/commands/a.py
Python
gpl-2.0
609
from boxbranding import getBoxType, getMachineName, getMachineBuild, getBrandOEM, getMachineBrand from Screens.Wizard import WizardSummary from Screens.WizardLanguage import WizardLanguage from Screens.Rc import Rc from Components.AVSwitch import iAVSwitch from Screens.Screen import Screen from Components.Pixmap impor...
openhdf/enigma2-wetek
lib/python/Screens/VideoWizard.py
Python
gpl-2.0
8,060
# Copyright (C) 1998 Ulf Larsson # 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 ...
fstltna/PyImp
src/empPath.py
Python
gpl-2.0
20,956
# -*- coding: utf-8 -*- # # clopath_synapse_spike_pairing.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST 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 ...
heplesser/nest-simulator
pynest/examples/clopath_synapse_spike_pairing.py
Python
gpl-2.0
6,051
# -*- coding: utf-8 -*- # enzyme - Video metadata parser # Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com> # Copyright 2003-2006 Thomas Schueppel <stain@acm.org> # Copyright 2003-2006 Dirk Meyer <dischi@freevo.org> # # This file is part of enzyme. # # enzyme is free software; you can redistribute it and/or mod...
SickGear/SickGear
lib/enzyme/mpeg.py
Python
gpl-3.0
31,404
# This file is part of Indico. # Copyright (C) 2002 - 2017 European Organization for Nuclear Research (CERN). # # Indico 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 (a...
nop33/indico
indico/modules/rb/models/locations.py
Python
gpl-3.0
5,228
#!/usr/bin/env python ################################################################################ # GIPS: Geospatial Image Processing System # # AUTHOR: Matthew Hanson # EMAIL: matt.a.hanson@gmail.com # # Copyright (C) 2014-2018 Applied Geosolutions # # This program is free software; you can redist...
Applied-GeoSolutions/gips
gips/__init__.py
Python
gpl-3.0
1,365
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Sun Mar 27 01:20:46 2016 @author: caioau """ import matplotlib.pyplot as plt import networkx as nx from networkx.drawing.nx_agraph import graphviz_layout def main(): G = nx.DiGraph() # G eh um grafo direcionado # gera o grafo apartir de suas are...
caioau/caioau-personal
fluxos/lista 2/grafo-3.py
Python
gpl-3.0
1,558
from __future__ import absolute_import from __future__ import unicode_literals # -*- coding: utf-8 -*- from django.utils.translation import ugettext as _ from wiki.core.plugins import registry from wiki.core.plugins.base import BasePlugin from wiki.plugins.macros import settings from wiki.plugins.macros.mdx.macro imp...
tinutomson/wikicoding
wiki/plugins/macros/wiki_plugin.py
Python
gpl-3.0
905
#! /usr/bin/env python3 from datetime import datetime, timedelta from perceval.backends.core.gerrit import Gerrit # hostname of the Gerrit instance hostname = 'gerrit.opnfv.org' # user for sshing to the Gerrit instance user = 'd.arroyome' # retrieve only reviews changed since one day ago from_date = datetime.now() - ...
davidam/python-examples
perceval/perceval_gerrit_me.py
Python
gpl-3.0
615
# Copyright 2011 Jeff Garzik # # RawProxy has the following improvements over python-jsonrpc's ServiceProxy # class: # # - HTTP connections persist for the life of the RawProxy object (if server # supports HTTP/1.1) # - sends protocol 'version', per JSON-RPC 1.1 # - sends proper, incrementing 'id' # - sends Basic HTT...
petertodd/timelock
lib/python-bitcoinlib/bitcoin/rpc.py
Python
gpl-3.0
16,944
# # Copyright 2009 Eigenlabs Ltd. http://www.eigenlabs.com # # This file is part of EigenD. # # EigenD 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) a...
Eigenlabs/EigenD
plg_macosx/caprobe.py
Python
gpl-3.0
794
from rocketlander import RocketLander from constants import LEFT_GROUND_CONTACT, RIGHT_GROUND_CONTACT import numpy as np import pyglet if __name__ == "__main__": # Settings holds all the settings for the rocket lander environment. settings = {'Side Engines': True, 'Clouds': True, ...
burakbayramli/classnotes
sk/2019/07/test_rocket1.py
Python
gpl-3.0
1,843
def agts(queue): d = queue.add('dipole.py', ncpus=4, walltime=60) queue.add('plot.py', deps=d, ncpus=1, walltime=10, creates=['zero.png', 'periodic.png', 'corrected.png', 'slab.png']) queue.add('check.py', deps=d, ncpus=1, walltime=10)
robwarm/gpaw-symm
doc/tutorials/dipole_correction/submit.agts.py
Python
gpl-3.0
285
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2018, Abhijeet Kasurde <akasurde@redhat.com> # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = { 'metadata...
wrouesnel/ansible
lib/ansible/modules/cloud/vmware/vmware_vmkernel_facts.py
Python
gpl-3.0
7,187
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Runs the conduction example, produces some output # nproc = 1 # Number of processors to use from boututils import shell, launch, plotdata from boutdata import collect import numpy as np from sys import argv from math import sqrt, log10, log, pi from matplotlib impo...
boutproject/BOUT-2.0
examples/non-local_1d/analyse_check_q_boundary_condition.py
Python
gpl-3.0
2,183
#=============================================================================== # Copyright (C) 2014-2019 Anton Vorobyov # # This file is part of Phobos. # # Phobos 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 ...
DarkFenX/Phobos
util/__init__.py
Python
gpl-3.0
1,042
import pytest from megaradrp.processing.fibermatch import generate_box_model from megaradrp.processing.fibermatch import count_peaks PEAKS = [ 3.806000000000000000e+03, 3.812000000000000000e+03, 3.818000000000000000e+03, 3.824000000000000000e+03, 3.830000000000000000e+03, 3.8360000000000000...
sergiopasra/megaradrp
megaradrp/processing/tests/test_fibermatch.py
Python
gpl-3.0
2,099
# Copyright (C) 2009, 2010, 2011, 2012, 2013, 2014, 2015 Rickard Lindberg, Roger Lindberg # # This file is part of Timeline. # # Timeline 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 th...
ezequielpereira/Time-Line
timelinelib/wxgui/dialogs/setcategory/controller.py
Python
gpl-3.0
2,583
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2015 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <http://weblate.org/> # # 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, eithe...
electrolinux/weblate
weblate/trans/aresource.py
Python
gpl-3.0
1,424
# coding: utf-8 # # Copyright 2012 NAMD-EMAP-FGV # # This file is part of PyPLN. You can get more information at: http://pypln.org/. # # PyPLN 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 o...
NAMD/pypln.backend
tests/test_worker_bigrams.py
Python
gpl-3.0
2,288
def bits_set(x): bits = 0 for i in range(0,8): if (x & (1<<i))>0: bits += 1 return bits def find_ber(sent, received): assert(len(received)<=len(sent)) if len(received) < len(sent)/2: print "frame detection error, more than half of the frames were lost!" return 0.5 errors = 0 for i in range(0,len(receiv...
kit-cel/gr-dab
python/channel_tests/ber.py
Python
gpl-3.0
427
from PyQt5.QtCore import QObject, pyqtSignal from model.player import Player class Playerset(QObject): """ Wrapper for an id->Player map Used to lookup players either by id or by login. """ playerAdded = pyqtSignal(object) playerRemoved = pyqtSignal(object) def __init__(self): Q...
GrotheFAF/client
src/model/playerset.py
Python
gpl-3.0
2,197
#!/usr/bin/env python """ This module preprocesses ERA-Interim data, units, accumulated to instantaneous values and timestep interpolation for 6 h to 3 h values. Example: as import: from getERA import era_prep as prep prep.main(wd, config['main']['startDate'], config['main']['endDate']) ...
joelfiddes/toposubv2
topoMAPP/getERA/era_prep.py
Python
gpl-3.0
1,384
from core import FM from core.FMOperation import FMOperation class CopyFiles(FM.BaseAction): def __init__(self, request, paths, session, target, overwrite, **kwargs): super(CopyFiles, self).__init__(request=request, **kwargs) self.paths = paths self.session = session self.target =...
LTD-Beget/sprutio
app/modules/webdav/actions/files/copy.py
Python
gpl-3.0
934
# -*- coding: utf-8 -*- # Copyright 2007-2011 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
sillvan/hyperspy
hyperspy/io_plugins/__init__.py
Python
gpl-3.0
1,835
"""CSS selector structure items.""" import copyreg from collections.abc import Hashable, Mapping __all__ = ( 'Selector', 'SelectorNull', 'SelectorTag', 'SelectorAttribute', 'SelectorContains', 'SelectorNth', 'SelectorLang', 'SelectorList', 'Namespaces', 'CustomSele...
SickGear/SickGear
lib/soupsieve_py3/css_types.py
Python
gpl-3.0
8,916
#!/usr/bin/env python # -*- coding: utf-8 -*- # # ndvi_test.py # # Copyright 2015 rob <rob@Novu> # # 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 # ...
PEAT-AI/Automato
Surveillance/make_ndvi.py
Python
gpl-3.0
1,020
""" InaSAFE Disaster risk assessment tool developed by AusAid **Messaging styles.** Contact : ole.moller.nielsen@gmail.com .. note:: 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 ...
drayanaindra/inasafe
safe/messaging/styles.py
Python
gpl-3.0
2,016
#!/usr/bin/env python2 # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai from __future__ import with_statement __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' from PyQt5.Qt import QDialog, QVBoxLayout, QPlainTextEdit, QTimer, \ QDialogBut...
jelly/calibre
src/calibre/gui2/preferences/device_user_defined.py
Python
gpl-3.0
3,843
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # 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 #...
rghe/ansible
lib/ansible/modules/cloud/ovirt/ovirt_quota_facts.py
Python
gpl-3.0
4,111
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para filesmonster # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ # ------------------------------------------------------------ import re from core import logger from core import s...
superberny70/pelisalacarta
python/main-classic/servers/filesmonster.py
Python
gpl-3.0
2,105
""" Copyright (c) 2012-2020 RockStor, Inc. <http://rockstor.com> This file is part of RockStor. RockStor 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 la...
phillxnet/rockstor-core
src/rockstor/scripts/ovpn_util.py
Python
gpl-3.0
1,622
######################################################################################################################## # VECNet CI - Prototype # Date: 4/5/2013 # Institution: University of Notre Dame # Primary Authors: ###################################################################################################...
vecnet/vnetsource
datawarehouse/exceptions/__init__.py
Python
mpl-2.0
395
"""Fixes bug 970406 - add raw_adi_logs table Revision ID: 32b54dec3fc0 Revises: 1ab8d5514ce2 Create Date: 2014-06-12 11:47:19.398882 """ # revision identifiers, used by Alembic. revision = '32b54dec3fc0' down_revision = '1ef041dfc3d5' from alembic import op from socorrolib.lib import citexttype, jsontype, buildtype...
KaiRo-at/socorro
alembic/versions/32b54dec3fc0_fixes_bug_970406_add_raw_adi_logs_table.py
Python
mpl-2.0
1,194
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public tr...
xlqian/navitia
source/jormungandr/jormungandr/exceptions.py
Python
agpl-3.0
5,255
# -*- 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 loggi...
petrjasek/superdesk-core
apps/archive_broadcast/__init__.py
Python
agpl-3.0
930
from . import stock_move from . import product_product
OCA/stock-logistics-warehouse
stock_move_auto_assign/models/__init__.py
Python
agpl-3.0
55
from django.contrib import admin from alert.donate.models import Donation from alert.userHandling.models import UserProfile class DonorInline(admin.TabularInline): model = UserProfile.donation.through max_num = 1 raw_id_fields = ( 'userprofile', ) class DonationAdmin(admin.ModelAdmin): r...
shashi792/courtlistener
alert/donate/admin.py
Python
agpl-3.0
730
# -*- coding: utf-8 -*- import requests import json misperrors = {'error': 'Error'} mispattributes = {'input': ['md5', 'sha1', 'sha256', 'domain', 'url', 'email-src', 'ip-dst|port', 'ip-src|port'], 'output': ['text']} moduleinfo = {'version': '0.1', 'author': 'Corsin Camichel', 'description': 'Module to search for an ...
VirusTotal/misp-modules
misp_modules/modules/expansion/threatfox.py
Python
agpl-3.0
2,146
""" This creates Django signals that automatically update the elastic search Index When an item is created, a signal is thrown that runs the create / update index API of the Search Manager When an item is deleted, a signal is thrown that executes the delete index API of the Search Manager This way the Policy compass da...
policycompass/policycompass-services
apps/metricsmanager/signals.py
Python
agpl-3.0
1,207
# -*- coding: utf-8 -*- # # OpenCraft -- tools to aid developing and hosting free software projects # Copyright (C) 2015 OpenCraft <xavier@opencraft.com> # # 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 Soft...
brousch/opencraft
instance/tests/views/test_index.py
Python
agpl-3.0
1,651
#!/usr/bin/env/python ''' Set of moment tensor utility functions ''' import numpy as np from math import fabs, log10, sqrt, acos, atan2, pi def tensor_components_to_use(mrr, mtt, mpp, mrt, mrp, mtp): ''' Converts components to Up, South, East definition USE = [[mrr, mrt, mrp], [mtt, mtt, mtp],...
g-weatherill/hmtk
hmtk/seismicity/gcmt_utils.py
Python
agpl-3.0
5,792
# -*- coding: utf-8 -*- # # Copyright (C) 2015 McKinsey Academy # # Authors: # Jonathan Piacenti <jonathan@opencraft.com> # # This software's license gives you freedom; you can copy, convey, # propagate, redistribute and/or modify this program under the terms of # the GNU Affero General Public License (AGPL) a...
open-craft/xblock-poll
tests/integration/test_submit_button.py
Python
agpl-3.0
2,450
# -*- encoding: utf-8 -*- ############################################################################## # # Avanzosc - Avanced Open Source Consulting # Copyright (C) 2011 - 2014 Avanzosc <http://www.avanzosc.com> # # This program is free software: you can redistribute it and/or modify # it under the terms ...
mikelarre/odoomrp-wip-1
product_last_purchase_sale_info/models/sale_order.py
Python
agpl-3.0
1,749
# -*- coding: iso-8859-15 -*- """ A wxValidator that matches APDU in hexadecimal such as: A4 A0 00 00 02 A4A0000002 __author__ = "http://www.gemalto.com" Copyright 2001-2010 gemalto Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com This file is part of pyscard. pyscard is free software; you ...
12019/pyscard
smartcard/wx/APDUHexValidator.py
Python
lgpl-2.1
2,088
#!/usr/bin/env python ''' fit best estimate of magnetometer offsets, trying to take into account motor interference ''' import sys, time, os, math from argparse import ArgumentParser parser = ArgumentParser(description=__doc__) parser.add_argument("--no-timestamps",dest="notimestamps", action='store_true', help="Log...
barthess/mavlink
pymavlink/tools/magfit_motors.py
Python
lgpl-3.0
4,813
# (C) British Crown Copyright 2011 - 2015, Met Office # # This file is part of cartopy. # # cartopy 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 the License, or # (at your option)...
ajdawson/cartopy
lib/cartopy/mpl/feature_artist.py
Python
lgpl-3.0
4,936
#!/usr/bin/env python # -*- coding:utf-8 -*- from jinja2 import Template import sys tmpl = """ {% for link in links %} {{ loop.index0 }}: <a href="{{link.href}}">{{link.name}}</a> {{ loop.index }}: <a href="{{link.href}}">{{link.name}}</a> {% endfor %} """ if __name__ == '__main__': links = [ {'name': 'Google'...
siongui/userpages
content/code/python-jinja2-vs-go-html-template/jinja2-example-3.py
Python
unlicense
485
# -*- coding: utf-8 -*- ''' Specto Add-on Copyright (C) 2015 lambda 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 l...
mrknow/filmkodi
plugin.video.wizjatv/resources/lib/lib/client.py
Python
apache-2.0
22,250
#!/usr/bin/env python # -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache Licen...
dmlc/mxnet
ci/build_windows.py
Python
apache-2.0
8,069
"""Draws DAG in ASCII.""" import logging import os import pydoc import sys from rich.pager import Pager from dvc.env import DVC_PAGER from dvc.utils import format_link logger = logging.getLogger(__name__) DEFAULT_PAGER = "less" LESS = "LESS" PAGER_ENV = "PAGER" def prepare_default_pager( clear_screen: bool ...
dmpetrov/dataversioncontrol
dvc/ui/pager.py
Python
apache-2.0
2,414
# Copyright (C) 2013-2015 Computer Sciences Corporation # # 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 a...
infochimps-forks/ezbake-platform-services
efe/frontend_app/modules/ezRPConfig.py
Python
apache-2.0
4,523
#!/usr/bin/env python2.6 # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*- # ex: set expandtab softtabstop=4 shiftwidth=4: # # Copyright (C) 2009,2010,2011,2012,2013 Contributor # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # Y...
stdweird/aquilon
tests/broker/test_del_10gig_hardware.py
Python
apache-2.0
2,595
#!/usr/bin/env python ############################################################################ # # 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 A...
apache/phoenix
bin/pherf-standalone.py
Python
apache-2.0
2,910
# coding=utf-8 """ Copyright 2013 LinkedIn Corp. 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 l...
linkedin/naarad
src/naarad/__init__.py
Python
apache-2.0
20,029
"""Tests for parsers.py""" import asyncio import unittest import unittest.mock from aiohttp import errors from aiohttp import parsers class StreamParserTests(unittest.TestCase): DATA = b'line1\nline2\nline3\n' def setUp(self): self.lines_parser = parsers.LinesParser() self.loop = asyncio.n...
noplay/aiohttp
tests/test_parsers.py
Python
apache-2.0
18,159
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 IBM Corp. # # 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 # # ...
DirectXMan12/nova-hacking
nova/virt/powervm/common.py
Python
apache-2.0
9,118
# Copyright 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.apache.org/licenses/LICENSE-2.0 # # Unless requ...
queria/my-tempest
tempest/api/object_storage/test_account_services.py
Python
apache-2.0
14,370