repo_name stringlengths 5 92 | path stringlengths 4 221 | copies stringclasses 19
values | size stringlengths 4 6 | content stringlengths 766 896k | license stringclasses 15
values | hash int64 -9,223,277,421,539,062,000 9,223,102,107B | line_mean float64 6.51 99.9 | line_max int64 32 997 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 13.6 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rspavel/spack | var/spack/repos/builtin/packages/seacas/package.py | 1 | 12541 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import sys
from spack import *
from spack.operating_systems.mac_os import macos_version
#
# Need to add:
# KOKKOS suppor... | lgpl-2.1 | 5,524,861,649,376,911,000 | 45.276753 | 100 | 0.536401 | false | 3.425567 | false | false | false |
Azure/azure-sdk-for-python | sdk/digitaltwins/azure-mgmt-digitaltwins/setup.py | 1 | 3041 | #!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------... | mit | -4,504,685,280,669,516,000 | 32.788889 | 91 | 0.594541 | false | 3.810777 | false | false | false |
CoderBounty/coderbounty | website/migrations/0003_auto_20151021_1455.py | 1 | 1365 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
("website", "0002_auto_20150413_0435"),
]
operations = [
migrations.AlterField(
m... | agpl-3.0 | -8,639,975,601,283,100,000 | 26.3 | 62 | 0.501832 | false | 4.723183 | false | false | false |
rob-smallshire/trailer | trailer/model/waypoint.py | 1 | 4378 | from decimal import Decimal
from trailer.model.fix import Fix
from trailer.model.fieldtools import nullable, make_list, make_time
class Waypoint:
def __init__(self, latitude, longitude, elevation=None, time=None,
magvar=None, geoid_height=None, name=None, comment=None,
descriptio... | mit | -2,166,302,555,318,290,400 | 26.89172 | 101 | 0.600046 | false | 4.035023 | false | false | false |
275958081/ez_blog | blog/mysafe.py | 1 | 1368 | from redis_accessor import get_safe_redis
from django.http import HttpResponse
def get_visitor_ip(req):
if req.META.has_key('HTTP_X_FORWARDED_FOR'):
ip = req.META['HTTP_X_FORWARDED_FOR']
else :
ip = req.META['REMOTE_ADDR']
return ip
def is_bad_ip(str_ip):
if l... | gpl-2.0 | -8,767,435,736,766,864,000 | 21.186441 | 55 | 0.505848 | false | 3.203747 | false | false | false |
lxc/pylxd | integration/test_containers.py | 1 | 9891 | # Copyright (c) 2016 Canonical Ltd
#
# 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 ... | apache-2.0 | 2,744,828,220,430,874,600 | 34.963636 | 87 | 0.642063 | false | 4.071634 | true | false | false |
vathpela/anaconda | pyanaconda/modules/storage/disk_initialization/initialization.py | 1 | 7732 | #
# Disk initialization module.
#
# Copyright (C) 2018 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distribu... | gpl-2.0 | 6,388,133,185,762,533,000 | 35.995215 | 97 | 0.669426 | false | 4.075909 | false | false | false |
krzychb/rtd-test-bed | tools/esp_app_trace/sysviewtrace_proc.py | 1 | 5295 | #!/usr/bin/env python
#
# Copyright 2019 Espressif Systems (Shanghai) PTE LTD
#
# 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 req... | apache-2.0 | 1,668,038,278,482,320,100 | 43.495798 | 155 | 0.644193 | false | 3.930958 | false | false | false |
yw374cornell/e-mission-server | emission/analysis/classification/inference/mode.py | 2 | 17308 | # Standard imports
from pymongo import MongoClient
import logging
from datetime import datetime
import sys
import os
import numpy as np
import scipy as sp
import time
from datetime import datetime
# Our imports
import emission.analysis.section_features as easf
import emission.core.get_database as edb
# We are not goi... | bsd-3-clause | -978,012,631,685,413,400 | 45.652291 | 143 | 0.691877 | false | 3.842806 | false | false | false |
mxabierto/openspending | openspending/lib/browser.py | 1 | 4858 | import json
from collections import defaultdict
from openspending.model.dataset import Dataset
from openspending.lib import solr_util as solr
from openspending.lib import util
class Browser(object):
def __init__(self,
q='',
filter=None,
page=1,
... | agpl-3.0 | 9,148,970,667,694,569,000 | 29.173913 | 75 | 0.533965 | false | 3.840316 | false | false | false |
wichovw/tca-gt | oldroot/test.py | 1 | 2230 | from service.tca_service import TCAService
def run():
# Object
service = TCAService()
# Get traffic lights
print()
print('Traffic lights dictionary:')
print(service.get_traffic_lights())
print()
# Start running fixed time
# service.fixed_time_start(10)
# service.random_fixed_... | mit | -3,012,228,935,836,812,300 | 25.235294 | 82 | 0.580269 | false | 3.478939 | false | false | false |
jeremyosborne/python | general/lies-damnlies-stats/server/settings.py | 1 | 5308 | # Django settings for server project.
# A nice way of getting around the absolute path hardcoding
import os
SITE_ROOT = os.path.dirname(os.path.realpath(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
... | mit | -6,158,216,014,328,124,000 | 33.245161 | 122 | 0.686511 | false | 3.706704 | false | false | false |
frankosan/pypers | pypers/steps/mothur/MothurSummarySeqs.py | 1 | 3305 | from pypers.core.step import Step
from pypers.steps.mothur import Mothur
import os
import json
import re
import glob
class MothurSummarySeqs(Mothur):
"""
Summarizes the quality of sequences in an unaligned or aligned fasta-formatted sequence file.
"""
spec = {
'name' : 'MothurSummarySeqs',
... | gpl-3.0 | -3,853,254,129,801,393,700 | 33.789474 | 106 | 0.438427 | false | 4.365918 | false | false | false |
Infinidat/infi.pyutils | infi/pyutils/python_compat.py | 1 | 1056 | import types
import platform
_PYTHON_VERSION = platform.python_version()
_IS_PYTHON_3 = _PYTHON_VERSION >= '3'
_IS_BELOW_PYTHON_2_7 = _PYTHON_VERSION < '2.7'
def get_underlying_function(f):
if _IS_BELOW_PYTHON_2_7 and (isinstance(f, classmethod) or isinstance(f, staticmethod)):
return _get_underlying_clas... | bsd-3-clause | 6,284,743,282,828,665,000 | 26.076923 | 92 | 0.706439 | false | 3.543624 | false | false | false |
lcabrini/pygame-pong | pong.py | 1 | 2601 | #! /usr/bin/env python3
import sys
import pygame
import random
PADDLE_WIDTH = 10
PADDLE_HEIGHT = 60
WIDTH = 800
HEIGHT = 600
FPS = 60
FONT_SIZE = 40
# define some colors
RED = (255, 0, 0)
GREEN = (0, 255, 0)
BLUE = (0, 0, 255)
WHITE = (255, 255, 255)
BLACK = (0, 0, 0)
class Paddle(pygame.sprite.Sprite):
def _... | mit | -3,423,952,036,116,152,300 | 27.9 | 78 | 0.602076 | false | 2.982798 | false | false | false |
mesgarpour/T-CARER | ReadersWriters/_TextFile.py | 1 | 8806 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright 2017 University of Westminster. 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.ap... | apache-2.0 | -5,616,987,302,024,308,000 | 37.488789 | 112 | 0.528844 | false | 4.088208 | false | false | false |
cyberbikepunk/smurfs | smurfs/migrations/0001_initial.py | 1 | 1409 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2015-12-05 16:38
from __future__ import unicode_literals
import django.contrib.gis.db.models.fields
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migratio... | gpl-2.0 | 1,482,716,469,157,356,800 | 39.257143 | 114 | 0.578424 | false | 4.256798 | false | false | false |
brianbv/armature | inkscape/armature.py | 1 | 8353 | #!/usr/bin/env python
import inkex
import os
import gettext
_ = gettext.gettext
from simplestyle import *
#styles
ArmatureTitleStyle = { 'font-family' : 'arial', 'font-size' : '24pt' } #'text-align' : 'center', 'text-anchor' : 'middle',
ArmatureSubTitleStyle = { 'font-family' : 'arial', 'font-size' : '18pt','font-sty... | mit | -4,075,902,981,163,393,000 | 35.160173 | 160 | 0.67353 | false | 2.99498 | false | false | false |
WoLpH/Cache-Debug-Toolbar | examples/settings.py | 1 | 2196 | # Django settings for examples project.
import sys
from os.path import dirname, join
import logging
logging.basicConfig(level=logging.DEBUG)
# add our parent directory to the path so that we can find cache_toolbar
sys.path.append('../')
# in order to track django's caching we need to import the panels code now
# so ... | bsd-3-clause | 56,576,075,526,401,440 | 25.780488 | 74 | 0.701275 | false | 3.347561 | false | false | false |
maas/maas | src/maasserver/migrations/maasserver/0115_additional_boot_resource_filetypes.py | 1 | 1935 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("maasserver", "0114_node_dynamic_to_creation_type")]
operations = [
migrations.AlterField(
model_name="bootresourcefile",
... | agpl-3.0 | -7,506,806,004,746,052,000 | 38.489796 | 76 | 0.419638 | false | 4.377828 | false | false | false |
hellsgate1001/thatforum_django | forumuser/migrations/0001_initial.py | 1 | 6150 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ForumUser'
db.create_table(u'forumuser_forumuser', (
... | mit | 6,497,214,455,424,636,000 | 63.072917 | 195 | 0.596748 | false | 3.594389 | false | false | false |
DADco/convalesense-web | convalesense/exercise/migrations/0005_auto_20170126_1357.py | 1 | 1798 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-01-26 13:57
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('exercise', '0004_auto_20170126_1157'),
]
operations = [
migrations.AddField... | mit | -7,376,432,480,576,266,000 | 34.96 | 127 | 0.594549 | false | 4.33253 | false | false | false |
sneakywombat/capirca | lib/ciscoxr.py | 1 | 1444 | # Copyright 2011 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... | apache-2.0 | -1,085,484,700,238,255,000 | 29.083333 | 74 | 0.691828 | false | 3.6743 | false | false | false |
CSD-Public/stonix | src/tests/rules/unit_tests/zzzTestRuleDisableAFPFileSharing.py | 1 | 4951 | ###############################################################################
# #
# Copyright 2019. Triad National Security, LLC. All rights reserved. #
# This program was produced under U.S. Government contract 89233218CNA000001 #
... | gpl-2.0 | 4,251,300,370,534,925,300 | 36.507576 | 82 | 0.579075 | false | 4.509107 | true | false | false |
OpenUpgrade/OpenUpgrade | openerp/addons/base/ir/ir_model.py | 1 | 62459 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... | agpl-3.0 | 8,268,390,740,437,451,000 | 47.342879 | 207 | 0.555388 | false | 4.096209 | false | false | false |
JaanPorkon/master-ssh | masterssh/masterssh.py | 1 | 16409 | #!/usr/bin/env python
import paramiko
import requests
import sys
import time
import threading
import os
import logging
from paramiko import SSHException
from termcolor import colored
logger = logging.getLogger('MasterSSH')
logger.setLevel(logging.INFO)
logging.basicConfig(format='[%(asctime)s] %(threadName)s: %(mess... | mit | 4,166,474,605,367,543,300 | 37.341121 | 223 | 0.489914 | false | 4.831861 | true | false | false |
facelesspanda/inkpy | inkpy/story.py | 1 | 2730 | from io import IOBase
from ._runtime import Story as RStory, InkList as RInkList, Path as RPath
from .choice import Choice
from .inklist import InkList
from .js import dec
import json
class Story:
# Constructor
def __init__(self, file_):
if isinstance(file_, str):
closefile = True
... | mit | -6,594,550,427,894,781,000 | 22.947368 | 73 | 0.555678 | false | 3.64 | false | false | false |
python-daisychain/daisychain | daisychain/steps/monitor.py | 1 | 5349 | from daisychain.step import Step
from daisychain.step_status import StepStatus
from daisychain.field import Field
from daisychain.reference import Reference,ReferenceList
from abc import abstractmethod
class MonitorStatus(StepStatus):
def __init__(self, *args, **kwargs):
super(MonitorStatus, self).__init__... | mit | 7,831,867,913,957,889,000 | 41.452381 | 145 | 0.633576 | false | 4.306763 | false | false | false |
smjhnits/Praktikum_TU_D_16-17 | Anfängerpraktikum/Protokolle/V101_Das_Trägheitsmoment/Auswertung3.py | 1 | 1329 | import numpy as np
from scipy.stats import sem
from uncertainties import ufloat
import uncertainties.unumpy as unp
Zeiten = np.genfromtxt("Restdaten.txt", unpack = True)
#print(Zeiten[2:])
Zeiten /= 5
#print(Zeiten[2:])
daten = np.genfromtxt("WRGdyn.txt", unpack = True)
Mittelwerte = np.array([np.mean(row) for ro... | mit | 3,336,208,014,950,567,400 | 19.6875 | 84 | 0.666918 | false | 2.04321 | false | false | false |
RaphaelLapierre/INF4215 | TP3/RiskAI/Agent.py | 1 | 1513 | #-*- coding: latin-1 -*-
# Agent pour choisir les pays de départ
# Adapté de l'agent de TicTacToe de Michel Gagnon
class Agent:
def __init__(self):
self.initQ()
def initQ(self):
self.nbQ = {}
self.q = {}
self.alpha = {}
def QValue(self,grid,action):
if (grid,action... | mit | -2,311,261,043,374,531,600 | 27.566038 | 74 | 0.555849 | false | 3.446469 | false | false | false |
yadutaf/command_line_interface | command_line_interface/command_line_interface.py | 1 | 5292 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (C) 2015 Thomas Maurice <thomas@maurice.fr>
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 o... | gpl-3.0 | 4,558,607,055,325,601,000 | 40.669291 | 95 | 0.594104 | false | 4.581818 | false | false | false |
nbdsp/regd | regd/fs.py | 1 | 18433 | """******************************************************************
* Module: regd
*
* File name: fs.py
*
* Created: 2015-12-17 15:14:24
*
* Abstract: "File system"
*
* Author: Albert Berger [ alberger@gmail.com ].
*
*******************************************************************"""
__lastedited__ = "2016... | gpl-2.0 | 7,663,002,791,549,078,000 | 27.846635 | 117 | 0.642381 | false | 2.907872 | false | false | false |
umlfri/umlfri2 | umlfri2/qtgui/appdialogs/settings/dialog.py | 1 | 2251 | import os
from PyQt5.QtWidgets import QDialog, QVBoxLayout, QTabWidget, QDialogButtonBox
from umlfri2.application import Application
from umlfri2.application.events.application import LanguageChangedEvent
from .general import SettingsDialogGeneral
from .updates import SettingsDialogUpdates
class SettingsDialog(QDial... | gpl-3.0 | 4,457,606,660,196,235,300 | 33.106061 | 116 | 0.626388 | false | 4.255198 | false | false | false |
nansencenter/nansat | nansat/mappers/mapper_netcdf_cf_sentinel1.py | 1 | 2222 | from nansat.mappers.sentinel1 import Sentinel1
from nansat.mappers.mapper_netcdf_cf import Mapper as NetCDF_CF_Mapper
class Mapper(Sentinel1, NetCDF_CF_Mapper):
def __init__(self, filename, gdal_dataset, gdal_metadata, *args, **kwargs):
NetCDF_CF_Mapper.__init__(self, filename, gdal_dataset, gdal_metadata... | gpl-3.0 | 7,828,261,526,897,155,000 | 43.44 | 99 | 0.549955 | false | 3.366667 | false | false | false |
guillaume-philippon/aquilon | lib/aquilon/worker/commands/add_required_service_osname.py | 1 | 2139 | # -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
# ex: set expandtab softtabstop=4 shiftwidth=4:
#
# Copyright (C) 2008,2009,2010,2011,2012,2013,2014,2015,2016,2017 Contributor
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# Y... | apache-2.0 | -1,663,968,167,387,204,900 | 42.653061 | 78 | 0.69051 | false | 3.819643 | false | false | false |
gabfl/vault | src/unittest/views/test_menu.py | 1 | 3305 | from unittest.mock import patch
from ..base import BaseTest
from ...models.Secret import SecretModel
from ...views import menu
from ...modules.carry import global_scope
class Test(BaseTest):
def setUp(self):
# Preserve enc to restore it on tear down
self.enc_save = global_scope['enc']
def t... | mit | 2,681,945,722,023,599,600 | 33.427083 | 78 | 0.638124 | false | 3.768529 | true | false | false |
rr-/szurubooru | server/szurubooru/func/tags.py | 1 | 11762 | import re
from datetime import datetime
from typing import Any, Callable, Dict, List, Optional, Tuple
import sqlalchemy as sa
from szurubooru import config, db, errors, model, rest
from szurubooru.func import serialization, tag_categories, util
class TagNotFoundError(errors.NotFoundError):
pass
class TagAlrea... | gpl-3.0 | 4,494,886,597,625,063,400 | 30.034301 | 77 | 0.619793 | false | 3.541704 | false | false | false |
rdo-management/python-heatclient | heatclient/tests/unit/test_actions.py | 1 | 2441 | # 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, software
# distributed under the... | apache-2.0 | -7,391,770,849,309,173,000 | 33.380282 | 69 | 0.61737 | false | 4.048093 | true | false | false |
redhat-openstack/trove | trove/guestagent/dbaas.py | 1 | 3302 | # Copyright (c) 2011 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 ... | apache-2.0 | -2,871,879,464,545,582,600 | 28.747748 | 78 | 0.683525 | false | 3.562028 | false | false | false |
dzavalishin/phantomuserland | tools/plc/test/pyfront/encode.py | 1 | 22716 | import tokenize
from tokenize import Token
if '.' in str(1.0):
from boot import *
#EOF,ADD,SUB,MUL,DIV,POW,AND,OR,CMP,GET,SET,NUMBER,STRING,GGET,GSET,MOVE,DEF,PASS,JUMP,CALL,RETURN,IF,DEBUG,EQ,LE,LT,DICT,LIST,NONE,LEN,POS,PARAMS,IGET,FILE,NAME,NE,HAS,RAISE,SETJMP,MOD,LSH,RSH,ITER,DEL,REGS = 0,1,2,3,4,5,6,7,8,9,10,... | lgpl-3.0 | 8,269,896,270,531,045,000 | 27.253731 | 334 | 0.48807 | false | 2.649714 | false | false | false |
RedHatQE/rhui-testing-tools | rhui-tests/test_rhui_tcms178474.py | 1 | 2494 | #! /usr/bin/python -tt
import nose
from rhuilib.util import *
from rhuilib.rhui_testcase import *
from rhuilib.rhuimanager import *
from rhuilib.rhuimanager_cds import *
from rhuilib.rhuimanager_client import *
from rhuilib.rhuimanager_repo import *
from rhuilib.rhuimanager_sync import *
from rhuilib.rhuimanager_enti... | gpl-3.0 | -2,763,472,301,740,885,500 | 46.056604 | 201 | 0.668003 | false | 2.951479 | true | false | false |
qkzk/sncf_lcd | adafruit_lcd/Adafruit_CharLCD/Adafruit_CharLCD.py | 1 | 20109 | # Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, c... | gpl-3.0 | 4,056,663,520,891,147,000 | 42.686667 | 104 | 0.583271 | false | 3.81575 | false | false | false |
browseinfo/nikita_modules | sale_start_end_dates/sale.py | 1 | 7458 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Sale Start End Dates module for Odoo
# Copyright (C) 2014-2015 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.com>
#
# This program is free software: you can ... | gpl-3.0 | 6,123,930,313,988,737,000 | 40.433333 | 88 | 0.560606 | false | 3.983974 | false | false | false |
akbarpn136/logapp-dj | perek_tugas/migrations/0003_auto_20160120_0916.py | 1 | 1113 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-01-20 02:16
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('perek_tugas', '0002_auto_20160119_1958'),
]
operations = [
migrations.AlterFie... | mit | -268,986,061,449,865,900 | 30.8 | 88 | 0.592093 | false | 3.71 | false | false | false |
castelao/CoTeDe | cotede/datasets.py | 1 | 2256 | import numpy as np
from numpy import datetime64, timedelta64
import os.path
from cotede.utils import cotederc
try:
import pandas as pd
PANDAS_AVAILABLE = True
except ImportError:
PANDAS_AVAILABLE = False
try:
from supportdata import download_file
SUPPORTDATA_AVAILABLE = True
except ImportError:... | bsd-3-clause | -6,616,734,323,954,936,000 | 29.08 | 100 | 0.652039 | false | 3.283843 | false | false | false |
dpursehouse/buck | programs/buck_package.py | 1 | 2137 | import os
import json
import stat
import tempfile
import pkg_resources
from buck_tool import BuckTool, Resource
SERVER = Resource("buck_server")
BOOTSTRAPPER = Resource("bootstrapper_jar")
class BuckPackage(BuckTool):
def __init__(self, buck_project):
super(BuckPackage, self).__init__(buck_project)
... | apache-2.0 | -5,585,552,686,461,046,000 | 32.390625 | 87 | 0.60365 | false | 3.729494 | false | false | false |
rackerlabs/qonos | qonos/db/sqlalchemy/models.py | 1 | 6763 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Rackspace
# 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/licen... | apache-2.0 | -7,574,595,437,630,625,000 | 32.815 | 78 | 0.636404 | false | 4.020809 | false | false | false |
bartoszj/Mallet | mallet/Foundation/NSPropertyListSerialization.py | 1 | 2375 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2015 Bartosz Janda
#
# 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 w... | mit | 9,003,200,701,510,459,000 | 34.447761 | 82 | 0.741474 | false | 4.059829 | false | false | false |
trabacus-softapps/openerp-8.0-cc | openerp/addons/product_margin/product_margin.py | 1 | 8105 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 | -4,318,110,590,444,737,500 | 60.401515 | 161 | 0.594941 | false | 3.798032 | false | false | false |
mattaustin/django-thummer | thummer/apps.py | 1 | 1204 | # -*- coding: utf-8 -*-
#
# Copyright 2011-2018 Matt Austin
#
# 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 applicabl... | apache-2.0 | 7,510,298,645,913,203,000 | 30.684211 | 74 | 0.7201 | false | 3.871383 | false | false | false |
bnbowman/HlaTools | src/pbhla/dictionary.py | 1 | 4290 | import os, re, csv, logging
from pbcore.io.FastaIO import FastaReader
from pbhla.io.BlasrIO import BlasrReader, record_to_string
from pbhla.io.SamIO import SamReader
from pbhla.utils import get_base_sequence_name
log = logging.getLogger()
def create_amp_assem_reference( m1_file, reference=None ):
log.info('Parsi... | bsd-3-clause | -6,020,739,768,453,500,000 | 37.303571 | 84 | 0.607692 | false | 3.629442 | false | false | false |
h2020-westlife-eu/VRE | api/views.py | 1 | 20952 | import os
import re
import tempfile
import traceback
from django.conf import settings
from django.contrib.auth.models import User
from django.contrib.auth import login
from django.contrib.auth.models import User
from django.contrib.sessions.models import Session
from django.core import signing
from django.core.excepti... | mit | 8,812,762,274,060,203,000 | 33.688742 | 121 | 0.671296 | false | 4.174537 | false | false | false |
naterh/cloud-init-rax-pkg | cloudinit/distros/rhel.py | 1 | 13770 | # vi: ts=4 expandtab
#
# Copyright (C) 2012 Canonical Ltd.
# Copyright (C) 2012, 2013 Hewlett-Packard Development Company, L.P.
# Copyright (C) 2012 Yahoo! Inc.
#
# Author: Scott Moser <scott.moser@canonical.com>
# Author: Juerg Haefliger <juerg.haefliger@hp.com>
# Author: Joshua Harlow <harlowja@yaho... | gpl-3.0 | 7,355,316,471,774,930,000 | 37.571429 | 77 | 0.543282 | false | 3.920843 | true | false | false |
goliatone/minions | setup.py | 1 | 2375 | #!/usr/bin/env python
import os
import sys
import re
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
#Include scaffolder
sys.path.append(
os.path.abspath(
os.path.join(
os.path.dirname(__file__), 'scaffolder')
)
)
import scaffolder
scaffolder... | mit | 5,604,260,685,536,521,000 | 23.234694 | 79 | 0.593684 | false | 3.378378 | false | false | false |
encukou/freeipa | ipaserver/dnssec/odsmgr.py | 3 | 8827 | #
# Copyright (C) 2014 FreeIPA Contributors see COPYING for license
#
import logging
import dns.name
import re
try:
from xml.etree import cElementTree as etree
except ImportError:
from xml.etree import ElementTree as etree
from ipapython import ipa_log_manager, ipautil
from ipaserver.dnssec.opendnssec impor... | gpl-3.0 | -3,052,307,776,513,307,000 | 34.882114 | 79 | 0.582757 | false | 3.691761 | false | false | false |
olivierverdier/sfepy | tests/test_matcoefs.py | 1 | 1180 | from sfepy.base.testing import TestCommon, assert_, debug
class Test(TestCommon):
@staticmethod
def from_conf(conf, options):
return Test(conf=conf, options=options)
def test_tensors(self):
import numpy as nm
from sfepy.mechanics.matcoefs import ElasticConstants
ok = True... | bsd-3-clause | 499,207,843,507,274,050 | 25.222222 | 69 | 0.476271 | false | 3.856209 | true | false | false |
4degrees/segue | source/segue/backend/processor/qube.py | 1 | 1994 | # :coding: utf-8
# :copyright: Copyright (c) 2013 Martin Pengelly-Phillips
# :license: See LICENSE.txt.
import pickle
import base64
try:
from shlex import quote
except ImportError:
from pipes import quote
from .base import Processor
from .. import pickle_support
class QubeProcessor(Processor):
'''Foregr... | apache-2.0 | -6,446,337,014,757,935,000 | 25.236842 | 72 | 0.499498 | false | 4.102881 | false | false | false |
Real-Instruments/fflib | fflib/ssh/config.py | 1 | 26230 | #!/usr/bin/env python3
# The MIT License (MIT)
# Copyright (c) 2016 Michael Sasser <Michael.Sasser@Real-Instruments.de>
#
# 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 restrictio... | agpl-3.0 | 1,806,710,816,696,217,000 | 35.577406 | 123 | 0.582361 | false | 4.177445 | true | false | false |
josiah-wolf-oberholtzer/uqbar | uqbar/cli/CLIAggregator.py | 1 | 8777 | import abc
import sys
from uqbar.cli.CLI import CLI
class CLIAggregator(CLI):
"""
Aggregates CLI scripts.
::
>>> import uqbar.cli
>>> class ExampleAggregator(uqbar.cli.CLIAggregator):
... @property
... def cli_classes(self):
... return []
... | mit | 3,709,501,154,939,288,000 | 36.995671 | 87 | 0.506893 | false | 4.648835 | false | false | false |
TribeMedia/synapse | synapse/storage/__init__.py | 2 | 11492 | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
#
# 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 applicab... | apache-2.0 | 2,170,196,784,225,768,400 | 36.070968 | 88 | 0.619735 | false | 3.927546 | false | false | false |
waynechu/PythonProject | dns/rdtypes/ANY/LOC.py | 2 | 12351 | # Copyright (C) Dnspython Contributors, see LICENSE for text of ISC license
# Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and ... | mit | -6,314,243,699,160,796,000 | 36.770642 | 85 | 0.553073 | false | 3.99063 | false | false | false |
dmpetrov/dataversioncontrol | dvc/data_cloud.py | 1 | 4298 | """Manages dvc remotes that user can use with push/pull/status commands."""
import logging
from dvc.config import NoRemoteError
from dvc.remote import Remote
logger = logging.getLogger(__name__)
class DataCloud:
"""Class that manages dvc remotes.
Args:
repo (dvc.repo.Repo): repo instance that belo... | apache-2.0 | -6,023,953,380,305,063,000 | 35.423729 | 78 | 0.594928 | false | 4.255446 | true | false | false |
VeritasOS/cloud-custodian | c7n/tags.py | 1 | 26589 | # Copyright 2016 Capital One Services, 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... | apache-2.0 | -2,868,887,039,737,986,600 | 31.50489 | 85 | 0.550265 | false | 4.079319 | false | false | false |
jepler/linuxcnc-mirror | lib/python/qtvcp/widgets/general_hal_output.py | 3 | 5353 | #!/usr/bin/python2.7
#
# Qtvcp widget
# Copyright (c) 2017 Chris Morley
#
# 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... | lgpl-2.1 | -685,887,494,941,553,800 | 33.535484 | 93 | 0.58995 | false | 3.554449 | false | false | false |
djaodjin/djaodjin-multitier | multitier/settings.py | 1 | 3069 | # Copyright (c) 2019, DjaoDjin inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... | bsd-2-clause | -6,951,907,875,754,757,000 | 42.842857 | 79 | 0.743565 | false | 3.711004 | false | false | false |
napalm-automation/napalm-yang | napalm_yang/models/openconfig/system/aaa/server_groups/server_group/servers/server/radius/config/__init__.py | 1 | 25641 | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | apache-2.0 | -5,796,375,324,781,693,000 | 41.806344 | 813 | 0.536836 | false | 3.932066 | true | false | false |
victorbordo/gh-showcases | gh_showcase_api.py | 1 | 3515 | from bs4 import BeautifulSoup
import requests
import json
from collections import OrderedDict
# TODO: Add OAuth2 so api can maximize rate limit of 30 requests per min
# for individual repo fetching using github search API.
class GhShowcaseAPI(object):
""""""
def __init__(self,):
pass
def get... | mit | 1,095,337,825,477,002,000 | 40.845238 | 132 | 0.589189 | false | 4.214628 | false | false | false |
mjpieters/rod.recipe.rabbitmq | src/rod/recipe/rabbitmq/__init__.py | 1 | 5364 | """Recipe for setting up RabbitMQ."""
import logging
import os
import pkg_resources
import shutil
import subprocess
import sys
import tempfile
import urllib
import zc.recipe.egg
logger = logging.getLogger(__name__)
class Recipe(zc.recipe.egg.Eggs):
"""Buildout recipe for installing RabbitMQ."""
def __init_... | lgpl-3.0 | 1,036,956,407,825,919,900 | 32.117284 | 81 | 0.57047 | false | 3.806955 | false | false | false |
leppa/home-assistant | homeassistant/components/wled/light.py | 1 | 7801 | """Support for LED lights."""
import logging
from typing import Any, Callable, List, Optional, Tuple
from wled import WLED, Effect, WLEDError
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
ATTR_COLOR_TEMP,
ATTR_EFFECT,
ATTR_HS_COLOR,
ATTR_TRANSITION,
ATTR_WHITE_VALUE,
SUPPOR... | apache-2.0 | -3,505,592,942,106,019,000 | 30.840816 | 88 | 0.602359 | false | 3.87531 | false | false | false |
DataONEorg/DataONE_Operations | d1_admin_tools/solrclient.py | 1 | 5018 |
import os
import argparse
import logging
import logging.handlers
import urllib.request, urllib.parse, urllib.error
import requests
import datetime
import json
import re
import time
LOG_NAME = "logagg"
APP_LOG = "app"
PAGE_SIZE = 10000 #Number of records to reetrieve per request
DEFAULT_CORE = "event_core" #name of... | apache-2.0 | 6,096,574,968,055,135,000 | 28.174419 | 121 | 0.609605 | false | 3.553824 | false | false | false |
rafafigueroa/wsdift | src/haws/scripts/other/backup_gui_haws.py | 1 | 1591 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author: Rafael Figueroa
"""
#Python imports
import numpy as np
from pyqtgraph.Qt import QtGui, QtCore
import pyqtgraph as pg
#pyqtgraph configuration
pg.setConfigOptions(antialias = True)
class GUI_haws:
def __init__(self):
#Qt Initialization (once per ... | apache-2.0 | 8,332,612,020,613,492,000 | 23.859375 | 78 | 0.610308 | false | 3.182 | false | false | false |
vcelis/cs253-wiki | handlers/registrations.py | 1 | 4124 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2014 Vincent Celis
#
# 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 righ... | mit | -5,372,747,798,785,555,000 | 33.663866 | 79 | 0.701018 | false | 4.278008 | false | false | false |
mgunyho/pyspread | pyspread/src/interfaces/ods.py | 1 | 3350 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright Martin Manns
# Distributed under the terms of the GNU General Public License
# --------------------------------------------------------------------
# pyspread is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publi... | gpl-3.0 | 3,731,405,029,275,072,000 | 27.87931 | 76 | 0.613433 | false | 3.969194 | false | false | false |
nickhand/nbodykit | nbodykit/algorithms/fftpower.py | 1 | 29201 | import os
import numpy
import logging
from nbodykit import CurrentMPIComm
from nbodykit.binned_statistic import BinnedStatistic
from nbodykit.meshtools import SlabIterator
from nbodykit.base.catalog import CatalogSourceBase
from nbodykit.base.mesh import MeshSource
class FFTBase(object):
"""
Base class provid... | gpl-3.0 | 2,064,871,321,750,785,500 | 37.171242 | 151 | 0.58409 | false | 3.593527 | false | false | false |
CityManager/start_flask | a01_quickstart/learn_flask_sqlalchemy.py | 1 | 2726 | #!/usr/bin/env python3
# _*_ coding:utf-8 _*_
import os
from flask import Flask, session, redirect, url_for, render_template, flash
from flask_bootstrap import Bootstrap
from flask_moment import Moment
from flask_script import Manager, Shell
from flask_sqlalchemy import SQLAlchemy
from flask_wtf import Form
from wtform... | apache-2.0 | 5,367,079,305,364,101,000 | 30.72619 | 93 | 0.661787 | false | 3.175209 | false | false | false |
heiligeslama/devilsBackbone | python2.7libs/server.py | 1 | 8963 | #! /usr/bin/python2.7
'''
Copyright (c) 2013, Nikola Wuttke
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of condit... | bsd-3-clause | -8,198,388,917,097,915,000 | 38.484581 | 755 | 0.613522 | false | 4.215898 | false | false | false |
vincentdavis/corrupt_image_finder | test_images/FindBadImages.py | 1 | 4968 | from PIL import Image
import os
import glob
import os
import EXIF
from datetime import datetime
print('starting')
#path = os.getcwd()
#path = '/Volumes/Hafnium/Pictures'
path = '/Volumes/home/Photos/Pictures2'
#os.walk
#path = '/Users/vincentdavis/Dropbox/Camera Uploads'
#knowimagetypes = set(['.jpg', '.JPG', '.jpeg... | bsd-3-clause | -8,826,246,846,409,449,000 | 34.492857 | 126 | 0.456522 | false | 4.167785 | true | false | false |
AdaDoom3/AdaDoom3 | Tools/compile-idmap.py | 1 | 24966 | import fileinput
import re
import sys
#############
## Globals ##
#############
scope = []
mode = 0
in_indicies = False
surface_done = False
ignore_next_line = False
on_first_entity = True
found_key_value = False
indent = " "
WHITE_SPACE = r'(?:(?!\n)\s)+'
NUM_PATTE... | gpl-3.0 | 779,115,644,000,344,000 | 27.147689 | 142 | 0.484459 | false | 2.969668 | false | false | false |
KSG-IT/ksg-nett | chat/redis.py | 1 | 1590 | import json
import logging
from typing import List
import redis
from django.conf import settings
from redis import RedisError
CHAT_STATE_STORAGE_ENABLED = True
CHAT_ROOM_USERS_REDIS_KEY = "chat-room-users"
CHAT_ROOM_OLD_MESSAGES_KEY = "chat-room-messages"
CHAT_ROOM_MAX_MESSAGES = 50
try:
db = redis.Redis(
... | gpl-3.0 | 2,134,648,874,049,937,400 | 25.065574 | 87 | 0.685535 | false | 2.966418 | false | false | false |
remyoudompheng/forum-gtk | lib/sum_buffer.py | 1 | 16718 | # -*- coding: utf-8 -*-
# Flrn-gtk: panneau sommaire
# Rémy Oudompheng, Noël 2005-Septembre 2006
# Modules GTK
import pygtk
pygtk.require('2.0')
import gtk
import gtk.gdk
import gobject
import pango
# Modules Python
import email.Utils
import time
import os, sys
from tempfile import mkstemp
import re
# Modules
impo... | gpl-3.0 | 4,771,831,922,810,199,000 | 38.0726 | 82 | 0.534284 | false | 3.696057 | false | false | false |
our-city-app/oca-backend | services/oca3/oca/models/home_screen_navigation_button.py | 1 | 3335 | # coding: utf-8
from __future__ import absolute_import
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from oca.models.base_model_ import Model
from oca import util
class HomeScreenNavigationButton(Model):
"""NOTE: This class is auto generated by OpenAPI Generator ... | apache-2.0 | 2,570,713,711,012,885,000 | 26.336066 | 97 | 0.603298 | false | 4.210859 | false | false | false |
TEAM-HRA/hra_suite | HRACore/src/hra_core/datetime_utils.py | 1 | 2598 | '''
Created on Jun 30, 2013
@author: jurek
module used for some specific tasks concerning time and date
'''
import datetime
class DateTimeUtils(object):
"""
class with some useful time/date functionality
"""
def __init(self):
self.__start_datetime__ = datetime.datetime.now()
self.__... | lgpl-3.0 | 8,507,660,949,476,492,000 | 27.866667 | 75 | 0.635104 | false | 3.54918 | false | false | false |
TieWei/openstack-kit | openstackkit/l3_evacuate.py | 1 | 30384 | #! /usr/bin/env python
# @author wtie@cisco.com
import logging
import os
import time
import itertools
import ansible.runner
from logging.handlers import SysLogHandler
from neutronclient.common.exceptions import NeutronClientException
from neutronclient.v2_0 import client
LOG = logging.getLogger('neutron-l3-evacuate')... | mit | 6,790,549,671,263,714,000 | 40.736264 | 86 | 0.512243 | false | 4.105391 | false | false | false |
chrislit/abydos | abydos/distance/_unknown_m.py | 1 | 5440 | # Copyright 2019-2020 by Christopher C. Little.
# This file is part of Abydos.
#
# Abydos 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 versio... | gpl-3.0 | 5,282,726,743,700,016,000 | 28.090909 | 78 | 0.561213 | false | 3.959243 | false | false | false |
ayanc/tf-boilerplate | imagenet/model.py | 1 | 3655 | # Ayan Chakrabarti <ayanc@ttic.edu>
import tensorflow as tf
import numpy as np
# Rate at which batch-norm population averages decay
_bndecay=0.99
class model:
def conv(self,inp,ksz,name,stride=1,padding='SAME',ifrelu=True,ifbn=True):
ksz = [ksz[0],ksz[0],ksz[1],ksz[2]]
# xavier init
sq = ... | mit | 3,868,395,140,147,047,400 | 33.158879 | 93 | 0.526129 | false | 3.102716 | false | false | false |
fmalina/texting | sms/views.py | 1 | 7278 | from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponse, Http404
from django.db.models import Count
from modem import list_devices
from humod.siminfo import (
show_operator, show_phone_no,
full_sms_list, BOXES, system_info, seq
)
from sms.models import *
from sms.fo... | gpl-3.0 | 3,817,004,015,209,347,600 | 26.992308 | 80 | 0.549739 | false | 3.236105 | false | false | false |
SripriyaSeetharam/tacker | tacker/common/rpc_compat.py | 1 | 5323 | # Copyright (c) 2014 Red Hat, 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... | apache-2.0 | -968,317,959,237,220,100 | 31.260606 | 78 | 0.640804 | false | 4.075804 | false | false | false |
karatheodory/python-parser | city_category_extractor.py | 1 | 1229 | __author__ = 'vasyanya'
from bs4 import BeautifulSoup
import re
class CityCategoryData:
def __init__(self):
self.link = ''
self.category = None
self.text = None
def extract(content):
soup = BeautifulSoup(content)
results = []
all_links = soup.find_all('a')
vacancy_link_r... | gpl-2.0 | 5,506,677,940,774,026,000 | 25.170213 | 87 | 0.560618 | false | 3.81677 | false | false | false |
iotile/coretools | iotilecore/iotile/core/hw/hwmanager.py | 1 | 33895 | # This file is adapted from python code released by WellDone International
# under the terms of the LGPLv3. WellDone International's contact information is
# info@welldone.org
# http://welldone.org
#
# Modifications to this file from the original created at WellDone International
# are copyright Arch Systems Inc.
"""T... | gpl-3.0 | -7,318,511,779,535,846,000 | 37.825888 | 126 | 0.611654 | false | 4.539306 | false | false | false |
agnusmaximus/cyclades | data/nh2010/replicate_n_times.py | 1 | 2302 | from __future__ import print_function
import sys
import numpy as np
import matplotlib.pyplot as plt
from scipy.sparse import coo_matrix
# Expect matrix market format. If A is the matrix, replicates like:
# [A, A ... ; A A .. ], so for n = 2, writes [A, A; A, A]
def plot_coo_matrix(m):
if not isinstance(m, coo_mat... | apache-2.0 | 5,736,052,357,777,667,000 | 27.073171 | 87 | 0.583406 | false | 2.717828 | false | false | false |
Zouyiran/ryu | ryu/app/reduce_t/flow_collector.py | 1 | 1939 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from ryu.base import app_manager
from ryu.ofproto import ofproto_v1_3
from command_sender import CommandSender
'''
###reduce_t###
--> flow collector
1) call rest_api and parse json
'''
class FlowCollector(app_manager.RyuApp):
'''
only collect access switches
... | apache-2.0 | 3,299,754,166,195,318,000 | 31.316667 | 86 | 0.534812 | false | 3.597403 | false | false | false |
dbarbier/privot | python/test/t_StandardEvent_std.py | 1 | 3234 | #! /usr/bin/env python
from openturns import *
TESTPREAMBLE()
RandomGenerator().SetSeed(0)
try :
# We create a numerical math function */
myFunction = NumericalMathFunction("poutre")
dim = myFunction.getInputDimension()
# We create a normal distribution point of dimension dim
myDistribution = ... | lgpl-3.0 | -6,145,299,164,690,831,000 | 31.019802 | 114 | 0.683364 | false | 3.577434 | false | false | false |
tmachows/kompilatory | lab04-interpreter/scanner.py | 1 | 1844 | import ply.lex as lex
class Scanner(object):
def find_tok_column(self, token):
last_cr = self.lexer.lexdata.rfind('\n', 0, token.lexpos)
if last_cr < 0:
last_cr = 0
return token.lexpos - last_cr
def build(self):
self.lexer = lex.lex(object=self)
def input(self, text):
... | gpl-2.0 | -6,042,413,468,531,517,000 | 17.45 | 113 | 0.474512 | false | 2.699854 | false | false | false |
andresriancho/w3af-api-client | w3af_api_client/log.py | 1 | 4234 | import json
from w3af_api_client.utils.exceptions import APIException
class LogEntry(object):
def __init__(self, _type, message, _time, severity, _id):
self.type = _type
self.message = message
self.time = _time
self.severity = severity
self.id = _id
def __eq__(self, o... | gpl-2.0 | -6,361,578,361,078,470,000 | 31.821705 | 76 | 0.572036 | false | 4.167323 | false | false | false |
prophile/webshack | webshack/dependencies.py | 1 | 3656 | import html.parser
from urllib.parse import urljoin
import re
import tinycss
from enum import Enum
from os.path import commonprefix
from collections import namedtuple
class RefCat(Enum):
internal = 1
external = 2
Ref = namedtuple('Ref', 'cat ref')
def grok_ref(link, containing_component=None):
ROOT = 'ht... | mit | -513,061,309,140,538,800 | 29.983051 | 79 | 0.605033 | false | 3.726809 | false | false | false |
NicovincX2/Python-3.5 | Géométrie/Fractales/random_spirale.py | 1 | 1983 | # -*- coding: utf-8 -*-
import os
# Random Spiral Fractals
# FB36 - 20130929
import math
import random
from collections import deque
from PIL import Image
imgx = 512
imgy = 512
image = Image.new("RGB", (imgx, imgy))
pixels = image.load()
xa = -1.5
xb = 1.5
ya = -1.5
yb = 1.5 # view
n = random.randint(2, 9) # of s... | gpl-3.0 | -1,282,432,075,014,798,300 | 33.189655 | 75 | 0.504286 | false | 3.009105 | false | false | false |
robwebset/script.suitability | resources/lib/settings.py | 1 | 4110 | # -*- coding: utf-8 -*-
import os
import xbmc
import xbmcaddon
ADDON = xbmcaddon.Addon(id='script.suitability')
ADDON_ID = ADDON.getAddonInfo('id')
# Common logging module
def log(txt, loglevel=xbmc.LOGDEBUG):
if (ADDON.getSetting("logEnabled") == "true") or (loglevel != xbmc.LOGDEBUG):
if isinstance(txt... | gpl-2.0 | 6,414,066,728,308,883,000 | 31.88 | 81 | 0.591727 | false | 3.951923 | false | false | false |
lkumar93/Robot-Learning | SVM/src/SVM.py | 1 | 4145 | #
# THIS IS AN IMPLEMENTATION OF SUPPORT VECTOR MACHINES
#
# COPYRIGHT BELONGS TO THE AUTHOR OF THIS CODE
#
# AUTHOR : LAKSHMAN KUMAR
# AFFILIATION : UNIVERSITY OF MARYLAND, MARYLAND ROBOTICS CENTER
# EMAIL : LKUMAR93@UMD.EDU
# LINKEDIN : WWW.LINKEDIN.COM/IN/LAKSHMANKUMAR1993
#
# THE WORK (AS DEFINED BELOW) IS PROVIDED... | mit | 4,897,134,533,523,494,000 | 25.741935 | 163 | 0.656212 | false | 2.929329 | false | false | false |
all-of-us/raw-data-repository | rdr_service/lib_fhir/fhirclient_3_0_0/models/device.py | 1 | 7936 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 3.0.0.11832 (http://hl7.org/fhir/StructureDefinition/Device) on 2017-03-22.
# 2017, SMART Health IT.
from . import domainresource
class Device(domainresource.DomainResource):
""" Item used in healthcare.
This resource identifies an ... | bsd-3-clause | -3,075,473,236,400,462,300 | 36.258216 | 98 | 0.593372 | false | 4.278167 | false | false | false |
deepmind/acme | acme/wrappers/gym_wrapper.py | 1 | 5894 | # python3
# Copyright 2018 DeepMind Technologies Limited. 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 re... | apache-2.0 | -8,985,539,020,161,410,000 | 31.384615 | 80 | 0.698337 | false | 3.924101 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.