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 |
|---|---|---|---|---|---|---|
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# @name: Wascan - Web Application Scanner
# @repo: https://github.com/m4ll0k/Wascan
# @author: Momo Outaadi (M4ll0k)
# @license: See the file 'LICENSE.txt
import os
import sys
from lib.utils.dirs import *
from lib.utils.printer import *
from importlib import impor... | m4ll0k/Spaghetti | lib/handler/attacks.py | Python | gpl-3.0 | 687 | 0.024745 |
""" Defines the base class for color maps
"""
from traits.api import Enum, HasTraits, Instance
from data_range_1d import DataRange1D
class AbstractColormap(HasTraits):
"""
Abstract class for color maps, which map from scalar values to color values.
"""
# The data-space bounds of the mapper.
range... | burnpanck/chaco | chaco/abstract_colormap.py | Python | bsd-3-clause | 2,253 | 0.001775 |
#the file is left intentionally blank
| equalitie/vengeance | src/util/__init__.py | Python | agpl-3.0 | 38 | 0.026316 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import SimpleTestCase, override_settings
@override_settings(ROOT_URLCONF='view_tests.generic_urls')
class URLHandling(SimpleTestCase):
"""
Tests for URL handling in views and responses.
"""
redirect_target = "/%E4%B8%AD%... | frishberg/django | tests/view_tests/tests/test_specials.py | Python | bsd-3-clause | 880 | 0 |
"""
Model fields for working with trees.
"""
from __future__ import unicode_literals
from django.db import models
from django.conf import settings
from mptt.forms import TreeNodeChoiceField, TreeNodeMultipleChoiceField
__all__ = ('TreeForeignKey', 'TreeOneToOneField', 'TreeManyToManyField')
class TreeForeignKey(mo... | watchdogpolska/django-mptt | mptt/fields.py | Python | mit | 1,592 | 0.004397 |
#-------------------------------------------------------------------------------
# . File : ParseScans.py
# . Program : MolarisTools
# . Copyright : USC, Mikolaj Feliks (2015-2018)
# . License : GNU GPL v3.0 (http://www.gnu.org/licenses/gpl-3.0.en.html)
#--------------------------------------------------... | mfx9/molaris-tools | MolarisTools/Scripts/ParseScans.py | Python | gpl-3.0 | 8,470 | 0.016411 |
# -*- coding: utf-8 -*-
# Copyright 2013 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 require... | endlessm/chromium-browser | third_party/catapult/third_party/gsutil/gslib/tests/testcase/unit_testcase.py | Python | bsd-3-clause | 16,831 | 0.004872 |
"""
WSGI config for text_analysis 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.8/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO... | bungoume/mecab-web-api | text_analysis/text_analysis/wsgi.py | Python | mit | 403 | 0 |
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Provides functions for creating a python classes from the cp2k_input.xml
file.
"""
import xml.etree.cElementTree as cElementTree
import utilities
import textwrap
#===============================================================================
def validify_section(st... | SINGROUP/pycp2k | inputparser.py | Python | lgpl-3.0 | 14,369 | 0.003549 |
# Copyright (c) 2009-2010 Stanford University
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR(S) DISC... | t3rm1n4l/ramcloud | bindings/python/ramcloud.py | Python | isc | 11,657 | 0.003174 |
#### 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 = Building()
result.template = "object/building/poi/base/shared_base_poi_medium.iff"
result.attribute_template_id =... | anhstudios/swganh | data/scripts/templates/object/building/poi/base/shared_base_poi_medium.py | Python | mit | 451 | 0.046563 |
#!/usr/bin/env python2.7
#naive implementation of a program that sorts function definitions alphabetically
import sys
import fileinput
DEBUG = False
function = ''
first_fun = None
output = []
funs = {}
bracket_count = 0
for line in fileinput.input():
bracket_count += line.count("{")
if bracket_count:
... | bdevorem/GGNoRe | sort_fun.py | Python | gpl-3.0 | 1,009 | 0.005946 |
#!/usr/bin/env python3
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2017 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 pub... | lahwaacz/qutebrowser | scripts/asciidoc2html.py | Python | gpl-3.0 | 10,901 | 0.000092 |
#!/usr/bin/python3
from __future__ import print_function
import os,sys,inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0,parentdir)
import sys
import scipy
from tqdm import tqdm
import django
from django.utils imp... | fzenke/morla | scripts/compute_feature_vectors.py | Python | mit | 1,674 | 0.022103 |
from django import template
# from kilonull.conf import BlogConf
from kilonull.models import Menu, MenuItem
from kilonull.settings import SETTINGS
import re
register = template.Library()
@register.simple_tag
def blog_title():
return SETTINGS['BLOG_TITLE']
# Generate HTML for the header menu.
# Use a regex (pat... | vacuus/kilonull | kilonull/templatetags/theming.py | Python | lgpl-3.0 | 901 | 0 |
# Copyright (c) 2014-2017 Cedric Bellegarde <cedric.bellegarde@adishatz.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, either version 3 of the License, or
# (at your option) any later vers... | gnumdk/lollypop | lollypop/player_userplaylist.py | Python | gpl-3.0 | 4,223 | 0 |
# -*- coding: utf-8 -*-
import glob
import os
import polib
from django import VERSION as DJANGO_VERSION
from django.core.management.commands.makemessages import (
Command as OriginalMakeMessagesCommand)
from django.utils import translation
from django.utils.translation.trans_real import CONTEXT_SEPARATOR
class Co... | divio/django-commontranslations | django_commontranslations/management/commands/makemessages_unique.py | Python | bsd-3-clause | 4,136 | 0.003627 |
# -*- coding: utf-8 -*-
"""Page model for Automation/Anisble/Credentials"""
import attr
from navmazing import NavigateToAttribute, NavigateToSibling
from widgetastic_patternfly import BootstrapSelect, Button, Dropdown, Input
from widgetastic_manageiq import ParametrizedSummaryTable, Table, PaginationPane
from widgetast... | anurag03/integration_tests | cfme/ansible/credentials.py | Python | gpl-2.0 | 18,975 | 0.002951 |
# -*- coding: utf-8 -*-
# Copyright 2010-2013 Kolab Systems AG (http://www.kolabsys.com)
#
# Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen a kolabsys.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 ... | tpokorra/pykolab | pykolab/cli/cmd_list_user_subscriptions.py | Python | gpl-3.0 | 3,424 | 0.009638 |
#!/usr/bin/env python
import sys
import argparse
import regrws
import regrws.method.org
try:
from apikey import APIKEY
except ImportError:
APIKEY = None
epilog = 'API key can be omitted if APIKEY is defined in apikey.py'
parser = argparse.ArgumentParser(epilog=epilog)
parser.add_argument('-k', '--key', help=... | RhubarbSin/arin-reg-rws | org_delete.py | Python | mit | 839 | 0 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | Azure/azure-sdk-for-python | sdk/appplatform/azure-mgmt-appplatform/azure/mgmt/appplatform/v2021_09_01_preview/operations/_skus_operations.py | Python | mit | 5,833 | 0.004115 |
from .base import FunctionalTest
class ItemValidationTest(FunctionalTest):
def get_error_element(self):
return self.browser.find_element_by_css_selector('.has-error')
def test_cannot_add_empty_list_items(self):
# Edith goes to the home page and accidentally tries to submit
# an empty... | jrwiegand/tdd-project | functional_tests/test_list_item_validation.py | Python | mit | 2,652 | 0 |
#!/usr/bin/env python
import re
import requests
import validators
import sys
import httplib2
import datetime
import socket
from urllib.parse import urlsplit, urljoin
from ipwhois import IPWhois
from pprint import pprint
from bs4 import BeautifulSoup, SoupStrainer
import pkg_resources
http_interface = httplib2.Http()
... | rascal999/qad | qad/__init__.py | Python | gpl-3.0 | 8,092 | 0.006179 |
import os
import logging
import tornado.options as opt
from motherbrain.base import conf
from motherbrain.base.conf import get_config
SITE_CONF = conf.site_conf(os.getcwd())
DATADIR = SITE_CONF.get('env.motherbrain_data', '/tmp')
API_URL = SITE_CONF.get('env.api_url')
WEBCLIENT_URL = SITE_CONF.get('env.webclient_url... | urlist/urlist | motherbrain/api_server/conf.py | Python | gpl-3.0 | 2,842 | 0.000352 |
###
# Copyright (c) 2015, butterscotchstallion
# Copyright (c) 2020, oddluck <oddluck@riseup.net>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain... | Alcheri/Plugins | IMDb/plugin.py | Python | bsd-3-clause | 7,840 | 0.001531 |
import serial #import serial module
import NASA_Conn
from NASA_Conn_TT import check
def read_rfid ():
ser = serial.Serial ("/dev/ttyAMA0") #Open named port
ser.baudrate = 9600 #Set baud rate to 9... | shadow1dos/NASA | Run.py | Python | gpl-3.0 | 745 | 0.036242 |
# This file is part of Spacetime.
#
# Copyright 2010-2014 Leiden University.
# Spec module written by Willem Onderwaater.
#
# Spacetime 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 L... | Onderwaater/spacetime | lib/spacetime/modules/spec/subplots.py | Python | gpl-2.0 | 1,206 | 0.009121 |
import copy
import numpy as np
import matplotlib.pyplot as plt
from sklearn.metrics import adjusted_mutual_info_score, adjusted_rand_score
from pyhawkes.models import DiscreteTimeNetworkHawkesModelSpikeAndSlab
from pyhawkes.plotting.plotting import plot_network
def test_gibbs_sbm(seed=None):
"""
Create a di... | mattjj/pyhawkes | test/test_sbm_gibbs.py | Python | mit | 2,521 | 0.005553 |
# Purpose: ac1009 table entries
# Created: 16.03.2011
# Copyright (C) 2011, Manfred Moitzi
# License: MIT License
from __future__ import unicode_literals
__author__ = "mozman <mozman@gmx.at>"
from ..entity import GenericWrapper
from ..tags import DXFTag
from ..classifiedtags import ClassifiedTags
from ..dxfattr import... | lautr3k/RepRap-iTopie | odmt/ezdxf/ac1009/tableentries.py | Python | gpl-3.0 | 8,896 | 0.00045 |
# sql/types_api.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Base types API.
"""
from .. import exc, util
from . import operators
from .vi... | pcu4dros/pandora-core | workspace/lib/python3.5/site-packages/sqlalchemy/sql/type_api.py | Python | mit | 46,121 | 0.000022 |
# -*- coding: utf-8 -*-
"""
/***************************************************************************
QFieldSync
-------------------
begin : 2020-08-19
git sha : $Format:%H$
copyright : (C) 2020 by OPENGIS.ch
email ... | opengisch/QFieldSync | qfieldsync/core/cloud_transferrer.py | Python | lgpl-3.0 | 29,804 | 0.001409 |
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
# Copyright (C) 2014 Jesús Espino <jespinog@gmail.com>
# Copyright (C) 2014 David Barragán <bameda@dbarragan.com>
# Copyright (C) 2014 Anler Hernández <hello@anler.me>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | CoolCloud/taiga-back | tests/fixtures.py | Python | agpl-3.0 | 2,031 | 0.001972 |
""" Python Character Mapping Codec generated from 'VENDORS/APPLE/ARABIC.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='st... | amrdraz/brython | www/src/Lib/encodings/mac_arabic.py | Python | bsd-3-clause | 37,165 | 0.018916 |
from distutils.core import setup
import py2exe
import sys
# this allows to run it with a simple double click.
sys.argv.append('py2exe')
py2exe_options = {
"includes": ["sip"],
"dll_excludes": ["MSVCP90.dll", ],
"compressed": 1,
"optimize": 2,
"ascii": 0,
# "bundle_files... | xcool/webtools | setup.py | Python | gpl-3.0 | 498 | 0.008032 |
import sys
import unittest
from dynd import nd, ndt
import numpy as np
from datetime import date, datetime
from numpy.testing import *
class TestNumpyDTypeInterop(unittest.TestCase):
def setUp(self):
if sys.byteorder == 'little':
self.nonnative = '>'
else:
self.nonnative = '... | aterrel/dynd-python | dynd/tests/test_numpy_interop.py | Python | bsd-2-clause | 27,383 | 0.002922 |
"""
Copyright (C) 2015 Quinn D Granfor <spootdev@gmail.com>
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
version 2, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
... | MediaKraken/MediaKraken_Deployment | source/subprogram_match_anime_id.py | Python | gpl-3.0 | 3,312 | 0.000906 |
import json
import argparse
import numpy
import sys
import copy
from astropy.coordinates import SkyCoord
from astropy import units
import operator
class Program(object):
def __init__(self, runid="16BP06", pi_login="gladman"):
self.config = {"runid": runid,
"pi_login": pi_login,
... | CFIS-Octarine/octarine | planning/ph2.py | Python | gpl-3.0 | 5,099 | 0.001961 |
# -*- encoding: utf-8 -*-
"""
Tests for django.core.servers.
"""
from __future__ import unicode_literals
import os
import socket
from django.core.exceptions import ImproperlyConfigured
from django.test import LiveServerTestCase
from django.test.utils import override_settings
from django.utils.http import urlencode
fr... | atruberg/django-custom | tests/servers/tests.py | Python | bsd-3-clause | 5,773 | 0.000173 |
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 9 11:10:56 2014
@author: MasterMac
"""
sec = int(raw_input())
hour = sec / 60**2
minute = sec / 60 % 60
second = sec % 60
print hour, minute, second
| hacpai/show-me-the-code | Python/0002/main.py | Python | gpl-2.0 | 202 | 0.00495 |
from src.discrete import Environment
from src.queue import Queue
from random import expovariate, seed
from tabulate import tabulate
from math import e
class MD1Queue(Queue):
"""MD1 Queue discrete time simulator"""
def __init__(self, lamb, mu, env):
super().__init__(env)
self.lamb = lamb
self.mu = mu
... | maxwellgerber/ee122_final_proj | md1.py | Python | mit | 1,637 | 0.020159 |
import asposebarcodecloud
from asposebarcodecloud.BarcodeApi import BarcodeApi
from asposebarcodecloud.BarcodeApi import ApiException
from asposebarcodecloud.models import BarcodeReader
import asposestoragecloud
from asposestoragecloud.StorageApi import StorageApi
from asposestoragecloud.StorageApi import Resp... | farooqsheikhpk/Aspose.BarCode-for-Cloud | Examples/Python/managing-recognition/without-cloud-storage/read-barcodes-with-checksum.py | Python | mit | 2,040 | 0.012745 |
"""Home Assistant command line scripts."""
from __future__ import annotations
import argparse
import asyncio
import importlib
import logging
import os
import sys
from typing import Sequence
from homeassistant import runner
from homeassistant.bootstrap import async_mount_local_lib_path
from homeassistant.config import... | w1ll1am23/home-assistant | homeassistant/scripts/__init__.py | Python | apache-2.0 | 2,358 | 0.000424 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-28 15:30
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('clubs', '0001_initial'),
]
operations = [
migrations.RemoveField(
... | waymao/SU-System | clubs/migrations/0002_auto_20170828_2330.py | Python | gpl-3.0 | 569 | 0 |
#
# DUT Connection classes
#
# Copyright (C) 2013 Curt Brune <curt@cumulusnetworks.com>
#
# SPDX-License-Identifier: GPL-2.0
'''
Defines a Connection object that the test fixture uses to communicate
with a DUT.
'''
#-------------------------------------------------------------------------------
#
# Imports
#
... | abaumhauer/onie | test/lib/connection.py | Python | gpl-2.0 | 6,914 | 0.003182 |
"""
This file is part of pyS5p
https://github.com/rmvanhees/pys5p.git
Performs unit-tests on S5Pplot methods: draw_signal, draw_quality,
draw_cmp_images, draw_trend1d and draw_lines (xarray version)
Copyright (c) 2020-2021 SRON - Netherlands Institute for Space Research
All Rights Reserved
License: BSD-3-Cla... | rmvanhees/pys5p | examples/unit_test_s5p_plot.py | Python | bsd-3-clause | 11,888 | 0.000252 |
#! /usr/bin/env python2
#-*- coding:utf-8 -*-
from builtins import range
import unittest
import logging
from miasm.analysis.machine import Machine
import miasm.os_dep.win_api_x86_32 as winapi
from miasm.os_dep.win_api_x86_32 import get_win_str_a, get_win_str_w
from miasm.core.utils import pck32
from miasm.jitter.csts ... | serpilliere/miasm | test/os_dep/win_api_x86_32.py | Python | gpl-2.0 | 9,960 | 0.002309 |
# TODO: this must be a stub!
| vg/netsukuku | pyntk/ntk/sim/network/route.py | Python | gpl-2.0 | 29 | 0 |
# (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
# (at your option) any later version.
#
# Ansible is dis... | qrkourier/ansible | test/units/modules/network/nxos/test_nxos_feature.py | Python | gpl-3.0 | 2,591 | 0.000772 |
# Copyright (C) 2013 Adam Stokes <adam.stokes@ubuntu.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 of the License, or
# (at your option) any later version.
# This prog... | pierg75/pier-sosreport | sos/plugins/maas.py | Python | gpl-2.0 | 2,550 | 0 |
#!/usr/bin/env python
__author__ = 'Mike McCann'
__copyright__ = '2013'
__license__ = 'GPL v3'
__contact__ = 'mccann at mbari.org'
__doc__ = '''
Contains class for common routines for loading all BEDS data
Mike McCann
MBARI 13 May 2013
@undocumented: __doc__ parser
@status: production
@license: GPL
'''
imp... | danellecline/stoqs | stoqs/loaders/BEDS/__init__.py | Python | gpl-3.0 | 3,934 | 0.009151 |
from flask.ext.migrate import MigrateCommand
from flask.ext.script import Manager
from flask.ext.script.commands import ShowUrls, Clean
from commands.testcase_command import TestCommand
from flask_learn import create_app
manager = Manager(create_app)
manager.add_option("-c", "--config", dest='config',
... | KotiyaSenya/FlaskLearn | manage.py | Python | mit | 605 | 0 |
#### 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/component/weapon/shared_reinforcement_core.iff"
result.attribute_te... | anhstudios/swganh | data/scripts/templates/object/tangible/component/weapon/shared_reinforcement_core.py | Python | mit | 484 | 0.045455 |
# 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... | peterbraden/tensorflow | tensorflow/python/framework/framework_lib.py | Python | apache-2.0 | 3,634 | 0 |
from . import db
class CustomPlaceholder(db.Model):
"""email notifications model class"""
__tablename__ = 'custom_placeholder'
id = db.Column(db.Integer,
primary_key=True)
name = db.Column(db.String)
url = db.Column(db.String)
thumbnail = db.Column(db.String)
copyright =... | gaeun/open-event-orga-server | app/models/custom_placeholder.py | Python | gpl-3.0 | 1,176 | 0 |
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | haad/ansible-modules-extras | cloud/profitbricks/profitbricks.py | Python | gpl-3.0 | 21,799 | 0.001973 |
# -*- coding:utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import time
import scrapy
from Global_function import get_localtime, print_new_number, save_messages
now_time = get_localtime(time.strftime("%Y-%m-%d", time.localtime()))
# now_time = 20170420
class USTC005_Spider(scrapy.Spider):
name = ... | hbtech-ai/ARPS | report_spider/report_spider/spiders/USTC005.py | Python | mit | 3,781 | 0.024005 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Unix SMB/CIFS implementation.
# Copyright (C) Kamen Mazdrashki <kamenim@samba.org> 2011
# Copyright (C) Andrew Bartlett <abartlet@samba.org> 2016
# Copyright (C) Catalyst IT Ltd. 2016
#
# This program is free software; you can redistribute it and/or modify
# it under t... | kernevil/samba | source4/torture/drs/python/drs_base.py | Python | gpl-3.0 | 24,898 | 0.001848 |
import codecs
from setuptools import setup
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with codecs.open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='zenbu',
version='1.0.5',
descrip... | metakirby5/zenbu | setup.py | Python | mit | 1,288 | 0 |
'''
Copyright (C) 2016 Bastille Networks
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 version.
This program is distribut... | BastilleResearch/gr-nordic | python/build_utils_codes.py | Python | gpl-3.0 | 1,289 | 0.013189 |
"""
HDF5 in memory object
Britton Smith <brittonsmith@gmail.com>
"""
import h5py
import numpy as np
import sys
class H5InMemory(object):
def __init__(self, fh):
self.attrs = {}
if fh is None:
self.data = {}
return
if isinstance(fh, str):
fh = h... | aemerick/galaxy_analysis | physics_data/UVB/grackle_tables/h5_in_memory.py | Python | mit | 2,620 | 0.002672 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# pylint: disable=W0403
# pylint: disable=R0915
# pylint: disable=W0613
# Copyright (c) 2014-2015, Human Brain Project
# Cyrille Favreau <cyrille.favreau@epfl.ch>
# Daniel Nachbaur <daniel.nachbaur@epfl.ch>
#
# This file is... | favreau/RenderingResourceManager | rendering_resource_manager_service/session/management/slurm_job_manager.py | Python | lgpl-3.0 | 18,783 | 0.001757 |
#! /usr/bin/python
# -*- coding: utf8 -*-
import tensorflow as tf
import tensorlayer as tl
import numpy as np
import time
import numbers
import random
import os
import re
import sys
import threading
# import Queue # <-- donot work for py3
is_py2 = sys.version[0] == '2'
if is_py2:
import Queue as queue
else:
... | zjuela/LapSRN-tensorflow | tensorlayer/prepro.py | Python | apache-2.0 | 62,978 | 0.005096 |
#!/usr/bin/env python
import math
import time
import naoqi
import motion
from naoqi import ALProxy
import roslib
roslib.load_manifest('nao_driver')
import rospy
use_robot_state_publisher = False
if use_robot_state_publisher:
from robot_state.msg import RobotState
from scan_pose_bending import scanPoseBending
from... | miguelsdc/nao_robot | nao_driver/scripts/headscanTop.py | Python | bsd-3-clause | 5,281 | 0.013634 |
from django.contrib.auth.models import Group, User
from django.db import models
from django.utils.translation import gettext_lazy as _
class GroupContact(models.Model):
"""
Groups displayed in contact page and their informations.
"""
class Meta:
verbose_name = _("Groupe de la page de contact"... | ChantyTaguan/zds-site | zds/pages/models.py | Python | gpl-3.0 | 982 | 0.00611 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-10-05 09:09
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('explorer', '0006_auto_20181004_1159'),
]
operations = [
migrations.AddField... | muccg/rdrf | rdrf/explorer/migrations/0007_fieldvalue_column_name.py | Python | agpl-3.0 | 482 | 0 |
import matplotlib.pyplot as plt
import numpy as np
import sklearn
from sklearn import svm, datasets
from sklearn.metrics import precision_recall_curve
from sklearn.metrics import average_precision_score
from sklearn.cross_validation import train_test_split
from sklearn.preprocessing import label_binarize
from sklearn.m... | JamesWo/cs194-16-data_manatees | precision_recall.py | Python | apache-2.0 | 4,204 | 0.002617 |
#!/usr/bin/env python2.6
# -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2010,2013 Contributor
#
# 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... | stdweird/aquilon | tests/aqdb/aqdb_nose_plugin.py | Python | apache-2.0 | 2,638 | 0.003033 |
import datetime
import bleach
import re
months = {
1: "jan",
2: "feb",
3: "mars",
4: ["apr\u00edl", "apr"],
5: "ma\u00ed",
6: "j\u00fan\u00ed",
7: "j\u00fal\u00ed",
8: "\u00e1g\u00fast",
9: "sept",
10: "okt",
11: "n\u00f3v",
12: "des",
}
def decode_date_string(date_st... | multiplechoice/workplace | jobs/common.py | Python | apache-2.0 | 2,436 | 0.003284 |
#!/usr/bin/python3
# This file is part of Epoptes, http://epoptes.org
# Copyright 2012-2018 the Epoptes team, see AUTHORS.
# SPDX-License-Identifier: GPL-3.0-or-later
"""
Display a simple window with a message.
"""
import os
import sys
from _common import gettext as _
from gi.repository import Gtk
class MessageWindo... | Epoptes/epoptes | epoptes-client/message.py | Python | gpl-3.0 | 2,401 | 0 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Author',
fields=[
('id', models.AutoField(verbo... | Ourinternet/website | commission/migrations/0001_initial.py | Python | mit | 10,354 | 0.003767 |
import os
import sys
from optparse import OptionParser
from jobTree.src.bioio import logger, setLoggingFromOptions
from jobTree.scriptTree.stack import Stack
from jobTree.scriptTree.target import Target
from margin.utils import pathToBaseNanoporeDir
from margin.marginCallerLib import marginCallerTargetFn
def main(... | isovic/marginAlign | src/margin/marginCaller.py | Python | mit | 2,779 | 0.020511 |
#!/usr/bin/env python
# Copyright 2019 The PySCF Developers. 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... | sunqm/pyscf | pyscf/tools/test/test_cubegen.py | Python | apache-2.0 | 2,994 | 0.007348 |
##
## Bragg fiber
##
from numpy import *
from pylab import *
from Polymode import *
from Polymode import LayeredSolver
ncore = 1.0
n1=1.4
n2=1.6
rcore = 5.0
Nlayer = 20
m = 0
neff_opt = 0.998
wl_opt = 1.0
d1 = wl_opt/(4*sqrt(n1**2 - neff_opt**2))
d2 = wl_opt/(4*sqrt(n2**2 - neff_opt**2))
dlayer = d1+d2
wlrange=[0... | juhasch/polymode | examples/ex8_bragg_fiber.py | Python | gpl-3.0 | 1,327 | 0.019593 |
# coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from twilio.base import deserialize
from twilio.base import serialize
from twilio.base import values
from twilio.base.instance_context import InstanceContext
from twilio.base.instance_resource import... | Vagab0nd/SiCKRAGE | lib3/twilio/rest/ip_messaging/v1/service/channel/invite.py | Python | gpl-3.0 | 15,284 | 0.002225 |
# proxy module
from __future__ import absolute_import
from codetools.contexts.with_mask import *
| enthought/etsproxy | enthought/contexts/with_mask.py | Python | bsd-3-clause | 97 | 0 |
# 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-network/azure/mgmt/network/v2017_03_01/models/sub_resource_py3.py | Python | mit | 823 | 0.00243 |
class Member(dict):
def __init__(self, *args, **kwargs):
super(Member, self).__init__(*args, **kwargs) | asascience-open/paegan | paegan/cdm/dsg/member.py | Python | gpl-3.0 | 114 | 0.008772 |
#!/usr/bin/env python3
import glob
import os
import sys
import shutil
import subprocess
from distutils.sysconfig import get_python_inc
# Overall script settings
binder_executable = glob.glob(f'{os.getcwd()}/../../build/llvm-4.0.0/build_4.0.0*/bin/binder')[0]
bindings_dir = 'cmake_bindings'
binder_source = f'{os.getc... | RosettaCommons/binder | examples/example_struct/make_bindings_via_cmake.py | Python | mit | 4,103 | 0.002437 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | charlescearl/VirtualMesos | src/webui/master/webui.py | Python | apache-2.0 | 2,037 | 0.015218 |
import sys
import regex as re
from BeautifulSoup import BeautifulStoneSoup as bss
# REQUIRES BeautifulSoup3. BS4 breaks on Python recursion errors when it gets badly damaged texts.
def cleanup(infile, outfile):
# main routine. takes a file handle for input and output; called at the bottom of the file.
text... | ARTFL-Project/PhiloLogic4 | extras/utilities/tei_cleanup.py | Python | gpl-3.0 | 8,791 | 0.00091 |
import os
import ast
import six
from .ModelComponents import ComponentBase
_comps_name = '__components'
class ExprsToAssigns(ast.NodeTransformer):
"""
Walks the Abstract Syntax Tree from the parsed model file, and transforms
bare expressions into augmented assignments that are tacked on to the end
of... | mmechtley/psfMC | psfMC/model_parser.py | Python | mit | 2,467 | 0.000405 |
eg.RegisterPlugin(
name = "Epson TW-700 Projector",
author = "Tom Wilson",
version = "0.1.0",
kind = "external",
guid = "{f6cfb453-416b-4276-92ac-c58ffe98972b}",
url = "",
description = (''),
canMultiLoad = True,
createMacrosOnAdd = True,
)
# Now we import some other t... | Kabal/eventghost-epson-tw700 | __init__.py | Python | mit | 5,840 | 0.010103 |
import os
from sqlalchemy import Column, String, Integer, create_engine
from flask_sqlalchemy import SQLAlchemy
import json
database_name = "trivia"
database_path = "postgres://{}:{}@{}/{}".format(
'postgres', 'abc@123', 'localhost:5432', database_name)
db = SQLAlchemy()
'''
setup_db(app)
binds a flask appli... | manishbisht/Udacity | Full Stack Web Developer Nanodegree v2/P2 - Trivia API/backend/models.py | Python | mit | 1,781 | 0 |
#!/usr/bin/env python
#------------------------------------------------------------------------------
# Copyright (C) 2013 Albert Simenon
#
# 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... | simenon/pocket-query-downloader | gc_util.py | Python | gpl-2.0 | 5,704 | 0.007714 |
# Copyright 2012 Michael Still and Canonical 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
#
# ... | cernops/nova | nova/tests/unit/virt/libvirt/test_imagecache.py | Python | apache-2.0 | 42,304 | 0.000307 |
# Copyright 2019, Google LLC 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... | googleapis/python-pubsub | google/cloud/pubsub_v1/subscriber/client.py | Python | apache-2.0 | 11,505 | 0.002086 |
import sys
import time
from scheduler import SoSpiderSchdulerBase
class SoClusterManager(SoSpiderSchdulerBase):
def __init__(self, name):
self.load_conf()
self.make_connection()
self.name = name
self.log_file = open('./logs/%s_cluster.log' % self.name, 'w')
def log(self, tex... | Rolight/So-Spider | cluster_manager.py | Python | gpl-3.0 | 1,490 | 0 |
#!/usr/bin/env python
from gnuradio import gr
from gnuradio import trellis, digital
from gnuradio import eng_notation
import math
import sys
import random
import fsm_utils
def run_test (fo,fi,interleaver,Kb,bitspersymbol,K,dimensionality,constellation,Es,N0,IT,seed):
tb = gr.top_block ()
# TX
src = gr.l... | n4hy/gnuradio | gr-trellis/src/examples/test_sccc_turbo1.py | Python | gpl-3.0 | 3,908 | 0.037615 |
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | googleapis/python-talent | samples/snippets/job_search_commute_search_test.py | Python | apache-2.0 | 828 | 0 |
#! /usr/bin/env python
# coding=utf-8
# Copyright (c) 2019 Uber Technologies, 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
#
# Unles... | uber/ludwig | ludwig/utils/h3_util.py | Python | apache-2.0 | 3,350 | 0.000299 |
import bpy
from bpy.types import NodeSocket
from bpy.props import FloatVectorProperty
class MatrixSocket(NodeSocket):
bl_idname = "MatrixSocket"
bl_label = "Matrix Socket"
MatProp = FloatVectorProperty(
name='Mat',
description='Vector of 16 floats representing the Matrix',
default... | jakobharlan/avango | avango-blender/blender-addon/sockets/matrix_socket.py | Python | lgpl-3.0 | 1,640 | 0 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Johann Prieur <johann.prieur@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 of the License, or
# (at your option) an... | Kjir/papyon | papyon/service/description/RSI/GetMetadata.py | Python | gpl-2.0 | 1,488 | 0.004704 |
import pyaf.Bench.TS_datasets as tsds
import tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 1024 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 30, transform = "Integration", sigma = 0.0, exog_count = 100, ar_order = 0); | antoinecarme/pyaf | tests/artificial/transf_Integration/trend_LinearTrend/cycle_30/ar_/test_artificial_1024_Integration_LinearTrend_30__100.py | Python | bsd-3-clause | 271 | 0.084871 |
# -*- encoding: utf-8 -*-
from supriya.tools.synthdeftools.SignalRange import SignalRange
from supriya.tools.ugentools.UGen import UGen
class Dust(UGen):
r'''A unipolar random impulse generator.
::
>>> dust = ugentools.Dust.ar(
... density=23,
... )
>>> dust
Dus... | andrewyoung1991/supriya | supriya/tools/ugentools/Dust.py | Python | mit | 2,414 | 0.003314 |
from django.contrib import admin
from .models import SimpleModel, Type, FKModel
admin.site.register(SimpleModel)
admin.site.register(Type)
admin.site.register(FKModel)
| wq/django-data-wizard | tests/data_app/admin.py | Python | mit | 170 | 0 |
from kivy.utils import platform
from kivy.logger import Logger
Logger.info('Loading RevMob module')
if platform() == 'android':
from .android import *
elif platform() == 'ios':
from .ios import *
else:
Logger.warning('[RevMob] Unkown platform: %s' % platform())
| aron-bordin/Kivy-Tutorials | 5_Perception/Perception/revmob/__init__.py | Python | gpl-2.0 | 275 | 0 |
# -*- coding: utf-8 -*-
# Copyright 2020 Green Valley Belgium NV
#
# 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 appl... | our-city-app/oca-backend | src/solutions/common/jobs/notifications.py | Python | apache-2.0 | 8,697 | 0.003449 |
import wx
import wx.xrc as xrc
import structobject
uimgr = None
def get():
return uimgr
class UIManager(object):
def __init__(self, resource_file, top_level_name, top_level_type="frame", reuse_app=False, load_on=None):
global uimgr
self._event_aliases = {}
self.resource_name = resourc... | tyrylu/orgedit | uimanager.py | Python | mit | 5,741 | 0.00749 |
__author__ = 'Mars'
import random
class Question:
def __init__(self, monster):
self.name = "Question"
self.monster = monster
class PercentMonsterLevel1(Question):
def __init__(self, monster):
Question.__init__(self,monster)
self.name = "PercentMonsterLevel1"
def makeQ(se... | rdp1070/PokeMath | Question.py | Python | gpl-3.0 | 5,970 | 0.019598 |
import graphene
from graphene_django.types import DjangoObjectType
from django.contrib.auth import (get_user_model, authenticate,
login as auth_login, logout as auth_logout,
update_session_auth_hash)
from django.contrib.auth.forms import (UserCreationFor... | pshrmn/cryptonite | cryptonite/user_auth/schema.py | Python | mit | 3,906 | 0.00384 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.