repo_name
stringlengths
5
92
path
stringlengths
4
232
copies
stringclasses
19 values
size
stringlengths
4
7
content
stringlengths
721
1.04M
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
15
997
alpha_frac
float64
0.25
0.97
autogenerated
bool
1 class
urq/awssql
shellsql.py
1
2032
import os import pickle import sys import click from shellsql import aws from shellsql.models import Dataset from shellsql.cache import TTLCache, FileCache from shellsql import utils @click.group() def cli(): pass @cli.command() def hello(): click.echo("hello world!") @cli.command() @click.argument('columns...
apache-2.0
-1,326,841,644,984,561,400
27.222222
74
0.656004
false
vijayendrabvs/ssl-neutron
neutron/plugins/nec/ofc_driver_base.py
1
5143
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012 NEC Corporation. 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.or...
apache-2.0
7,191,177,591,923,439,000
36.268116
79
0.642815
false
Lujeni/matterllo
core/models.py
1
3323
# -*- coding: utf-8 -*- from __future__ import unicode_literals from ast import literal_eval from django.db import models from django.conf import settings class Board(models.Model): name = models.CharField(max_length=100) webhook_activate = models.BooleanField(default=False) trello_board_id = models.Cha...
mit
9,003,355,092,251,951,000
30.647619
144
0.63858
false
solus-project/evolve-sc
solus_sc/main_window.py
2
8096
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # # This file is part of solus-sc # # Copyright © 2013-2018 Ikey Doherty <ikey@solus-project.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 Founda...
gpl-2.0
-6,569,056,492,320,678,000
32.17623
80
0.627548
false
pluyckx/kam
kam/modules/plugins/core/base.py
1
2017
##\package base # \brief The base class for a core plugin. # # Core plugins are plugins that do not check parameters to keep the machine alive. # They just execute some code to get a wanted behaviour. # # \author Philip Luyckx # \copyright GNU Public License # This file is part of Keep Alive Monitor (kam). # # Keep Al...
gpl-2.0
-6,864,702,130,165,024,000
27.814286
85
0.714923
false
bundgus/python-playground
sqlalchemy-playground/sqlalchemy-playground.py
1
4317
import sqlalchemy from sqlalchemy import create_engine from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey from sqlalchemy.sql import select from sqlalchemy.sql import and_, or_, not_ from sqlalchemy.sql import text from sqlalchemy import func, desc print(sqlalchemy.__version__) engine = create...
mit
-1,070,303,591,381,381,500
26.496815
93
0.604587
false
Horniman/Horniman_Hack
satalite/models.py
1
1056
"""Satalite date models""" from __future__ import division, absolute_import, print_function, unicode_literals from django.db import models from db import models as db_models class LogTempLive(models.Model): """Messages from Buoy""" sensor = models.ForeignKey(db_models.Sensor) processed = models.BooleanFie...
gpl-2.0
3,972,958,697,875,750,400
34.2
82
0.686553
false
ElementalAlchemist/txircd
txircd/modules/rfc/cmd_topic.py
1
4733
from twisted.plugin import IPlugin from twisted.words.protocols import irc from txircd.config import ConfigValidationError from txircd.module_interface import Command, ICommand, IModuleData, ModuleData from txircd.utils import timestamp from zope.interface import implements from datetime import datetime irc.RPL_TOPICW...
bsd-3-clause
-808,310,799,892,986,600
33.057554
170
0.71498
false
masaohamanaka/mbed
workspace_tools/targets.py
1
59025
""" mbed SDK Copyright (c) 2011-2015 ARM Limited 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 writin...
apache-2.0
8,006,120,062,554,410,000
32.902929
147
0.573469
false
myarjunar/QGIS
tests/src/python/test_qgsproject.py
1
5476
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsProject. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. """ from b...
gpl-2.0
3,873,158,816,957,129,700
32.595092
104
0.620161
false
eirnym/aiopg
examples/notify.py
1
1061
import asyncio import aiopg dsn = 'dbname=aiopg user=aiopg password=passwd host=127.0.0.1' async def notify(conn): async with conn.cursor() as cur: for i in range(5): msg = "message {}".format(i) print('Send ->', msg) await cur.execute("NOTIFY channel, '{}'".format(msg...
bsd-2-clause
5,568,833,685,149,267,000
26.205128
65
0.572102
false
loveisbug/liveshow-sh
live.py
1
3864
# -*- coding: utf-8 -*- import urllib2 import HTMLParser from bs4 import BeautifulSoup import sys from datetime import * import re import smtplib from email.MIMEText import MIMEText def sendmail(subject, content): email_host = 'smtp host' email_user = 'sender email' email_pwd = 'sender pwd' maillist = ['example@12...
mit
4,368,484,991,240,511,500
35.742857
142
0.653447
false
SamuelToh/pixelated-user-agent
service/test/unit/test_welcome_mail.py
1
2330
# # Copyright (c) 2014 ThoughtWorks, Inc. # # Pixelated 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 License, or # (at your option) any later version. # # Pixelated is distrib...
agpl-3.0
6,749,108,892,892,384,000
30.917808
77
0.639056
false
Diyago/Machine-Learning-scripts
DEEP LEARNING/segmentation/Segmentation pipeline/get dataset.py
1
2616
# code from https://github.com/BBarbosa/tflearn-image-recognition-toolkit/blob/4a0528dcfb206b1e45997f2fbc097aafacfa0fa0/scripts/html_link_parser.py import re import argparse from PIL import Image from io import BytesIO from bs4 import BeautifulSoup from skimage import io as skio from urllib.request import urlopen imp...
apache-2.0
-718,070,879,443,201,700
31.296296
147
0.574541
false
zhlinh/leetcode
0057.Insert Interval/solution.py
1
1441
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' ***************************************** Author: zhlinh Email: zhlinhng@gmail.com Version: 0.0.1 Created Time: 2016-02-22 Last_modify: 2016-02-22 ****************************************** ''' ''' Given a set of non-overlapping intervals, ...
apache-2.0
-6,815,767,327,999,001,000
26.711538
72
0.529493
false
psychopy/versions
psychopy/experiment/components/mouse/__init__.py
1
28995
#!/usr/bin/env python # -*- coding: utf-8 -*- # Part of the PsychoPy library # Copyright (C) 2002-2018 Jonathan Peirce (C) 2019-2020 Open Science Tools Ltd. # Distributed under the terms of the GNU General Public License (GPL). from __future__ import absolute_import, print_function from builtins import super # provi...
gpl-3.0
-2,335,225,837,905,101,000
45.02381
114
0.534989
false
shootstar/novatest
nova/api/openstack/compute/plugins/v3/cells.py
1
14865
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011-2012 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www....
apache-2.0
837,730,049,796,058,100
34.141844
78
0.592398
false
appleseedhq/cortex
python/IECoreNuke/UndoManagers.py
5
3349
########################################################################## # # Copyright (c) 2010, Image Engine Design 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: # # * Redistribu...
bsd-3-clause
6,144,218,958,561,458,000
35.402174
81
0.692744
false
Upstream-Research/csv-tools
csv_tools/csv_prepend.py
1
11652
## Copyright (c) 2016-2017 Upstream Research, Inc. All Rights Reserved. ## ## Subject to an 'MIT' License. See LICENSE file in top-level directory ## ## #python-3.x ## python 2 does not work due mostly to issues with csv and io modules with unicode data help_text = ( "CSV-PREPEND tool version 20170918\n" ...
mit
-3,902,079,733,962,294,300
34.202417
101
0.495795
false
Oleh-Hrebchuk/OpenVPN-TryFalse
vpn/models.py
1
3592
from django.db import models # Create your models here. class General(models.Model): class Meta: db_table = "general" permissions = (('admins', "admins manage all settings openvpn"),) general_vpn_name = models.TextField(max_length=200) general_project_name = models.TextField(max_length=20...
gpl-3.0
8,188,553,040,697,901,000
23.772414
74
0.679287
false
jhh/puka
puka/middleware/debug.py
1
1769
import os from django.conf import settings from django.db import connection def terminal_width(): """ Function to compute the terminal width. WARNING: This is not my code, but I've been using it forever and I don't remember where it came from. """ width = 0 try: import fcntl ...
mit
3,804,612,522,956,817,400
28.983051
83
0.549463
false
ashtonteng/squad_exp
SelfMatchingLayer.py
1
6757
import tensorflow as tf from tensorflow.contrib import rnn import os os.environ["TF_CPP_MIN_LOG_LEVEL"]="2" class SelfMatchingLayer(): def __init__(self, args, inputs, scope): print("building self-matching layer", scope) batch_size = args.batch_size vocab_size = args.vocab_size hid...
mit
-9,153,670,270,058,485,000
57.258621
229
0.631789
false
google/nitroml
examples/config.py
1
1213
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
apache-2.0
6,816,562,970,263,589,000
38.129032
79
0.700742
false
scopenco/hagent
lib/modules/ip/IpAddr.py
1
3971
#!/usr/bin/env python # -*- coding: UTF-8 -*- ''' Set of fuctions/classes for ip administration Author: Andrey Scopenco andrey@scopenco.net ''' import sys sys.path.insert(0, '/usr/local/hagent/lib') import logging from cli import Output from hagent_db import add_record, del_record, update_record, \ get_record_attr...
gpl-2.0
5,762,475,317,647,996,000
30.267717
78
0.498363
false
KBNLresearch/iromlab
iromlab/kbapi/sru.py
1
12625
#! /usr/bin/env python """ Python API for KB SRU """ import sys import urllib import requests from lxml import etree SRU_BASEURL = 'http://jsru.kb.nl/sru/sru' SRU_BASEURL += '?version=1.2&maximumRecords=%i' SRU_BASEURL += '&operation=searchRetrieve' SRU_BASEURL += '&startRecord=%i' SRU_BASEURL += '&recordSchema=%s' S...
apache-2.0
-5,763,885,260,459,784,000
35.594203
106
0.515644
false
klen/fquest
base/fquest/celery.py
1
2029
from __future__ import absolute_import from sqlalchemy.exc import IntegrityError, DataError from datetime import datetime, timedelta from celery import Celery from celery.utils.log import get_task_logger from flask import current_app as app from ..app import create_app logger = get_task_logger('fquest') if not a...
bsd-3-clause
-30,655,614,917,419,030
25.012821
125
0.637753
false
shubhamjain0594/OthelloReinforcementLearning
nn.py
1
8833
import neurolab as nl import game2 import othello import ntuplesystematic as nts import time import random class nn: def __init__(self): self.x = [[-1,1] for x in range(64)] self.net = nl.net.newff(self.x,[1]) #self.net.trainf = nl.train.train_gd self.moveb = 0 self.movew = 0 self.last_vb = 0 self.last...
gpl-2.0
-5,274,029,948,232,391,000
22.744624
174
0.510246
false
tjcsl/ion
intranet/apps/templatetags/math.py
1
1143
import logging from django import template register = template.Library() logger = logging.getLogger(__name__) @register.filter def round_num(number, precision=0): """Rounds a number to a given precision in decimal digits (default 0 digits) and returns the integer value. Precision may be negative. A pre...
gpl-2.0
6,612,513,036,553,923,000
18.05
96
0.677165
false
cjdinsmore/slack-karma-bot
sqlite_helper.py
1
2956
import sqlite3 from models import DbMessage, DbUser, ReactionNames class SqliteHelper(object): """ This class manages interfacing with the SQLite database. It stores DbUser and DbMessage objects (see: models.py). """ def __init__(self, db_file): self.connection = sqlite3.connect(db_...
mit
-4,904,182,541,421,417,000
32.213483
95
0.569012
false
torch2424/LanguageProcessingLearning
pythonIsItMeme/memeML.py
1
3017
import nltk from textblob.classifiers import NaiveBayesClassifier #Utf 8 support import sys reload(sys) sys.setdefaultencoding("utf-8") print "Welcom 2 meme guesser!" print "Plz wait we is being loaded..." #Our testing data features memeFeatures = [] noMemeFeatures = [] #Read in our meme training data memeTrainLis...
apache-2.0
-6,739,082,548,951,831,000
28.871287
106
0.71528
false
VertNet/api
Download/CountHandler.py
1
3989
# This file is part of VertNet: https://github.com/VertNet/webapp # # VertNet 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. # # VertN...
gpl-2.0
-9,069,144,461,149,763,000
31.169355
72
0.601655
false
UMD-DRASTIC/drastic-web
webdav/resources.py
1
6514
from os import path as ospath from datetime import datetime from djangodav.fs.resources import BaseFSDavResource from djangodav.utils import url_join from drastic.models import Collection, Resource, DataObject import logging logging.warn('WEBDAV has been loaded') CHUNK_SIZE = 1048576 def chunkstring(string, lengt...
agpl-3.0
-4,060,378,795,736,630,300
32.927083
90
0.548204
false
chrisRubiano/django_reportes
config/settings/local.py
1
2241
# -*- coding: utf-8 -*- """ Local settings - Run in Debug mode - Use console backend for emails - Add Django Debug Toolbar - Add django-extensions as app """ import socket import os from .base import * # noqa # DEBUG # ------------------------------------------------------------------------------ DEBUG = env.bool...
mit
205,409,767,345,248,540
29.283784
99
0.481481
false
DatapuntAmsterdam/datapunt_geosearch
web/geosearch/create_import_index.py
1
6572
# -*- coding: utf-8 -*- """ Geosearch master index Create a master index that should be usable for all geosearches With this master index we could do one search and find all items within a specific radius or that contains some specific point Current counts for different datasets: kadastraal_object 582551 pand 183659...
mpl-2.0
3,499,150,070,914,391,600
32.530612
113
0.583993
false
roboime/pyroboime
roboime/core/skills/orientto.py
1
2436
# # Copyright (C) 2013-2015 RoboIME # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distrib...
agpl-3.0
2,438,896,582,819,734,000
33.309859
102
0.65353
false
matthagy/Jamenson
jamenson/transform/globals.py
1
4950
'''Transform operation on globally scoped symbols to operations on symbol_cell mapping. ''' from __future__ import absolute_import from __future__ import with_statement from ..runtime.symbol import get_symbol_cells_map, gensym from ..compiler import ir as I from ..compiler import bind from ..compiler.walk import I...
apache-2.0
-3,855,520,096,124,097,500
36.218045
99
0.573131
false
ari-zah/gaiasky
assets/scripts/tests/camera-path-sync.py
1
1065
# This script tests the synchronous camera file playing. # Created by Toni Sagrista import time, os from py4j.java_gateway import JavaGateway, GatewayParameters gateway = JavaGateway(gateway_parameters=GatewayParameters(auto_convert=True)) gs = gateway.entry_point # Prints to both Gaia Sky and Python logs def printa...
lgpl-3.0
-7,236,454,278,470,441,000
23.204545
78
0.738028
false
rob-nn/motus
gait_loader.py
1
2787
from numpy import * class DataLoader(object): def __init__(self, file_name): self._data = None self._file_name = file_name self._load_data() self._data_descs =[] self._generate_data_descs() def _load_data(self): f = open(self._file_name) data = f.readlines() f.close() j = 0 data_list = []...
gpl-2.0
-6,392,789,390,617,272,000
30.314607
88
0.642268
false
mariocesar/django-tricks
django_tricks/models/abstract.py
1
2638
from uuid import uuid4 from django.contrib.contenttypes.models import ContentType from django.db import models from django.utils.functional import cached_property from django.utils.translation import gettext_lazy as _ from .mixins import MPAwareModel treebeard = True try: from treebeard.mp_tree import MP_Node e...
isc
4,206,543,305,950,345,000
29.321839
97
0.655042
false
jamielennox/requests-mock
requests_mock/adapter.py
1
10629
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under ...
apache-2.0
-4,611,116,238,172,673,500
32.215625
79
0.581428
false
netinept/plog
plog/storages/settings_s3boto.py
1
1207
# S3Boto storage settings for photologue example project. import os DEFAULT_FILE_STORAGE = 'plog.storages.s3utils.MediaS3BotoStorage' STATICFILES_STORAGE = 'plog.storages.s3utils.StaticS3BotoStorage' try: # If you want to test the example_project with S3, you'll have to configure the # environment variables ...
apache-2.0
-7,196,048,099,957,750,000
40.655172
91
0.727423
false
Bhare8972/LOFAR-LIM
LIM_scripts/utilities.py
1
11289
#!/usr/bin/env python3 ##ON APP MACHINE import sys from os import listdir, mkdir from os.path import isdir, dirname, abspath import os import subprocess import weakref from scipy import fftpack import numpy as np ## some global variables, this needs to be fixed at some point default_raw_data_loc = None#"/exp_app...
mit
-6,915,917,853,648,077,000
29.349462
141
0.60776
false
fintech-circle/edx-platform
openedx/core/djangoapps/auth_exchange/forms.py
1
4033
""" Forms to support third-party to first-party OAuth 2.0 access token exchange """ import provider.constants from django.contrib.auth.models import User from django.forms import CharField from edx_oauth2_provider.constants import SCOPE_NAMES from oauth2_provider.models import Application from provider.forms import OAu...
agpl-3.0
-3,508,841,061,231,892,500
36
106
0.598562
false
nicolaselie/pykuli
keyboard/mac.py
1
5816
#Copyright 2013 Paul Barton # #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 distributed in the hope tha...
gpl-3.0
-165,510,983,904,530,620
27.935323
115
0.585798
false
rgayon/plaso
plaso/cli/status_view.py
1
18822
# -*- coding: utf-8 -*- """The status view.""" from __future__ import unicode_literals import ctypes import sys import time try: import win32api import win32console except ImportError: win32console = None from dfvfs.lib import definitions as dfvfs_definitions import plaso from plaso.cli import tools from pl...
apache-2.0
-2,176,070,529,547,022,800
33.855556
80
0.660663
false
hoogenm/compose
compose/project.py
1
23763
from __future__ import absolute_import from __future__ import unicode_literals import datetime import logging import operator from functools import reduce import enum from docker.errors import APIError from . import parallel from .config import ConfigurationError from .config.config import V1 from .config.sort_servi...
apache-2.0
-5,603,012,117,800,324,000
34.361607
102
0.58124
false
tpltnt/hackerspace-api-bot
bot.py
1
3642
#!/usr/bin/env python3 """ Make your hackerspace a XMPP buddy. """ from configparser import ConfigParser from optparse import OptionParser import logging import requests import sleekxmpp import sys import time import urllib.request import json class HackerspaceApiBot(sleekxmpp.ClientXMPP): """ A SleekXMPP bas...
agpl-3.0
-2,070,123,706,832,758,800
33.358491
93
0.589237
false
ktneely/ir-scripts
VulnMgmt/Vuln-tickets.py
1
9151
#!/usr/bin/python3 # This takes an XML report extracted from an OpenVAS VA scanner and # creates issue tickets on ServiceNow and Redmine systems for tracking # purposes. # # Most parameters are specified in the 'ov_prefs.txt' file, however, # the XML report file may be specified on the command line. If # specified th...
gpl-3.0
3,450,388,158,392,082,000
35.899194
103
0.635013
false
easyw/kicad-3d-models-in-freecad
cadquery/FCAD_script_generator/4UCON_17809/cq_models/conn_4ucon_17809.py
1
10895
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # CadQuery script to generate connector models ## requirements ## freecad (v1.5 and v1.6 have been tested) ## cadquery FreeCAD plugin (v0.3.0 and v0.2.0 have been tested) ## https://github.com/jmwright/cadquery-freecad-module ## This script can be run from within the...
gpl-2.0
7,542,962,034,964,685,000
38.908425
134
0.616246
false
lavizhao/keyword
data_analysis/ana_words.py
1
1087
#coding: utf-8 import sys def morethan(keyword,n): """ Arguments: - `keyword`: - `n`: """ ans = 0 for line in keyword: if len(line.split()) - 1 <= n : ans += 1 print "少余%s的词占总的百分比为%s"%(n,1.0*ans/len(keyword)) def aw(kf,nc): """ """ f = open(kf) ...
apache-2.0
-7,799,968,741,795,487,000
16.40678
71
0.484907
false
a10networks/a10sdk-python
a10sdk/core/waf/waf_wsdl.py
2
1276
from a10sdk.common.A10BaseClass import A10BaseClass class Wsdl(A10BaseClass): """Class Description:: Manage Web Services Definition Language files. Class wsdl supports CRUD Operations and inherits from `common/A10BaseClass`. This class is the `"PARENT"` class for this module.` :param uuid: ...
apache-2.0
6,820,183,366,621,144,000
33.486486
252
0.631661
false
jasonrbriggs/stomp.py
tests/test_basic.py
1
8361
import signal from time import monotonic import stomp from stomp.listener import TestListener from .testutils import * @pytest.fixture() def testlistener(): yield TestListener("123", print_to_log=True) @pytest.fixture() def conn(testlistener): conn = stomp.Connection11(get_default_host()) conn.set_list...
apache-2.0
-6,242,501,988,846,949,000
35.995575
101
0.640115
false
phiros/nepi
src/nepi/resources/linux/ns3/ccn/ns3ccnrdceapplication.py
1
9256
# # NEPI, a framework to manage network experiments # Copyright (C) 2014 INRIA # # 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 ...
gpl-3.0
6,438,432,219,293,200,000
39.243478
87
0.611927
false
cswaney/hfttools
prickle/core.py
1
65651
import numpy as np import pandas as pd from matplotlib import pyplot as plt import struct import h5py import time import os class Database(): """Connection to an HDF5 database storing message and order book data. Parameters ---------- path : string Specifies location of the HDF5 file name...
mit
8,576,444,294,337,752,000
36.861015
232
0.489086
false
conejoninja/pelisalacarta
python/main-classic/channels/vepelis.py
1
18213
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Canal para VePelis # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re import os, sys from core imp...
gpl-3.0
6,332,740,761,873,854,000
55.691589
283
0.652599
false
smn/malva
malva/utils.py
1
1658
# -*- test-case-name: malva.tests.test_utils -*- from twisted.internet.serialport import SerialPort from twisted.internet.defer import DeferredList, Deferred from twisted.internet import reactor from txgsm import txgsm from serial.tools import list_ports class ModemProbe(object): protocol = txgsm.TxGSMProtoco...
bsd-3-clause
5,435,535,710,121,342,000
28.607143
57
0.638721
false
codycollier/netropy
netropy/record.py
1
2678
"""record The record data structure and helper functions. """ import collections import hashlib # ----------------------------------------------------------------------------- # The main data structure # ----------------------------------------------------------------------------- record_fields = ['version', 'fr...
mit
-1,230,551,760,263,086,600
28.428571
79
0.558626
false
jerpat/csmake
csmake-manifest/CsmakeModules/CsversionHLinuxConfigApt.py
1
3468
# <copyright> # (c) Copyright 2017 Hewlett Packard Enterprise Development LP # # 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 ve...
gpl-3.0
2,895,465,660,196,402,700
45.24
80
0.647636
false
cemoody/lda2vec
lda2vec/negative_sampling.py
1
7611
import numpy import six from chainer import cuda from chainer import function from chainer.utils import type_check class NegativeSamplingFunction(function.Function): ignore_label = -1 def __init__(self, sampler, sample_size): self.sampler = sampler self.sample_size = sample_size def _m...
mit
-4,506,923,810,108,634,600
31.665236
79
0.496518
false
seraphln/onedrop
crawler/api_proxy.py
1
5434
# coding=utf8 # """ 跟远程API服务器交互的通用逻辑 """ import os import json import socket import urllib import datetime import requests import traceback import config API_HOST = "http://180.76.149.212:8083" GRAPHQL_HOST = "%s/graphql?query=%%s" % API_HOST def to_url_params(params): """ 根据GET参数的请求对URL进行编码 ...
gpl-3.0
1,172,086,396,405,874,000
23.528571
83
0.481359
false
pytn/pytn
pytn/proposals/models.py
1
1067
from django.db import models from symposion.proposals.models import ProposalBase class Proposal(ProposalBase): AUDIENCE_LEVEL_NOVICE = 1 AUDIENCE_LEVEL_EXPERIENCED = 2 AUDIENCE_LEVEL_INTERMEDIATE = 3 AUDIENCE_LEVELS = [ (AUDIENCE_LEVEL_NOVICE, "Novice"), (AUDIENCE_LEVEL_INTE...
mit
4,846,354,523,018,538,000
26.358974
230
0.677601
false
OpenIxia/ixnetwork_client_python
ixnetwork/samples/emulation_host/emulation_host_demo.py
1
2859
import sys import os path = os.path.realpath(__file__) sys.path.insert(0, path[0: path.rfind('ixnetwork')]) from ixnetwork.IxnHttp import IxnHttp from ixnetwork.IxnConfigManagement import IxnConfigManagement from ixnetwork.IxnPortManagement import IxnPortManagement from ixnetwork.IxnStatManagement import IxnSt...
mit
4,229,875,265,070,379,500
31.244186
95
0.733123
false
PhilHarnish/forge
src/puzzle/problems/crossword/cryptic_problem.py
1
10923
import collections from data import chain, crossword, warehouse from data.alphabets import cryptic_keywords from puzzle.problems.crossword import _base_crossword_problem class CrypticProblem(_base_crossword_problem._BaseCrosswordProblem): def __init__(self, name, lines, **kwargs): super(CrypticProblem, self)._...
mit
-3,694,395,314,970,705,000
33.457413
81
0.657786
false
adykstra/mne-python
mne/decoding/base.py
1
20408
"""Base class copy from sklearn.base.""" # Authors: Gael Varoquaux <gael.varoquaux@normalesup.org> # Romain Trachel <trachelr@gmail.com> # Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr> # Jean-Remi King <jeanremi.king@gmail.com> # # License: BSD (3-clause) import numpy as np im...
bsd-3-clause
8,974,590,610,377,032,000
35.771171
79
0.59315
false
mpetyx/energagement
energagement/myapp/migrations/0014_auto_20150823_1721.py
1
4241
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('myapp', '0013_auto_20150731_0044'), ] operations = [ migrations.RemoveField( model_name='building', ...
mit
-554,861,424,052,546,050
27.273333
107
0.500354
false
KDE/kcmgrub2
kcmgrub2.py
1
41045
#!/usr/bin/env python # -*- coding: utf-8 -*- # Grub2 Control Module # # Copyright 2011 Alberto Mattea <alberto@mattea.info> # # 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 o...
gpl-3.0
-3,379,527,373,034,329,600
47.174883
489
0.691388
false
davidraleigh/cxxtest
python/cxxtest/cxxtest_misc.py
1
2691
#!/usr/bin/python #------------------------------------------------------------------------- # CxxTest: A lightweight C++ unit testing library. # Copyright (c) 2008 Sandia Corporation. # This software is distributed under the LGPL License v2.1 # For more information, see the COPYING file in the top CxxTest directory. #...
lgpl-2.1
1,456,833,161,039,569,400
33.5
74
0.578595
false
liviu-/ding
ding/ding.py
1
4914
#!/usr/bin/env python """Simple CLI beep tool""" from __future__ import unicode_literals from __future__ import print_function import re import os import sys import time import datetime import argparse VERSION = '2.1.0' N_BEEPS = 4 WAIT_BEEPS = 0.15 def relative_time(arg): """Validate user provided relative t...
mit
-4,648,106,790,088,834,000
32.202703
98
0.59361
false
keithadavidson/ansible-mezzanine
deploy/scripts/set_mezzanine_settings.py
1
1811
#!/usr/bin/env python # The MIT License (MIT) # # Copyright (c) 2015 Keith Davidson # # 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 ri...
mit
-3,355,165,800,266,858,500
39.244444
80
0.773606
false
Crompulence/cpl-library
utils/design_topology/CFD.py
1
4796
import numpy as np import matplotlib.pyplot as plt from mpi4py import MPI from cplpy import CPL from draw_grid import draw_grid class CFD(): def __init__(self, npxyz, xyzL, xyz_orig, ncxyz): #initialise MPI and CPL self.comm = MPI.COMM_WORLD self.CPL = CPL() self.CFD_COMM = sel...
gpl-3.0
-1,381,466,288,594,465,300
34.791045
101
0.541076
false
caterinaurban/Typpete
typpete/unittests/inference/generic_test.py
1
1346
# type_params {'generic_tolist': ['GTL'], 'flatten': ['FL'], 'flatten_dict': ['DK','DV']} def generic_tolist(a): return [a] u = generic_tolist(1.2) u[0] = 2.4 v = generic_tolist(True) v2 = v[v[0]] def flatten(lists): """ Flattens a list of lists into a flat list """ return [item for sublist in ...
mpl-2.0
5,171,939,318,511,768,000
21.830508
89
0.520802
false
hedvig/project-config
zuul/openstack_functions.py
1
2255
# Copyright 2013 OpenStack Foundation # # 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
-4,446,275,520,323,971,000
40.759259
119
0.636807
false
linearregression/socorro
socorro/external/es/supersearch.py
1
19711
# 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/. import datetime import re from elasticsearch_dsl import Search, A, F, Q from elasticsearch.exceptions import NotFoundErr...
mpl-2.0
1,042,928,458,989,342,600
35.981238
79
0.488205
false
fabian0010/Blaze
pyasn1/type/namedval.py
1
2701
# # This file is part of pyasn1 software. # # Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com> # License: http://pyasn1.sf.net/license.html # # ASN.1 named integers # from pyasn1 import error __all__ = ['NamedValues'] class NamedValues(object): def __init__(self, *namedValues): self.nameToValIdx...
mit
7,432,628,266,542,734,000
27.431579
99
0.569789
false
jmeyers314/jtrace
batoid/coordTransform.py
1
3059
from . import _batoid from .coordSys import CoordSys import numpy as np class CoordTransform: """Transformation between two coordinate systems. Parameters ---------- fromSys : CoordSys Origin coordinate systems. toSys : CoordSys Destination coordinate systems. """ def __in...
bsd-2-clause
-2,283,730,100,674,697,700
24.705882
73
0.552141
false
tparks5/tor-stem
test/integ/installation.py
1
5352
""" Tests installation of our library. """ import glob import os import shutil import sys import tarfile import threading import unittest import stem import stem.util.system import test.util from test.util import only_run_once INSTALL_MISMATCH_MSG = "Running 'python setup.py sdist' doesn't match our git contents i...
lgpl-3.0
474,349,562,360,036,700
31.634146
178
0.674327
false
alq666/sre-kpi
monitors.py
1
1349
"""Summarizes the monitor reports from Datadog into key metrics """ import csv import os import sqlite3 import sys # Prepare the sqlite file for queries # A denormalized version of the csv try: os.remove('monitors.sqlite') except: pass conn = sqlite3.connect('monitors.sqlite') c = conn.cursor() c.execute("""...
mit
1,948,408,615,343,619,800
23.527273
136
0.650852
false
OzFlux/PyFluxPro
scripts/pfp_gfALT.py
1
64336
# standard modules import logging import os import traceback # 3rd party modules import dateutil import numpy import matplotlib.pyplot as plt import pylab import scipy import statsmodels.api as sm # PFP modules from scripts import constants as c from scripts import pfp_io from scripts import pfp_ts from scripts import ...
bsd-3-clause
3,962,994,394,770,090,000
52.792642
153
0.613529
false
sravel/scripts
local/make_ldhatfiles.py
1
14611
#!/usr/bin/python2.7 # -*- coding: utf-8 -*- # @package make_ldhatfiles.py # @author Lea Picard, Sebastien RAVEL """ The make_ldhatfiles script ========================== :author: Sebastien Ravel, Lea Picard :contact: sebastien.ravel@cirad.fr :date: 08/07/2016 :version: 0.1 Script description ----------------...
gpl-3.0
7,221,963,836,876,002,000
31.826966
304
0.64629
false
project-rig/rig
rig/place_and_route/place/rcm.py
1
6479
"""Reverse Cuthill-McKee based placement. """ from collections import defaultdict, deque from six import itervalues from rig.place_and_route.place.sequential import place as sequential_place from rig.links import Links from rig.netlist import Net def _get_vertices_neighbours(nets): """Generate a listing of eac...
gpl-2.0
-5,137,749,699,306,870,000
34.994444
79
0.656737
false
electionleaflets/electionleaflets
electionleaflets/apps/boundaries/views.py
1
4341
import math from PIL import Image, ImageDraw from django.http import HttpResponse, Http404 from django.shortcuts import render_to_response from boundaries.models import Boundary from parties.models import Party from leaflets.models import Leaflet google_dist = 20037508.34 def leaflet_polygon_options(boundary): ...
mit
428,706,416,601,348,300
36.102564
146
0.601705
false
wright-group/WrightTools
tests/kit/diff.py
1
1245
"""Test diff.""" # --- import ------------------------------------------------------------------------------------- import numpy as np import WrightTools as wt # --- test --------------------------------------------------------------------------------------- def test_ascending_1(): x = np.linspace(0, 10, 1...
mit
-850,052,172,316,749,000
22.055556
98
0.452209
false
openstack/ironic
ironic/tests/unit/drivers/modules/ibmc/test_management.py
1
12202
# # 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...
apache-2.0
3,788,170,899,793,567,000
43.210145
77
0.597935
false
py-eww/eww
eww/ioproxy.py
1
3215
# -*- coding: utf-8 -*- """ eww.ioproxy ~~~~~~~~~~~ We replace ``sys.std[in, out, err]`` with instances of ``IOProxy``. ``IOProxy`` provides a thread-local proxy to whatever we want to use for IO. It is worth mentioning that this is *not* a perfect proxy. Specifically, it doesn't proxy an...
mit
1,519,809,513,948,798,000
33.202128
78
0.598445
false
sajuptpm/neutron-ipam
neutron/tests/unit/metaplugin/fake_plugin.py
1
2680
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012, Nachi Ueno, NTT MCL, 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/L...
apache-2.0
3,253,998,093,902,717,000
34.263158
78
0.65
false
rwatson/chromium-capsicum
tools/grit/grit/xtb_reader.py
1
3972
#!/usr/bin/python2.4 # Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. '''Fast and efficient parser for XTB files. ''' import sys import xml.sax import xml.sax.handler class XtbContentHandler(xm...
bsd-3-clause
-5,619,635,609,388,487,000
33.241379
81
0.674723
false
mindis/canteen
canteen/core/meta.py
1
9304
# -*- coding: utf-8 -*- ''' canteen meta core ~~~~~~~~~~~~~~~~~ metaclass tools and APIs. :author: Sam Gammon <sam@keen.io> :copyright: (c) Keen IO, 2013 :license: This software makes use of the MIT Open Source License. A copy of this license is included as ``LICENSE.md`` in the ...
mit
-6,218,907,525,932,880,000
30.013333
156
0.576849
false
pypa/twine
tests/test_main.py
1
1168
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the L...
apache-2.0
-8,956,839,330,193,934,000
39.275862
88
0.735445
false
gilliM/MFQ
ModisFromQgis/help/source/conf.py
1
7118
# -*- coding: utf-8 -*- # # ModisFromQgis documentation build configuration file, created by # sphinx-quickstart on Sun Feb 12 17:11:03 2012. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. #...
gpl-2.0
1,405,499,702,715,317,000
31.953704
80
0.709609
false
SavinaRoja/Kerminal
kerminal/telemachus_api.py
1
13310
# encoding: utf-8 #The information in this module was gleaned from DataLinkHandlers.cs #https://github.com/richardbunt/Telemachus/blob/master/Telemachus/src/DataLinkHandlers.cs #Actions are sent to server, result in one action per message mj_actions = ['mj.smartassoff', # Smart ASS Off 'mj.node', ...
gpl-3.0
2,619,396,659,809,475,000
52.24
111
0.456123
false
YoungKwonJo/mlxtend
mlxtend/plotting/remove_chartchunk.py
1
1051
# Sebastian Raschka 08/13/2014 # mlxtend Machine Learning Library Extensions # matplotlib utilities for removing chartchunk def remove_borders(axes, left=False, bottom=False, right=True, top=True): """ A function to remove chartchunk from matplotlib plots, such as axes spines, ticks, and labels. ...
bsd-3-clause
-849,386,927,102,821,400
35.241379
94
0.591817
false
eunchong/build
scripts/slave/recipe_modules/chromium_tests/chromium_chromiumos.py
1
6899
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from . import steps SPEC = { 'settings': { 'build_gs_bucket': 'chromium-chromiumos-archive', # WARNING: src-side runtest.py is only tested with ch...
bsd-3-clause
-4,032,269,570,872,546,000
27.27459
76
0.541963
false
johnaparker/dynamics
examples/old/leap_semistable.py
1
8602
import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from matplotlib import animation from scipy import constants def rotation_transform(axis, angle, ax = None): if ax is None: ax = plt.gca() t_scale = ax.transData t_rotate = mpl.transforms.Affine2D().rotate_deg_around(axis[0], axis[...
mit
8,537,241,411,429,405,000
33.270916
194
0.58126
false
bendk/thesquirrel
docs/forms.py
1
1624
# thesquirrel.org # # Copyright (C) 2015 Flying Squirrel Community Space # # thesquirrel.org 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 License, or (at your # option) any la...
agpl-3.0
-4,625,286,531,913,107,000
33.553191
78
0.666256
false
kenik/pyrcp
pyrcp/user.py
1
2065
# -* coding: utf-8 -*- from hashlib import md5 from pyrcp import * import pyrcp.db as pydb from flask import Flask, request, redirect, render_template from flask_login import (LoginManager, login_required, login_user, current_user, logout_user, UserMixin, AnonymousUserMixin) from itsdangerous i...
gpl-2.0
2,577,444,483,230,044,700
25.818182
91
0.607264
false
NoNameYet07/421_521_final_project
BEERdunio_modules_kg1_sp.py
1
6285
# bin/usr/python # Setting up GPIO pins from time import sleep import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) # Identifies the pin numbers to the pi GPIO.setwarnings(False) GPIO.setup(3, GPIO.OUT) # Should sets pin #3 as an output...but doesnt work yet GPIO.setup(3, GPIO.LOW) # Turns initial output for pin 3 off ...
gpl-2.0
-4,553,099,314,612,198,000
32.972973
119
0.449642
false
oblalex/gnuplot.py-py3k
gp_macosx.py
1
4576
# $Id: gp_macosx.py 291 2006-03-03 08:58:48Z mhagger $ # Copyright (C) 1998-2003 Michael Haggerty <mhagger@alum.mit.edu> # # This file is licensed under the GNU Lesser General Public License # (LGPL). See LICENSE.txt for details. """gp_macosx -- an interface to the command line version of gnuplot used under Mac OS ...
lgpl-2.1
5,807,611,642,525,777,000
30.342466
79
0.629808
false
laterpay/djtranslationchecker
setup.py
1
1271
# -*- coding: UTF-8 -*- from setuptools import find_packages, setup import codecs import os #import time #_version = "0.10.dev%s" % int(time.time()) _version = "0.10.0" _packages = find_packages('.', exclude=["*.tests", "*.tests.*", "tests.*", "tests"]) if os.path.exists('README.rst'): _long_description = codecs...
mit
5,567,271,756,062,893,000
27.886364
84
0.626279
false
grnet/agkyra
agkyra/syncer/file_client.py
1
1872
# Copyright (C) 2015 GRNET S.A. # # 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 distributed in the...
gpl-3.0
-1,186,452,690,488,314,600
36.44
79
0.69391
false
telefonicaid/fiware-puppetwrapper
acceptance_tests/component/delete_module/features/steps.py
1
1740
__author__ = 'arobres' # -*- coding: utf-8 -*- from commons.rest_utils import RestUtils from nose.tools import assert_true, assert_false import commons.assertions as Assertions import commons.fabric_utils as Fabutils from commons.constants import URL, MODULE_NAME, REPOSITORY from lettuce import step, world, before ...
apache-2.0
-1,643,073,405,117,868,800
30.636364
103
0.737931
false