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 |
|---|---|---|---|---|---|---|---|---|---|---|
piotroxp/scibibscan | scib/lib/python3.5/site-packages/astropy/visualization/tests/test_norm.py | 1 | 2818 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from numpy import ma
from numpy.testing import assert_allclose
try:
import matplotlib
HAS_MATPLOTLIB = True
except:
HAS_MATPLOTLIB = False
from ..mpl_normalize import ImageNormalize
from ...tests.helper import pytest
fro... | mit | -4,890,521,937,240,437,000 | 25.336449 | 102 | 0.657559 | false |
PuZheng/cloud-dashing | cloud_dashing/basemain.py | 1 | 4573 | # -*- coding: UTF-8 -*-
import os
from flask import Flask, render_template, request, redirect, url_for
from flask.ext.principal import (identity_loaded, Principal, RoleNeed,
PermissionDenied)
from flask.ext.babel import gettext as _
from flask.ext.mail import Mail, Message
from sqlalche... | gpl-2.0 | 8,992,936,506,906,388,000 | 37.108333 | 79 | 0.591515 | false |
ska-sa/spead2 | src/spead2/send/__init__.py | 1 | 6188 | # Copyright 2015, 2020 National Research Foundation (SARAO)
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation, either version 3 of the License, or (at your option) any
# later version.
#
#... | lgpl-3.0 | -8,544,114,998,688,665,000 | 38.666667 | 93 | 0.615061 | false |
CLVsol/clvsol_odoo_addons | clv_mass_editing/models/ir_model_fields.py | 1 | 1092 | # © 2016 Serpent Consulting Services Pvt. Ltd. (support@serpentcs.com)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, models
class IrModelFields(models.Model):
_inherit = 'ir.model.fields'
@api.model
def search(self, args, offset=0, limit=0, order=None, count=False... | agpl-3.0 | -1,077,670,935,507,037,800 | 37.964286 | 74 | 0.492209 | false |
lobocv/crashreporter_hq | crashreporter_hq/db_repository/versions/001_migration.py | 1 | 2508 | from sqlalchemy import *
from migrate import *
from migrate.changeset import schema
pre_meta = MetaData()
post_meta = MetaData()
sequence = Table('sequence', post_meta,
Column('id', Integer, primary_key=True, nullable=False),
Column('count', Integer, default=ColumnDefault(0)),
Column('name', String(length... | mit | 9,179,526,756,315,560,000 | 33.833333 | 68 | 0.678628 | false |
rvs/gpdb | gpMgmt/bin/gppylib/gpresgroup.py | 1 | 1082 | #!/usr/bin/env python
#
# Copyright (c) 2017, Pivotal Software Inc.
#
from gppylib.commands import base
from gppylib.commands.unix import *
from gppylib.commands.gp import *
from gppylib.gparray import GpArray
from gppylib.gplog import get_default_logger
from gppylib.gphostcache import *
class GpResGroup(object):
... | apache-2.0 | -3,767,740,201,307,964,000 | 26.74359 | 80 | 0.613678 | false |
alexei-matveev/ccp1gui | idle/AutoExpand.py | 1 | 2632 | import string
import re
###$ event <<expand-word>>
###$ win <Alt-slash>
###$ unix <Alt-slash>
class AutoExpand:
keydefs = {
'<<expand-word>>': ['<Alt-slash>'],
}
unix_keydefs = {
'<<expand-word>>': ['<Meta-slash>', '<Alt-slash>'],
}
menudefs = [
('edit', [
('... | gpl-2.0 | -444,942,918,299,097,800 | 27.923077 | 69 | 0.503799 | false |
benrudolph/commcare-hq | custom/ewsghana/filters.py | 1 | 3043 | from django.utils.translation import ugettext_noop
from corehq.apps.products.models import Product, SQLProduct
from corehq.apps.programs.models import Program
from corehq.apps.reports.filters.base import BaseDrilldownOptionFilter, BaseSingleOptionFilter
from corehq.apps.reports.filters.fixtures import AsyncLocationFilt... | bsd-3-clause | 7,027,879,074,916,347,000 | 29.737374 | 114 | 0.609924 | false |
JetStarBlues/Nand-2-Tetris | PlayArea/OtherExperiments/FSMs/mod4.py | 1 | 1536 | ''''''''''''''''''''''''''' imports '''''''''''''''''''''''''''''
# Built ins
import sys
# Computer files
sys.path.append('../../Modules')
from _1__elementaryGates import *
from _2__arithmeticGates import *
from _3__clock import *
from _4__flipFlops import *
''''''''''''''''''''''''' helpers '''''''''''''''''''''''... | mit | 8,447,660,619,758,624,000 | 15.706522 | 100 | 0.555339 | false |
googleapis/googleapis-gen | google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/services/keyword_plan_campaign_service/client.py | 1 | 24567 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | apache-2.0 | -8,020,731,475,618,517,000 | 45.178571 | 173 | 0.632434 | false |
sargas/scipy | setupscons.py | 1 | 3499 | #!/usr/bin/env python
"""SciPy: Scientific Library for Python
SciPy (pronounced "Sigh Pie") is open-source software for mathematics,
science, and engineering. The SciPy library
depends on NumPy, which provides convenient and fast N-dimensional
array manipulation. The SciPy library is built to work with NumPy
arrays, a... | bsd-3-clause | 1,736,345,542,407,141,400 | 29.692982 | 106 | 0.677336 | false |
mwiencek/picard | picard/ui/options/tags.py | 1 | 5715 | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
# Copyright (C) 2006 Lukáš Lalinský
#
# 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... | gpl-2.0 | 3,342,055,691,295,774,000 | 45.819672 | 106 | 0.672269 | false |
vincenting/BeautifyRust | BeautifyRust.py | 1 | 3189 | import os.path
import shutil
import sublime
import sublime_plugin
import subprocess
SETTINGS_FILE = "BeautifyRust.sublime-settings"
def which(program):
def is_exe(fpath):
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
fpath, fname = os.path.split(program)
if fpath:
if is_exe(p... | mit | 757,475,552,624,579,200 | 36.964286 | 107 | 0.618062 | false |
c-bata/django-auth-example | accounts/migrations/0001_initial.py | 1 | 3050 | # Generated by Django 2.2 on 2019-04-07 12:04
import accounts.validators
import django.contrib.auth.models
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
... | mit | 6,103,907,302,205,594,000 | 65.304348 | 311 | 0.642951 | false |
bally12345/enigma2 | lib/python/Screens/SoftwareUpdate.py | 1 | 12332 | from Screens.ChoiceBox import ChoiceBox
from Screens.MessageBox import MessageBox
from Screens.Screen import Screen
from Screens.Standby import TryQuitMainloop
from Components.About import about
from Components.ActionMap import ActionMap, NumberActionMap
from Components.Button import Button
from Components.config impor... | gpl-2.0 | 8,617,721,726,443,560,000 | 40.662162 | 223 | 0.698427 | false |
aarpon/obit_flow_core_technology | core-plugins/flow/4/dss/reporting-plugins/retrieve_fcs_events/retrieve_fcs_events.py | 1 | 13183 | # -*- coding: utf-8 -*-
# Notes:
#
# - this plug-in uses LRCache.jar from export_flow_datasets/lib.
# - this plug-in requires Jython version 2.7 (for json module)
'''
Aggregation plug-in to generate FCS plots.
The first time a scatterplot is generated for an FCS file, the data is read
and stored in a CSV file that i... | apache-2.0 | -274,063,512,111,088,030 | 33.875661 | 84 | 0.644846 | false |
azariven/BioSig_SEAS | bin_stable/cross_section/load_physical_cloud_cross_section.py | 1 | 5111 |
import os
import sys
import numpy as np
import time
from scipy import interpolate
import matplotlib.pyplot as plt
DIR = os.path.abspath(os.path.dirname(__file__))
sys.path.insert(0, os.path.join(DIR, '../..'))
from SEAS_Main.atmosphere_effects.cloud import File_Cloud_Simulator, Physical_Cloud_Simulator
from SEAS_Ut... | gpl-3.0 | 8,680,982,130,842,436,000 | 28.72093 | 97 | 0.563882 | false |
GiulianoFranchetto/zephyr | scripts/west_commands/runners/dfu.py | 1 | 4430 | # Copyright (c) 2017 Linaro Limited.
#
# SPDX-License-Identifier: Apache-2.0
'''Runner for flashing with dfu-util.'''
from collections import namedtuple
import sys
import time
from west import log
from runners.core import ZephyrBinaryRunner, RunnerCaps, \
BuildConfiguration
DfuSeConfig = namedtuple('DfuSeConf... | apache-2.0 | 3,216,762,482,001,115,600 | 35.01626 | 79 | 0.550564 | false |
rmed/akamatsu | setup.py | 1 | 2681 | # -*- coding: utf-8 -*-
#
# Akamatsu CMS
# https://github.com/rmed/akamatsu
#
# MIT License
#
# Copyright (c) 2020 Rafael Medina García <rafamedgar@gmail.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
... | mit | -5,365,877,865,346,702,000 | 27.5 | 80 | 0.615901 | false |
fmaguire/volution | data/tm_sequences/get_tm_seqs.py | 1 | 3037 | #!/usr/bin/env python3
import sys
import os
import re
from Bio import SeqIO
import argparse
def main(args):
if len(args) is not 4:
print("get_seqs.py SORTED_tmhmm_output_filepath SORTED_input_fasta_filepath output_file")
tmhmm_out_fh = open(args[1], 'rU')
input_seq_fh = open(args[2], 'rU')
... | apache-2.0 | -4,751,719,109,523,673,000 | 29.37 | 144 | 0.494238 | false |
bccBalloon/HiBalloon | accel_card.py | 1 | 2128 | #!/usr/bin/python
import Adafruit_BBIO.ADC as ADC
import time
import datetime
import numpy as np
ADC.setup()
# Based on observation of high and low raw readings X 3.6 V. Then took the average of each.
zeroOffsetX = 1.595
zeroOffsetY = 1.614
zeroOffsetZ = 1.672
#The sensitivity or conversion factor is the average fo... | gpl-2.0 | 5,328,364,604,334,632,000 | 35.084746 | 229 | 0.62406 | false |
google/google-ctf | 2017/quals/2017-crypto-backdoor/generator.py | 1 | 2217 | #!/usr/bin/python
#
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 | -1,921,660,062,109,035,300 | 34.190476 | 91 | 0.676139 | false |
IHCantabria/THREDDSExplorer | libvisor/utilities/LayerLegendGroupifier.py | 1 | 4578 | '''
Created on 28 de mar. de 2016
@author: IHC
'''
from PyQt4.QtCore import QObject, pyqtSignal
from qgis.core import QgsRectangle, QgsLayerTreeLayer, QgsLayerTreeGroup, \
QgsProject, QgsMapLayerRegistry
from qgis.utils import iface
from threading import RLock
class LayerGroupifier(QObject):
... | gpl-3.0 | -7,256,800,875,467,990,000 | 41.398148 | 121 | 0.626474 | false |
fbradyirl/home-assistant | homeassistant/helpers/state.py | 1 | 7888 | """Helpers that help with state related things."""
import asyncio
import datetime as dt
import json
import logging
from collections import defaultdict
from types import TracebackType
from typing import ( # noqa: F401 pylint: disable=unused-import
Awaitable,
Dict,
Iterable,
List,
Optional,
Tuple... | apache-2.0 | -8,419,235,931,339,174,000 | 28.878788 | 88 | 0.641227 | false |
Kjir/papyon | papyon/service/OfflineIM/scenario/delete_messages.py | 1 | 1905 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007 Johann Prieur <johann.prieur@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) an... | gpl-2.0 | 7,619,992,812,602,080,000 | 37.1 | 76 | 0.659843 | false |
xaratustrah/manar | mainwindow_ui.py | 1 | 24883 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'mainwindow.ui'
#
# Created: Fri May 15 18:20:42 2015
# by: PyQt5 UI code generator 5.4
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(se... | gpl-2.0 | -6,529,363,739,883,643,000 | 62.154822 | 100 | 0.707833 | false |
MattNolanLab/ei-attractor | grid_cell_model/simulations/007_noise/figures/paper/ii_connections/config.py | 1 | 2543 |
'''Configuration file for the noise paper.'''
from __future__ import absolute_import, print_function
import os.path
import matplotlib.ticker as ti
from noisefigs.plotters.base import SeparateMultipageSaver
def get_config():
return _config
ROOT_DIR = ['simulation_data', 'ii_connections', 'gE_vs_gI']
_config =... | gpl-3.0 | -1,297,183,615,076,284,200 | 21.113043 | 65 | 0.426661 | false |
AutorestCI/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/azure_reachability_report.py | 1 | 1852 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit | 7,470,136,276,778,346,000 | 40.155556 | 102 | 0.646328 | false |
Darthkpo/xtt | openpyxl/worksheet/properties.py | 1 | 5070 | from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
"""Worksheet Properties"""
from openpyxl.compat import safe_string
from openpyxl.descriptors import Strict, String, Bool, Typed
from openpyxl.styles.colors import ColorDescriptor
from openpyxl.xml.constants import SHEET_MAIN_NS
from openpyxl.xm... | mit | 3,601,019,178,774,147,600 | 30.296296 | 90 | 0.631558 | false |
kakunbsc/enigma2.2 | lib/python/Plugins/SystemPlugins/Videomode/VideoHardware.py | 2 | 10472 | from enigma import eTimer
from Components.config import config, ConfigSelection, ConfigSubDict, ConfigYesNo
from Tools.CList import CList
from Tools.HardwareInfo import HardwareInfo
# The "VideoHardware" is the interface to /proc/stb/video.
# It generates hotplug events, and gives you the list of
# available and pre... | gpl-2.0 | 6,534,390,111,145,124,000 | 30.542169 | 133 | 0.646772 | false |
Rustem/tt | test_tt.py | 1 | 2374 | import unittest
from collections import namedtuple
from exc import AheadOfMaxOffsetError
import tt
from build import tt_pb2 as proto
SEND = 's'
RECV = 'r'
ClockCase = namedtuple('ClockCase',
['wall_time', 'event', 'input', 'expected'])
class TTTest(unittest.TestCase):
def test_less(self... | mit | 8,274,236,714,354,594,000 | 32.914286 | 119 | 0.589722 | false |
mpeters/ansible | v2/test/errors/test_errors.py | 1 | 2846 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 | -3,998,484,781,529,902,600 | 37.986301 | 176 | 0.664793 | false |
zak-k/cis | cis/plotting/line_plot.py | 1 | 3756 | from cis.plotting.generic_plot import Generic_Plot
class Line_Plot(Generic_Plot):
line_styles = ["solid", "dashed", "dashdot", "dotted"]
def plot(self):
"""
Plots one or many line graphs
"""
from cis.exceptions import InvalidDimensionError
self.mplkwargs["linewidth"] =... | gpl-3.0 | 2,224,748,964,197,030,400 | 44.253012 | 118 | 0.56017 | false |
AnishShah/tensorflow | tensorflow/contrib/lite/python/convert.py | 1 | 14556 | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 | -684,545,305,695,395,500 | 42.192878 | 80 | 0.683979 | false |
dmulholland/pymatrix | setup.py | 1 | 1481 | #!/usr/bin/env python3
"""
Pymatrix
========
A lightweight, easy-to-use matrix module in pure Python. Supports a range of
basic linear algebra operations.
Sample syntax::
from pymatrix import matrix
m = matrix([
[1, 2],
[3, 4]
])
a = m + m * 2
b = m * m
c = m ** 3
d = m... | unlicense | 2,585,921,403,486,972,400 | 21.439394 | 76 | 0.58609 | false |
peterbe/bramble | bramble/base/views.py | 1 | 2654 | import re
import datetime
import functools
import anyjson as json
from django import http
from django.conf import settings as django_settings
from django.shortcuts import render, render_to_response
from django.template import RequestContext
from redis_utils import redis_client
def json_view(f):
@functools.wraps(... | mpl-2.0 | 6,387,355,071,676,878,000 | 27.847826 | 80 | 0.598342 | false |
neilhan/python_cv_learning | 05-img-arithmetic/run_me_2.py | 1 | 3213 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import cv2
import sys
import ava.cv.utl
import random
import numpy as np
def main( argv = None ):
if argv is None:
argv = sys.argv
# test_with_gray()
print('----------... | bsd-3-clause | 8,251,951,575,585,122,000 | 30.811881 | 102 | 0.626206 | false |
gjhiggins/vcoincore | test/functional/feature_proxy.py | 1 | 8356 | #!/usr/bin/env python3
# Copyright (c) 2015-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test bitcoind with different proxy configuration.
Test plan:
- Start vcored's with different proxy con... | mit | 6,475,869,940,880,096,000 | 40.572139 | 121 | 0.613332 | false |
foosel/OctoPrint | src/octoprint/vendor/sockjs/tornado/transports/xhr.py | 1 | 2840 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
"""
sockjs.tornado.transports.xhr
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Xhr-Polling transport implementation
"""
import logging
from tornado.web import asynchronous
from octoprint.vendor.sockjs.tornado imp... | agpl-3.0 | -8,759,048,714,395,411,000 | 28.278351 | 84 | 0.610563 | false |
boldingd/BadSnn | rule_scratch.py | 1 | 6872 | #! /usr/bin/python3
import SnnBase
import Stdp
import DopamineStdp
import random
class TogglePulsar:
def __init__(self, magnitude, frequency):
self.magnitude = magnitude
self.frequency = frequency # not used after construction at present
self.delay = 1.0 / frequency
self.remainin... | bsd-3-clause | -1,762,644,887,899,792,400 | 28.118644 | 167 | 0.562573 | false |
inuyasha2012/tornado-qrcode-login-example | example/main.py | 1 | 4259 | # coding=utf-8
import base64
import tornado.ioloop
import tornado.web
from tornado.web import _create_signature_v1, _time_independent_equals
import tornado.gen
import tornado.httpclient
import tornado.escape
from tornado.escape import utf8
from tornado.concurrent import Future
from qr import get_qrcode
import uuid
imp... | mit | -4,151,695,492,188,493,300 | 26.973333 | 94 | 0.620739 | false |
Eulercoder/fabulous | test/plugin_tests/test_directions.py | 1 | 2275 | import unittest
from fabulous.services import directions
from fabulous.services.secret_example import GOOGLE_DIRECTION_API
from fabulous.services.directions import DIRECTIONS_BASEURL
''' In python3 mock is part of unittest
for python2 we need to install mcok seperately
'''
try:
from unittest.mock import MagicMock,... | gpl-3.0 | 3,067,695,825,953,000,400 | 34 | 98 | 0.701978 | false |
liyatanggithub/futures | python/cal.py | 1 | 2893 | #!/usr/bin/python
import string
import time
import matplotlib.pyplot as plt
FileName=raw_input("Please enter file name : ")
f=open(FileName, "r")
dataMat=[[0],[0]]
Aaa=0
Bbb=0
Ccc=0
xMax=100
yMin=10000
yMax=0
Money=1000
BuyPrice=0
MoreOrEmpty=0
LineHigh=0
LineLow=10000
Vertex=[]
while True:
s=f.readline()
... | gpl-2.0 | -7,213,722,963,543,938,000 | 27.93 | 177 | 0.547874 | false |
Adikso/BashBot | bashbot/core/utils.py | 1 | 1170 | import asyncio
import logging
from bashbot.core.settings import settings
loop = asyncio.get_event_loop()
def get_logger(name):
logger = logging.getLogger(name)
handler = logging.FileHandler('bashbot.log')
formatter = logging.Formatter('[%(asctime)s] %(levelname)s:%(name)s: %(message)s')
handler.set... | mit | -9,011,476,840,109,196,000 | 22.32 | 98 | 0.669811 | false |
mobarski/sandbox | parallel/p7x4m5.py | 1 | 4406 | ## p7.py - parallel processing microframework
## (c) 2017 by mobarski (at) gmail (dot) com
## licence: MIT
## version: ex4 (simple fan-in of subprocess outputs)
## mod2 (cmd line options)
## mod3 (2.6 compatibility)
## mod4 (no fan-in)
## mod5 (output pipe command for partitions)
from _... | mit | -1,997,737,394,157,168,000 | 33.692913 | 169 | 0.647299 | false |
duaraghav8/Corque | detect.py | 1 | 1133 | import cv2
import os
import sys
from string import Template
from PIL import Image
def doDetect(filename):
dirname = '/home/dark_knight/hackerrank/demo'
# first argument is the haarcascades path
face_cascade_path = "haarcascade_frontalface_default.xml"
face_cascade = cv2.CascadeClassifier(os.path.expanduser... | mit | 4,306,258,100,013,249,500 | 27.325 | 106 | 0.64872 | false |
pignacio/chorddb-django | docs/conf.py | 1 | 7798 | # -*- coding: utf-8 -*-
#
# chorddb_django documentation build configuration file, created by
# sphinx-quickstart on Sun Feb 17 11:46:20 2013.
#
# 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-3.0 | -3,725,401,606,865,684,000 | 31.22314 | 80 | 0.705694 | false |
JiaKang0615/Group-Projects | Unemployment vs. campus crime rate.py | 1 | 2534 | from pandas import DataFrame, Series
import pandas as pd
import numpy as np
import random as r
from scipy import stats
import scipy
import math
# Calculate crime_y12_y12 rate
un_rate=pd.read_csv('Zip_county.csv')
Unemp=pd.read_csv('crate_year.csv')
crime=pd.read_csv('Python_totalsheet.csv')
crime=crime[[... | cc0-1.0 | 1,006,985,952,192,664,600 | 35.850746 | 206 | 0.667719 | false |
freevo/freevo1 | src/plugins/home_automation.py | 1 | 4466 | import os
import plugin
import config
from item import Item
import config, menu, rc, plugin, skin, osd, util
class PluginInterface(plugin.MainMenuPlugin):
"""
Home Automation Plugin
Activate:
| plugin.activate('home_automation')
This plugin is for controlling home automation items, such as X10 d... | gpl-2.0 | 8,381,362,635,900,584,000 | 29.175676 | 119 | 0.571429 | false |
VirusTotal/msticpy | tests/test_folium.py | 1 | 4877 | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import mat... | mit | -1,594,403,641,124,946,000 | 34.59854 | 85 | 0.612877 | false |
ossobv/exactonline | exactonline/elements/invoice.py | 1 | 11247 | # vim: set ts=8 sw=4 sts=4 et ai tw=79:
"""
Data structures for communication with remote.
Example usage::
class BossoExactInvoice(ExactInvoice):
def __init__(self, bosso_invoice=None, **kwargs):
super(BossoExactInvoice, self).__init__(**kwargs)
self._bosso_invoice = bosso_invoice... | lgpl-3.0 | 2,025,355,521,391,060,000 | 34.146875 | 78 | 0.56255 | false |
NeCTAR-RC/nova | nova/virt/libvirt/imagebackend.py | 1 | 46286 | # Copyright 2012 Grid Dynamics
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | apache-2.0 | 2,769,925,494,254,628,000 | 39.38918 | 79 | 0.57041 | false |
nightjuggler/qc | qc.py | 1 | 13333 | #
# qc.py - Quantum Computing Library for Python
#
# by Pius Fischer, February 13-20, 2016
#
# Various functions for mathematically simulating the quantum circuit model of computation.
#
# Example 1 - Superdense coding (sending two classical bits a1 and a2 from Alice to Bob via
# ... | mit | -7,023,424,993,711,938,000 | 25.349802 | 105 | 0.631441 | false |
supertree-toolkit/stk | stk/yapbib/adsparse.py | 1 | 7928 | #! /usr/bin/env python
import sys,os
import re
import codecs
import helper
ads_fields={'R': 'Bibliographic Code',
'A': 'Author List',
'a': 'Book Authors',
'F': 'Author Affiliation',
'J': 'Journal Name',
'V': 'Journal Volume',
'D': 'Publication Da... | gpl-3.0 | -5,861,550,258,326,980,000 | 32.73617 | 146 | 0.598133 | false |
wurstmineberg/wurstminebot | wurstminebot/__main__.py | 1 | 3656 | #!/usr/bin/env python3
### BEGIN INIT INFO
# Provides: wurstminebot
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the wurstminebot Minecraft/IRC bot
# Description: starts wurstminebot ... | mit | -7,870,164,942,341,953,000 | 32.541284 | 192 | 0.637582 | false |
dev-coop/plithos | src/run.py | 1 | 1718 | import argparse
from plithos.simulations.random_mover import RandomMover
from plithos.simulations.dqn_single_drone import DQNSingleDroneExperiment
from plithos.simulations.hand_controlled import HandControlled
from plithos.simulations.manual_ai import ManualAIExperiment
if __name__ == '__main__':
simulations = {... | mit | 3,844,613,870,252,509,000 | 32.038462 | 116 | 0.655413 | false |
grap/odoo-eshop | odoo_eshop/eshop_app/tools/auth.py | 1 | 1800 | # encoding: utf-8
# Extra Lib
from functools import wraps
from flask import session, render_template, flash
from flask.ext.babel import gettext as _
# Custom Tools
from .erp import openerp
from .web import redirect_url_for
def logout():
session.clear()
# Decorator called for pages that DON'T require authentic... | agpl-3.0 | -2,588,128,139,585,947,600 | 30.034483 | 77 | 0.597778 | false |
ZLLab-Mooc/edx-platform | cms/envs/test.py | 1 | 9102 | # -*- coding: utf-8 -*-
"""
This config file runs the simplest dev environment using sqlite, and db-based
sessions. Assumes structure:
/envroot/
/db # This is where it'll write the database file
/edx-platform # The location of this repo
/log # Where we're going to write log files
"""
# We ... | agpl-3.0 | 8,424,455,987,551,631,000 | 31.741007 | 144 | 0.676445 | false |
plotly/python-api | packages/python/plotly/plotly/graph_objs/_ohlc.py | 1 | 48985 | from plotly.basedatatypes import BaseTraceType as _BaseTraceType
import copy as _copy
class Ohlc(_BaseTraceType):
# class properties
# --------------------
_parent_path_str = ""
_path_str = "ohlc"
_valid_props = {
"close",
"closesrc",
"customdata",
"customdatasrc",... | mit | 1,772,029,968,138,772,200 | 30.042459 | 89 | 0.540594 | false |
south-coast-science/scs_dfe_eng | tests/gas/isi/elc_dsi_t1_test.py | 1 | 1580 | #!/usr/bin/env python3
"""
Created on 27 May 2019
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
"""
import sys
import time
from scs_dfe.gas.isi.elc_dsi_t1 import ElcDSIt1
from scs_dfe.interface.interface_conf import InterfaceConf
from scs_host.bus.i2c import I2C
from scs_host.sys.host import Host
# ... | mit | 5,856,037,002,768,893,000 | 20.066667 | 118 | 0.529747 | false |
janamcr/laserflect | laserflect.py | 1 | 9349 | '''
Copyright 2012 Iwan Gabovitch and Jana Wendler
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... | gpl-3.0 | 7,591,401,104,119,569,000 | 24.684066 | 90 | 0.567761 | false |
wagnerand/addons-server | src/olympia/reviewers/views.py | 1 | 65357 | import functools
import json
import time
from collections import OrderedDict
from datetime import date, datetime, timedelta
from django import http
from django.conf import settings
from django.core.cache import cache
from django.core.exceptions import PermissionDenied
from django.core.paginator import Paginator
from ... | bsd-3-clause | 2,331,642,368,895,851,500 | 35.086692 | 96 | 0.638257 | false |
macosforge/ccs-calendarserver | calendarserver/provision/test/test_root.py | 1 | 10928 | ##
# Copyright (c) 2005-2017 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | apache-2.0 | -6,156,759,224,787,534,000 | 28.219251 | 92 | 0.588397 | false |
alfredodeza/execnet | testing/test_multi.py | 1 | 7561 | # -*- coding: utf-8 -*-
"""
tests for multi channels and gateway Groups
"""
import gc
from time import sleep
import execnet
import py
import pytest
from execnet import XSpec
from execnet.gateway_base import Channel
from execnet.multi import Group
from execnet.multi import safe_terminate
class TestMultiChannelAnd... | mit | 323,461,627,127,507,700 | 26.900369 | 80 | 0.555747 | false |
FancyRice/RitoAPI | ritoapi/rate_limit/rate_ticker.py | 1 | 1637 | import time
import threading
class RateTicker:
global_rate_limit = 'X-App-Rate-Limit'
method_rate_limit = 'X-Method-Rate-Limit'
global_rate_limit_count = 'X-App-Rate-Limit-Count'
method_rate_limit_count = 'X-Method-Rate-Limit-Count'
service_reset_time = 3
def __init__(self, usage_limit, reset... | mit | -6,764,404,491,455,072,000 | 33.829787 | 93 | 0.624924 | false |
Tillsten/MPLslides | mplslides/utils.py | 1 | 11427 | # -*- coding: utf-8 -*-
'''
.. module:: audiochan.utils.cascadicts
:platform: Unix, Windows
:synopsis: Implementation of Cascading dict collection. CascaDicts implement something like inheritance on dictionary level.
Example::
In [2]: a = CascaDict({'level':0, 'name':'root'})
In [3]: b = a.cascade({... | mit | 2,462,875,882,698,541,000 | 35.164557 | 129 | 0.549926 | false |
wt52571314/MyAutoTest | Auto_Pay/old/oo.py | 1 | 1702 | # __author__ = 'Administrator'
# [
# {"questionId":"5","questionAns":"4"},
# {"questionId":"6","questionAns":"8"},
# {"questionId":"7","questionAns":"12"},
# {"questionId":"9","questionAns":"15"},
# {"questionId":"10","questionAns":"18"},
# {"questionId":"11","questionAns":"24"},
# {"questionId":"12","questionAns":"27... | gpl-2.0 | 966,669,798,809,416,700 | 34.458333 | 105 | 0.565217 | false |
michaeljoseph/righteous | righteous/__init__.py | 1 | 1028 | __version__ = '0.5.0'
__author__ = 'Michael Joseph'
from .api.base import init, initialise, login
from .api.server import (
list_servers, find_server, server_info,
server_settings, create_and_start_server, create_server,
set_server_parameters, start_server, stop_server, delete_server
)
from .api.server_tem... | unlicense | -8,350,987,318,766,564,000 | 37.074074 | 74 | 0.744163 | false |
joelwking/ansible-cliqr | phantom/base_connector.py | 1 | 2382 | #!/usr/bin/env python
# base_connector.py
#
"""
Copyright (c) 2017 World Wide Technology, Inc.
All rights reserved.
author: Joel W. King, World Wide Technology
Revision history:
- 16 February 2017 | 1.0 | Initial release
"""
import json
class BaseConnector(object):
""" This mimics ... | gpl-3.0 | -662,813,616,256,438,100 | 30.355263 | 115 | 0.616289 | false |
serge-sans-paille/pythran | pythran/tests/test_advanced.py | 1 | 15985 | #encoding: utf8
from pythran.tests import TestEnv
from unittest import skip, skipIf
import numpy
from pythran.typing import *
class TestAdvanced(TestEnv):
def test_generator_enumeration(self):
code = '''
def dummy_generator(l):
for i in l: yield i
def generator_en... | bsd-3-clause | -4,114,732,264,823,799,000 | 34.676339 | 221 | 0.524245 | false |
realm/realm-core | test/benchmark-common-tasks/collect_stats.py | 1 | 4812 | import os
import sys
import getopt
def get_zero_bytes_of_file(filename):
count = 0
with open(filename, "rb") as f:
byte = f.read(1)
while byte:
if byte == '\0':
count = count + 1
byte = f.read(1)
return count
def get_file_size(filename):
statinfo... | apache-2.0 | -2,407,931,739,273,338,000 | 32.65035 | 98 | 0.592477 | false |
mtmail/Nominatim | nominatim/clicmd/special_phrases.py | 1 | 2312 | """
Implementation of the 'special-phrases' command.
"""
import logging
from pathlib import Path
from nominatim.errors import UsageError
from nominatim.db.connection import connect
from nominatim.tools.special_phrases.sp_importer import SPImporter
from nominatim.tools.special_phrases.sp_wiki_loader import SPWikiLoa... | gpl-2.0 | 4,599,181,903,326,657,000 | 37.533333 | 92 | 0.660467 | false |
celebdor/kuryr-libnetwork | kuryr_libnetwork/schemata/request_pool.py | 1 | 2102 | # 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 t... | apache-2.0 | -7,775,517,763,167,128,000 | 35.241379 | 75 | 0.569933 | false |
Guzi219/Python | com/github/utils/IniFileUtil.py | 1 | 1845 | # -*- coding:utf-8 -*_
import ConfigParser
import os
class INIFILE:
"""
a class which can process *.ini file
with read and write function.
"""
def __init__(self, fileName):
self.fileName = fileName
self.initflag = False
self.cfg = None
self.readhandle = None
... | mit | 6,201,506,048,901,360,000 | 27.384615 | 102 | 0.573984 | false |
trabucayre/gnuradio | gr-filter/python/filter/qa_filter_delay_fc.py | 1 | 3902 | #!/usr/bin/env python
#
# Copyright 2004,2007,2010,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import gr, gr_unittest, filter, blocks
import math
def sin_source_f(samp_rate, freq, amp, N):
t = [float(x) / samp_rate f... | gpl-3.0 | -2,342,077,721,687,046,000 | 26.097222 | 81 | 0.57714 | false |
gogoair/foremast | tests/lambda/test_aws.py | 1 | 3080 | """Verify AWS Lambda Function creation."""
import copy
from unittest import mock
from foremast.awslambda.awslambda import LambdaFunction
TEST_PROPERTIES = {
'pipeline': {
'lambda': {
'app_description': None,
'handler': None,
'runtime': None,
'vpc_enabled': N... | apache-2.0 | 8,655,338,477,454,333,000 | 37.024691 | 95 | 0.693831 | false |
Pulgama/supriya | supriya/ugens/LinLin.py | 1 | 1205 | import abc
from supriya.ugens.PseudoUGen import PseudoUGen
class LinLin(PseudoUGen):
### CLASS VARIABLES ###
__documentation_section__ = "Line Utility UGens"
### INITIALIZER ###
@abc.abstractmethod
def __init__(self):
raise NotImplementedError
### PUBLIC METHODS ###
@staticm... | mit | 2,338,045,730,599,095,300 | 24.104167 | 87 | 0.609129 | false |
osblinnikov/snocs | snocs_helper.py | 1 | 19241 | import os.path
import shutil
import copy
import sys
from colors import *
# from cogapp import Cog
join = os.path.join
#--------------------------------------
# Functions
#--------------------------------------
def initEnv(env, name):
env['SNOCSCRIPT_PATH'] = os.path.abspath(os.path.dirname(env['SNOCSCRIPT']))
... | mit | 6,161,139,523,123,708,000 | 37.252485 | 175 | 0.647835 | false |
ericmjl/bokeh | bokeh/colors/util.py | 1 | 3940 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | bsd-3-clause | -2,405,973,552,636,025,300 | 31.03252 | 95 | 0.385533 | false |
alphatwirl/alphatwirl | alphatwirl/roottree/BranchAddressManagerForVector.py | 1 | 1619 | # Tai Sakuma <tai.sakuma@gmail.com>
import ROOT
import re
##__________________________________________________________________||
class BranchAddressManagerForVector:
"""The branch address manager for ROOT TTree
This class manages ROOT.vector objects used for branch addresses
of ROOT TTree. The main purpos... | bsd-3-clause | -2,334,217,209,679,618,000 | 31.38 | 70 | 0.583694 | false |
idaholab/raven | tests/framework/unit_tests/TSA/testPolynomialRegression.py | 1 | 10152 | # Copyright 2017 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed t... | apache-2.0 | 633,392,834,700,745,900 | 31.126582 | 111 | 0.646966 | false |
tensorflow/mesh | mesh_tensorflow/transformer/adaptive_softmax.py | 1 | 18201 | # coding=utf-8
# Copyright 2021 The Mesh TensorFlow Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | apache-2.0 | -1,187,358,357,249,531,600 | 42.028369 | 80 | 0.683424 | false |
kdunn926/eunomia-django | People/models.py | 1 | 2149 | from __future__ import unicode_literals
from django.db import models
#from CongressionalRecord import db
from neo4j import contextmanager
from neo4j import connection
from re import escape
from django.conf import settings
connection.http.REQUEST_TIMEOUT = 9999
manager = contextmanager.Neo4jDBConnectionManager(settin... | apache-2.0 | 6,801,981,152,957,756,000 | 32.578125 | 104 | 0.590507 | false |
ohspite/xatag | xatag/test/test_config.py | 1 | 4862 | #pylint: disable-all
import pytest
import os
from xatag.config import *
import xatag.constants as constants
from xatag.constants import DEFAULT_TAG_KEY
@pytest.fixture
def confdir(tmpdir):
os.environ[constants.CONFIG_DIR_VAR] = str(tmpdir)
create_config_dir()
fname = tmpdir.join('known_tags')
with fna... | gpl-3.0 | -7,838,774,792,254,259,000 | 32.07483 | 81 | 0.58042 | false |
wimoverwater/Sick-Beard | lib/tvnamer/roman.py | 1 | 2827 | ## {{{ http://code.activestate.com/recipes/81611/ (r2)
def int_to_roman(input):
"""
Convert an integer to Roman numerals.
Examples:
>>> int_to_roman(0)
Traceback (most recent call last):
ValueError: Argument must be between 1 and 3999
>>> int_to_roman(-1)
Traceback (most recent call last):
ValueE... | gpl-3.0 | 4,928,052,177,722,792,000 | 22.37069 | 72 | 0.600283 | false |
sunlightlabs/tcamp | tcamp/twit/migrations/0001_initial.py | 1 | 10740 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'SessionBlockTweet'
db.create_table(u'twit_sessionblocktweet', (
(u'id', self.gf(... | bsd-3-clause | 383,170,107,251,586,300 | 74.640845 | 194 | 0.563128 | false |
git-keeper/git-keeper | git-keeper-server/gkeepserver/email_sender_thread.py | 1 | 5346 | # Copyright 2016 Nathan Sommer and Ben Coleman
#
# 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 dis... | agpl-3.0 | 5,637,033,515,681,715,000 | 30.821429 | 77 | 0.628507 | false |
sgravel/tracts | example/fancyplotting.py | 1 | 6336 | #!/usr/bin/env python
"""
fancyplotting.py -- make nice plots of tracts output.
It mimics for the most part the output of fancyplotting.nb, but additionally
provides a command-line interface and is generally more reusable that the
originally-bundled Mathematica code.
fancyplotting.py optionally uses seaborn or brewe... | gpl-2.0 | -4,603,262,905,557,491,000 | 33.248649 | 85 | 0.561395 | false |
fc-thrisp-hurrata-dlm-graveyard/flack | flask_flack/views.py | 1 | 1618 | from flask import (current_app, redirect, request, render_template, jsonify,
after_this_request, Blueprint)
from werkzeug import LocalProxy
from .utils import (get_post_feedback_redirect, get_message, do_flash)
_feedback = LocalProxy(lambda: current_app.extensions['feedback'])
_datastore = LocalPr... | mit | -4,552,643,240,028,351,500 | 27.385965 | 76 | 0.627318 | false |
gkc1000/pyscf | pyscf/fci/direct_spin1.py | 1 | 38081 | #!/usr/bin/env python
# Copyright 2014-2019 The PySCF Developers. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | apache-2.0 | -3,266,150,161,214,682,600 | 40.527808 | 95 | 0.584255 | false |
Aloomaio/googleads-python-lib | examples/ad_manager/v201811/activity_service/create_activities.py | 1 | 2230 | #!/usr/bin/env python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | apache-2.0 | -4,271,302,710,969,008,000 | 31.794118 | 77 | 0.718834 | false |
hexinatgithub/CLRS | Chapter4/maximum-subarray.py | 1 | 1207 | import sys
def find_max_crossing_subarray(A, low, mid, high):
left_sum = -sys.maxint
sum = 0
i = mid
max_left = mid
while i >= low:
sum += A[i]
if sum > left_sum:
max_left = i
left_sum = sum
i -= 1
right_sum = -sys.maxint
sum = 0
i = mid + 1
max_right = mid + 1
while i <= high:
sum += A[i]
i... | mit | 224,464,295,923,469,250 | 23.14 | 84 | 0.609776 | false |
ericmjl/bokeh | tests/unit/bokeh/command/subcommands/test_secret.py | 1 | 2312 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2020, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | bsd-3-clause | 2,766,755,261,859,993,600 | 34.569231 | 88 | 0.310554 | false |
gyoto/Gyoto | python/example-patterndisk.py | 1 | 2991 | #!/usr/bin/env python3
#
# In this example script, we create a Gyoto Scnenery with a
# PatternDisk, save it, read it and check that the re-read scenery is
# identical to the saved one.
# This is the same example as yorick/check-patterndisk.i
import gyoto.core, gyoto.std
import numpy
import os
import matplotlib.pyplot ... | gpl-3.0 | 5,693,086,111,596,858,000 | 28.613861 | 103 | 0.750919 | false |
thorsummoner/crowbar | crowbar/linkedpanes.py | 1 | 2370 |
from gi.repository import Gtk
class LinkedPanes(Gtk.Bin):
def __init__(self, tl, tr, bl, br):
super(LinkedPanes, self).__init__()
if 'linked-pane':
link1 = LinkedPane(
Gtk.Orientation.HORIZONTAL,
tl, tr,
(160, 90)
)
... | unlicense | -8,135,434,122,472,808,000 | 28.625 | 84 | 0.553586 | false |
BobBuildTool/bob | pym/bob/cmds/jenkins.py | 1 | 98147 | # Bob build tool
# Copyright (C) 2016 TechniSat Digital GmbH
#
# SPDX-License-Identifier: GPL-3.0-or-later
from .. import BOB_VERSION
from ..archive import getArchiver
from ..errors import ParseError, BuildError
from ..input import RecipeSet
from ..languages import StepSpec
from ..state import BobState
from ..stringp... | gpl-3.0 | 8,702,361,835,393,258,000 | 42.698575 | 222 | 0.567577 | false |
koss822/misc | Linux/MySettings/myvim/vim/bundle/jedi-vim/pythonx/jedi/test/completion/comprehensions.py | 1 | 3188 | # -----------------
# list comprehensions
# -----------------
# basics:
a = ['' for a in [1]]
#? str()
a[0]
#? ['insert']
a.insert
a = [a for a in [1]]
#? int()
a[0]
y = 1.0
# Should not leak.
[y for y in [3]]
#? float()
y
a = [a for a in (1, 2)]
#? int()
a[0]
a = [a for a,b in [(1,'')]]
#? int()
a[0]
arr = [1,'... | gpl-3.0 | -8,414,466,140,589,009,000 | 13.168889 | 91 | 0.452008 | false |
gpersistence/tstop | python/persistence/PersistenceKernel.py | 1 | 6536 | #TSTOP
#
#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 will be useful,
... | gpl-3.0 | 480,175,032,194,464,300 | 39.345679 | 170 | 0.649327 | false |
Koheron/zynq-sdk | examples/red-pitaya/adc-dac-bram/adc_dac_bram.py | 2 | 1467 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import math
import numpy as np
from koheron import command
class AdcDacBram(object):
def __init__(self, client):
self.client = client
self.dac_size = self.get_dac_size()
self.dac = np.zeros((2, self.dac_size))
self.adc_size... | mit | -1,183,001,327,098,025,000 | 27.230769 | 87 | 0.582822 | false |
pgleeson/TestArea | models/MooseDemo/pythonScripts/RunTests.py | 1 | 11129 |
#
#
# File to test current configuration of GranuleCell project.
#
# To execute this type of file, type '..\..\..\nC.bat -python XXX.py' (Windows)
# or '../../../nC.sh -python XXX.py' (Linux/Mac). Note: you may have to update the
# NC_HOME and NC_MAX_MEMORY variables in nC.bat/nC.sh
#
# Author: Padr... | gpl-2.0 | 8,018,619,242,984,670,000 | 28.828255 | 127 | 0.555665 | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.