repo_name stringlengths 5 92 | path stringlengths 4 221 | copies stringclasses 19
values | size stringlengths 4 6 | content stringlengths 766 896k | license stringclasses 15
values | hash int64 -9,223,277,421,539,062,000 9,223,102,107B | line_mean float64 6.51 99.9 | line_max int64 32 997 | alpha_frac float64 0.25 0.96 | autogenerated bool 1
class | ratio float64 1.5 13.6 | config_test bool 2
classes | has_no_keywords bool 2
classes | few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mobb-io/django-erp | djangoerp/notifications/managers.py | 1 | 3927 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
"""This file is part of the django ERP project.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND ... | mit | 3,655,872,889,356,209,700 | 34.378378 | 105 | 0.661828 | false | 4.120672 | false | false | false |
BurningPixel/LispyCalculator | parser.py | 1 | 3787 | from functools import reduce
class Parser(object):
"""
General Notes:
Why Floats?:
I'm using floats here because I can remove a '.0'
but can't add a '.$whatever', after the calculation.
"""
def __init__(self, given_calc_code):
self.given_calc_code = given_c... | bsd-2-clause | 8,088,886,024,927,916,000 | 25.305556 | 93 | 0.443887 | false | 3.832996 | false | false | false |
adampresley/trackathon | app/controllers/home.py | 1 | 1101 | from bottle import view, route, request, response
from model.model import *
@route("/")
@view("home")
def home():
viewData = {}
return viewData
@route("/api/ideas", method="GET")
def api_listIdeas():
ideas = Idea.query.all()
result = [idea.toDict() for idea in ideas]
return result
@route("/api/idea", method="... | mit | 4,791,848,767,354,680,000 | 20.173077 | 79 | 0.675749 | false | 2.936 | false | false | false |
climapulse/dj-bgfiles | bgfiles/http.py | 1 | 2125 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function, division, absolute_import
from django.utils.encoding import force_bytes, force_text
from django.utils.http import urlquote
import unicodedata
def create_content_disposition(filename, attachment=True):
"""Create the Content-Dispositio... | bsd-3-clause | -4,337,149,917,805,613,600 | 36.280702 | 105 | 0.654588 | false | 4.199605 | false | false | false |
glenngillen/dotfiles | .vscode/extensions/ms-python.python-2021.5.842923320/pythonFiles/lib/python/debugpy/_vendored/_util.py | 1 | 1985 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
from __future__ import absolute_import, division, print_function, unicode_literals
import contextlib
import os
@contextlib.contextmanager
def cwd(dirnam... | mit | -7,952,962,982,748,197,000 | 30.540984 | 82 | 0.623174 | false | 4.196617 | false | false | false |
uliss/quneiform | tests/py/lpod/paragraph.py | 1 | 14598 | # -*- coding: UTF-8 -*-
#
# Copyright (c) 2009 Ars Aperta, Itaapy, Pierlis, Talend.
#
# Authors: David Versmisse <david.versmisse@itaapy.com>
# Hervé Cauwelier <herve@itaapy.com>
# Romain Gauthier <romain@itaapy.com>
#
# This file is part of Lpod (see: http://lpod-project.org).
# Lpod is free software... | gpl-3.0 | -793,280,292,552,058,200 | 34.864865 | 77 | 0.529972 | false | 4.513605 | false | false | false |
aileisun/bubbleimg | bubbleimg/filters/getllambda.py | 1 | 1909 | # getllambda.py
# ALS 2016/12/05
"""
Get wavelength of line in AA (in vacuum by default). The data is read from file linelist.txt.
"""
import numpy as np
import re
import astropy.table as at
from PyAstronomy import pyasl
from . import filtertools
def getllambda(ion='OIII', lid=0, vacuum=True):
"""
PURPOS... | mit | -3,167,229,642,856,302,000 | 26.271429 | 111 | 0.591933 | false | 3.396797 | false | false | false |
dashimaki360/turtle_war | scripts/abstractBot.py | 1 | 2087 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import rospy
from abc import ABCMeta, abstractmethod
from geometry_msgs.msg import Twist
from kobuki_msgs.msg import BumperEvent
from gazebo_msgs.msg import ModelStates
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
import cv2
class Abstr... | mit | 7,514,601,076,950,278,000 | 27.202703 | 106 | 0.588884 | false | 3.836397 | false | false | false |
SnowRomance/CMDB | app/migrations/0005_auto_20161228_1007.py | 1 | 1083 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-12-28 02:07
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0004_auto_20161227_1717'),
]
operations = [
migration... | gpl-3.0 | 2,281,396,350,659,687,700 | 33.935484 | 136 | 0.581717 | false | 3.760417 | false | false | false |
seecloud/ceagle | tests/unit/test_cmd.py | 1 | 1156 | # Copyright 2016: Mirantis 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 b... | apache-2.0 | -1,091,732,237,166,051,200 | 34.030303 | 78 | 0.681661 | false | 3.578947 | true | false | false |
leivaburto/stem | stem/interpreter/commands.py | 1 | 11489 | # Copyright 2014-2015, Damian Johnson and The Tor Project
# See LICENSE for licensing information
"""
Handles making requests and formatting the responses.
"""
import code
import socket
import stem
import stem.control
import stem.descriptor.remote
import stem.interpreter.help
import stem.util.connection
import stem.... | lgpl-3.0 | 269,877,546,550,135,360 | 31.454802 | 124 | 0.654278 | false | 3.933242 | false | false | false |
jasonbunk/BunkNeuralNets | layer_conv.py | 1 | 12441 | '''Copyright (c) 2015 Jason Bunk
Covered by LICENSE.txt, which contains the "MIT License (Expat)".
'''
import numpy as np
import activations
import costfuncs
import cython_convolution
class convlayer(object):
# inshape == (nsamples-per-batch, nchannels-in, im-dimensions...)
# filtshape == (nchannels-out, nchannels... | mit | 8,917,722,690,043,989,000 | 43.591398 | 232 | 0.666506 | false | 2.974892 | false | false | false |
yinzishao/YPro | share/share3.py | 1 | 4409 | def get_fileinf(file):
documentName = file.name
isFiles =2 #默认普通文件
fileType=05 #文件类型,默认OTHER
postfix = documentName.split(".")[-1]
for i,v in enumerate(types):
if postfix.lower() in v:
fileType = i+1
break
#调用云查看链接
file_url =file.absolute_url(request)
ur... | gpl-2.0 | 7,919,961,506,551,584,000 | 25.212903 | 80 | 0.601526 | false | 2.827418 | false | false | false |
Unidata/siphon | siphon/ncss_dataset.py | 1 | 14039 | # Copyright (c) 2013-2015 Siphon Contributors.
# Distributed under the terms of the BSD 3-Clause License.
# SPDX-License-Identifier: BSD-3-Clause
"""Support reading and parsing the dataset.xml documents from the netCDF Subset Service."""
from __future__ import print_function
import logging
import re
import numpy as ... | bsd-3-clause | -1,927,453,648,561,803,800 | 31.955399 | 91 | 0.554384 | false | 4.392678 | false | false | false |
akx/shoop | shoop/simple_cms/admin_module/views.py | 1 | 5423 | # This file is part of Shoop.
#
# Copyright (c) 2012-2016, Shoop Ltd. All rights reserved.
#
# This source code is licensed under the AGPLv3 license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from dja... | agpl-3.0 | -1,292,308,328,326,264,800 | 36.143836 | 117 | 0.59764 | false | 4.303968 | false | false | false |
google/starthinker | dags/dv360_api_insert_from_bigquery_dag.py | 1 | 3986 | ###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... | apache-2.0 | 7,627,536,034,618,030,000 | 28.746269 | 87 | 0.54014 | false | 4.281418 | false | false | false |
AmandaCMS/amanda-cms | amanda/articles/migrations/0016_auto__del_field_article_content_list.py | 1 | 7821 | # -*- 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 'Article.content_list'
db.delete_column(u'articles_artic... | mit | -8,965,940,096,096,964,000 | 76.445545 | 194 | 0.553254 | false | 3.612471 | false | false | false |
DavidNorman/tensorflow | tensorflow/python/eager/core_test.py | 1 | 37342 | # Copyright 2017 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,337,685,457,674,256,000 | 33.543941 | 115 | 0.624016 | false | 3.517189 | true | false | false |
omaraboumrad/mastool | mastool/test.py | 1 | 3324 | """mastool test module"""
import ast
import collections
import os
from mastool import practices
Fixture = collections.namedtuple('Fixture', 'practice finds ignores')
ALL_FIXTURES = [
Fixture(
practice=practices.find_for_x_in_y_keys,
finds=['for_in_y_keys.py'],
ignores=['for_in_y.py']
... | apache-2.0 | -7,207,463,157,093,396,000 | 24.569231 | 78 | 0.577617 | false | 3.6013 | false | false | false |
escapewindow/signingscript | src/signingscript/vendored/mozbuild/mozbuild/compilation/database.py | 2 | 6931 | # 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/.
# This modules provides functionality for dealing with code completion.
from __future__ import absolute_import, print_f... | mpl-2.0 | -756,210,101,431,987,000 | 34.362245 | 96 | 0.550426 | false | 4.02731 | false | false | false |
gstsistemas/passwall | telas/collect.py | 1 | 5170 | # -*- coding: utf-8 -*-
from kivy.uix.screenmanager import Screen
#from kivy.lang import Builder
from models.senhas import Senha, Collection
from kivy.uix.button import Button
from kivy.uix.gridlayout import GridLayout
from telas.utilities import Confirma, JanelaSettings
import sys
class JanelaCollect (Screen):
... | gpl-2.0 | 1,587,664,183,274,672,400 | 33.019737 | 91 | 0.615861 | false | 3.41029 | false | false | false |
robotframework/DbBot | examples/failbot/failbot/html_writer.py | 1 | 2345 | import os
from string import Template
from xml.sax.saxutils import escape
from dbbot import Logger
class HtmlWriter(object):
template_path = os.path.abspath(__file__ + '../../../templates')
# escape() only takes care of &, < and >
additional_html_escapes = {
'"': """,
"'": "'"
... | apache-2.0 | -8,517,836,069,135,902,000 | 32.985507 | 75 | 0.602132 | false | 3.722222 | false | false | false |
liushuizijin/vastio | Algorithm/Fire/fire_risk/risk_train.py | 1 | 2796 | """
消防单位火灾风险预测
"""
import sys
import fire_risk.data_utils as fr
import sklearn.linear_model as lm
from sklearn.externals import joblib
# 读入配置参数
file_train_path, _, model_path, deadline, _, _ = fr.read_config(sys.argv[1])
# 导入数据
fire_data = fr.data_input_from_file(file_train_path)
# 对数据进行转换
fire_data = fr.DataTransla... | apache-2.0 | -6,975,590,051,169,167,000 | 59.772727 | 120 | 0.534405 | false | 2.241408 | false | true | false |
davidedmundson/telepathy-hangups | telepathy/_generated/Channel_Interface_SASL_Authentication.py | 1 | 8524 | # -*- coding: utf-8 -*-
# Generated from the Telepathy spec
""" Copyright © 2010 Collabora Limited
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 (a... | lgpl-2.1 | 1,913,757,949,955,048,700 | 41.193069 | 128 | 0.679066 | false | 4.844798 | false | false | false |
KillersDeath/PyCrawler | spiders/deppre/fetch.py | 1 | 6136 | # -*- coding:utf-8 -*-
"""
抓取主逻辑,分三个进程:解析三级目录,抓取种子,解析详情
@version: 1.0
@author: kevin
@license: Apache Licence
@contact: liujiezhang@bupt.edu.cn
@site:
@software: PyCharm Community Edition
@file: fetch.py
@time: 16/11/26 下午5:21
"""
import sys
import getopt
# from dataBase.mysql import M
from mysql import M
from detail... | apache-2.0 | 5,767,791,469,894,340,000 | 26.266667 | 152 | 0.555711 | false | 2.965303 | false | false | false |
tsh/Rosalind-solutions-python | algorithmic-heights/bfs.py | 1 | 1414 | """
The task is to use breadth-first search to compute single-source shortest distances in an unweighted directed graph.
Given: A simple directed graph with n≤103 vertices in the edge list format.
Return: An array D[1..n] where D[i] is the length of a shortest path from the vertex 1 to the vertex i (D[1]=0).
If i is n... | gpl-3.0 | -2,970,676,157,567,038,000 | 28.375 | 116 | 0.586525 | false | 3.389423 | false | false | false |
glederrey/camogen | camogen/helpers.py | 1 | 10145 | #! /usr/bin/env python
# coding=utf-8
#
# Copyright © 2017 Gael Lederrey <gael.lederrey@epfl.ch>
#
# Distributed under terms of the MIT license.
#
# Based on the code of Ulf Astrom (http://www.happyponyland.net)
from camogen.vertex import *
import numpy as np
def distort():
"""
:return: random value between... | mit | -5,396,153,192,595,316,000 | 30.116564 | 120 | 0.589314 | false | 3.465665 | false | false | false |
Neui/MCEdit-Unified | albow/table_view.py | 1 | 5655 | #
# Albow - Table View
#
#-# Modified by D.C.-G. for translation purpose
from pygame import Rect
from layout import Column
from palette_view import PaletteView
from utils import blit_in_rect
from translate import _
class TableView(Column):
columns = []
header_font = None
header_fg_color = None
header_... | isc | -8,208,429,836,802,886,000 | 30.243094 | 83 | 0.574005 | false | 3.627325 | false | false | false |
poppogbr/genropy | packages/showcase/webpages/webpage_elements/widgets/editing/grids.py | 1 | 1773 | #!/usr/bin/env pythonw
# -*- coding: UTF-8 -*-
#
# untitled
#
# Created by Giovanni Porcari on 2007-03-24.
# Copyright (c) 2007 Softwell. All rights reserved.
#
""" GnrDojo Grid Test"""
from gnr.core.gnrbag import Bag
class GnrCustomWebPage(object):
def main(self, root, **kwargs):
bc = root.borderCont... | lgpl-2.1 | -7,670,070,991,870,698,000 | 37.543478 | 98 | 0.591089 | false | 3.370722 | false | false | false |
baoboa/Crystal-Space | scripts/blender/io_scene_cs/io/object.py | 1 | 27255 | import bpy
from mathutils import *
from .util import *
from .transform import *
from .renderbuffer import *
from .morphtarget import *
from .material import *
from io_scene_cs.utilities import B2CS
class Hierarchy:
OBJECTS = {}
exportedFactories = []
def __init__(self, anObject, anEmpty):
self.object = anO... | lgpl-2.1 | 2,597,069,485,716,116,000 | 36.284542 | 117 | 0.630416 | false | 3.675162 | false | false | false |
jubatus/jubatus-python-client | jubatus/common/types.py | 1 | 4998 | from .compat import int_types, string_types, binary_types
def check_type(value, typ):
if not isinstance(value, typ):
raise TypeError('type %s is expected, but %s is given' % (typ, type(value)))
def check_types(value, types):
if isinstance(value, types):
return
t = ', '.join([str(t) for t i... | mit | 1,280,570,525,719,842,600 | 25.870968 | 110 | 0.545418 | false | 3.327563 | false | false | false |
nilouco/dpAutoRigSystem | dpAutoRigSystem/Controls/dpClipStraight.py | 1 | 2952 | # importing libraries:
import maya.cmds as cmds
import dpBaseControlClass as BaseControl
reload(BaseControl)
# global variables to this module:
CLASS_NAME = "ClipStraight"
TITLE = "m109_clipStraight"
DESCRIPTION = "m099_cvControlDesc"
ICON = "/Icons/dp_clipStraight.png"
dpClipStraightVersion = 1.1
class ClipStra... | gpl-2.0 | -3,002,721,589,767,636,500 | 51.732143 | 159 | 0.538279 | false | 2.720737 | false | false | false |
btidor/django-serverauth | serverauth/backends.py | 1 | 2888 | from __future__ import unicode_literals
from django.conf import settings
from django.contrib.auth import get_user_model
from django.contrib.auth.backends import ModelBackend
from django.contrib.auth.models import Permission
class ServerAuthBackend(ModelBackend):
"""
This backend is to be used in conjunction w... | mit | -8,094,277,368,780,972,000 | 37.506667 | 79 | 0.644391 | false | 4.66559 | false | false | false |
Limafer/game | game/game.py | 1 | 3645 | #! /usr/bin/env python
import pygame
from pygame.locals import *
from sys import exit
from random import randrange
pygame.init()
pygame.font.init()
pygame.mixer.pre_init(44100, 32, 2, 4096)
font_name = pygame.font.get_default_font()
game_font = pygame.font.SysFont(font_name, 72)
screen = pygame.display.set_mode((956... | gpl-2.0 | -1,329,957,868,505,982,500 | 23.802721 | 76 | 0.575034 | false | 3.403361 | false | false | false |
AutorestCI/azure-sdk-for-python | azure-mgmt-network/azure/mgmt/network/v2017_09_01/models/next_hop_result.py | 1 | 1760 | # 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 | -3,392,545,748,422,380,500 | 40.904762 | 90 | 0.623295 | false | 3.963964 | false | false | false |
isque03/pyslicer | readStl.py | 1 | 109129 | #!/usr/bin/env pypy
import sys
from datetime import datetime
from clipper import *
from timer import Timer
# import resource
from multiprocessing.dummy import Pool
from functools import partial
import math
import traceback
import threading
import logging
from operator import itemgetter, attrgetter
from copy import c... | mit | 6,765,124,354,233,065,000 | 38.799052 | 162 | 0.547664 | false | 3.902621 | true | false | false |
kret0s/gnuhealth-live | tryton/server/trytond-3.8.3/trytond/modules/sale_stock_quantity/setup.py | 1 | 4009 | #!/usr/bin/env python
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
from setuptools import setup
import re
import os
import ConfigParser
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).r... | gpl-3.0 | -6,933,666,403,461,919,000 | 33.560345 | 74 | 0.626091 | false | 3.579464 | true | false | false |
mgiustiniani/httpdomain | sphinxcontrib/httpdomain.py | 1 | 16945 | """
sphinxcontrib.httpdomain
~~~~~~~~~~~~~~~~~~~~~~~~
The HTTP domain for documenting RESTful HTTP APIs.
:copyright: Copyright 2011 by Hong Minhee
:license: BSD, see LICENSE for details.
"""
import re
from docutils import nodes
from docutils.parsers.rst.roles import set_classes
from pygments.l... | bsd-2-clause | 7,403,416,321,039,101,000 | 31.092803 | 93 | 0.56406 | false | 3.729093 | false | false | false |
hebrinkmann/lights | leuchtturm.py | 1 | 1357 | import bibliopixel.colors as colors
#Load driver for your hardware, visualizer just for example
import time
from bibliopixel.animation import BaseMatrixAnim
class Leuchtturm(BaseMatrixAnim):
def __init__(self, led, start=0, end=-1, period = 20):
#The base class MUST be initialized by calling super like thi... | mit | 2,326,568,015,324,156,400 | 37.771429 | 90 | 0.619013 | false | 3.571053 | false | false | false |
XertroV/bitcoin-nulldata | qa/rpc-tests/wallet-hd.py | 1 | 3260 | #!/usr/bin/env python3
# Copyright (c) 2016 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 Hierarchical Deterministic wallet function."""
from test_framework.test_framework import BitcoinTestFr... | mit | -754,420,485,830,275,800 | 36.045455 | 91 | 0.612577 | false | 3.336745 | true | false | false |
hagne/atm-py | atmPy/aerosols/instruments/miniSASP/miniSASP.py | 1 | 45927 | # -*- coding: utf-8 -*-
"""
Created on Thu Mar 19 21:23:22 2015
@author: htelg
"""
import warnings
import numpy as np
import pandas as pd
import pylab as plt
from scipy import stats
from atmPy.tools import array_tools, plt_tools
from atmPy.tools import math_linear_algebra as mla
# from scipy import integrate
from ... | mit | 6,611,355,322,641,861,000 | 41.096242 | 184 | 0.580508 | false | 3.459922 | false | false | false |
project-oak/hafnium-verification | experiments/ownership-inference/infer/infer/lib/python/inferlib/capture/gradle.py | 1 | 8338 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import itertools
import logging
import os
import util
import tempfile
MODULE_NAME = __name__
MODULE_DESCRIPTION = '''Run analysis of code bui... | apache-2.0 | -2,542,931,754,572,284,400 | 37.423963 | 96 | 0.559367 | false | 3.663445 | false | false | false |
picoCTF/picoCTF-web | daemons/share_instances.py | 1 | 4805 | #!/usr/bin/python3
import api
import spur
import json
import string
import random
from os.path import join
script = \
"""
import json
import os
import stat
import pwd
import subprocess
from os.path import join
data = json.loads(raw_input())
for user, correct_symlinks in data.items():
try:
home_dir = p... | mit | 6,266,827,422,933,645,000 | 33.568345 | 126 | 0.571488 | false | 3.997504 | false | false | false |
Garrappachc/tf2director | tf2server.py | 1 | 7149 | import datetime
import os
import time
import libtmux
from valve.source.a2s import ServerQuerier
from subprocess import call
class CorruptedTf2ServerInstanceError(Exception):
"""
Raised when an invalid TF2 server instance is found.
"""
class SteamCmdNotFoundError(Exception):
"""
Raised when the ... | mit | 8,262,604,814,189,408,000 | 29.814655 | 127 | 0.552525 | false | 3.98273 | false | false | false |
danakj/chromium | tools/perf/page_sets/mac_gpu_sites.py | 1 | 5328 | # Copyright 2016 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 telemetry.page import page as page_module
from telemetry.page import shared_page_state
from telemetry import story
class _NoGpuSharedPageState(shared_p... | bsd-3-clause | -5,708,481,289,625,409,000 | 40.302326 | 80 | 0.723724 | false | 3.464239 | true | false | false |
xirdneh/oposum | oPOSum/libs/migrate.py | 1 | 12304 | import MySQLdb as mdb
import sys
from oPOSum.apps.products.models import *
import re
from django.core.exceptions import ObjectDoesNotExist
import re
import logging
from decimal import Decimal
logger = logging.getLogger("oPOSum.mysql")
def get_con( ):
try:
con = mdb.connect('joyeriasbalco.com', 'balco', 'tsm... | mit | -151,554,474,499,668,200 | 31.986595 | 225 | 0.4362 | false | 3.630569 | false | false | false |
yinglanma/AI-project | tensorpack/dataflow/imgaug/paste.py | 1 | 3017 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: paste.py
# Author: Yuxin Wu <ppwwyyxxc@gmail.com>
from .base import ImageAugmentor
from abc import abstractmethod
import numpy as np
__all__ = ['CenterPaste', 'BackgroundFiller', 'ConstantBackgroundFiller',
'RandomPaste']
class BackgroundFiller(object):... | apache-2.0 | 5,813,919,745,948,893,000 | 31.44086 | 98 | 0.615844 | false | 3.557783 | false | false | false |
klahnakoski/ActiveData | vendor/jx_base/expressions/between_op.py | 1 | 5352 | # encoding: 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/.
#
# Contact: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import, divis... | mpl-2.0 | 4,303,102,964,235,726,000 | 34.210526 | 88 | 0.565583 | false | 3.869848 | false | false | false |
reesmanp/Nao | Nao/Automation_src/planner_parser.py | 1 | 1102 | '''
Created on Jul 9, 2013
Updated on Aug 5, 2013
@author: Paul Reesman
@param plan: A string copied from the output of the SapaReplan planner
Finds the phrase 'getready' and 'EOP' and sends their indexes to low and high respectfully
Copies only the text between 'getready' and 'EOP' into instruct_plan
Loop... | apache-2.0 | -9,020,304,308,667,429,000 | 31.454545 | 90 | 0.598911 | false | 3.786942 | false | false | false |
rogerthat-platform/rogerthat-backend | src/rogerthat/pages/admin/js_embedding.py | 1 | 1848 | # -*- coding: utf-8 -*-
# Copyright 2017 GIG Technology NV
#
# 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 | -818,769,668,640,334,500 | 36.714286 | 117 | 0.697511 | false | 3.786885 | false | false | false |
sharoonthomas/trytond-report-html-accounts | tests/test_party.py | 1 | 20494 | # -*- coding: utf-8 -*-
import sys
import unittest
from datetime import date
from dateutil.relativedelta import relativedelta
from decimal import Decimal
import trytond.tests.test_tryton
from trytond.tests.test_tryton import POOL, DB_NAME, USER, CONTEXT
from trytond.transaction import Transaction
from trytond.pool imp... | bsd-3-clause | 8,040,115,976,749,563,000 | 36.261818 | 79 | 0.445789 | false | 4.716686 | true | false | false |
Skylion007/popupcad | popupcad/filetypes/genericlaminate.py | 1 | 14057 | from __future__ import division
# -*- coding: utf-8 -*-
"""
Written by Daniel M. Aukes.
Email: danaukes<at>seas.harvard.edu.
Please see LICENSE.txt for full license.
"""
import popupcad
import numpy
from popupcad.filetypes.popupcad_file import popupCADFile
try:
import itertools.izip as zip
except ImportError:
... | mit | -9,194,283,029,082,293,000 | 39.051282 | 128 | 0.572099 | false | 3.919967 | false | false | false |
crckyl/pixplus | tools/changelog.py | 1 | 3224 | import sys
import re
import json
def stable(f):
def w(changelog):
return f(list(filter(lambda v: v['date'], changelog)))
return w
def out_json(changelog):
return [json.dumps(changelog, sort_keys = True, indent = 2)]
def out_dev_version(changelog):
return [changelog[0]['version']]
@stable
def out_stable_... | mit | -8,051,231,018,537,412,000 | 23.610687 | 82 | 0.586538 | false | 2.982424 | false | false | false |
arenadata/ambari | ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/utils.py | 1 | 16823 | """
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 use this ... | apache-2.0 | 3,519,208,613,618,296,000 | 38.123256 | 169 | 0.679189 | false | 3.56495 | false | false | false |
ninja777/Utils | outputFileStats.py | 1 | 3653 | import os
def getIndirectCalls(filename='beanstalkd.out', verbose=False):
if verbose:
print "getindirectCalls :: Reading file :", filename
f = open(filename, 'r')
contents = f.read()
f.close()
indirectCalls = contents.count('========')
contents = contents.split('\n')
count = 0
... | mit | 2,206,708,753,596,048,400 | 38.706522 | 140 | 0.573227 | false | 4.385354 | false | false | false |
turon/openthread | tests/scripts/thread-cert/Cert_5_3_02_RealmLocal.py | 1 | 5825 | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | bsd-3-clause | 6,624,594,367,286,619,000 | 37.576159 | 79 | 0.655966 | false | 3.580209 | true | false | false |
weiting-chen/manila | manila/tests/api/test_common.py | 1 | 10096 | # Copyright 2010 OpenStack LLC.
# 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 b... | apache-2.0 | 5,109,787,621,793,541,000 | 40.719008 | 78 | 0.63649 | false | 3.709037 | true | false | false |
yueyongyue/saltshaker | shaker/shaker_core.py | 1 | 8130 | #!/usr/bin/env python
import urllib2,urllib
from django.conf import settings
from nodegroups import *
try:
import json
except ImportError:
import simplejson as json
class SaltAPI(object):
__token_id = ''
def __init__(self):
self.__url = settings.SALT_API_URL
self.__user = settings.SALT_... | apache-2.0 | -7,380,418,697,742,444,000 | 36.293578 | 107 | 0.564945 | false | 3.737931 | false | false | false |
yliu120/dbsystem | HW1/dbsys-hw1/Storage/Page.py | 1 | 16371 | from io import BytesIO
import copy, math, struct
from Catalog.Identifiers import TupleId
class PageHeader:
"""
A base class for page headers, storing bookkeeping information on a page.
Page headers implement structural equality over their component fields.
This includes the page's flags (e.g., whether the p... | apache-2.0 | -5,774,462,357,568,004,000 | 32.072727 | 138 | 0.670943 | false | 3.808981 | true | false | false |
beeftornado/sentry | src/sentry/api/serializers/rest_framework/commit.py | 1 | 1294 | from __future__ import absolute_import
from rest_framework import serializers
from sentry.api.serializers.rest_framework.list import ListField
from sentry.models import CommitFileChange
class CommitPatchSetSerializer(serializers.Serializer):
path = serializers.CharField(max_length=255)
type = serializers.Cha... | bsd-3-clause | -3,367,516,665,309,448,700 | 38.212121 | 99 | 0.734158 | false | 4.04375 | false | false | false |
sochka/os-lab | fifo_scheduler/scheduler.py | 1 | 1119 | #!/usr/bin/python3
from random import randint, random
from operator import itemgetter
minlen = 1
maxlen = 15
tasks = 1000
for intensivity in [0.1]:
# for intensivity in [i/1000 for i in range(1, 100, 2)]:
# print('INTENSIVITY = {}'.format(intensivity), end=' => ') ## DEBUG
time = 0
waiting_sum = 0
tasks_left =... | gpl-3.0 | 4,588,132,833,880,194,600 | 26.975 | 75 | 0.590706 | false | 3.03252 | false | false | false |
eyaler/tensorpack | tensorpack/tfutils/sessinit.py | 1 | 9676 | # -*- coding: utf-8 -*-
# File: sessinit.py
import os
import numpy as np
import tensorflow as tf
import six
from ..utils import logger
from ..utils.develop import deprecated
from .common import get_op_tensor_name
from .varmanip import (SessionUpdate, get_savename_from_varname,
is_training_name... | apache-2.0 | 2,755,535,274,946,339,300 | 33.557143 | 110 | 0.600765 | false | 3.923763 | false | false | false |
levilucio/SyVOLT | GM2AUTOSAR_MM/Properties/positive/Himesis/HP1IsolatedLHS.py | 1 | 23687 |
from core.himesis import Himesis, HimesisPreConditionPatternLHS
class HP1IsolatedLHS(HimesisPreConditionPatternLHS):
def __init__(self):
"""
Creates the himesis graph representing the AToM3 model HP1IsolatedLHS.
"""
# Flag this instance as compiled now
self.is_compiled = T... | mit | 8,456,940,167,093,672,000 | 48.867368 | 192 | 0.509647 | false | 5.149348 | false | false | false |
sorki/faf | src/pyfaf/problemtypes/ruby.py | 1 | 13593 | # Copyright (C) 2013 ABRT Team
# Copyright (C) 2013 Red Hat, Inc.
#
# This file is part of faf.
#
# faf 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) ... | gpl-3.0 | -8,794,422,266,913,718,000 | 38.172911 | 83 | 0.524755 | false | 4.261129 | false | false | false |
chrisseto/waterbutler | waterbutler/core/utils.py | 1 | 5171 | import json
import asyncio
import logging
import functools
# from concurrent.futures import ProcessPoolExecutor TODO Get this working
import aiohttp
from raven.contrib.tornado import AsyncSentryClient
from stevedore import driver
from waterbutler import settings
from waterbutler.core import exceptions
from waterbut... | apache-2.0 | -4,689,323,767,052,328,000 | 27.569061 | 167 | 0.611294 | false | 4.190438 | false | false | false |
snudler6/time-travel | src/time_travel/patchers/poll_patcher.py | 1 | 3189 | """A patch to the select.poll object."""
from .base_patcher import BasePatcher
import select as select_lib
class MockPollObject(object):
"""A mock poll object."""
def __init__(self, clock, event_pool):
"""Initialize the object."""
self.clock = clock
self.event_pool = event_pool
... | mit | 230,175,157,121,994,100 | 29.663462 | 79 | 0.569458 | false | 4.083227 | false | false | false |
pabloriera/gpuODE | examples/hr_montecarlos.py | 1 | 3809 | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 15 18:59:49 2016
@author: miles
"""
from __future__ import division
import time as timemodule
from gpuODE import ode, param_grid, funcs2code, run_ode
import pylab as pl
import numpy as np
import pandas as pd
#from utils import *
osc = ode("osc")
INPUTS = ["I"]
PAR... | gpl-2.0 | 1,495,076,035,918,751,500 | 22.512346 | 158 | 0.541612 | false | 2.383605 | false | false | false |
magyarm/periphondemand-code | src/bin/toolchain/simulation.py | 1 | 3450 | #! /usr/bin/python
# -*- coding: utf-8 -*-
#-----------------------------------------------------------------------------
# Name: Simulation.py
# Purpose:
# Author: Fabien Marteau <fabien.marteau@armadeus.com>
# Created: 16/07/2008
#-----------------------------------------------------------------------------
# ... | lgpl-2.1 | 6,741,689,834,651,697,000 | 36.5 | 90 | 0.61971 | false | 4.151625 | false | false | false |
dvliman/jaikuengine | .google_appengine/google/appengine/ext/cloudstorage/common.py | 2 | 9207 | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | apache-2.0 | 1,166,626,393,158,739,200 | 25.381089 | 79 | 0.639622 | false | 3.649227 | false | false | false |
sfrank2147/student_narratives | src/narratives.py | 1 | 3760 | def yes_value(response):
'''Returns True if a response is intended to be a Yes
Returns False if a response is intended to be a No
Returns None if response is blank or irrelevant'''
if response.lower() in ['yes','y']:
return True
elif response.lower() in ['no','n']:
return False... | gpl-3.0 | -1,006,900,340,365,883,500 | 33.495413 | 81 | 0.603723 | false | 4.017094 | false | false | false |
PressLabs/pyolite | pyolite/models/lists/keys.py | 1 | 1657 | import hashlib
from unipath import Path
class ListKeys(list):
def __init__(self, user, *args, **kwargs):
super(ListKeys, self).__init__(*args, **kwargs)
self.user = user
def append(self, key):
key_path = Path(str(key))
if key_path.isfile():
with open(str(key_path... | bsd-2-clause | 7,105,225,381,590,818,000 | 27.568966 | 74 | 0.524442 | false | 3.748869 | false | false | false |
ratschlab/ASP | examples/undocumented/python_modular/graphical/converter_spe_helix.py | 1 | 2588 | """
Shogun demo
Fernando J. Iglesias Garcia
This example shows the use of dimensionality reduction methods, mainly
Stochastic Proximity Embedding (SPE), although Isomap is also used for
comparison. The data selected to be embedded is an helix. Two different methods
of SPE (global and local) are applied showing that... | gpl-2.0 | 7,728,211,142,684,525,000 | 23.186916 | 80 | 0.707496 | false | 2.782796 | false | false | false |
NoiSek/Automata | main.py | 1 | 5834 | import random
import util
import sfml
from collections import deque
from models.automata import Automata
from models.algae import Algae
class Simulation():
def __init__(self):
self.global_vars = { "debug": True }
self.fps_enabled = True
settings = sfml.window.ContextSettings(antialiasing=2)
self.win... | gpl-2.0 | -6,994,960,279,491,262,000 | 34.797546 | 127 | 0.63387 | false | 3.341352 | false | false | false |
snaury/copper | contrib/python-copper/t/test_frames.py | 1 | 3325 | # -*- coding: utf-8 -*-
from copper.frames import (
Frame,
PingFrame,
DataFrame,
ResetFrame,
WindowFrame,
SettingsFrame,
FLAG_PING_ACK,
FLAG_DATA_OPEN,
FLAG_DATA_EOF,
FLAG_RESET_READ,
FLAG_RESET_WRITE,
FLAG_SETTINGS_ACK,
FrameReader,
FrameWriter,
)
from copper.err... | mit | -4,579,143,189,188,996,000 | 29.504587 | 81 | 0.61594 | false | 2.511329 | true | false | false |
studio1247/gertrude | github_release.py | 1 | 6604 | import json
import os
from optparse import OptionParser
import requests
import sys
import logging as log
API_URL = 'https://api.github.com/repos/{}/{}/releases'
UPLOAD_URL = 'https://api.github.com/repos/{}/{}/releases'
class GitHubRelease(object):
def __init__(self, in_user, in_owner, in_repo, in_password='x-oa... | gpl-3.0 | -153,907,246,719,676,930 | 43.322148 | 98 | 0.567383 | false | 3.963986 | false | false | false |
heikomuller/sco-worker | scoworker/cortical.py | 1 | 4011 | """This module conatins methods for creating and manipulating cortical images
that are generated from SCO model run predictions and functional data.
csv
img.identifier, Func/Pred, V1-3, Filename
"""
import os
import shutil
import tempfile
import tarfile
import sco
import pimms
import pint
import nibabel as nib
impor... | gpl-3.0 | -8,044,596,109,195,231,000 | 30.582677 | 84 | 0.575168 | false | 3.717331 | false | false | false |
dagwieers/ansible | lib/ansible/modules/cloud/google/gcp_dns_resource_record_set_facts.py | 1 | 4896 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2017 Google
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# ----------------------------------------------------------------------------
#
# *** AUTO GENERATED CODE *** AUTO GENERATED CODE ***
#
... | gpl-3.0 | -6,988,564,219,659,454,000 | 30.384615 | 125 | 0.568015 | false | 4.287215 | false | false | false |
Axelrod-Python/axelrod-evolver | src/axelrod_dojo/algorithms/particle_swarm_optimization.py | 1 | 2804 | from multiprocessing import cpu_count
import axelrod as axl
import pyswarm
from axelrod_dojo.utils import score_player
from axelrod_dojo.utils import PlayerInfo
class PSO(object):
"""PSO class that implements a particle swarm optimization algorithm."""
def __init__(self, player_class, params_kwargs, objective... | mit | 7,606,033,551,012,049,000 | 42.138462 | 82 | 0.548502 | false | 4.340557 | false | false | false |
4cylinder/hearboi | hearboi_listener.py | 1 | 1622 | #!/usr/bin/python
import pyaudio
import wave
import urllib2
import thread
import time
import requests
CHUNK = 1024
FORMAT = pyaudio.paInt16 #paInt8
CHANNELS = 2
RATE = 44100 #sample rate
filename = "output.wav"
website = 'http://ec2-54-71-180-108.us-west-2.compute.amazonaws.com/hearboi/device/record/status'
status =... | mit | -4,746,987,948,016,424,000 | 23.575758 | 107 | 0.706535 | false | 2.896429 | false | false | false |
FrederichRiver/neutrino | applications/old_code/libmysql5.py | 1 | 5742 | #!/usr/bin/python3
'''
Created on Aug 31, 2017
@Author: Frederich River
@Project: Mercury
Lib of mysql contains methods to drive mysql db using python.
v1.0.0-stable: Library is released.
v1.0.1-stable: Encrypted password is supported, relative codes are in
libencrypt.
v1.0.2-stable: Add new function TABLEEXIST.
Pre ... | bsd-3-clause | -1,324,086,200,227,831,000 | 35.113208 | 104 | 0.532741 | false | 3.954545 | true | false | false |
sbotond/rlsim | tools/effest_src/est_levels.py | 1 | 5098 | #
# Copyright (C) 2013 EMBL - European Bioinformatics Institute
#
# 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.
#
# ... | gpl-3.0 | 6,348,011,163,315,234,000 | 38.215385 | 122 | 0.567674 | false | 3.900536 | false | false | false |
scienceblock/pyron | pyron.py | 1 | 2033 | import csv
from datetime import date
import time
from shutil import copyfile
def encrypt():
global secretCode
message = input("t/>> ")
characters = "JKLZXC=VBNMabcUIOPASDFGH&*123WERT-Ytuvwxyz.!?()567890Qefghijklmnopqrsd4!£$%^ "
encryption = "jihg12345=6789A$%SDFGHJKLPOI^&*()UYzyxwvut-srqp!... | mit | 4,450,618,086,779,586,000 | 21.569767 | 104 | 0.53478 | false | 3.21746 | false | false | false |
kpreid/shinysdr | shinysdr/i/receiver.py | 1 | 18690 | # -*- coding: utf-8 -*-
# Copyright 2013, 2014, 2015, 2016, 2017, 2018 Kevin Reid and the ShinySDR contributors
#
# This file is part of ShinySDR.
#
# ShinySDR 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,... | gpl-3.0 | -5,233,360,714,151,314,000 | 40.441242 | 215 | 0.60931 | false | 3.991031 | false | false | false |
zhao-ji/weibo_old | captcha/app_captcha/captcha.py | 1 | 3587 | # coding: utf-8
import os
from itertools import repeat
from random import choice, randint
from StringIO import StringIO
from PIL import Image, ImageDraw, ImageFont
def output_character(amount=4, area='alnum'):
'output a string of area of amount'
'area is in alnum, alpha, digit, zh'
if not all([amount > ... | gpl-2.0 | 179,084,751,878,866,080 | 30.743363 | 64 | 0.580987 | false | 3.439118 | false | false | false |
nicklhy/mxnet | python/mxnet/image/image.py | 1 | 39736 | # 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 u... | apache-2.0 | -9,053,685,107,187,268,000 | 31.839669 | 130 | 0.587276 | false | 3.775033 | false | false | false |
mrbell/connectfour | board.py | 1 | 10796 | # -*- coding: utf-8 *-*
"""
board.py
The generic connect four board object. Encodes the rules of the connect four
game (i.e. checks for legal moves and for victory conditions). It also provides
a method for encoding board configurations with a unique ID.
"""
"""
Copyright 2012 Michael Bell
This file is part of conne... | gpl-3.0 | 133,352,556,836,593,000 | 27.485488 | 79 | 0.546036 | false | 4.125334 | true | false | false |
Donkyhotay/MoonPy | zope/app/zptpage/interfaces.py | 1 | 2220 | ##############################################################################
#
# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# T... | gpl-3.0 | -2,382,977,226,702,104,600 | 32.134328 | 78 | 0.615315 | false | 4.683544 | false | false | false |
d10genes/safeish_eval | eval_test.py | 1 | 2102 | from pytest import raises
from safe_eval import SqlVisitor, ArbitraryCode
def test_code_check():
v = SqlVisitor()
v2 = SqlVisitor(safe_funcs=[ord, cmp])
oks = [
'a[0:250]',
'float(a)',
'float()',
'float(x=6)',
'float(*[])',
'float(**[])',
'x if y e... | bsd-2-clause | -3,100,221,370,232,628,700 | 24.325301 | 72 | 0.481446 | false | 3.073099 | false | false | false |
leandrotoledo/python-correios-wrapper | correios/services/rastro.py | 1 | 1647 | #!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2016
# Leandro Toledo de Souza <leandrotoledodesouza@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
# th... | lgpl-3.0 | 8,515,012,840,210,029,000 | 30.673077 | 77 | 0.642987 | false | 3.676339 | false | false | false |
brunosmmm/hbussd | hbussd/hbus/constants.py | 1 | 7153 | """hbussd general purpose constants."""
from hbussd.hbus.command import HbusCommand
# HBUS security key size in bytes
# @todo Make this useful
HBUS_PUBKEY_SIZE = 192
# HBUS authentication key size in bytes
#
# This size is 192 but it is followed by another byte, e/f/r (193 bytes)
HBUS_SIGNATURE_SIZE = 192
# @defgrou... | gpl-2.0 | 4,535,392,805,656,915,500 | 23.084175 | 77 | 0.630085 | false | 2.610584 | false | false | false |
cuckootan/WeiboSpider | WeiboSpider/middlewares.py | 1 | 1698 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'Jason'
from . import cookies
import random
class CustomCookiesMiddleware(object):
def __init__(self, settings):
custom_cookies = settings.get('CUSTOM_COOKIES')
if custom_cookies:
self.cookie_list = settings.get('REQUEST_CU... | apache-2.0 | -4,418,269,399,455,746,000 | 27.779661 | 97 | 0.626031 | false | 3.867882 | false | false | false |
PabloLefort/graphitesend | tests/test_all.py | 1 | 11201 | #!/usr/bin/env python
from graphitesend import graphitesend
import unittest2 as unittest
import socket
import os
class TestAll(unittest.TestCase):
""" Basic tests ( better than nothing ) """
def setUp(self):
""" reset graphitesend """
# Drop any connections or modules that have been setup fr... | apache-2.0 | -4,683,114,501,987,323,000 | 38.86121 | 81 | 0.631819 | false | 3.858422 | true | false | false |
Eigenlabs/EigenD | plg_loop/audio_player_plg.py | 1 | 2562 |
#
# Copyright 2009 Eigenlabs Ltd. http://www.eigenlabs.com
#
# This file is part of EigenD.
#
# EigenD 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) a... | gpl-3.0 | -8,644,696,815,682,386,000 | 33.16 | 132 | 0.688915 | false | 3.327273 | false | false | false |
mlaprise/PyOFTK | PyOFTK/freespace/test.py | 1 | 1647 | import Image
import time
import fkabcd
import pyfits
from numpy import *
from pylab import *
from matplotlib.widgets import Slider, Button, RadioButtons
dz = 0.50/10
champ_in = Image.open("anneaux_large_ellipse2.gif")
intensiteArchive = zeros([512,512,512])
champ_in_fld = zeros([1024,1024], complex)
tampon = list(ch... | gpl-2.0 | -2,674,161,048,102,992,400 | 22.869565 | 84 | 0.660595 | false | 2.297071 | false | false | false |
abilian/abilian-core | src/abilian/web/blueprints.py | 1 | 2065 | """"""
from typing import Any, Callable, Collection, Union, cast
from flask import Blueprint as BaseBlueprint
from abilian.core.models.subjects import User
from abilian.services.security import Anonymous, Role
from abilian.services.security.service import SecurityService
def allow_anonymous(user: User, roles: Colle... | lgpl-2.1 | 2,342,989,190,869,192,000 | 28.927536 | 87 | 0.620339 | false | 4.163306 | false | false | false |
xray/xray | xarray/core/coordinates.py | 1 | 13448 | from contextlib import contextmanager
from typing import (
TYPE_CHECKING,
Any,
Dict,
Hashable,
Iterator,
Mapping,
Sequence,
Set,
Tuple,
Union,
cast,
)
import pandas as pd
from . import formatting, indexing
from .indexes import Indexes
from .merge import merge_coordinates_wi... | apache-2.0 | 2,703,945,241,319,886,000 | 32.041769 | 88 | 0.612731 | false | 4.277354 | false | false | false |
SterlingPeet/madesigner | lib/contour.py | 1 | 27725 | #!python
__author__ = "Curtis L. Olson < curtolson {at} flightgear {dot} org >"
__url__ = "http://gallinazo.flightgear.org"
__version__ = "1.0"
__license__ = "GPL v2"
import fileinput
import math
import string
import spline
import Polygon
import Polygon.Shapes
import Polygon.Utils
class Cutpos:
def __init__(se... | gpl-2.0 | -7,140,639,566,121,052,000 | 34.774194 | 113 | 0.48927 | false | 3.593649 | false | false | false |
anirudhSK/chromium | tools/telemetry/telemetry/web_components/viewer.py | 1 | 3776 | # Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import HTMLParser
import json
import os
import string
from telemetry.web_components import web_components_project
from tvcm import generate
class View... | bsd-3-clause | 75,463,519,539,761,340 | 33.962963 | 80 | 0.678231 | false | 3.991543 | false | false | false |
sappo/simindex | measures.py | 1 | 12164 | import glob
import sys
import time
import json
import click
import jellyfish
import numpy as np
from sklearn.metrics import recall_score, precision_score
from difflib import SequenceMatcher
from simindex import DySimII, DyLSH, DyKMeans, RecordTimer, read_csv
from simindex import MultiSimAwareAttributeIndex, WeakLabels,... | mpl-2.0 | 4,706,270,152,728,255,000 | 37.37224 | 103 | 0.559355 | false | 4.085993 | false | false | false |
zarafagroupware/zarafa-zsm | webservice/apiapp/pumpkin_ext/dn.py | 1 | 3180 | # Copyright 2012 - 2013 Zarafa B.V.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License, version 3,
# as published by the Free Software Foundation with the following additional
# term according to sec. 7:
#
# According to sec. 7 of the ... | agpl-3.0 | 4,047,651,787,322,990,600 | 41.4 | 85 | 0.726101 | false | 3.73678 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.