repo_name
stringlengths
8
92
path
stringlengths
5
221
copies
stringclasses
10 values
size
stringlengths
4
6
content
stringlengths
974
828k
license
stringclasses
15 values
hash
int64
-9,212,977,344,346,658,000
9,220,224,517B
line_mean
float64
8.67
91.6
line_max
int64
15
966
alpha_frac
float64
0.29
0.86
autogenerated
bool
1 class
nl_text
stringlengths
0
164k
nl_size
int64
0
164k
nl_language
stringclasses
17 values
nl_language_score
float64
0.04
1
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
if not os.path.exists(os.path.expanduser(cache_dir)): os.mkdir(os.path.expanduser(cache_dir)) cache = TTLCache(FileCache(os.path.expanduser(cache_dir))) data = cache.get(profile) if data is None: data = aws.get_instances_as_table(profile, region) print 'inserting into cache' cache.insert(profile, pickle.dumps(data)) el...
566
en
0.106766
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
OpenFlow Controller (OFC) Driver Specification. OFCDriverBase defines the minimum set of methods required by this plugin. It would be better that other methods like update_* are implemented. Convert old-style ofc network id to new-style one. :param context: neutron context object :param ofc_network_id: ofc_network_id...
3,504
en
0.724682
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
-*- coding: utf-8 -*- card checklist list
41
en
0.712504
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
So we don't show empty boxes :) Handle back navigation For now just propagate the event Our first ever show Switch to search view Switch to updates view Update back navigation !/usr/bin/env python2 -*- coding: utf-8 -*- This file is part of solus-sc Copyright © 2013-2018 Ikey Doherty <ikey@solus-project.com> ...
1,250
en
0.827563
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
\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 Alive Monitor is free sof...
1,367
en
0.83343
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
result.close()
14
en
0.161549
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
Messages from Buoy Satalite date models class LogTempBackup(models.Model): """Backup data""" sensor = models.ForeignKey(db_models.Sensor) byyy = models.CharField(max_length=4) bm = models.CharField(max_length=2) bd = models.CharField(max_length=2) bh = models.CharField(max_length=2) eyyy = models....
643
en
0.333256
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
Don't set the topic when our channel overrides Assume handled by our ignoring of it Don't set the topic when our topic overrides
128
en
0.921649
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
ARM Core Is the disk provided by the interface chip of this board virtual? list of toolchains that are supported by the mbed SDK for this target list of extra specific labels list of macros (-D) Default online compiler: Code used to determine devices' platform This code is prefix in URL link provided in mbed.htm (in mb...
2,882
en
0.606674
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
Run once on class initialization. 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. -...
1,214
en
0.848662
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
0
en
0.110449
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
-*- coding: utf-8 -*- https://site.douban.com/maosh/widget/events/1441569/ https://site.douban.com/187956/widget/events/11298220/ https://site.douban.com/273062/widget/events/191469274/ https://site.douban.com/290170/widget/events/192970720/ https://site.douban.com/livebar696/widget/events/1381481/ https://site.douban....
587
en
0.419566
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
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 distributed in the hope t...
658
en
0.918335
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
HTML parser to download images from URL. Params: `url` - Image url `save_dir` - Directory to save extracted images `show` - Show downloaded image `wait` - Press key to continue executing code from https://github.com/BBarbosa/tflearn-image-recognition-toolkit/blob/4a0528dcfb206b1e45997f2fbc097aafacfa0fa0/scripts/h...
472
en
0.400475
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
:type intervals: List[Interval] :type newInterval: Interval :rtype: List[Interval] ***************************************** Author: zhlinh Email: zhlinhng@gmail.com Version: 0.0.1 Created Time: 2016-02-22 Last_modify: 2016-02-22 ****************************************** !/usr/bin/env pyt...
373
en
0.345957
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
An event class for checking the mouse location and buttons at given timepoints Code compiler for mouse button events Write the code that will be called every frame Write the code that will be called every frame Write code at end of routine Write the code that will be called at the start of the routine Write th...
3,542
en
0.876089
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
Deserializer to handle xml-formatted cell create requests. Enables cells-related functionality such as adding neighbor cells, listing neighbor cells, and getting the capabilities of the local cell. Controller for Cell resources. Filters all model attributes except for keys item is a dict If the transport_url is present...
2,596
en
0.827146
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
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: * Redistributions of source code must retain the above copyright notice, this list of conditions a...
2,413
en
0.918136
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
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 'std' will be translated to the standard line break decided by csv_helpers.dec...
1,119
en
0.735911
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
Create your models here.
24
en
0.920486
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
Middleware which prints out a list of all SQL queries done for each view that is processed. This is only useful for debugging. 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.
269
en
0.94412
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
inputs = batch_size x seq_length x hidden_sizelengths must be integers dropout beta testing: double check which one should affect next lineif training and output_keep_prob < 1.0: inputs = tf.nn.dropout(inputs, output_keep_prob)variables unsed in the pointerRNN, initializer=tf.random_normal_initializer), initializer=...
1,717
en
0.528716
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
NitroML config. This file defines environments for nitroml. 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 require...
706
en
0.810603
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
!/usr/bin/env python -*- coding: UTF-8 -*- check if some ip existTODO add check if ip assigned to one of users if so show error check if ip exist TODO remove ip from all domains TODO remove ip from account and assign to shared TODO remove from shared and assign to account if shared add is only one, show error
312
en
0.565851
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
Python API for KB SRU ! /usr/bin/env python No idea what to use here? Name spaces in GGC records Returns text content of all elements for which tag matches tagName, and attribute value equals attributeValue. Set attributeName to empty string to get all tagName matches. Below property functions all return a list with a...
516
en
0.661304
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
graph.post('/me/fquest-klen:raised', data=dict( level="http://fquest.node42.org%s" % level )) pymode:lint_ignore=E061
117
en
0.228375
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
self.net.trainf = nl.train.train_gdprint temp.get_color([k,l])print 0print self.last_vbprint 1print self.last_vbprint temp.get_color([k,l])print 2print self.last_vwprint 3print self.last_vwprint temp.get_color([k,l])print vprint temp.get_color([k,l])print 4print self.last_vbprint temp.get_color([k,l])print vprint 5prin...
513
en
0.111225
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
Returns the quotient of the arguments as a float. Returns smaller of two numbers. Returns smaller of two numbers. Returns the product of the arguments. Rounds a number to a given precision in decimal digits (default 0 digits) and returns the integer value. Precision may be negative. A precision of 1 will round to the ...
433
en
0.568389
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
This class manages interfacing with the SQLite database. It stores DbUser and DbMessage objects (see: models.py). Protected method that executes a database query. `args` represents arguments for the WHERE clause, like user_id and such. Adds messages to the database. Adds users to the database. Gets the timestamp for th...
541
en
0.717768
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
Utf 8 supportOur testing data featuresRead in our meme training dataAdd the memes to the featuresRead in our non-meme training dataAdd the nomemes to the featuresTrain a classifier iteratively, and use the most accurateMake sure maxsize is greater than 10Find our index for 10 iterationsCreate our features array, and cl...
652
en
0.817098
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
Download service. Get parameters from request Get record count from vnsearch.query_rec_counter Send email to user with result 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 publish...
922
en
0.881581
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
Create a directory in the location of this resource. Delete the resource, recursive is implied. Return True if this resource exists. Return the absolute path of the resource. Used internally to interface with an actual file system. If you override all other methods, this one will not be used. Return an iterator of all ...
1,054
en
0.781854
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
Local settings - Run in Debug mode - Use console backend for emails - Add Django Debug Toolbar - Add django-extensions as app -*- coding: utf-8 -*- noqa DEBUG ------------------------------------------------------------------------------ SECRET CONFIGURATION --------------------------------------------------------...
1,131
en
0.341476
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
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 beperking 45202 meetbout 12...
1,020
nl
0.339274
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
This skill will orient the robot arount a given point to look to another given point, 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...
694
en
0.84055
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
Transform operation on globally scoped symbols to operations on symbol_cell mapping.
84
en
0.92018
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
This script tests the synchronous camera file playing. Created by Toni Sagrista Prints to both Gaia Sky and Python logs print to gaia sky log print to python log
161
en
0.890409
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
0
en
0.110449
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
A Model that if inherited from will store the specific class reference in self. Return this page in its most specific subclassed form. Return the class that this page would be if instantiated in its most specific form. this model is being newly created rather than retrieved from the db; set content type to correctly ...
370
en
0.976365
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
A fake adapter than can return predefined responses. Contains all the information about a provided URL to match. A fake exception to jump out of mocking and allow a real request. This exception is caught at the mocker level and allows it to execute this request through the real requests mechanism rather than the...
2,421
en
0.887722
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
S3Boto storage settings for photologue example project. If you want to test the example_project with S3, you'll have to configure the environment variables as specified below. (Secret keys are stored in environment variables for security - you don't want to accidentally commit and push them to a public repository). Def...
391
en
0.90849
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
return true if two N-D bounding boxes collide, False otherwise takes both pulse data file names and h5 file names and returns UTC_time, station_name, Fpath return directory for location of GSL headers, useful when combining GSL and cython return directory for location of GSL binaries, useful when combining GSL and cyth...
3,083
en
0.669186
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
Form for access token exchange endpoint Raise an appropriate OAuthValidationError error if the field is missing Validates and returns the "access_token" field. Validates and returns the "client_id" field. Forms to support third-party to first-party OAuth 2.0 access token exchange invalid_client isn't really the right...
470
en
0.735735
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
Helper method for special keys. Source: http://stackoverflow.com/questions/11045814/emulate-media-key-press-on-mac Copyright 2013 Paul BartonThis program is free software: you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation, either ver...
1,229
en
0.765243
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
Processing status view. Retrieves the analysis status update callback function. Returns: function: status update callback function or None if not available. Retrieves the extraction status update callback function. Returns: function: status update callback function or None if not available. Prints the extraction ...
3,327
en
0.58925
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
A collection of services. Construct a Project from a config.Config object. Retrieve a service by name. Raises NoSuchService if the named service does not exist. Returns a list of this project's services filtered by the provided list of names, or all services if service_names is None or []. If include_deps is specified...
1,164
en
0.904208
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
A SleekXMPP based bot that will mimic the on-/offline status of a given hackerspace. It also authorizes other automatically to allow status tracking. Make your hackerspace a XMPP buddy. !/usr/bin/env python3 Setup the command line arguments. JID and password as arguments iterate over all sections (hackerspace configs...
707
en
0.705292
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
!/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 this way, the scri...
2,565
en
0.802657
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
!/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 cadquery module of free...
3,022
en
0.849824
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
coding: utf-8analysis words
27
en
0.819637
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
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: {"description": "uuid of the object", "format": "string", "minLength": 1, "modify-not-allowed": 1, "optional...
802
en
0.645497
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
success!
8
en
0.728044
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
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 option) any later v...
768
en
0.865612
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
A class to represent an order book. This class provides a method for updating the state of an order book from an incoming message. Attributes ---------- bids : dict Keys are prices, values are shares asks : dict Keys are prices, values are shares levels : int Number of levels of the the order book to trac...
6,727
en
0.674051
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
-*- coding: utf-8 -*------------------------------------------------------------- pelisalacarta - XBMC Plugin Canal para VePelis http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/------------------------------------------------------------ Descarga la página Extrae las entradas de la pagina seleccionada Añade al li...
3,605
en
0.233948
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
-*- test-case-name: malva.tests.test_utils -*- separate function for easier stubbing in a test
94
en
0.316785
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
Extract a value from raw xml Simplistic string parsing version... Parse record xml and return a dictionary Simplistic string parsing version... Verify two records which are chained together Any given record (except the first) should be chained to the previous by a matching hash in previousOutputValue. From the sche...
1,406
en
0.501942
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
Purpose: To capture the information provided to a HLinuxConfigApt section. Options: tag - Provides a context name for the information for example - cs-mgmt-base-image or cs-mgmt-sources Joinpoints: end__build - captures the metadata from the section Creates Environment: __Csversion__ - A ...
2,218
en
0.836726
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
Negative sampling loss function. In natural language processing, especially language modeling, the number of words in a vocabulary can be very large. Therefore, you need to spend a lot of time calculating the gradient of the embedding matrix. By using the negative sampling trick you only need to calculate the gradien...
2,064
en
0.785935
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
coding=utf8import jsonimport base64task_result = {"name": "%s-%s" % (socket.gethostname(), os.getpid())}print register_crawler_node(base64.urlsafe_b64encode(json.dumps(task_result)))
182
en
0.250953
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
0
en
0.110449
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
connect to an existing session print system information load a binary configuration get a list of vports and change the type to ethernet assign hardware ports to virtual ports find igmp emulation host session(s) by vport_name and mac addresses find ipv4 emulation host session(s) by vport_name low level API start all p...
450
en
0.748834
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
Lower than normal. First pass: perform any necessary expansions. Attempt to find the solution from pieces of the expanded words. Finally, attempt to find the solution from just 1 expanded word. Initial indicator produces more tokens. Skip first word. Edge indicator produces more tokens. Initial indicator produces more ...
1,148
en
0.871821
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
Compute and store patterns from linear models. The linear model coefficients (filters) are used to extract discriminant neural sources from the measured data. This class computes the corresponding patterns of these linear filters to make them more interpretable [1]_. Parameters ---------- model : object | None A ...
8,431
en
0.64787
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
-*- coding: utf-8 -*-
21
en
0.767281
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
!/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 of the License, or ...
874
en
0.853443
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
Print error message and exit Return a relative version of a path. (provides compatibility with Python < 2.6) !/usr/bin/python------------------------------------------------------------------------- CxxTest: A lightweight C++ unit testing library. Copyright (c) 2008 Sandia Corporation. This software is distributed und...
908
en
0.706459
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
Class helping with parsing user provided time into seconds Validate user provided absolute time Make the beep noise Countdown for `seconds`, printing values unless `notimer` Parse commandline arguments Figure out the number of seconds to wait Validate user provided relative time Simple CLI beep tool !/usr/bin/env pyth...
745
en
0.724015
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
!/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 rights to use, cop...
1,258
en
0.840064
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
initialise MPI and CPL Parameters of the cpu topology (cartesian grid)Setup coupled simulationGet limits of overlap region recv data to plotPlot CFD and coupler GridPlot MD domain === Plot both grids ===Plot x component on gridGet input file
241
en
0.80154
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
Flattens a list of lists into a flat list Flattens a dict of lists, i.e., concatenates all lists for the same keys. type_params {'generic_tolist': ['GTL'], 'flatten': ['FL'], 'flatten_dict': ['DK','DV']} flatten := Callable[[List[List[FL]]], List[FL]] flatten_dict := Callable[[List[Dict[DV, List[DK]]], List[DV]], Dic...
381
en
0.507578
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
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 writing, software...
783
en
0.830809
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
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/. Create a map to associate a field's name in the database to its exposed name (in the results and facets). Make sure no index is...
3,289
en
0.920628
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
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 TODO support by-name subscription XXX clone/subtype?
212
en
0.647772
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
Transformation between two coordinate systems. Parameters ---------- fromSys : CoordSys Origin coordinate systems. toSys : CoordSys Destination coordinate systems. Apply forward-direction transformation to RayVector. Parameters ---------- rv : RayVector Rays to transform. Returns ------- transformed : Ra...
1,182
en
0.586633
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
Check that all the files in the stem directory are present in the installation. This is a very common gotcha since our setup.py requires us to remember to add new modules and non-source files. :raises: **AssertionError** files don't match our content Performs setup our tests will need. This mostly just needs disk iops...
779
en
0.891251
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
Summarizes the monitor reports from Datadog into key metrics Prepare the sqlite file for queries A denormalized version of the csv Consume the csv yyyy-mm-dd hh24 In the case of multiple users, denormalize
208
en
0.742909
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
This is the gap fill from alternate data GUI. The alternate data gap fill GUI is displayed separately from the main OzFluxQC GUI. It consists of text to display the start and end datetime of the file, two entry boxes for the start and end datetimes of the alternate data gap fill and a button to insert the gap fill data...
8,530
en
0.837533
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
!/usr/bin/python2.7 -*- coding: utf-8 -*- @package make_ldhatfiles.py @author Lea Picard, Sebastien RAVEL Modules Python modulesImport MODULES_SEB USE EGGLIB_3 Variables GlobalesintervalLDhatPATH = "interval"intervalLDhatPATH = "rhomap" Functionsif nameChro not in dictListPositions.keys():dictListPositions[nameChro] = ...
2,015
en
0.566971
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
Yield the Cuthill-McKee order for a connected, undirected graph. `Wikipedia <https://en.wikipedia.org/wiki/Cuthill%E2%80%93McKee_algorithm>`_ provides a good introduction to the Cuthill-McKee algorithm. The RCM algorithm attempts to order vertices in a graph such that their adjacency matrix's bandwidth is reduced. In ...
2,920
en
0.895764
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
0
en
0.110449
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
Test diff. --- import ------------------------------------------------------------------------------------- --- test ---------------------------------------------------------------------------------------
206
en
0.250487
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
Test class for iBMC Management interface. 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, ...
892
en
0.744268
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
IOProxy provides a proxy object meant to replace sys.std[in, out, err]. It does not proxy magic methods. It is used by calling the object's register and unregister methods. All other methods and attributes lookups go to the original file. Creates the thread local and registers the original file. Args: original_fil...
1,812
en
0.871745
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
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/LICENSE-2.0 Unle...
694
en
0.852482
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
A content handler that calls a given callback function for each translation in the XTB file. Parse xtb_file, making a call to callback_function for every translation in the XTB file. The callback function must have the signature as described below. The 'parts' parameter is a list of tuples (is_placeholder, text). Th...
1,757
en
0.815141
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
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 root of the project. -*- coding: utf-8 -*- u...
1,881
en
0.791721
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
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 License is distri...
518
en
0.879907
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
-*- 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. All configuration v...
6,118
en
0.6728
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
encoding: utf-8The information in this module was gleaned from DataLinkHandlers.cshttps://github.com/richardbunt/Telemachus/blob/master/Telemachus/src/DataLinkHandlers.csActions are sent to server, result in one action per message Smart ASS Off Node Prograde Retrograde Normal Plus Normal Minus Radial Plus Radial Minus ...
4,571
en
0.501462
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
A function to remove chartchunk from matplotlib plots, such as axes spines, ticks, and labels. Keyword arguments: axes: An iterable containing plt.gca() or plt.subplot() objects, e.g. [plt.gca()]. left, bottom, right, top: Boolean to specify which plot axes to hide. Sebastian Raschka 08/13/2014 mlxtend ...
400
en
0.566787
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
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. WARNING: src-side runtest.py is only tested with chromium CQ builders. Usage not covered by chromium CQ is not supported and can break without notice. Simple Chrome...
343
en
0.916762
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
plt.figure() plt.plot(time, phi) Writer = animation.writers['ffmpeg'] writer = Writer(fps=30, bitrate=7800) anim.save('test.mp4', writer=writer, dpi=200) plt.plot(x, y) plt.figure() rad_data = np.array([(sphere.x**2 + sphere.y**2)**0.5 for sphere in spheres]) plt.hist(rad_data.flatten()) plt.figure() phi_data = np.arra...
1,518
en
0.362571
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
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 later version. the...
706
en
0.915037
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
Static method to search the database and see if userid exists. If it does exist then return a User Object. If not then return None as required by Flask-Login. Encode a secure token for cookie -* coding: utf-8 -*-For this example the USERS database is a list consisting of(user,hased_password) of users.
306
en
0.745138
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
bin/usr/python Setting up GPIO pins Identifies the pin numbers to the pi Should sets pin 3 as an output...but doesnt work yet Turns initial output for pin 3 off Import functions to analyze license validity from CheckLicense.py Operating modestry:Normal mode operations----------------------------------------------------...
1,048
en
0.476655
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
The configuration options for gnuplot on Mac OS X. See the gp_unix.py for documentation on all of the parameters. Unsophisticated interface to a running gnuplot program. This represents a running gnuplot program and the means to communicate with it at a primitive level (i.e., pass it commands or data). When the obje...
2,647
en
0.797569
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
-*- coding: UTF-8 -*-import time_version = "0.10.dev%s" % int(time.time())test_suite="tests",
93
en
0.425265
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
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 hope that it wi...
639
en
0.912433
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
-*- coding: utf-8 -*-
21
en
0.767281