repo_name stringlengths 6 90 | path stringlengths 4 230 | copies stringlengths 1 4 | size stringlengths 4 7 | content stringlengths 734 985k | license stringclasses 15
values | hash int64 -9,223,303,126,770,100,000 9,223,233,360B | line_mean float64 3.79 99.6 | line_max int64 19 999 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 8.06 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
noiselabs/zf-debug-utils | docs/conf.py | 1 | 1629 | # -*- coding: utf-8 -*-
import os
import sys
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath(... | mit | -1,960,608,872,603,594,500 | 26.1 | 80 | 0.678769 | false | 3.350515 | false | false | false |
unreal666/youtube-dl | youtube_dl/utils.py | 2 | 121771 | #!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
import base64
import binascii
import calendar
import codecs
import contextlib
import ctypes
import datetime
import email.utils
import email.header
import errno
import functools
import gzip
import io
import itertools
import json
import local... | unlicense | 3,374,019,621,751,892,500 | 30.05998 | 130 | 0.529817 | false | 3.32431 | false | false | false |
mfherbst/spack | var/spack/repos/builtin/packages/phasta/package.py | 2 | 2372 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | 9,153,036,567,349,327,000 | 39.20339 | 78 | 0.628583 | false | 3.550898 | false | false | false |
Charliiee/fbchat-terminal | fbchat-terminal/chat.py | 1 | 4942 | # -*- coding: utf-8 -*-
"""
Terminal facebook messenger in python.
obs: in case Windows command prompt exit with charmap codec error
run the command chcp 65001 in it to fix the problem.
"""
from datetime import datetime
from passlib.hash import pbkdf2_sha256
import fbchat
import getpass
impo... | bsd-3-clause | 6,000,415,364,859,600,000 | 32.333333 | 101 | 0.514367 | false | 4.505014 | false | false | false |
rastersoft/Devede | devede_bincue.py | 1 | 3195 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright 2006-2009 (C) Raster Software Vigo (Sergio Costas)
# Copyright 2006-2007 (C) Peter Gill - win32 parts
# This file is part of DeVeDe
#
# DeVeDe is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as pub... | gpl-3.0 | -5,245,048,918,204,832,000 | 30.323529 | 121 | 0.712676 | false | 3.060345 | false | false | false |
Ifsttar/I-Simpa | currentRelease/ExperimentalCore/md_octave/kdtree.py | 3 | 19554 | # -*- coding: utf-8 -*-
"""A Python implemntation of a kd-tree
This package provides a simple implementation of a kd-tree in Python.
https://en.wikipedia.org/wiki/K-d_tree
"""
from __future__ import print_function
import heapq
import itertools
import operator
import math
from collections import deque
from functoo... | gpl-3.0 | 2,951,975,257,080,783,000 | 27.878877 | 106 | 0.577259 | false | 4.090167 | false | false | false |
gavinfish/leetcode-share | python/103 Binary Tree Zigzag Level Order Traversal.py | 1 | 1397 | '''
Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and alternate between).
For example:
Given binary tree {3,9,20,#,#,15,7},
3
/ \
9 20
/ \
15 7
return its zigzag level order traversal as:
[
[3],
... | mit | -8,365,117,335,735,086,000 | 23.103448 | 169 | 0.513243 | false | 3.913165 | false | false | false |
recursecenter/RSVPBot | rsvp_commands.py | 1 | 15428 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import re
import datetime
from time import mktime
import random
import urllib.parse
import strings
import util
from models import Event, Session, insert_event, event_exists
import rc
import zulip_util
import config
def zulip_names_from_participants(part... | mit | -7,168,280,865,418,549,000 | 32.317495 | 207 | 0.654804 | false | 3.259932 | false | false | false |
DiCarloLab-Delft/PycQED_py3 | pycqed/instrument_drivers/physical_instruments/Weinschel_8320_novisa.py | 2 | 1430 | from qcodes.instrument.base import Instrument
from qcodes.instrument.parameter import ManualParameter
from qcodes.utils import validators as vals
import numpy as np
import telnetlib
class Weinschel_8320(Instrument):
'''
QCodes driver for the stepped attenuator
Weinschel is formerly known as Aeroflex/Weins... | mit | 9,164,941,774,055,118,000 | 33.047619 | 75 | 0.604196 | false | 3.496333 | false | false | false |
shirlei/helios-server | heliosinstitution/south_migrations/0012_auto__del_field_institution_mngt_email.py | 1 | 6641 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Deleting field 'Institution.mngt_email'
db.delete_column(u'heliosinstit... | apache-2.0 | 4,012,638,849,385,605,000 | 68.915789 | 195 | 0.564975 | false | 3.638904 | false | false | false |
mohamed/trap-gen | trap/isa.py | 2 | 40261 | # -*- coding: iso-8859-1 -*-
####################################################################################
# ___ ___ ___ ___
# / /\ / /\ / /\ / /\
# / /:/ / /::\ / /::\ / /::\
# / /:/ / /:/\:\ / /:/\:\ ... | gpl-3.0 | -9,119,234,798,052,195,000 | 50.222646 | 243 | 0.610839 | false | 4.344087 | true | false | false |
takeshineshiro/heat | heat/engine/event.py | 7 | 3672 | #
# 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
# ... | apache-2.0 | -941,242,811,950,227,000 | 36.090909 | 78 | 0.620915 | false | 4.211009 | false | false | false |
jshholland/dutch-bits | fpi.py | 1 | 3829 | #!/usr/bin/env python
import sys
import os.path
from optparse import OptionParser
from decimal import Decimal
import logging
__version__ = "0.0.1"
__version_info__ = (0, 0, 1)
__copyright__ = """\
Copyright (c) 2010 Josh Holland
This is free software: you are free to change and redistribute it.
There is NO WARRANTY... | bsd-3-clause | 4,546,943,184,495,210,000 | 32.587719 | 88 | 0.63672 | false | 3.772414 | false | false | false |
kevinpt/symbolator | setup.py | 1 | 1864 |
import sys
try:
from setuptools import setup
except ImportError:
sys.exit('ERROR: setuptools is required.\nTry using "pip install setuptools".')
# Use README.rst for the long description
with open('README.rst') as fh:
long_description = fh.read()
def get_package_version(verfile):
'''Scan the script for the... | mit | -7,709,396,280,444,995,000 | 29.064516 | 89 | 0.635193 | false | 3.87526 | false | false | false |
clarinsi/reldi-api | src/core/tokenizer.py | 1 | 6694 | #!/usr/bin/python
#-*-encoding:utf-8-*-
import re
import codecs
import sys
import os
from signal import signal, SIGPIPE, SIG_DFL
signal(SIGPIPE,SIG_DFL)
def read_abbrevs(file):
abbrevs={'B':[],'N':[],'S':[]}
for line in open(file):
if not line.startswith('#'):
abbrev,type=line.decode('utf8').strip().sp... | gpl-3.0 | -1,376,412,360,374,019,000 | 35.508197 | 154 | 0.540338 | false | 2.662814 | false | false | false |
ocadotechnology/aimmo | aimmo/migrations/0004_auto_20160808_1511.py | 1 | 1515 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("aimmo", "0003_auto_20160802_1418")]
operations = [
migrations.AddField(
model_name="game",
name="obstacle_ratio",... | agpl-3.0 | -752,188,297,486,461,200 | 29.3 | 88 | 0.547855 | false | 4.220056 | false | false | false |
roadmapper/ansible | lib/ansible/module_utils/aws/rds.py | 13 | 11301 | # Copyright: (c) 2018, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.module_utils._text import to_text
from ansible.module_utils.aws.waiters import get_wa... | gpl-3.0 | 620,807,244,470,483,800 | 47.711207 | 160 | 0.670206 | false | 3.747016 | false | false | false |
roim/PyTranscribe | plotting/clustering.py | 1 | 2157 | # Copyright 2015 Rodrigo Roim Ferreira
#
# 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 distribute... | gpl-3.0 | 611,838,966,174,861,700 | 41.176471 | 286 | 0.669456 | false | 3.00419 | false | false | false |
simoesusp/Hexacoptero | Denis/MissionPlanner trabalho/ExtLibs/Mavlink/pymavlink/generator/lib/genxmlif/xmlifODict.py | 11 | 1450 | from types import DictType
from UserDict import UserDict
class odict(UserDict):
def __init__(self, dictOrTuple = None):
self._keys = []
UserDict.__init__(self, dictOrTuple)
def __delitem__(self, key):
UserDict.__delitem__(self, key)
self._keys.remove(key)
def __setitem_... | gpl-3.0 | 6,726,008,346,923,515,000 | 24.45614 | 56 | 0.564138 | false | 3.99449 | false | false | false |
matthijsvk/multimodalSR | code/Experiments/neon-master/examples/deep_dream.py | 2 | 7066 | #!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2016 Nervana Systems 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
#
# ... | mit | 3,557,392,572,239,242,000 | 32.971154 | 96 | 0.631333 | false | 3.418481 | false | false | false |
trivoldus28/pulsarch-verilog | tools/local/bas-release/bas,3.9-SunOS-i386/lib/pfe/Pfe_Strand.py | 1 | 11564 |
class GetAttrError(Exception):
def __init__(self,name):
Exception.__init__(self)
self.name = name
def __str__(self):
return "The strand has no getable state member '"+self.name+"'"
class DelAttrError(Exception):
def __init__(self,name):
Exception.__init__(self)
self.name = name
def __str__... | gpl-2.0 | 5,114,200,531,613,629,000 | 27.204878 | 103 | 0.548426 | false | 3.249227 | false | false | false |
pluskid/mxnet | example/rnn/old/rnn_cell_demo.py | 15 | 5755 | """A simple demo of new RNN cell with PTB language model."""
import os
import numpy as np
import mxnet as mx
from bucket_io import BucketSentenceIter, default_build_vocab
data_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), 'data'))
def Perplexity(label, pred):
# TODO(tofix): we make a transpos... | apache-2.0 | -7,743,223,845,540,183,000 | 41.62963 | 95 | 0.589922 | false | 3.737013 | false | false | false |
isudox/leetcode-solution | python-algorithm/leetcode/sort_colors.py | 1 | 1202 | """75. Sort Colors
https://leetcode.com/problems/sort-colors/
Given an array with n objects colored red, white or blue, sort them in-place
so that objects of the same color are adjacent, with the colors in the order
red, white and blue.
Here, we will use the integers 0, 1, and 2 to represent the color red, white,
and... | mit | -6,440,219,481,216,702,000 | 26.318182 | 78 | 0.526622 | false | 3.366947 | false | false | false |
dohko93/ML-PlayLikeChopin | lstm.py | 1 | 1452 | from keras.models import Sequential
from keras.layers import LSTM, Dense
import numpy as np
import os
import io
data_dim = 88
timesteps = 480*3
num_classes = 88
def convertTo88(str):
result = np.zeros(88)
for x in str:
index = ord(x) - 33
result[index] = 1
return result
# expected input ... | apache-2.0 | -6,702,626,407,536,795,000 | 26.415094 | 99 | 0.685262 | false | 3.27027 | false | false | false |
voidabhi/python-scripts | sse.py | 1 | 1349 | from gevent import monkey; monkey.patch_all()
from gevent import sleep
from bottle import get, post, request, response
from bottle import GeventServer, run
sse_test_page = """
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.3/jquery.min.js "><... | mit | 8,740,080,393,054,475,000 | 21.483333 | 91 | 0.63232 | false | 2.714286 | false | false | false |
honur/django-tenant-schemas | tenant_schemas/__init__.py | 7 | 1968 | import django
import warnings
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from tenant_schemas.utils import get_public_schema_name, get_tenant_model
recommended_config = """
Warning: You should put 'tenant_schemas' at the end of INSTALLED_APPS:
INSTALLED_APPS = TENANT_APPS ... | mit | -5,078,842,417,324,820,000 | 42.733333 | 82 | 0.715955 | false | 4.117155 | true | false | false |
pfalcon/fdroidserver | fdroidserver/metadata.py | 1 | 25830 | # -*- coding: utf-8 -*-
#
# common.py - part of the FDroid server tools
# Copyright (C) 2013, Ciaran Gultnieks, ciaran@ciarang.com
# Copyright (C) 2013 Daniel Martí <mvdan@mvdan.cc>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as ... | agpl-3.0 | -6,965,472,568,265,768,000 | 34.046133 | 119 | 0.526463 | false | 4.130657 | false | false | false |
gautam1858/tensorflow | tensorflow/python/kernel_tests/list_ops_test.py | 1 | 54659 | # 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 | -7,486,558,859,005,161,000 | 43.15105 | 80 | 0.636126 | false | 3.307855 | true | false | false |
al45tair/dmgbuild | dmgbuild/__main__.py | 1 | 1533 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
import sys
import argparse
from .core import build_dmg
def main():
parser = argparse.ArgumentParser(description='Construct a disk image file.')
parser.add_argument('volume_name', met... | mit | -8,560,319,893,972,761,000 | 35.5 | 135 | 0.593607 | false | 3.842105 | false | false | false |
h4ck3rm1k3/orca-sonar | src/orca/script_utilities.py | 1 | 100066 | # Orca
#
# Copyright 2010 Joanmarie Diggs.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library i... | lgpl-2.1 | -2,184,261,832,252,659,200 | 34.853099 | 92 | 0.54578 | false | 4.717424 | false | false | false |
dzamie/weasyl | weasyl/resetpassword.py | 1 | 5696 | # resetpassword.py
# -*- coding: utf-8 -*-
from sqlalchemy.exc import IntegrityError
from libweasyl import security
from weasyl import define as d
from weasyl import emailer
from weasyl.error import WeasylError
def checktoken(token):
return d.execute("SELECT EXISTS (SELECT 0 FROM forgotpassword WHERE token = '%... | apache-2.0 | 7,451,864,422,642,597,000 | 36.473684 | 112 | 0.664501 | false | 3.944598 | false | false | false |
arizvisa/syringe | template/image/targa.py | 1 | 1789 | import ptypes
from ptypes import *
ptypes.setbyteorder(ptypes.config.byteorder.littleendian)
class DataType(pint.enum, pint.uint8_t):
_values_ = [
('No image data included.', 0),
('Uncompressed, color-mapped images.', 1),
('Uncompressed, RGB images.', 2),
('Uncompressed, black and ... | bsd-2-clause | 4,639,384,570,909,315,000 | 28.327869 | 123 | 0.574064 | false | 3.200358 | false | false | false |
SportySpice/Collections | src/tools/dialog.py | 1 | 1040 | import xbmcgui
from src.tools.enum import enum
dialog = xbmcgui.Dialog()
def ok(heading, line1, line2=None, line3=None):
return dialog.ok(heading, line1, line2, line3)
def select(heading, stringList, autoclose=0):
return dialog.select(heading, stringList, autoclose)
BrowseType = enum (SHOW_AND_G... | gpl-2.0 | -6,879,799,786,103,967,000 | 28.742857 | 112 | 0.7 | false | 3.291139 | false | false | false |
ppy/angle | src/common/gen_uniform_type_table.py | 1 | 9660 | #!/usr/bin/python
# Copyright 2017 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# gen_uniform_type_table.py:
# Code generation for OpenGL uniform type info tables.
# NOTE: don't run this script directly. Run scr... | bsd-3-clause | 934,488,651,657,805,200 | 32.894737 | 251 | 0.635404 | false | 3.002798 | false | false | false |
DavidOStewart/ProjectEuler | 33.py | 1 | 1392 | #####
# Author : David Stewart
# Date : April 14, 2016
# Problem : https://projecteuler.net/problem=33
# Brief : There exist exactly four fractions of the form XY / ZX, YX / ZX, or XY / XZ such that removing the X digit preserves the answer. Find them, then find the lowest common denominator if they are m... | mit | 5,075,211,727,815,952,000 | 37.694444 | 226 | 0.556753 | false | 3.55102 | false | false | false |
ansp-2015/arquea | protocolo/templatetags/proto_tags.py | 1 | 18710 | # -*- coding: utf-8 -*-
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from django.template import Library
from django.core.urlresolvers import resolve
from django.uti... | mpl-2.0 | 5,696,787,810,466,521,000 | 37.430928 | 120 | 0.640968 | false | 2.945946 | false | false | false |
tudelft3d/prepair-qgis | ui_prepair.py | 1 | 7213 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_prepair.ui'
#
# Created: Fri May 30 19:41:47 2014
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Att... | gpl-3.0 | -8,066,516,687,249,276,000 | 53.643939 | 102 | 0.709691 | false | 4.025112 | false | false | false |
catseye/NaNoGenLab | selfref-timeline/selfref-timeline.py | 1 | 5746 | #!/usr/bin/env python
from optparse import OptionParser
import random
import sys
OPTIONS = None
SIGHTINGS = 0
NOUN_PHRASES = (
'a UFO', 'a bigfoot', 'a ghost', 'a black helicopter', 'a chupacabra',
'a Yeti', 'the Loch Ness monster', 'the Flying Dutchman', 'a vampire',
'a pixie', 'a zombie', 'a Chinese d... | unlicense | -5,792,182,792,944,041,000 | 26.758454 | 85 | 0.573442 | false | 3.564516 | false | false | false |
Royal-Society-of-New-Zealand/NZ-ORCID-Hub | orcid_api_v3/models/biography_v30_rc2.py | 1 | 6630 | # coding: utf-8
"""
ORCID Member
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: Latest
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import si... | mit | 7,840,249,250,077,733,000 | 28.730942 | 123 | 0.579638 | false | 3.850174 | false | false | false |
osuripple/pep.py | objects/channel.py | 1 | 1382 | import logging
from constants import exceptions
from objects import glob
class channel:
def __init__(self, name, description, publicRead, publicWrite, temp, hidden):
"""
Create a new chat channel object
:param name: channel name
:param description: channel description
:param publicRead: if True, this chan... | agpl-3.0 | 8,222,900,878,813,686,000 | 30.431818 | 112 | 0.734443 | false | 3.54359 | false | false | false |
rwl/PyCIM | CIM14/IEC61968/Assets/AssetFunction.py | 1 | 3054 | # Copyright (C) 2010-2011 Richard Lincoln
#
# 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, copy, modify, merge, publish... | mit | 2,316,946,353,876,544,000 | 37.658228 | 123 | 0.667649 | false | 4.325779 | true | false | false |
muk-it/muk_dms | muk_dms_attachment/tests/test_action.py | 1 | 1843 | ###################################################################################
#
# Copyright (c) 2017-2019 MuK IT GmbH.
#
# This file is part of MuK Documents Attachment
# (see https://mukit.at).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | lgpl-3.0 | 7,361,138,053,887,783,000 | 37.416667 | 83 | 0.639718 | false | 4.015251 | true | false | false |
f0rki/cb-multios | original-challenges/Minimalistic_Memo_Manager_3M/poller/for-release/machine.py | 1 | 7349 | #!/usr/bin/env python
from generator.actions import Actions, Variable
import random
import string
import struct
import sys
from collections import OrderedDict
MAX_MEMO_SUBJECT = 32
MAX_MEMO_BODY = 4096
MAX_MEMO_ID = 500
MAX_AC_LEN = 32
MAX_AC_LIST = 100
def random_string_n(size=20):
return ''.join([random.choice(s... | mit | 2,046,448,439,145,895,000 | 30.540773 | 95 | 0.552592 | false | 2.952591 | false | false | false |
samapriya/Clip-Ship-Planet-CLI | pclip/clip_json.py | 1 | 3909 | import requests,json,re,csv,os,subprocess,urllib2,getpass,time
from pprint import pprint
from os.path import expanduser
from urllib2 import Request, urlopen
from os.path import expanduser
from retrying import retry
from planet.api.utils import read_planet_json
os.chdir(os.path.dirname(os.path.realpath(__file__)))
plane... | apache-2.0 | 2,633,801,134,995,473,400 | 56.485294 | 156 | 0.568688 | false | 3.490179 | false | false | false |
mtunique/knows | server/handle_url.py | 1 | 5151 | __author__ = 'mt'
# -*- coding: utf-8 -*-
import time
import sys
import os
import tornado.web
from get_data import *
from handle_user import *
import knows_users as k_user
sys.path.append(os.path.join(os.path.abspath('..'), 'algorithm'))
from std_functions import cos
TAG_VECTOR = mongodb.db.tag_vector.find_one({}, {'... | gpl-2.0 | 2,497,468,118,217,438,700 | 31.764331 | 119 | 0.551624 | false | 3.606592 | false | false | false |
redshodan/cairn | src/python/cairn/sysdefs/linux/unknown/restore/bootloader/grub/MapDrives.py | 1 | 2383 | """linux.unknown.restore.bootloader.grub.MapDrives Module"""
import os.path
import cairn
def getClass():
return MapDrives()
class MapDrives(object):
def createDeviceMap(self, sysdef):
mdir = sysdef.info.get("env/mountdir")
mapFileName = os.path.join(mdir, "boot/grub/device.map")
mapFile = None
cairn.... | gpl-2.0 | -914,030,960,669,013,900 | 29.164557 | 77 | 0.660512 | false | 2.806832 | false | false | false |
caballerocsc/univ-polyclip | polygon.py | 2 | 12365 | # -*- coding: UTF-8 -*-
# Efficient Clipping of Arbitrary Polygons
#
# Copyright (c) 2011, 2012 Helder Correia <helder.mc@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 vers... | gpl-3.0 | -5,166,967,566,634,623,000 | 32.504065 | 109 | 0.559735 | false | 3.948579 | false | false | false |
JustAFakeName/ss | shadowsocks/tools/global_vars.py | 1 | 2901 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#global mysql_host,mysql_password,mysql_user,mysql_port,mysql_db
try:
import time,os,sys,datetime
except ImportError,e:
print "Hi,Boss..I catch a exception: ",e
print "Exit now"
sys.exit()
#---------------------------------------------------------
CURR_DAT... | apache-2.0 | -8,247,610,787,569,723,000 | 35.2625 | 98 | 0.648052 | false | 2.4175 | false | true | false |
Skytim/nccuTEG | alembic/versions/aee7291c81_rename_app_table_to_project.py | 8 | 3870 | """Rename app table to project
Revision ID: aee7291c81
Revises: 4e435ff8ba74
Create Date: 2015-03-02 12:29:05.534510
"""
# revision identifiers, used by Alembic.
revision = 'aee7291c81'
down_revision = '4e435ff8ba74'
from alembic import op
import sqlalchemy as sa
def upgrade():
# Rename table name
query =... | agpl-3.0 | -7,976,193,938,517,280,000 | 41.065217 | 102 | 0.710853 | false | 3.477089 | false | false | false |
richtier/imhotep | imhotep/http.py | 2 | 1264 | import json
import logging
import requests
from requests.auth import HTTPBasicAuth
log = logging.getLogger(__name__)
class NoGithubCredentials(Exception):
pass
class BasicAuthRequester(object):
"""
Object used for issuing authenticated API calls.
"""
def __init__(self, username, password):
... | mit | -5,101,596,139,315,144,000 | 25.333333 | 65 | 0.595728 | false | 4.090615 | false | false | false |
jamespeterschinner/async_v20 | async_v20/interface/order.py | 1 | 81903 | from .decorators import endpoint, shortcut
from ..definitions.types import ClientExtensions
from ..definitions.types import ClientID
from ..definitions.types import DateTime
from ..definitions.types import DecimalNumber
from ..definitions.types import InstrumentName
from ..definitions.types import LimitOrderRequest
fro... | mit | 3,353,493,764,452,441,000 | 54.602851 | 129 | 0.601639 | false | 4.611915 | false | false | false |
vigneras/sequencer | lib/sequencer/ise/rc.py | 2 | 2564 | # -*- coding: utf-8 -*-
###############################################################################
# Copyright (C) Bull S.A.S (2010, 2011)
# Contributor: Pierre Vignéras <pierre.vigneras@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Publ... | gpl-3.0 | 1,047,732,161,472,939,400 | 31.0375 | 79 | 0.618806 | false | 3.825373 | false | false | false |
54lihaoxin/leetcode_python | src/MergeSortedArray/solution.py | 1 | 1050 |
debug = True
debug = False
# from classes import ? # hxl: comment out this line for submission
class Solution:
# @param A a list of integers
# @param m an integer, length of A
# @param B a list of integers
# @param n an integer, length of B
# @return nothing
def ... | apache-2.0 | 5,015,237,006,678,915,000 | 22.465116 | 97 | 0.35619 | false | 4.038462 | false | false | false |
Shironofenny/BioEE_CamSys | src/pyqt5/python/Camera.py | 1 | 4639 | import cv2
import Constant
# Documentation from OpenCV's github on camera properties. The official documentation is outdated
# Python interface uses directly the id code
# CAP_PROP_POS_MSEC =0, //!< Current position of the video file in milliseconds.
# CAP_PROP_POS_FRAMES =1, //!< 0-based... | gpl-3.0 | -6,780,910,690,779,069,000 | 47.322917 | 155 | 0.616081 | false | 3.147218 | false | false | false |
edvakf/nbupload | nbupload/FileUploaderWidget.py | 1 | 2888 | from __future__ import print_function
from IPython.html import widgets
from IPython.utils.traitlets import Unicode
from IPython.display import clear_output
import binascii
import os, sys
class FileUploaderWidget(widgets.DOMWidget):
_view_name = Unicode('FileUploaderView', sync=True)
filename = Unicode(sync=Tru... | mit | 2,911,748,606,023,722,500 | 29.083333 | 82 | 0.543283 | false | 4.278519 | false | false | false |
ajaysaini725/spark | python/pyspark/ml/util.py | 16 | 17378 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 | 5,295,137,171,752,247,000 | 31.604128 | 100 | 0.627057 | false | 4.291924 | false | false | false |
alunny/commonplace.js | script/template.py | 1 | 1155 | # class for rendering templates
import re
# template helper functions
def print_all(seq,type):
fn = lambda(x,y): x
if type=="js": fn = script_tag
def formatted_concat(x,y): return x+fn(y,"root")
return reduce(formatted_concat,seq,"")
def script_tag(url, base):
tag_template = "<script src=\"{__src__}\" type=\"... | mit | -1,135,101,492,534,711,700 | 27.9 | 80 | 0.667532 | false | 3.039474 | false | false | false |
shaunvxc/multiprocessing-logging | multiprocessing_logging.py | 1 | 2510 | # vim : fileencoding=UTF-8 :
from __future__ import absolute_import, division, unicode_literals
import logging
import multiprocessing
import sys
import threading
import traceback
__version__ = '0.2.2'
def install_mp_handler(logger=None):
"""Wraps the handlers in the given Logger with an MultiProcessingHandler... | lgpl-3.0 | 2,509,222,804,203,685,000 | 26.582418 | 77 | 0.606375 | false | 4.350087 | false | false | false |
billma12/espn-ff | ff.py | 1 | 2448 | import requests
class League:
def __init__(self, league_id, year):
self.league_id = league_id
self.year = year
self.endpoint = "http://games.espn.com/ffl/api/v2/teams"
self.teams = [] # list of Team instances
self._fetch_league()
def _fetch_league(self):
"""re... | gpl-3.0 | 3,045,077,930,527,573,000 | 33.971429 | 84 | 0.548611 | false | 3.783617 | false | false | false |
Paybook/lite-python | utilities.py | 1 | 2376 | # -*- coding: utf-8 -*-
import logging
from logging.handlers import TimedRotatingFileHandler
from flask import json
from flask import make_response
import sys
import getopt
import os
def setup_logger(name):
project_path = os.path.abspath(os.path.join(os.path.dirname(__file__)))
file_name = name + '.log'
complete... | mit | -3,924,370,135,706,909,000 | 24.234043 | 136 | 0.682546 | false | 2.991173 | false | false | false |
loopCM/chromium | chrome/common/extensions/docs/server2/handler.py | 4 | 2300 | # Copyright (c) 2012 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 branch_utility import BranchUtility
from cron_servlet import CronServlet
from patch_servlet import PatchServlet
from instance_servlet import Instanc... | bsd-3-clause | 9,212,853,310,322,927,000 | 31.394366 | 74 | 0.654783 | false | 3.622047 | false | false | false |
zhonghualiu/FaST-LMM | fastlmm/util/genphen.py | 1 | 3540 | import scipy as sp
import pdb
import scipy.linalg as la
import fastlmm.util.util as utilx
import sys
def genphen(y_G0,G1,covDat,options,nInd,K1=None,fracCausal=None,randseed=None):
'''
Generate synthetic phenotype with a LMM and linear kernels, using SNPs in G1 for signal,
snps in GO for backgroun... | apache-2.0 | 3,568,651,920,336,892,400 | 37.333333 | 127 | 0.573446 | false | 3.299161 | false | false | false |
stvstnfrd/edx-platform | common/djangoapps/student/tests/test_admin_views.py | 1 | 21125 | # coding=UTF-8
"""
Tests student admin.py
"""
import datetime
import ddt
import pytest
import six
from django.conf import settings # lint-amnesty, pylint: disable=unused-import
from django.contrib.admin.sites import AdminSite
from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imported-auth... | agpl-3.0 | 4,467,757,380,485,620,000 | 38.671053 | 175 | 0.639848 | false | 4.085366 | true | false | false |
SEC-i/ecoControl | server/settings.py | 1 | 4803 | """
Django settings for server project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
imp... | mit | -1,566,674,896,001,250,300 | 25.39011 | 90 | 0.599625 | false | 3.571004 | true | false | false |
rsignell-usgs/notebook | ERDDAP/ooi_datasets_xml.py | 1 | 4951 |
# coding: utf-8
# # Create ERDDAP dataset.xml from NetCDF file
# Create an ERDDAP <dataset> snippet by reading a NetCDF CF-1.6 DSG **`featureType=TimeSeries`** file
# In[1]:
import numpy as np
import netCDF4
import uuid
import glob
import os
import string
from jinja2 import Environment, FileSystemLoader
env = Envir... | mit | 6,234,881,569,671,956,000 | 34.876812 | 287 | 0.591396 | false | 3.579899 | false | false | false |
ipsosante/holidays.py | tests.py | 1 | 111520 | # -*- coding: utf-8 -*-
# holidays.py
# -----------
# A fast, efficient Python library for generating country-specific sets of
# holidays on the fly. It aims to make determining whether a specific date is
# a holiday as fast and flexible as possible.
#
# Author: ryanss <ryanssdev@icloud.com>
# Website: https:/... | mit | 2,901,684,743,213,588,000 | 49.072744 | 79 | 0.553591 | false | 3.493484 | true | false | false |
limscoder/amfast | tests/subscription_test.py | 1 | 7612 | import time
import unittest
from amfast.remoting.subscription_manager import MemorySubscriptionManager
import amfast.remoting.flex_messages as messaging
class SubscriptionTestCase(unittest.TestCase):
class Connection(object):
def __init__(self, **kwargs):
for key, val in kwargs.iteritems():
... | mit | 3,762,939,299,987,279,400 | 31.391489 | 95 | 0.644246 | false | 4.125745 | true | false | false |
tooxie/shiva-server | shiva/http.py | 2 | 5656 | # -*- coding: utf-8 -*-
from math import ceil
import json
from flask import current_app as app, Response, request, g
from flask.ext import restful
from shiva.constants import HTTP
from shiva.decorators import allow_origins, allow_method
from shiva.utils import parse_bool, unpack
class JSONResponse(restful.Response)... | mit | -5,417,542,461,405,203,000 | 26.456311 | 78 | 0.569661 | false | 4.063218 | false | false | false |
eguven/mobai | mobai/engine/game.py | 1 | 7171 | import enum
import gzip
import pickle
from .base import Player
from .map import Map
class ActionType(enum.Enum):
target = 0
clear_target = 1
stop = 2
class Command(object):
'''a command received from a player
{'id': '<uuid>', 'action': '<action-type>.name', 'target': '<uuid>' | {'posx': X, 'pos... | mit | 1,373,972,195,089,832,400 | 35.035176 | 99 | 0.577046 | false | 4.088369 | false | false | false |
slauzinho/caixa.py | alerts.py | 1 | 3511 | from __future__ import print_function
from pushbullet import Pushbullet
from urllib import urlencode
from urllib2 import Request
from urllib2 import urlopen
from pushbullet.errors import InvalidKeyError
from json import loads
from config import PUSHBULLET
from config import NEXMO
def send_pb(text):
""... | gpl-3.0 | -3,849,730,903,855,407,600 | 26.778689 | 102 | 0.574195 | false | 4.003421 | false | false | false |
tangrs/synthesiavid2midi | keyboardScanner.py | 1 | 8771 | # synthesiavid2midi
# Copyright (C) 2012 Daniel Tang
#
# 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... | gpl-3.0 | 1,943,345,847,789,011,000 | 36.643777 | 126 | 0.536313 | false | 3.741894 | false | false | false |
whancock/pysoccer | Ball.py | 2 | 4258 | '''
(c) 2015 Georgia Tech Research Corporation
This source code is released under the New BSD license. Please see the LICENSE.txt file included with this software for more information
authors: Arindam Bose (arindam.1993@gmail.com), Tucker Balch (trbalch@gmail.com)
'''
import numpy as np
from numpy.linalg.linalg imp... | bsd-3-clause | 946,453,005,163,710,000 | 38.073394 | 137 | 0.565993 | false | 3.957249 | false | false | false |
dmitriz/zipline | tests/test_history.py | 2 | 52137 | #
# Copyright 2014 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | apache-2.0 | -9,033,613,132,480,489,000 | 29.868561 | 79 | 0.550108 | false | 3.660535 | true | false | false |
novoid/tstest | tagstore-src/tsgui/syncdialog.py | 1 | 16691 | # -*- coding: utf-8 -*-
## this file is part of tagstore, an alternative way of storing and retrieving information
## Copyright (C) 2010 Karl Voit, Christoph Friedl, Wolfgang Wintersteller, Johannes Anderwald
##
## This program is free software; you can redistribute it and/or modify it under the terms
## of the... | gpl-3.0 | 7,819,355,657,844,875,000 | 39.83208 | 179 | 0.586783 | false | 4.273169 | false | false | false |
expfactory/expfactory-docker | expdj/apps/turk/urls.py | 2 | 2338 | from django.conf.urls import url
from django.views.generic.base import TemplateView
from expdj.apps.experiments.views import sync
from expdj.apps.turk.api_views import BatteryResultAPIList
from expdj.apps.turk.views import (clone_hit, contact_worker, delete_hit,
edit_hit, end_assignm... | mit | 1,291,541,412,812,508,400 | 33.895522 | 80 | 0.514115 | false | 2.918851 | false | true | false |
AhmadHamzeei/Amir-Accounting | amir/payments.py | 1 | 26169 | import sys
import os
from datetime import date
import gobject
import pygtk
import gtk
from sqlalchemy.sql import and_
from sqlalchemy.orm.util import outerjoin
import numberentry
import decimalentry
import dateentry
import subjects
import utility
import bankaccountsui
import customers
import class_bankaccounts
from... | gpl-3.0 | -3,249,277,060,620,698,600 | 32.987013 | 115 | 0.682028 | false | 2.888729 | false | false | false |
ilastik/ilastik-0.5 | ilastik/gui/exportDialog.py | 1 | 5043 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 2010 C Sommer, C Straehle, U Koethe, FA Hamprecht. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are
# permitted provided that the following conditions are met:
#
# 1. Redistribu... | bsd-2-clause | -5,398,560,718,998,325,000 | 43.236842 | 114 | 0.629387 | false | 4.354922 | false | false | false |
madongfly/grpc | src/python/grpcio_test/grpc_test/framework/interfaces/face/_invocation.py | 18 | 7178 | # Copyright 2015, Google 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 and the f... | bsd-3-clause | 1,438,538,652,398,082,800 | 32.699531 | 79 | 0.730844 | false | 3.933151 | false | false | false |
BleekerLab/Solanum_sRNAs | scripts/ShortStack_data_concat.py | 1 | 2135 | import pandas as pd
import os, sys
import glob
# Change to the directory with your shortstack output
os.chdir('/Users/michelle/surfdrive/Shared/trichome_team/06.results_from_xp/sRNA-Seq/20170117_srnadesc/shortstack')
# here I would add a line to get the accession names. I am careful with wildcards since they don't ... | mit | 7,016,307,860,514,918,000 | 47.522727 | 160 | 0.737705 | false | 2.99439 | false | false | false |
dnikulin/ppk | python/ppk/bitio.py | 1 | 4146 | # Copyright (c) 2010 Dmitri Nikulin
# See LICENSE-MIT.txt for details
# Part of the PPK project
'''
Convenience classes for bit stream encoding/decoding.
'''
__all__ = ['BitReader', 'BitWriter', 'mask', 'read0', 'write0']
class BitReader(object):
'''Bit stream reader.'''
def __init__(self, getbyte):
... | mit | -188,029,881,123,889,060 | 25.075472 | 87 | 0.519778 | false | 4.265432 | false | false | false |
HarrieO/PairwisePreferenceMultileave | multileaving/PairwisePreferenceMultileave.py | 1 | 3860 | # -*- coding: utf-8 -*-
import numpy as np
class PairwisePreferenceMultileave(object):
def __init__(self, num_data_features, k=10):
self._name = 'Pairwise Preferences Multileave'
self._k = k
self.needs_inverted = True
self.needs_descending = True
self.needs_oracle = False... | mit | -1,107,543,955,873,837,700 | 41.417582 | 132 | 0.600518 | false | 3.304795 | false | false | false |
joanma100/agora-ciudadana | agora_site/agora_core/tests/search.py | 4 | 1024 | from common import (HTTP_OK,
HTTP_CREATED,
HTTP_ACCEPTED,
HTTP_NO_CONTENT,
HTTP_BAD_REQUEST,
HTTP_FORBIDDEN,
HTTP_NOT_FOUND,
HTTP_METHOD_NOT_ALLOWED)
from common import RootTestCa... | agpl-3.0 | -698,159,304,613,474,400 | 31 | 80 | 0.580078 | false | 4.047431 | false | false | false |
jswanljung/CliMT | lib/climt_lite/io.py | 5 | 8679 | import os
from numpy import *
from __version__ import __version__
import time
if 'climt_lite' in __file__:
Lite = True
else:
Lite = False
try:
from netCDF4 import Dataset as open_file
gotNetCDF = True
NetCDFInterface = 'netCDF4'
except:
gotNetCDF = False
if not gotNetCDF:
try:
fro... | bsd-3-clause | 1,141,689,153,744,436,700 | 34.137652 | 99 | 0.563775 | false | 4.082314 | false | false | false |
mostaphaRoudsari/Honeybee | src/Honeybee_Thermally Bridged EP Construction.py | 1 | 10105 | #
# Honeybee: A Plugin for Environmental Analysis (GPL) started by Mostapha Sadeghipour Roudsari
#
# This file is part of Honeybee.
#
# Copyright (c) 2013-2020, Chris Mackey <Chris@MackeyArchitecture.com.com>
# Honeybee is free software; you can redistribute it and/or modify
# it under the terms of the GNU General ... | gpl-3.0 | 1,587,692,026,199,644,400 | 48.534314 | 301 | 0.696289 | false | 3.630974 | false | false | false |
okwow123/djangol2 | example/env/lib/python2.7/site-packages/allauth/socialaccount/providers/shopify/tests.py | 2 | 5617 | import json
from django.test.utils import override_settings
from allauth.compat import parse_qs, reverse, urlparse
from allauth.socialaccount.models import SocialAccount
from allauth.socialaccount.providers import registry
from allauth.socialaccount.tests import create_oauth2_tests
from allauth.tests import MockedRes... | mit | -8,404,324,674,841,211,000 | 38.556338 | 79 | 0.569521 | false | 4.055596 | true | false | false |
Anaethelion/Geotrek | geotrek/tourism/migrations/0003_auto__change_field_datasource_targets.py | 3 | 1436 | # -*- coding: utf-8 -*-
from south.db import db
from south.v2 import SchemaMigration
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'DataSource.targets'
db.alter_column('t_t_source_donnees', 'targets', self.gf('multiselectfield.db.fields.MultiSelectField')(max_length... | bsd-2-clause | -3,815,313,765,974,471,000 | 48.517241 | 139 | 0.594011 | false | 3.386792 | false | false | false |
r-duisters/plp | lib/cdp.py | 1 | 3424 | #!/usr/bin/python
import re
import string
class CDP():
def __init__(self, logging, db, pcap_name):
self.logger = logging
self.db = db
self.pcap_name = pcap_name
def process_packet(self, p):
src_mac = p.src
ip_addr = ""
software_version = ""
port_id =... | gpl-3.0 | -1,748,436,012,639,972,900 | 40.253012 | 187 | 0.49007 | false | 3.685684 | false | false | false |
pliniopereira/ccd10 | src/ui/ephemerisShooterWindow/ephemerisShooterWindow.py | 1 | 1035 | from PyQt5 import QtWidgets
from src.controller.camera import Camera
class EphemerisShooterWindow(QtWidgets.QWidget):
"""
cria o modo automatico no item connection no Toolbar
"""
def __init__(self, parent=None):
super(EphemerisShooterWindow, self).__init__(parent)
self.cam = Camera()
... | gpl-3.0 | 3,068,528,877,247,716,400 | 32.387097 | 81 | 0.680193 | false | 3.508475 | false | false | false |
texastribune/scuole | scuole/campuses/management/commands/bootstrapcampuses.py | 1 | 6870 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import csv
import json
import os
import string
from django.conf import settings
from django.contrib.gis.geos import GEOSGeometry
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Count
from s... | mit | -5,458,049,631,191,871,000 | 29.131579 | 82 | 0.547453 | false | 3.664 | false | false | false |
Mastermindzh/han4pi | python/games/pong/speler.py | 1 | 2372 | import pygame, sys, potmeter
class Speler(pygame.sprite.Sprite):
def __init__(speler, spelernummer, scherm, kant):
pygame.sprite.Sprite.__init__(speler) # initialiseer de sprite
speler.image, speler.rect = scherm.laad_afbeelding('padje.png') # gebruik de methode laad_afbeelding... | mit | 9,201,867,306,592,017,000 | 63.108108 | 167 | 0.661889 | false | 2.939281 | false | false | false |
jamesdsmith/pymips | utils.py | 1 | 1724 | import os
from exceptions import duplicate_label_found, multiple_label_definitions, label_not_found, address_not_found
def write_inst_hex(output, instruction):
output += ["{:08x}".format(instruction)]
def write_file_from_list(filename, string_list):
with open(filename, 'w') as f:
for line in string_li... | bsd-3-clause | -8,542,502,562,655,222,000 | 26.806452 | 108 | 0.552204 | false | 3.874157 | false | false | false |
Azure/azure-sdk-for-python | sdk/cognitiveservices/azure-cognitiveservices-personalizer/azure/cognitiveservices/personalizer/models/rank_response.py | 1 | 1879 | # 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 | -5,013,987,301,976,835,000 | 37.346939 | 79 | 0.609899 | false | 4.260771 | false | false | false |
jorisvandenbossche/numpy | numpy/random/tests/test_extending.py | 1 | 1410 | import os, sys
import pytest
import warnings
try:
import cffi
except ImportError:
cffi = None
if sys.flags.optimize > 1:
# no docstrings present to inspect when PYTHONOPTIMIZE/Py_OptimizeFlag > 1
# cffi cannot succeed
cffi = None
try:
with warnings.catch_warnings(record=True) as w:
# ... | bsd-3-clause | -472,409,042,631,956,600 | 26.647059 | 78 | 0.651773 | false | 3.873626 | true | false | false |
mdrasmus/compbio | rasmus/htmltable.py | 2 | 2959 |
from rasmus import util
def format_link(linkfunc):
"""make a format function from a link function that takes a cell's item
and returns the link url and text"""
def func(item):
url, text = linkfunc(item)
return '<a href="%s">%s</a>' % (url, text)
return func
class HtmlTable (obje... | mit | 8,323,986,183,629,723,000 | 29.505155 | 114 | 0.510308 | false | 4.036835 | false | false | false |
jefftranter/udis | 8051.py | 1 | 15401 | ##########################################################################
#
# Processor specific code
# CPU = "8051"
# Description = "Intel 8051 8-bit microprocessor."
# DataWidth = 8 # 8-bit data
# AddressWidth = 16 # 16-bit addresses
# Maximum length of an instruction (for formatting purposes)
maxLength = 3
# L... | apache-2.0 | 338,091,337,937,433,200 | 36.655257 | 74 | 0.328031 | false | 2.134581 | false | false | false |
EricssonResearch/calvin-base | calvin/utilities/code_signer.py | 1 | 9271 | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# 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 ... | apache-2.0 | -8,767,366,248,615,365,000 | 36.383065 | 107 | 0.577823 | false | 4.308086 | false | false | false |
PinguinoIDE/pinguino-ide | pinguino/qtgui/ide/tools/stdout.py | 1 | 1449 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import os
import codecs
from datetime import datetime
from PySide2 import QtGui
from ..methods.decorators import Decorator
########################################################################
class Stdout(object):
""""""
#------------------------------------... | gpl-2.0 | -624,119,815,151,053,700 | 33.5 | 96 | 0.572119 | false | 3.991736 | false | false | false |
certik/sympy-oldcore | sympy/plotting/pyglet/window/__init__.py | 1 | 54133 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2007 Alex Holkner
# 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 | -5,498,202,773,533,715,000 | 34.450557 | 81 | 0.603828 | false | 4.585211 | true | false | false |
pwwang/bioprocs | bioprocs/scripts/tcga/pGtFiles2Mat.py | 1 | 1594 | from os import path
from bioprocs.utils import logger
infiles = {{i.infiles | repr}}
outfile = {{o.outfile | quote}}
rsmap = {{args.rsmap | : None if not a else a | repr}}
fn2sam = {{args.fn2sample}}
confcut = {{args.confcut | repr}}
def readone(infile, getsnps = True, progress = ''):
logger.info('Reading ' + pro... | mit | -4,717,680,661,413,477,000 | 27.464286 | 85 | 0.619824 | false | 2.566828 | false | false | false |
jhgg/graphene | tests/starwars_relay/data.py | 1 | 1623 | from collections import namedtuple
Ship = namedtuple('Ship', ['id', 'name'])
Faction = namedtuple('Faction', ['id', 'name', 'ships'])
xwing = Ship(
id='1',
name='X-Wing',
)
ywing = Ship(
id='2',
name='Y-Wing',
)
awing = Ship(
id='3',
name='A-Wing',
)
# Yeah, technically it's Corellian. But ... | mit | 6,739,570,995,849,261,000 | 14.911765 | 77 | 0.54159 | false | 2.714047 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.