code stringlengths 3 1.05M | repo_name stringlengths 5 104 | path stringlengths 4 251 | language stringclasses 1
value | license stringclasses 15
values | size int64 3 1.05M |
|---|---|---|---|---|---|
import re
import pytest
from flask import url_for
from freezegun import freeze_time
from app.formatters import normalize_spaces
from tests.conftest import (
SERVICE_ONE_ID,
create_active_caseworking_user,
create_active_user_with_permissions,
create_platform_admin_user,
)
@pytest.mark.parametrize('ex... | alphagov/notifications-admin | tests/app/main/views/uploads/test_upload_hub.py | Python | mit | 10,939 |
###############################################################################
##
## Copyright (C) 2006-2011, University of Utah.
## All rights reserved.
## Contact: contact@vistrails.org
##
## This file is part of VisTrails.
##
## "Redistribution and use in source and binary forms, with or without
## modification, ... | CMUSV-VisTrails/WorkflowRecommendation | vistrails/packages/controlflow/utils.py | Python | bsd-3-clause | 4,958 |
from hetnet import graphs, dynamics
import numpy as np
from numpy import linspace
from pylab import plot, axis, show, savefig
import matplotlib.pyplot as plt
from matplotlib.colors import LinearSegmentedColormap
from scipy.cluster.vq import kmeans2 as kmeans
colors= ['red', 'green', 'blue', 'yellow', 'black', 'cyan', ... | talevy/hetnet | test.py | Python | bsd-2-clause | 2,024 |
#------------------------------------------------------------------------------
__author__ = 'James T. Dietrich'
__contact__ = 'james.t.dietrich@dartmouth.edu'
__copyright__ = '(c) James Dietrich 2016'
__license__ = 'MIT'
__date__ = 'Wed Nov 16 11:33:39 2016'
__version__ = '1.0'
__status__ = "initial release"
__url__ =... | geojames/Dart_EnvGIS | Week6-2_Matplotlib_Adv.py | Python | mit | 3,114 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Ansible module to manage symbolic link alternatives.
(c) 2014, Gabe Mulley <gabe.mulley@gmail.com>
(c) 2015, David Wittman <dwittman@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 Gene... | dresden-weekly/ansible-modules-extras | system/alternatives.py | Python | gpl-3.0 | 4,766 |
from django.conf.urls.defaults import *
urlpatterns = patterns('aquaticore.accounts.views.',
(r'^join/$', 'join'),
(r'^profile/$', 'profile'),
(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'aquaticore/login.html'}),
(r'^logout/$', 'django.contrib.auth.views.logout', {'template_name' :... | rockerBOO/aquaticore | aquaticore/accounts/urls.py | Python | mit | 350 |
# coding=utf-8
"""
Pinyto cloud - A secure cloud database for your personal data
Copyright (C) 2105 Johannes Merkert <jonny@pinyto.de>
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... | Pinyto/cloud | pinytoCloud/tests/test_assembly_admin.py | Python | gpl-3.0 | 48,951 |
#!/usr/bin/env python
# Copyright (c) 2018 Orange and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
"""Ease dep... | opnfv/functest | functest/core/tenantnetwork.py | Python | apache-2.0 | 12,531 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import time
import warnings
from collections import OrderedDict
from importlib import import_module
from django.apps import apps
from django.core.management import call_command
from django.core.management.base import BaseCommand, CommandError
from django... | akaariai/django | django/core/management/commands/migrate.py | Python | bsd-3-clause | 13,990 |
# Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0. Licensed to the Apache
# Software Foundation. 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
#... | kevin-coder/tensorflow-fork | tensorflow/contrib/opt/python/training/lars_optimizer_test.py | Python | apache-2.0 | 4,317 |
"""This script checks whether DOM has embedded youtube
video tag or not and creates and returns the EYouTubeVideo object"""
from urllib.parse import urlparse
import bs4
from data_models.embedded_youtube_video import EYouTubeVideo
from extraction.content_extractors.interface_content_extractor import \
IContentExt... | googleinterns/stampify | extraction/content_extractors/embedded_youtube_video_extractor.py | Python | apache-2.0 | 915 |
##############################################################################
#
# OSIS stands for Open Student Information System. It's an application
# designed to manage the core business of higher education institutions,
# such as universities, faculties, institutes and professional schools.
# The core ... | uclouvain/osis | attribution/views/manage_my_courses/my_educational_information.py | Python | agpl-3.0 | 8,399 |
import RPi.GPIO as GPIO
BtnPin = 11
LedPin = 12
Led_status = 0
def setup():
GPIO.setmode(GPIO.BOARD) # Numbers GPIOs by physical location
GPIO.setup(LedPin, GPIO.OUT) # Set LedPin's mode is output
GPIO.setup(BtnPin, GPIO.IN, pull_up_down=GPIO.PUD_UP) # Set BtnPin's mode is input, and pull up to high le... | bicard/raspberrypi | quad-store-sensors/37in1/push-button-rgb-led-smd.py | Python | gpl-3.0 | 1,046 |
#!/usr/local/sci/bin/python
#*****************************
#
# All heat stress indices
#
#
#************************************************************************
# SVN Info
#$Rev:: 107 $: Revision of last commit
#$Author:: rdunn ... | rjhd2/HadISD_v2 | heat_stress.py | Python | bsd-3-clause | 11,163 |
# -*- coding: utf-8 -*-
# Copyright 2016 SYLEAM
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging
from datetime import datetime, timedelta
from openerp import models, api, fields, exceptions, _
_logger = logging.getLogger(__name__)
try:
from oauthlib.oauth2.rfc6749.tokens import rand... | ClearCorp/server-tools | oauth_provider_jwt/models/oauth_provider_client.py | Python | agpl-3.0 | 7,489 |
"""
raven.conf
~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import logging
from raven.utils.urlparse import urlparse
__all__ = ('load', 'setup_logging')
# TODO (vng): this seems weirdly located in raven.conf. See... | lptorres/noah-inasafe | web_api/third_party/raven/conf/__init__.py | Python | gpl-3.0 | 2,451 |
import pygame
def painel_cpu_info():
slot = pygame.Surface()
return slot
def painel_cpu_uso():
slot = pygame.Surface()
return slot
def main():
tela = pygame.display.set_mode(800, 600)
slot_cpu_info = painel_cpu_info()
tela.blit(slot_cpu_info)
slot_cpu_uso = painel_cpu_uso()
tela... | ebertti/infnet-sdi-python | python/organizando.py | Python | mit | 379 |
#FLM: Print Selection Spaces
# Description:
# Print slected glyph names separated with spaces to the ouput windows
# Credits:
# Pablo Impallari
# http://www.impallari.com
from robofab.world import CurrentFont
font = CurrentFont()
selection = font.selection
selection.sort()
print " ".join(selection) | impallari/Impallari-Fontlab-Macros | IMP Selecions/Print Spaces.py | Python | apache-2.0 | 304 |
def sort(sortlist):
outlist = []
x = 0
lsize = len(sortlist)
while x < lsize:
smlst = sortlist[0]
for i in range(len(sortlist)):
if float(sortlist[i]) < float(smlst):
smlst = sortlist[i]
sortlist.remove(smlst)
outlist.append(float(smlst))
... | TNT-Samuel/Coding-Projects | Sorting Algorithms/bubble.py | Python | gpl-3.0 | 349 |
"""
This automatization script includes most of the functions that where originally developed, and they are writen how should they have been used. They are old versioned and probably don't work any more.
Contains an example of how most of the JobManager functions work. It is given as an example of possibilities, not to... | bbiped-platform/BBIPED | src/BBIPED-GUI/src/Automatization/Tasks_to_perform_example.py | Python | lgpl-3.0 | 3,633 |
# -*- coding: utf-8 -*-
# Copyright 2017-2018 Bob Leers (http://www.novacode.nl)
# See LICENSE file for full licensing details.
from datetime import datetime
from lxml import etree
from . import CommonTestCase
from ..controls import DateControl
class DateTestCase(CommonTestCase):
def setUp(self):
super... | bobslee/orbeon-xml-api | orbeon_xml_api/tests/controls/test_date.py | Python | mit | 2,535 |
# -*- coding: utf-8 -*-
from django.conf.urls import url
from django.views.generic import TemplateView
from . import views
app_name = 'simone'
urlpatterns = [
url(r'^$', views.index),
#url(r'main/$', 'main'),
#url(r'msglist/(?P<folder_name>.*?)/$', 'msglist'),
url(r'msglist/(?P<server>\d+)/(?P<folder... | iggy/simone | simone/urls.py | Python | bsd-3-clause | 2,234 |
#!/usr/bin/env python
#
# Copyright (c) 2013 The Linux Foundation. All rights reserved.
#
"""
Script to create a U-Boot flashable multi-image blob.
This script creates a multi-image blob, from a bunch of images, and
adds a U-Boot shell script to the blob, that can flash the images from
within U-Boot. The procedure to ... | itgb/opCloudRouter | qca/src/u-boot/tools/pack.py | Python | gpl-2.0 | 54,850 |
# ----------------------------------------------------------------------------
# Copyright (c) 2016-2021, QIIME 2 development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | jakereps/q2-feature-table | q2_feature_table/_heatmap/_visualizer.py | Python | bsd-3-clause | 8,349 |
"""
Create contact form table
Revision ID: 0da6b26c212f
Revises: d441dca1e974
Create Date: 2018-07-20 16:12:39.081415
"""
import enum
from alembic import op
from sqlalchemy.dialects import mysql
from sqlalchemy.types import Enum
import sqlalchemy as sa
# Revision identifiers, used by Alembic.
revision = '0da6b26c21... | StartupsPoleEmploi/labonneboite | labonneboite/alembic/versions/0da6b26c212f_create_contact_form_table.py | Python | agpl-3.0 | 2,773 |
# Spiderling: A Spider spawned by the BroodMother.
# DO NOT MODIFY THIS FILE
# Never try to directly create an instance of this class, or modify its member variables.
# Instead, you should only be reading its variables and calling its functions.
from typing import Optional
from games.spiders.spider import Spider
# <... | siggame/Joueur.py | games/spiders/spiderling.py | Python | mit | 3,434 |
from MuellerBrown import getPotentialAndForces
from PlotUtils import PlotUtils
import numpy as np
import matplotlib.pyplot as plt
import MuellerBrown as mbpot
m=1.0
def getKineticEnergy(velocity):
return 0.5*m*(velocity[0]**2+velocity[1]**2)
dt = 0.01
num_steps = 1000
#initial_position = np.array( [ 0.0 , ... | valsson/MD-MC-Codes-2016 | MuellerBrown-MD/MD-MuellerBrown.py | Python | mit | 1,665 |
import os
from functools import wraps
from flask import Flask, request, Response
from flask import render_template, url_for, redirect, send_from_directory, jsonify, g
from flask_jwt import verify_jwt
from flask.ext.jwt import current_user
from gb import jwt
from gb.models import *
class UserObj(object):
def __ini... | mbiokyle29/geno-browser | gb/controllers.py | Python | mit | 1,916 |
import RPi.GPIO as GPIO
import time
import pifacedigitalio
import picamera
import datetime
import json
import sys
import os
media_directory = 'home-server/public/images/media'
data_directory = 'home-server/public/data/'
schedule = json.loads(open(data_directory + 'schedule.json').read())
in_hours = False
previous_stat... | maxf/home | monitor-with-pir-and-piface.py | Python | mit | 4,249 |
"""
WSGI config for reports 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.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "reports_viewer.settings")
from django... | tomaszpiotro/honeypot_reports | reports/reports_viewer/wsgi.py | Python | mit | 396 |
__author__ = 'Administrator'
import toolbox.sphinxapi as sphinx
class SearchBasic(object):
SPHINX_IP = "192.168.1.107"
SPHINX_PORT = 9312
def _get_client(self):
# Ini the sphinx search engine
client = sphinx.SphinxClient()
client.SetServer(self.SPHINX_IP, self.SPHINX_PORT)
... | master-zhuang/SearchMax | backend/utils/search.py | Python | unlicense | 486 |
from collections import deque
from hwt.interfaces.agents.vldSynced import VldSyncedAgent
from hwt.pyUtils.arrayQuery import grouper
from hwtSimApi.agents.base import AgentBase
from hwtSimApi.hdlSimulator import HdlSimulator
from typing import List
from pyMathBitPrecise.bit_utils import get_bit_range
from hwtLib.periph... | Nic30/hwtLib | hwtLib/peripheral/ethernet/rmii_agent.py | Python | mit | 3,316 |
level = u'Exemples'
| JeromeO/Pyromaths | src/pyromaths/ex/examples/__init__.py | Python | gpl-2.0 | 20 |
class UnmessageNotification(object):
def __init__(self, message, title=None):
self.title = title or 'unMessage'
self.message = message
def __str__(self):
return self.message
class UntalkNotification(UnmessageNotification):
def __init__(self, message, title=None):
super(Unt... | felipedau/unmessage | unmessage/notifications.py | Python | gpl-3.0 | 1,360 |
# Copyright 2016 Nicolas Bessi, Camptocamp SA
# Copyright 2018 Aitor Bouzas <aitor.bouzas@adaptivecity.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class ResCityZip(models.Model):
"""City/locations completion object"""
_name = "res.city.zip"
_... | syci/partner-contact | base_location/models/res_city_zip.py | Python | agpl-3.0 | 1,353 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-29 02:19
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('webcore', '0005_employee'),
... | Nikita1710/ANUFifty50-Online-Mentoring-Platform | project/fifty_fifty/webcore/migrations/0006_auto_20170429_0219.py | Python | apache-2.0 | 592 |
#!/usr/bin/env python
#Copyright (C) 2007-2008 Don Brown 2010 Spike Burch <spikeb@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 3 of the License, or
# (at... | jon1012/bambam | bambam.py | Python | gpl-3.0 | 7,674 |
"""
WSGI Utilities
(from web.py)
"""
import os, sys
import http
import webapi as web
from utils import listget
from net import validaddr, validip
import httpserver
def runfcgi(func, addr=('localhost', 8000)):
"""Runs a WSGI function as a FastCGI server."""
import flup.server.fcgi as flups
return flup... | merckhung/bokken | lib/web/wsgi.py | Python | gpl-2.0 | 2,060 |
from collections import namedtuple
from mock import MagicMock
from mock import patch
import unittest
from wikipathways_api_client import WikipathwaysApiClient
class TestGetPathwayAs(unittest.TestCase):
def test_get_as_gpml(self):
with patch('requests.get') as patched_get:
expected_text = open(... | ariutta/target-interaction-finder | tests/test_get_pathway.py | Python | apache-2.0 | 1,050 |
# Copyright 2011 Nicholas Bray
#
# 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... | ncbray/pystream | bin/tests/decompilertests/test_basic.py | Python | apache-2.0 | 10,314 |
"""Configuration classes and APIs for Neural Structured Learning."""
from neural_structured_learning.configs.configs import AdvNeighborConfig
from neural_structured_learning.configs.configs import AdvRegConfig
from neural_structured_learning.configs.configs import AdvTargetConfig
from neural_structured_learning.config... | tensorflow/neural-structured-learning | neural_structured_learning/configs/__init__.py | Python | apache-2.0 | 1,989 |
# Copyright Buildbot Team Members
# Portions copyright 2015-2016 ClusterHQ Inc.
#
# 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 right... | pmisik/buildbot | master/buildbot/test/fake/reactor.py | Python | gpl-2.0 | 6,029 |
#! /usr/bin/env python
import urllib
SAT_ZOOM_LEVEL = 0.0001389 #Like in request form
def retrieveImage(coordinates, image_size, name):
"""Retrieve satellite images from the Nasa's site
coordinates: tuple (longitude, latitude) in decimal degrees
image_size: tuple (width, height)
name: output filename
"""
re... | ActiveState/code | recipes/Python/496966_Download_satellite_images/recipe-496966.py | Python | mit | 982 |
#%% PAQUETERIAS
from gensim.models import ldaseqmodel
from gensim.corpora import Dictionary, bleicorpus
import numpy
from gensim.matutils import hellinger
#%%Cargar datos
# loading our corpus and dictionary
try:
dictionary = Dictionary.load('datasets/news_dictionary')
except FileNotFoundError as e:
raise Val... | jadm333/aut-top | DTM.py | Python | mit | 554 |
#!/usr/bin/env python
#####################################################################
# Software License Agreement (BSD License)
#
# Copyright (c) 2017, Michal Drwiega
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the fol... | kwiecien/ppl | depth_nav_tools/laserscan_kinect/test/conversion_time_tester.py | Python | gpl-3.0 | 4,859 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import numpy as np
import pandas as pd
import math
import proteindf_bridge as bridge
import proteindf_tools as pdf
class ESP_charge(object):
def get_RRMS(self, mpac_path, atoms):
grids, ESPs = self._load_ESPs(mpac_path)
rrms = self._c... | ProteinDF/ProteinDF_pytools | scripts/pdf-pop-lasso.py | Python | gpl-3.0 | 11,713 |
# Generated by Django 2.2.13 on 2020-08-30 07:06
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('tagging', '0014_category_taggit_tag'),
]
operations = [
migrations.RemoveField(
model_name='category',
name='taggit',
... | jeromecc/doctoctocbot | src/tagging/migrations/0015_remove_category_taggit.py | Python | mpl-2.0 | 332 |
"""
Routines for filling missing data
"""
import numpy as np
from distutils.version import LooseVersion
import pandas.core.common as com
import pandas.algos as algos
import pandas.lib as lib
from pandas.compat import range, string_types
def mask_missing(arr, values_to_mask):
"""
Return a masking array of sa... | BigDataforYou/movie_recommendation_workshop_1 | big_data_4_you_demo_1/venv/lib/python2.7/site-packages/pandas/core/missing.py | Python | mit | 21,007 |
#!/usr/bin/env python
# Created by Pearu Peterson, September 2002
""" Test functions for fftpack.basic module
"""
__usage__ = """
Build fftpack:
python setup_fftpack.py build
Run tests if scipy is installed:
python -c 'import scipy;scipy.fftpack.test()'
Run tests if fftpack is not installed:
python tests/test_bas... | huard/scipy-work | scipy/fftpack/tests/test_basic.py | Python | bsd-3-clause | 18,018 |
#
# The Python Imaging Library
# $Id: pilfont.py 2134 2004-10-06 08:55:20Z fredrik $
#
# PIL raster font compiler
#
# history:
# 1997-08-25 fl created
# 2002-03-10 fl use "from PIL import"
#
VERSION = "0.4"
import site
import glob, os, sys
# drivers
from PIL import BdfFontFile
from PIL import PcfFontFile
if len... | sneumann/efpbrowser | eFPbrowser-1.6.0/Imaging-1.1.6efp/Scripts/pilfont.py | Python | gpl-2.0 | 1,007 |
from django.contrib import admin
# Register your models here.
from .models import Environment,EnvironmentAdmin,Component,ComponentAdmin,Environment_property,Environment_propertyAdmin,Component_attribute,Component_attributeAdmin
admin.site.register(Environment,EnvironmentAdmin)
admin.site.register(Component,Component... | wdq007/supreme-garbanzo | fkkenv/fukoku/env/admin.py | Python | gpl-3.0 | 461 |
#!/usr/bin/python
import hsgw
from sys import argv, exit
if len(argv) < 3:
print argv[0], "<key> <addr> [<addr> [...]]"
exit(1)
key = argv[1]
addrs = argv[2:]
conn = hsgw.HomeserverConnection(key = key)
for addr in addrs:
name = "(" + conn.getNameByAddr(addr) + ")"
print addr, "=", conn.getValueByAdd... | okohlbacher/pyHSgw | pyhsgw/hs_get_values_by_addr.py | Python | bsd-3-clause | 357 |
from CUBRIDPy.CUBRIDConnection import *
import logging
logging.root.setLevel(logging.INFO)
logging.info('Executing test: %s...' % __file__)
conn = CUBRIDConnection()
conn.connect()
cur = conn.cursor()
try:
executed_queries_count = cur.batch_execute([
'create table',
'drop table ttt'
... | cubrid-talks/CUBRIDPy | trunk/test/test_batch_execute_error.py | Python | gpl-2.0 | 808 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#-------------------------------------------------------------------------------
'''
This software has been developed by:
GI Genética, Fisiología e Historia Forestal
Dpto. Sistemas y Recursos Naturales
ETSI Montes, Forestal y del Medio Natural
Universida... | GGFHF/NGScloud | Package/xec2.py | Python | gpl-3.0 | 60,894 |
"""Generic Redis commands"""
import asyncio
from mockredis.pipeline import MockRedisPipeline
from mockredis.exceptions import WatchError
from mockaioredis.util import _NOTSET
class AsyncMockRedisPipeline(MockRedisPipeline):
async def execute(self):
"""
Execute all of the saved commands and retur... | kblin/mockaioredis | mockaioredis/commands/generic.py | Python | apache-2.0 | 4,095 |
from injector import Module
from cassandra.cqlengine import connection
from cassandra.cluster import Cluster
from cassandra.cqlengine.management import create_keyspace_simple, sync_table, sync_type
from cassandra.cqlengine.usertype import UserType
from ...entities.track_type import TrackType
from cassandra_users_reposi... | jacekdalkowski/bike-timer | web-api/biketimerwebapi/db/repositories/cassandra/cassandra_repositories_module.py | Python | apache-2.0 | 1,685 |
#!/usr/bin/env python3
import re
from setuptools import setup
# Get the version from the main script
version = re.search(
'^__version__\s*=\s*"(.*)"',
open("ahadd/ahadd.py").read(),
re.M,
).group(1)
# Try to import pypandoc to convert the readme, otherwise ignore it
try:
import pypandoc
long_d... | agude/Alex-Hadd | setup.py | Python | mit | 1,593 |
#!/usr/bin/env python
import sys
warnings = list()
try:
from setuptools import setup, Extension, find_packages
modules = find_packages(exclude=['examples'])
except ImportError:
warnings.append("warning: using distutils.core.setup, cannot use \"develop\" option")
from distutils.core import setup, Exten... | DEAP/deap | setup.py | Python | lgpl-3.0 | 3,832 |
#!/usr/bin/python
# Author: Felipe Molina (@felmoltor)
# Date: 05/2015
# Summary: Download nvd.nist.gov XML files containing CVE details.
# Parse it and saves in sqlite3 db
# LICENSE: GPLv2
from mechanize import *
from lxml import etree
import os
import datetime
import time
import gzip
import sqlite3
i... | felmoltor/NVDparser | nvdparser.py | Python | gpl-2.0 | 15,511 |
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2011 OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute i... | 837278709/metro-openerp | third_modules/product_extended/product_extended.py | Python | agpl-3.0 | 6,788 |
# 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/storage/azure-mgmt-storage/azure/mgmt/storage/v2021_04_01/aio/operations/_management_policies_operations.py | Python | mit | 10,775 |
from .find import findNS, findProductsNS
from .gender import genderNS
from .product import productNS
from .session import sessionNS, sessionProductsNS
NSStore = [
findNS,
findProductsNS,
genderNS,
productNS,
sessionNS,
sessionProductsNS
]
| willrp/willbuyer | backend/controller/api/store/__init__.py | Python | mit | 265 |
# shipBonusCruiseMissileExploDmgMB
#
# Used by:
# Ship: Typhoon Fleet Issue
type = "passive"
def handler(fit, ship, context):
fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Cruise Missiles"),
"explosiveDamage", ship.getModifiedItemAttr("shipBonusMB"),
... | Ebag333/Pyfa | eos/effects/shipbonuscruisemissileexplodmgmb.py | Python | gpl-3.0 | 382 |
class Fibs:
def __init__(self):
self.a=0
self.b=1
def __next__(self):
self.a,self.b = self.b, self.a + self.b
return self.b
def __iter__(self):
return self
counter = 0
fib=Fibs()
for f in fib:
counter+=1
print(f)
if counter >49:
... | ryanlqiu/ForLinux | PythonProject/HeadFirstPython/Fibonachi.py | Python | gpl-3.0 | 327 |
# -*- encoding: utf-8 -*-
"""
lunaport.dao.line
~~~~~~~~~~~~~~~~~
Storage interaction logic for line resource.
"""
import pprint
pp = pprint.PrettyPrinter(indent=4).pprint
from sqlalchemy import text, exc
from ..wsgi import app, db
from .. domain.line import LineBuilder, LineAdaptor
from exceptions impo... | greggyNapalm/lunaport_server | lunaport_server/dao/path.py | Python | apache-2.0 | 4,535 |
# -*- coding: utf-8 -*-
#
# This file is part of Glances.
#
# Copyright (C) 2015 Nicolargo <nicolas@nicolargo.com>
#
# Glances 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 Lic... | maikelwever/glances | glances/core/glances_snmp.py | Python | lgpl-3.0 | 4,873 |
from django.core.exceptions import ImproperlyConfigured, PermissionDenied
from django.http import Http404
from django.shortcuts import get_object_or_404
from django.utils.translation import gettext as _
from django.conf import settings
from zds.utils.models import Comment
class FilterMixin:
"""
View mixin whi... | ChantyTaguan/zds-site | zds/utils/mixins.py | Python | gpl-3.0 | 2,279 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'Form_6.ui'
#
# Created: Sun Aug 3 18:33:17 2014
# by: PyQt4 UI code generator 4.9.6
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attribut... | paratagas/persona_python | ui_MyForm.py | Python | gpl-3.0 | 74,890 |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | pelson/package_with_continuous_delivery | continuous_delivery_with_travis_and_pypi/_version.py | Python | bsd-3-clause | 20,003 |
#!/usr/bin/env python
import base64
import json
import requests
import time
import dns
from dnsdisttests import DNSDistTest
try:
range = xrange
except NameError:
pass
class DynBlocksTest(DNSDistTest):
_webTimeout = 2.0
_webServerPort = 8083
_webServerBasicAuthPassword = 'secret'
_webServerBasicAut... | shinsterneck/pdns | regression-tests.dnsdist/test_DynBlocks.py | Python | gpl-2.0 | 48,469 |
#!/usr/bin/env python
from .acfun import *
from .alive import *
from .archive import *
from .baidu import *
from .bandcamp import *
from .bigthink import *
from .bilibili import *
from .bokecc import *
from .cbs import *
from .ckplayer import *
from .cntv import *
from .dailymotion import *
from .dilidili import *
fro... | zmwangx/you-get | src/you_get/extractors/__init__.py | Python | mit | 1,878 |
# Embedded file name: /usr/lib/enigma2/python/Components/Converter/ServiceName2.py
from Components.Converter.Converter import Converter
from enigma import iServiceInformation, iPlayableService, iPlayableServicePtr, eServiceReference, eServiceCenter, eTimer, getBestPlayableServiceReference
from Components.Element imp... | kingvuplus/boom | lib/python/Components/Converter/ServiceName2.py | Python | gpl-2.0 | 32,772 |
#!/usr/bin/env python3
import sys
import re
def extract(s):
return [int(x) for x in re.findall(r'-?\d+', s)]
bs = ["byr", "iyr", "eyr", "hgt", "hcl", "ecl", "pid", "cid"]
bs2 = ["byr", "iyr", "eyr", "hgt", "hcl", "ecl", "pid"]
def main(args):
data = [s.strip() for s in sys.stdin]
data.append('')
cr... | msullivan/advent-of-code | 2020/4b.py | Python | mit | 1,822 |
import unittest
from reactivex import operators as ops
from reactivex.testing import ReactiveTest, TestScheduler
on_next = ReactiveTest.on_next
on_completed = ReactiveTest.on_completed
on_error = ReactiveTest.on_error
subscribe = ReactiveTest.subscribe
subscribed = ReactiveTest.subscribed
disposed = ReactiveTest.disp... | ReactiveX/RxPY | tests/test_observable/test_skip.py | Python | mit | 10,293 |
# encoding: utf-8
#
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import, divis... | klahnakoski/SpotManager | vendor/jx_python/group_by.py | Python | mpl-2.0 | 4,538 |
# -*- coding: utf-8 -*-
# Copyright 2017 Google, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | JavaRabbit/CS496_capstone | language/cloud-client/v1beta2/snippets_test.py | Python | apache-2.0 | 2,586 |
from util.geometry import np2d
class Edge(object):
_segment: np2d.Segment
def __init__(self, segment: np2d.Segment) -> None:
self._segment = segment
| PhilHarnish/forge | src/data/image/edge.py | Python | mit | 160 |
from mock import patch
from django.test import TestCase
from django.test.utils import override_settings
from rapidsms.tests import harness
from rapidsms.router import get_router
from rapidsms.router.celery.tasks import receive_async, send_async
class CeleryRouterTest(harness.DatabaseBackendMixin, TestCase):
"""... | catalpainternational/rapidsms | rapidsms/router/celery/tests.py | Python | bsd-3-clause | 3,244 |
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2006 ACYSOS S.L. (http://acysos.com)
# Pedro Tarrafeta <pedro@acysos.com>
# Copyright (c) 2008 Pablo Rocandio.
# Copyright... | jaumemarti/l10n-spain-txerpa | l10n_es_payment_order/wizard/converter.py | Python | agpl-3.0 | 5,391 |
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
# --------------------------------------------... | jdrudolph/scikit-bio | skbio/io/tests/test_util.py | Python | bsd-3-clause | 21,855 |
"""
General helper functions that don't fit neatly under any given category.
They provide some useful string and conversion methods that might
be of use when designing your own game.
"""
import os, sys, imp, types, math, re
import textwrap, datetime, random, traceback, inspect
from inspect import ismodule
from colle... | YourCyborg/Sun-RPI | src/utils/utils.py | Python | bsd-3-clause | 35,689 |
# -*- coding: utf-8 -*-
"""
pygments.lexers.configs
~~~~~~~~~~~~~~~~~~~~~~~
Lexers for configuration file formats.
:copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, default, words, bygro... | unreal666/outwiker | plugins/source/source/pygments/lexers/configs.py | Python | gpl-3.0 | 31,855 |
import random
import math
import discord
from discord.ext import commands
class Memes(commands.Cog):
"""
Meme commands
"""
def __init__(self, bot):
self.bot = bot
async def _meme(self, ctx, msg, directed: bool = False, imagelink=None, allowed_mentions=None):
author = ctx.author
... | ihaveamac/Kurisu | cogs/memes.py | Python | apache-2.0 | 19,321 |
from django import forms
from browser.models import *
import datetime
class CourseGroupForm(forms.ModelForm):
class Meta:
model = CourseGroup
fields = ['name', 'validated']
class GroupForCourseForm(forms.Form):
group_name = forms.CharField()
group = forms.ModelChoiceField(queryset=Cour... | erickpeirson/mbl-browser | browser/forms.py | Python | gpl-3.0 | 14,351 |
# Copyright (c) 2015 Orange.
# 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 a... | openstack/networking-bgpvpn | networking_bgpvpn/neutron/db/bgpvpn_db.py | Python | apache-2.0 | 25,177 |
# Copyright 2014 Google Inc. All Rights Reserved.
"""Command for listing URL maps."""
from googlecloudsdk.compute.lib import base_classes
class List(base_classes.GlobalLister):
"""List URL maps."""
@property
def service(self):
return self.compute.urlMaps
@property
def resource_type(self):
return '... | wemanuel/smry | smry/server-auth/ls/google-cloud-sdk/lib/googlecloudsdk/compute/subcommands/url_maps/list.py | Python | apache-2.0 | 397 |
#Embedded file name: /Users/versonator/Hudson/live/Projects/AppLive/Resources/MIDI Remote Scripts/LPD8/consts.py
""" The following consts should be substituted with the Sys Ex messages for requesting
a controller's ID response and that response to allow for automatic lookup"""
ID_REQUEST = 0
ID_RESP = 0
GENERIC_STOP = ... | jim-cooley/abletonremotescripts | remote-scripts/samples/Twister_Device_Control/consts.py | Python | apache-2.0 | 1,670 |
# -*- coding: utf-8 -*-
# This file is part of pygal
#
# A python svg graph plotting library
# Copyright © 2012 Kozea
#
# This library 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... | vineethguna/heroku-buildpack-libsandbox | vendor/pygal-0.13.0/pygal/config.py | Python | mit | 8,580 |
from django.db import models
from model_utils.models import TimeStampedModel
from apps.repositories.models import Repository
from apps.repositories.github_url_helper import get_github_view_url
GITHUB_TIME_FORMAT_STRING = '%Y-%m-%dT%H:%M:%SZ'
class Milestone(TimeStampedModel):
"""
Information from API call: ... | IQSS/milestone-reader | milestone_reader/apps/milestones/models.py | Python | mit | 1,798 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('polls', '0010_report_location'),
]
operations = [
migrations.AddField(
model_name='report',
name='kw... | mnithya/cs3240-s15-team06-test | polls/migrations/0011_report_kw.py | Python | mit | 404 |
import pytest
from urlparse import urlparse
from api.base.settings.defaults import API_BASE
from framework.auth.core import Auth
from osf.models import NodeLog
from osf_tests.factories import (
ProjectFactory,
RegistrationFactory,
AuthUserFactory
)
from rest_framework import exceptions
from tests.utils imp... | aaxelb/osf.io | api_tests/nodes/views/test_node_links_list.py | Python | apache-2.0 | 44,577 |
import datetime
import lxml.html
from billy.utils.fulltext import text_after_line_numbers
from .bills import NCBillScraper
from .legislators import NCLegislatorScraper
from .committees import NCCommitteeScraper
from .votes import NCVoteScraper
metadata = dict(
name='North Carolina',
abbreviation='nc',
capi... | showerst/openstates | openstates/nc/__init__.py | Python | gpl-3.0 | 5,650 |
#!/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 ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License");... | basvdl/incubator-metron | metron-deployment/packaging/ambari/metron-mpack/src/main/resources/common-services/METRON/CURRENT/package/scripts/params/status_params.py | Python | apache-2.0 | 3,912 |
# -*- coding: utf-8 -*-
# Copyright(C) 2013 Bezleputh
#
# This file is part of a weboob module.
#
# This weboob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the Licen... | vicnet/weboob | modules/monster/module.py | Python | lgpl-3.0 | 3,186 |
from .holonomic import (DifferentialOperator, HolonomicFunction, DifferentialOperators,
from_hyper, from_meijerg, from_sympy)
from .recurrence import RecurrenceOperators, RecurrenceOperator, HolonomicSequence
| hargup/sympy | sympy/holonomic/__init__.py | Python | bsd-3-clause | 213 |
from appprocrunner import AppProcRunner, AppProcess
class CustomAppProccess(AppProcess):
def __init__(self, *args, **kwargs):
AppProcess.__init__(self, *args, **kwargs)
def formatCmd(self, raw_cmd):
print "cmd before formatting:", raw_cmd
cmd = AppProcess.formatCmd(self, raw_cmd)
... | p4lang/p4app | examples/customtopo.p4app/myprocrunner.py | Python | apache-2.0 | 565 |
import hashlib, binascii
from nose.tools import * # flake8: noqa
from modularodm import Q
from website.models import MetaSchema
from website.project.metadata.schemas import LATEST_SCHEMA_VERSION
from api.base.settings.defaults import API_BASE
from website.settings import PREREG_ADMIN_TAG
from website.project.model im... | monikagrabowska/osf.io | api_tests/nodes/views/test_node_draft_registration_detail.py | Python | apache-2.0 | 31,571 |
from django import forms
from monitor.models import Sites, Observations
from django.forms import ModelForm, Textarea, Select, DateInput
# Form based on the Sites model
class SiteForm(ModelForm):
class Meta:
model = Sites
exclude = ('time_stamp')
widgets = {
'description': Textar... | sokolic/miniSASS | monitor/forms.py | Python | gpl-3.0 | 3,965 |
#!/usr/bin/env python3
# Planet parsing and mapping code
# By Braddock Gaskill 10 November 2018
import cstruct
import sys
# pip install ansicolors
from colors import color
class PlanetRecord(cstruct.CStruct):
__byte_order__ = cstruct.LITTLE_ENDIAN
__struct__ = """
unsigned char name_length;
... | braddockcg/dominions | maps.py | Python | apache-2.0 | 1,880 |
# GPL, (c) Reinout van Rees
#
# Script to show the diff with the last relevant tag.
import logging
import sys
import zest.releaser.choose
from zest.releaser.utils import system
from zest.releaser import utils
logger = logging.getLogger(__name__)
def main():
logging.basicConfig(level=utils.loglevel(),
... | mgedmin/zest.releaser | zest/releaser/lasttagdiff.py | Python | gpl-2.0 | 903 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.