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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ancafarcas/superdesk-core | content_api/items_versions/service.py | 7 | 1501 | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
from eve.util... | agpl-3.0 | -1,097,337,749,767,128,800 | 33.906977 | 87 | 0.660227 | false | 3.960422 | false | false | false |
llonchj/django-tastypie-elasticsearch | tastypie_elasticsearch/paginator.py | 1 | 1785 | # -*- coding: utf-8 -*-
"""
tastypie.Resource definitions for Elasticsearch
"""
from tastypie.bundle import Bundle
from tastypie.paginator import Paginator
#from tastypie.resources import Resource, DeclarativeMetaclass
#from tastypie.exceptions import NotFound
#from tastypie.utils import trailing_slash
#from tastypie... | agpl-3.0 | 3,889,401,589,173,123,600 | 27.790323 | 73 | 0.587675 | false | 4.141531 | false | false | false |
kalmanolah/macmond | setup.py | 1 | 1111 | #!/usr/bin/env python3
"""Setup module."""
from setuptools import setup, find_packages
import os
def read(fname):
"""Read and return the contents of a file."""
return open(os.path.join(os.path.dirname(__file__), fname)).read()
setup(
name='macmond',
version='0.0.1',
description='MACMond - MAC ad... | mit | 2,068,522,913,170,618,000 | 23.688889 | 70 | 0.588659 | false | 3.804795 | false | false | false |
Linerd/sdn_optimization | example/cli.py | 138 | 3376 | #!/usr/bin/python
import sys
import argparse
import json
import httplib
import urllib2
class RestApi(object):
def __init__(self, server,port):
self.server = server
self.port = port
def get(self, path):
#ret = self.rest_call(path, {}, 'GET')
#return ret[2]
f = urllib2.... | apache-2.0 | -6,884,177,690,615,471,000 | 28.356522 | 101 | 0.580569 | false | 3.494824 | false | false | false |
zhuango/python | pandasLearning/lrModel_forCom.py | 2 | 2161 | import sklearn
from sklearn import linear_model
from sklearn import tree
from sklearn.datasets import load_iris
import pandas as pd
import numpy as np
from sklearn.metrics import accuracy_score
from sklearn import preprocessing
from sklearn import neural_network
def standard(tasks, attri):
scaler = preprocessing.S... | gpl-2.0 | 5,030,142,618,133,790,000 | 29.203125 | 58 | 0.628557 | false | 2.543421 | false | false | false |
ssvsergeyev/ZenPacks.zenoss.AWS | src/boto/boto/cloudsearch/document.py | 153 | 9780 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# 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... | gpl-2.0 | -2,417,713,075,524,259,300 | 35.088561 | 94 | 0.642638 | false | 4.24111 | false | false | false |
marrow/web.security | test/helper.py | 1 | 1553 | # encoding: utf-8
from __future__ import unicode_literals
from contextlib import contextmanager
from web.security import when
from web.security.predicate import always, never
@contextmanager
def must_be_called(n=None):
"""Ensure the target function is called.
If an `n` value is supplied, ensure the target is c... | mit | -8,836,721,241,973,194,000 | 16.850575 | 95 | 0.690277 | false | 3.124748 | false | false | false |
UWPCE-PythonCert/IntroPython2016 | students/heb2016/Python2016_project/uw_project/uw_project.py | 2 | 2127 |
from sqlalchemy import create_engine, select, text
from sqlalchemy.orm import sessionmaker
import psycopg2
import sys
import os
from os.path import join, dirname
from datetime import date, timedelta, datetime
from urllib import parse
from pandas import DataFrame, ExcelWriter
import pandas as pd
sql_dir = os.path.... | unlicense | 4,703,628,591,763,204,000 | 27.36 | 67 | 0.58016 | false | 3.486885 | false | false | false |
SpaceGroupUCL/qgisSpaceSyntaxToolkit | esstoolkit/external/networkx/algorithms/communicability_alg.py | 1 | 4491 | """
Communicability.
"""
import networkx as nx
from networkx.utils import not_implemented_for
__all__ = [
"communicability",
"communicability_exp",
]
@not_implemented_for("directed")
@not_implemented_for("multigraph")
def communicability(G):
r"""Returns communicability between all pairs of nodes in G.
... | gpl-3.0 | 2,412,726,752,218,567,700 | 26.552147 | 79 | 0.601202 | false | 3.663132 | false | false | false |
juancarlospaco/fades | fades/logger.py | 1 | 2304 | # Copyright 2014 Facundo Batista, Nicolás Demarchi
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 3, as published
# by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ... | gpl-3.0 | -6,406,076,994,971,166,000 | 32.376812 | 84 | 0.665653 | false | 3.910017 | false | false | false |
IanHawke/orcomp-training | test_quadratic.py | 1 | 1079 | from numpy.testing import assert_equal, assert_allclose
import pytest
from quadratic import quadratic
def test_distinct_real():
assert_allclose(quadratic(1, 0, -1), [1, -1],
err_msg="Roots of x^2 - 1 = 0 should be [1, -1]")
def test_repeated_real_trivial():
assert_allclose(quadrat... | mit | 5,067,129,137,324,903,000 | 33.806452 | 81 | 0.560704 | false | 3.091691 | true | false | false |
ctrlaltdel/python-devicecloud | devicecloud/test/integration/inttest_streams.py | 3 | 4858 | # 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/.
#
# Copyright (c) 2015 Etherios, Inc. All rights reserved.
# Etherios, Inc. is a Division of Digi International.
"""Inte... | mpl-2.0 | -3,527,233,329,713,813,000 | 36.953125 | 115 | 0.615068 | false | 3.968954 | true | false | false |
lukas/scikit-class | examples/keras-gan/gan-simple.py | 2 | 5649 | import os
import numpy as np
from keras.layers import Input
from keras.models import Model, Sequential
from keras.layers.core import Reshape, Dense, Dropout, Flatten
from keras.layers.advanced_activations import LeakyReLU
from keras.layers.convolutional import Convolution2D, UpSampling2D
from keras.layers.normalizatio... | gpl-2.0 | 7,914,087,647,310,410,000 | 35.681818 | 120 | 0.685077 | false | 3.394832 | true | false | false |
rockyzhengwu/mlpractice | word2vec/huffman_tree_example.py | 1 | 1960 | #!/usr/bin/env python
# -*-coding=utf-8-*-
"""
通过一个例子说明huffman树的构造过程
"""
class VocabWord():
def __init__(self, word, cn=0):
self.word = word
self.cn = cn
self.code = None
self.codelen = 0
vocab = [
VocabWord("我", 15),
VocabWord("喜欢", 8),
VocabWord("观看", 6),
Vocab... | mit | -7,374,011,969,623,519,000 | 21.116279 | 58 | 0.442692 | false | 2.86015 | false | false | false |
edouardswiac/python-edgar | edgar/main.py | 1 | 3854 | # -*- coding: utf-8 -*-
from __future__ import print_function
import multiprocessing
import os
import datetime
import zipfile
import tempfile
import logging
import os.path
import sys
import io
EDGAR_PREFIX = "https://www.sec.gov/Archives/"
SEP = "|"
IS_PY3 = sys.version_info[0] >= 3
def _worker_count():
cpu_coun... | mit | -3,818,612,128,738,565,000 | 25.951049 | 84 | 0.575246 | false | 3.571826 | false | false | false |
eduNEXT/edunext-ecommerce | ecommerce/extensions/catalogue/migrations/0038_coupon_enterprise_id_attribute.py | 1 | 1374 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.db import migrations
from oscar.core.loading import get_model
from ecommerce.core.constants import COUPON_PRODUCT_CLASS_NAME
ProductAttribute = get_model("catalogue", "ProductAttribute")
ProductClass = get_model("catalogue",... | agpl-3.0 | 4,260,863,974,224,727,600 | 32.512195 | 96 | 0.721252 | false | 3.925714 | false | false | false |
zhenkai/xgunicorn | xgunicorn/views.py | 1 | 1464 | from __future__ import absolute_import
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.contrib.auth.models import User
from django.contrib import messages
from django.core.urlresolvers import reverse_lazy
from django.http import HttpResp... | apache-2.0 | 7,514,457,325,541,493,000 | 27.72549 | 78 | 0.760929 | false | 3.562044 | false | false | false |
Zehaos/MobileNet | datasets/kitti_common.py | 1 | 3327 | # Copyright 2017 Zehao Shi. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | apache-2.0 | -1,172,423,169,458,560,300 | 38.607143 | 80 | 0.679291 | false | 3.660066 | false | false | false |
Josue-Martinez-Moreno/trackeddy | trackeddy/datastruct.py | 1 | 27217 | import numpy as np
import netCDF4 as nc4
from datetime import datetime
import pylab as plt
import seawater as sw
import warnings
from trackeddy.savedata import *
from trackeddy.geometryfunc import *
from trackeddy.physics import *
warnings.filterwarnings("ignore")
import pdb
def dict_eddym(contour, ellipse, position_s... | mit | -2,478,411,430,105,668,000 | 52.790514 | 316 | 0.562332 | false | 3.616396 | false | false | false |
Netflix-Skunkworks/cloudaux | cloudaux/gcp/utils.py | 1 | 4724 | """
.. module: cloudaux.gcp.utils
:platform: Unix
:copyright: (c) 2016 by Google Inc., see AUTHORS for more
:license: Apache, see LICENSE for more details.
.. moduleauthor:: Tom Melendez (@supertom) <supertom@google.com>
"""
def strdate(dte):
return dte.strftime('%Y-%m-%dT%H:%M:%SZ')
def get_creds_f... | apache-2.0 | -1,874,189,017,156,911,400 | 28.341615 | 77 | 0.617697 | false | 3.865794 | false | false | false |
nogaems/adventofcode2016 | day004.py | 1 | 1958 | class Room:
def __init__(self, s):
_, *self.name = s.split('-')[::-1]
self.name = ''.join(self.name)[::-1]
self.id, *self.hash = _[:-1].split('[')
self.id = int(self.id)
self.hash = self.hash[0]
self.name_with_dashes = '-'.join(s.split('-')[:-1])
def __r... | gpl-3.0 | -5,176,114,993,940,062,000 | 27.376812 | 77 | 0.453524 | false | 3.923848 | false | false | false |
foxscotch/advent-of-code | 2017/13/p2.py | 1 | 1915 | # Python 3.6.1
import re
import sys
from pdb import set_trace
"""
This version is significantly faster than p2_slow.py. I don't think you could
reasonably ever reach the answer for this using that one. Anyway, for this one,
I took an approach where I _calculate_ the 'position' of the scanner in the
current row. I th... | mit | -865,789,419,419,669,100 | 24.533333 | 79 | 0.557702 | false | 3.45045 | false | false | false |
CodeforLeipzig/luftqualitaet_sachsen | luftqualitaet_sachsen/measuring_stations/management/commands/fetchData.py | 1 | 6325 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import sys
import gevent.monkey
import requests
import json
from dateutil import parser
from datetime import date, timedelta
from django.core.management.base import BaseCommand
from django.utils import timezone
from gevent.pool import P... | bsd-3-clause | 160,321,354,872,519,420 | 32.470899 | 108 | 0.524111 | false | 3.918835 | false | false | false |
iwanders/OBD9141 | examples/T3_ILI9341_display/read_image.py | 1 | 4437 | #!/usr/bin/env python3
# The MIT License (MIT)
#
# Copyright (c) 2016 Ivor Wanders
#
# 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 rig... | mit | -1,534,838,767,352,447,700 | 35.081301 | 112 | 0.62407 | false | 3.586904 | false | false | false |
tiborsimko/invenio-deposit | tests/conftest.py | 1 | 12010 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016 CERN.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... | gpl-2.0 | 8,840,538,372,733,482,000 | 30.941489 | 79 | 0.658035 | false | 3.807863 | true | false | false |
ivanhorvath/openshift-tools | ansible/roles/lib_zabbix/library/zbx_user_media.py | 6 | 9525 | #!/usr/bin/env python
'''
Ansible module for user media
'''
# vim: expandtab:tabstop=4:shiftwidth=4
#
# Zabbix user media ansible module
#
#
# Copyright 2015 Red Hat Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | apache-2.0 | 8,195,057,548,366,811,000 | 32.188153 | 116 | 0.593176 | false | 3.900491 | false | false | false |
bcgov/ckanext-bcgov | ckanext/bcgov/scripts/export/exporter.py | 4 | 3329 | # original script: https://github.com/ckan/ckanapi/blob/master/ckanapi/remoteckan.py.
# modified by mbrown to load entire catalogue (each request can only return 1000 records at a time)
import sys
import argparse
import ckanapi
import losser.losser
import losser.cli
# added by mb
import requests
VERSION = '0.0.5'
... | agpl-3.0 | 3,954,016,982,020,931,000 | 33.6875 | 99 | 0.620607 | false | 3.606717 | false | false | false |
cloudvisory/ansible-modules-hashivault | ansible/modules/hashivault/hashivault_rekey_cancel.py | 1 | 2645 | #!/usr/bin/env python
DOCUMENTATION = '''
---
module: hashivault_rekey_cancel
version_added: "3.3.0"
short_description: Hashicorp Vault rekey cancel module
description:
- Module to cancel rekey Hashicorp Vault.
options:
url:
description:
- url for vault
default: to environment variab... | mit | -5,434,389,026,774,354,000 | 31.256098 | 167 | 0.657467 | false | 4.158805 | false | false | false |
hacklabr/django-discussion | discussion/models.py | 1 | 10831 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from autoslug import AutoSlugField
from django.conf import settings
from django.contrib.auth.models import Group
from django.utils import timezone
import hashlib
class Category(models.Model):
parent = models.ForeignKey('self', mo... | agpl-3.0 | 7,897,633,503,916,127,000 | 33.384127 | 134 | 0.650355 | false | 3.964495 | false | false | false |
dimven/SpringNodes | py/Mesh.ToPolySurface.py | 1 | 1629 | # Copyright(c) 2019, Dimitar Venkov
# @5devene, dimitar.ven@gmail.com
# www.badmonkeys.net
import clr
from System.Threading import Thread, ThreadStart
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import PolySurface, Surface
meshes, mergeAll, NUMTHREADS = IN
CHOPLIMIT = 10
def tolist(obj1):
... | mit | 6,109,342,479,035,632,000 | 24.873016 | 75 | 0.680172 | false | 2.644481 | false | false | false |
noironetworks/group-based-policy | gbpservice/neutron/db/grouppolicy/extensions/apic_reuse_bd_db.py | 1 | 2363 | # 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
# d... | apache-2.0 | -2,611,845,000,969,055,000 | 37.112903 | 78 | 0.637749 | false | 3.429608 | false | false | false |
lidan-fnst/samba | source4/torture/drs/python/getnc_exop.py | 2 | 47485 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Tests various schema replication scenarios
#
# Copyright (C) Kamen Mazdrashki <kamenim@samba.org> 2011
# Copyright (C) Andrew Bartlett <abartlet@samba.org> 2016
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Gene... | gpl-3.0 | -9,071,049,937,256,635,000 | 41.171403 | 123 | 0.562072 | false | 3.29391 | true | false | false |
compston/TAP-Workshop | utilities/Gnip-Tweet-Evaluation/gnip_tweet_evaluation/analysis.py | 1 | 6165 | import sys
import os
try:
import ujson as json
except ImportError:
import json
import logging
from collections import defaultdict
from simple_n_grams.simple_n_grams import SimpleNGrams
import uuid
import datetime
def constant_factory():
return (0, set([]))
logger = logging.getLogger("analysis")
def an... | mit | 3,360,969,485,394,212,400 | 38.519231 | 104 | 0.581184 | false | 3.617958 | false | false | false |
fabianvf/scrapi | scrapi/harvesters/scholarscompass_vcu.py | 3 | 5200 | '''
Harvester for the VCU Scholars Compass for the SHARE project
Example API call: http://scholarscompass.vcu.edu/do/oai/?verb=ListRecords&metadataPrefix=oai_dc
'''
from __future__ import unicode_literals
from scrapi.base import OAIHarvester
class Scholarscompass_vcuHarvester(OAIHarvester):
short_name = 'schola... | apache-2.0 | -2,435,875,352,585,439,700 | 21.12766 | 95 | 0.45 | false | 2.846196 | false | false | false |
bokeh/bokeh | tests/unit/bokeh/embed/test_server__embed.py | 1 | 10823 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | bsd-3-clause | 134,560,872,481,692,080 | 40.626923 | 146 | 0.543287 | false | 3.77371 | true | false | false |
guewen/stock-logistics-warehouse | __unported__/stock_reserve_sale/wizard/sale_stock_reserve.py | 2 | 4602 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... | agpl-3.0 | 5,539,051,676,439,140,000 | 40.459459 | 78 | 0.570187 | false | 3.906621 | false | false | false |
sigmundv/encrypt-image | config.py | 1 | 1236 | import os, json
# This file is used for configuration options that are used in the main app
basedir = os.path.abspath(os.path.dirname(__file__))
class Auth:
with open("../client_secret.json", 'r') as f:
oauth2_params = json.loads(f.read())
CLIENT_ID = oauth2_params["web"]["client_id"]
CLIENT_SECRET = oau... | bsd-2-clause | -5,622,660,153,732,669,000 | 28.428571 | 77 | 0.656958 | false | 2.964029 | true | false | false |
eggsandbeer/scheduler | synergy/mx/scheduler_entries.py | 1 | 1892 | __author__ = 'Bohdan Mushkevych'
from werkzeug.utils import cached_property
from synergy.mx.base_request_handler import BaseRequestHandler
from synergy.mx.rest_model_factory import create_rest_managed_scheduler_entry, create_rest_freerun_scheduler_entry
from synergy.system.performance_tracker import FootprintCalculat... | bsd-3-clause | -4,035,476,388,057,499,000 | 36.84 | 114 | 0.642706 | false | 3.925311 | false | false | false |
xapple/plumbing | plumbing/scraping/headers.py | 1 | 1659 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Written by Lucas Sinclair.
MIT Licensed.
Contact at www.sinclair.bio
"""
# Built-in modules #
# Internal modules #
# First party modules #
# Third party modules #
# Constants #
popular_agents = None
###############################################################... | mit | 7,546,627,581,059,375,000 | 30.903846 | 79 | 0.616637 | false | 3.736486 | false | false | false |
AlgorithmLover/OJCodes | qlcoder/cryptography/substitution_cipher/decrpt_subs_trans.py | 1 | 1529 | def get_cipher_text():
with open('subs_cipher_text.txt') as ifs:
return ifs.readline().strip()
def transform_ch(ch, shift_num):
if ch == ',' or ch == ' ' or ch == '.':
return ch
else:
num = ord(ch) - shift_num
if 65 <= ord(ch) <= 90:
if num < 65:
... | mit | -7,606,734,906,922,885,000 | 28.980392 | 81 | 0.536298 | false | 3.165631 | false | false | false |
fredmorcos/attic | projects/pyfuzz-2/rulebase.py | 1 | 1995 | from rule import Rule
class RuleBase:
""" a set of rules """
def __init__(self, inputs = [], outputs = []):
""" constructor """
self.inputs = inputs
self.outputs = outputs
self.rules = []
def generate(self):
""" generates the rules base from all possible combinations of input
vari... | isc | 2,754,172,748,554,348,500 | 25.6 | 80 | 0.580451 | false | 3.807252 | false | false | false |
samba-team/samba | python/samba/netcmd/gpo.py | 1 | 154472 | # implement samba_tool gpo commands
#
# Copyright Andrew Tridgell 2010
# Copyright Amitay Isaacs 2011-2012 <amitay@gmail.com>
#
# based on C implementation by Guenther Deschner and Wilco Baan Hofman
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public L... | gpl-3.0 | 1,797,665,386,174,072,800 | 37.387674 | 151 | 0.551161 | false | 3.908012 | false | false | false |
JConwayAWT/PGSS14CC | lib/python/multimetallics/ase/io/etsf.py | 12 | 3341 | import numpy as np
from ase.atoms import Atoms
from ase.units import Bohr
from ase.io.pupynere import NetCDFFile
class ETSFReader:
def __init__(self, filename):
self.nc = NetCDFFile(filename, 'r')
def read_atoms(self):
var = self.nc.variables
cell = var['primitive_vectors']
a... | gpl-2.0 | -1,179,459,307,260,355,300 | 32.079208 | 71 | 0.506136 | false | 3.939858 | false | false | false |
rchuppala/usc_agent | src/usc-agent-dev/common/source/pyang/pyang/plugins/jstree.py | 1 | 20796 | """JS-Tree output plugin
Generates a html/javascript page that presents a tree-navigator
to the YANG module(s). Assumes that an images folder exists
relative to the html file.
The images folder is installed at share/yang/images in the pyang installation folder.
Copy or link to that folder.
"""
import optparse
import s... | gpl-2.0 | -5,313,121,289,275,374,000 | 40.261905 | 946 | 0.614012 | false | 2.700779 | false | false | false |
alcarney/stylo | arlunio/_shapes.py | 1 | 17156 | import inspect
import json
import logging
import re
from typing import Any, Dict, List
import pkg_resources
import attr
from .color import RGB8
from .image import Image
from .loaders import load_parameters
Parameter = load_parameters()
logger = logging.getLogger(__name__)
class Canvas:
"""A good canvas is wh... | mit | -2,673,385,573,037,713,400 | 27.833613 | 85 | 0.573619 | false | 4.144963 | false | false | false |
kost/volatility | volatility/win32/tasks.py | 7 | 3717 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your o... | gpl-2.0 | -3,218,633,264,630,727,000 | 33.100917 | 103 | 0.670702 | false | 3.709581 | false | false | false |
someorz/spark | examples/src/main/python/ml/min_max_scaler_example.py | 123 | 1798 | #
# 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 | 2,658,603,556,205,214,700 | 34.96 | 84 | 0.697998 | false | 3.825532 | false | false | false |
vijaysrao/dipa | apps/dipa/data/dipa/log_conv.py | 2 | 2385 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: Xin Wang
# @Date: 2015-06-22 14:28:59
import time
import sys
'''
Log Converter
converts wilab testbed log to Cooja log format
'''
class TestbedLogConverter(object):
def __init__(self, filename):
try:
content = open(filename).read().... | gpl-3.0 | -6,582,399,643,724,260,000 | 28.8125 | 78 | 0.555136 | false | 3.522895 | false | false | false |
AlvinCJin/RealEstateApp | app/__init__.py | 1 | 1921 | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_login import LoginManager
from flask_mail import Mail
from config import ADMINS, MAIL_SERVER, MAIL_PORT, MAIL_USERNAME, MAIL_PASSWORD
from flask_moment import Moment
from flask_admin import Admin
from flask_bootstrap import Bootstrap
db = SQLAl... | bsd-3-clause | -7,037,634,547,716,371,000 | 29.983871 | 134 | 0.677251 | false | 3.744639 | false | false | false |
GPHemsley/congressxml | congressxml/citations/__init__.py | 1 | 3208 | import urllib, json
def is_special_segment(entity_value_segment):
return (entity_value_segment in [ "note", "etseq" ])
def add_special_segment(citation, entity_value_segment):
if "special" not in citation:
citation["special"] = entity_value_segment
else:
raise ValueError("Special segment already defined in cit... | unlicense | 2,448,953,267,672,096,000 | 27.642857 | 129 | 0.68298 | false | 3.058151 | false | false | false |
eviljeff/olympia | src/olympia/addons/management/commands/process_addons.py | 2 | 9012 | from datetime import datetime
from django.core.management.base import BaseCommand, CommandError
from django.db.models import Q, F
from celery import chord, group
from olympia import amo
from olympia.addons.models import Addon
from olympia.addons.tasks import (
add_dynamic_theme_tag,
delete_addons,
extrac... | bsd-3-clause | -9,118,132,711,145,982,000 | 34.904382 | 79 | 0.565579 | false | 3.949167 | false | false | false |
georgetown-analytics/team-404 | analysis.py | 2 | 11700 | ##!!!!!!!!!!!!!!!!!!!!!!!!!!!!This code should not be run from untrusted connections.!!!!!!!!!!!!
##!!!!!!!!!!!!!!!!!!!!!!!!!!!!It is vulnerable to SQL Injection attacks.!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
import random
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import pylab... | mit | -44,827,803,531,406,540 | 33.718101 | 127 | 0.59812 | false | 3.563814 | false | false | false |
cgogolin/ncpol2sdpa | ncpol2sdpa/sdp_relaxation.py | 1 | 63396 | # -*- coding: utf-8 -*-
"""
The module converts a noncommutative optimization problem provided in SymPy
format to an SDPA semidefinite programming problem.
Created on Sun May 26 15:06:17 2013
@author: Peter Wittek
"""
from __future__ import division, print_function
import sys
from functools import partial
import nump... | gpl-3.0 | -3,976,727,306,305,766,000 | 44.905865 | 116 | 0.518471 | false | 4.492347 | false | false | false |
brandonshults01/openemr | phpmyadmin/doc/_ext/configext.py | 121 | 6622 | from sphinx.domains import Domain, ObjType
from sphinx.roles import XRefRole
from sphinx.domains.std import GenericObject, StandardDomain
from sphinx.directives import ObjectDescription
from sphinx.util.nodes import clean_astext, make_refnode
from sphinx.util import ws_re
from sphinx import addnodes
from sphinx.util.do... | gpl-3.0 | 73,193,084,539,967,820 | 34.223404 | 96 | 0.56267 | false | 4.118159 | true | false | false |
lino-framework/lino | lino/management/commands/passwd.py | 1 | 2864 | # -*- coding: UTF-8 -*-
# Copyright 2020 by Rumma & Ko Ltd.
# License: GNU Affero General Public License v3 (see file COPYING for details)
"""
This defines the :manage:`passwd` management command.
See :doc:`/dev/users`.
"""
import djclick as click
import getpass
from lino.api import rt
def default_username():
... | bsd-2-clause | -7,740,756,203,830,548,000 | 32.302326 | 93 | 0.622905 | false | 3.743791 | false | false | false |
ryanakca/slingshot | src/slingshot/network.py | 1 | 3375 | # This file is part of Slingshot.
#
# Slingshot is a two-dimensional strategy game where two players attempt to shoot one
# another through a section of space populated by planets. The main feature of the
# game is that the shots, once fired, are affected by the gravity of the planets.
# Slingshot is Copyright 200... | gpl-2.0 | -351,976,674,207,114,700 | 24.37594 | 92 | 0.67763 | false | 3.107735 | false | false | false |
ioram7/keystone-federado-pgid2013 | build/paste/paste/util/threadedprint.py | 27 | 8211 | # (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
threadedprint.py
================
:author: Ian Bicking
:date: 12 Jul 2004
Multi-threaded printing; allows the output produced via print to be
se... | apache-2.0 | -4,206,024,306,303,339,500 | 31.844 | 84 | 0.635002 | false | 4.046821 | false | false | false |
Ex-sabagostar/atom-shell | script/update-frameworks.py | 2 | 1042 | #!/usr/bin/env python
import sys
import os
from lib.util import safe_mkdir, extract_zip, tempdir, download
SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
FRAMEWORKS_URL = 'https://github.com/atom/atom-shell-frameworks/releases' \
'/download/v0.0.2'
def main():
os.chdi... | mit | -9,208,075,239,644,122,000 | 23.232558 | 75 | 0.68714 | false | 3.287066 | false | false | false |
unsiloai/syntaxnet-ops-hack | tensorflow/contrib/tensor_forest/python/ops/model_ops.py | 68 | 4851 | # 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,095,178,957,292,891,000 | 39.764706 | 90 | 0.717584 | false | 3.97623 | false | false | false |
amaas-fintech/amaas-core-sdk-python | amaascore/transactions/mtm_result.py | 1 | 1359 | from decimal import Decimal
from dateutil.parser import parse
import pytz
from amaascore.core.amaas_model import AMaaSModel
class MTMResult(AMaaSModel):
def __init__(self, asset_manager_id, book_id, business_date, asset_id,
mtm_timestamp, mtm_value=None, mtm_status='Active', message=None,
... | apache-2.0 | 7,256,124,739,873,332,000 | 31.380952 | 82 | 0.621045 | false | 3.595238 | false | false | false |
compas-dev/compas | src/compas/geometry/trimesh/remesh.py | 1 | 2648 | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from compas.plugins import pluggable
__all__ = [
'trimesh_remesh',
'trimesh_remesh_constrained',
'trimesh_remesh_along_isoline',
]
@pluggable(category='trimesh')
def trimesh_remesh(mesh, target_... | mit | 7,328,993,877,921,161,000 | 26.020408 | 116 | 0.652568 | false | 4.270968 | false | false | false |
michaelconnor00/gbdxtools | examples/get_images.py | 1 | 1707 | # Order a list of cat ids, launch AOP workflow for each one and download locally.
import json
import time
from gbdxtools import Interface
start_time = time.time()
catalog_ids = ['1030010034AFCE00',
'103001003696B200',
'105041001126A900',
'1050410011360600',
... | mit | -6,172,392,498,583,437,000 | 30.611111 | 99 | 0.616872 | false | 3.52686 | false | false | false |
jakobj/UP-Tasks | NEST/microcircuit_task/plotting.py | 1 | 4050 | import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import glob
def plot_raster_bars(t_start, t_stop, n_rec, frac_to_plot, network_pops,
path, filename, conf):
# PYTHON2.6: ADDED ARGUMENT network_pops, NEEDED FOR EXTRACTING FIRST
# ID PER POPULATION
... | gpl-2.0 | -8,168,516,630,543,035,000 | 37.571429 | 100 | 0.544198 | false | 3.229665 | false | false | false |
cmohl2013/140327 | filteredMemapToPickle.py | 2 | 1513 | import sys
import numpy as np
sys.path.append("/mnt/moehlc/home/idaf_library")
#import mahotas
import libidaf.idafIO as io
import matplotlib.pyplot as plt
import re
import vigra
import os
import pickle
#SAVE MEMAPS AS pickles
def exportPickle(vol,savepath, fname):
if fname.find('.') != -1: #if file extension zB... | mit | -1,273,528,930,710,076,700 | 23.803279 | 103 | 0.738929 | false | 2.801852 | false | false | false |
simpkins/amass | test/icedax_cmp.py | 1 | 2902 | #!/usr/bin/python -tt
#
# Copyright (c) 2009, Adam Simpkins
#
"""
Examines the current CD via both our internal methods and via icedax,
and makes sure the information reported via both mechanisms agrees.
"""
import optparse
import os
import sys
import traceback
lib_dir = os.path.normpath(os.path.join(sys.path[0], '..... | gpl-3.0 | 8,484,871,319,143,356,000 | 28.313131 | 77 | 0.636802 | false | 3.171585 | false | false | false |
rmadapur/networking-brocade | networking_brocade/vyatta/common/globals.py | 1 | 2071 | # Copyright 2015 Brocade Communications System, 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
#
#... | apache-2.0 | 2,268,428,783,011,083,800 | 30.861538 | 78 | 0.666828 | false | 4.037037 | false | false | false |
OpenIxia/ixnetwork_client_python | ixnetwork/IxnFileManagement.py | 1 | 1894 | """Encapsulates file transfer
"""
import json
import os
class IxnFileManagement(object):
"""File management """
def __init__(self, ixnhttp):
self._ixnhttp = ixnhttp
def create(self, remote_filename):
"""Create an empty file on the server """
url = '/files?filename=%s' % r... | mit | 4,689,666,629,697,777,000 | 32.22807 | 122 | 0.585533 | false | 3.818548 | false | false | false |
sde1000/miltonxero | invoicer/xero.py | 1 | 9372 | from django.shortcuts import render, redirect
import requests
from requests_oauthlib import OAuth2Session
from oauthlib.oauth2.rfc6749.errors import OAuth2Error
from xml.etree.ElementTree import Element, SubElement, tostring, fromstring
from django.conf import settings
from django.http import Http404
import datetime
im... | gpl-3.0 | 8,625,742,087,025,892,000 | 34.233083 | 109 | 0.618545 | false | 3.551345 | false | false | false |
lasoren/ml-optimization | neural_net/NeuralNet.py | 1 | 9431 | """
Created on Wed Feb 10 21:56:02 2016
@author: Ryan Lader, Emily MacLeod working from Lab4_Soln
"""
import numpy as np
import matplotlib.pyplot as plt
def construct_truth(y):
v = []
for i in range(len(y)):
if y[i] == 0:
v += [[1,0]]
elif y[i] == 1:
v += [[0,1]]
r... | mit | -1,762,244,422,584,833,300 | 36.875502 | 100 | 0.510868 | false | 3.530887 | false | false | false |
Tumetsu/FMI-weather-downloader | gui/services/downloadworker.py | 1 | 1351 | from gui.mainwindow import *
from collections import OrderedDict
from PyQt5.QtCore import pyqtSlot, QObject
from gui.messages import Messages
class DownloadWorker(QObject):
"""
A simple download worker class which is ran in separate thread to keep the ui responsive. utilizes
FMIApi classes to process the ... | gpl-2.0 | -5,220,900,152,088,712,000 | 38.735294 | 128 | 0.710585 | false | 4.144172 | false | false | false |
linuxme/python-scripts | nginx_uwsgi/uwsgi_analyze.py | 1 | 1211 | #!/bin/bash
from __future__ import division
import sys
read_file=sys.argv[1]
sum_value = {}
count = {}
max_value = {}
min_value = {}
for line in open(read_file):
line_data = line.split(' ')
try:
if '?' in line_data[18]:
line_data[18] = line_data[18].split('?')[0]
if int(line_data[... | gpl-2.0 | -6,407,040,888,109,353,000 | 34.617647 | 114 | 0.515277 | false | 3.0275 | false | false | false |
soldag/home-assistant | homeassistant/components/onvif/camera.py | 4 | 6333 | """Support for ONVIF Cameras with FFmpeg as decoder."""
import asyncio
from haffmpeg.camera import CameraMjpeg
from haffmpeg.tools import IMAGE_JPEG, ImageFrame
from onvif.exceptions import ONVIFError
import voluptuous as vol
from homeassistant.components.camera import SUPPORT_STREAM, Camera
from homeassistant.compon... | apache-2.0 | 5,118,335,421,704,327,000 | 31.147208 | 99 | 0.593873 | false | 3.923792 | true | false | false |
masroore/pynewscred | pynewscred/req_parser.py | 1 | 7407 | __author__ = 'Dr. Masroor Ehsan'
__email__ = 'masroore@gmail.com'
__copyright__ = 'Copyright 2013, Dr. Masroor Ehsan'
__license__ = 'BSD'
__version__ = '0.1.1'
from datetime import datetime
try:
from lxml import etree
except ImportError:
try:
# Python 2.5
import xml.etree.cElementTree as etree... | bsd-3-clause | 485,683,558,398,270,300 | 31.349345 | 74 | 0.62927 | false | 3.507102 | false | false | false |
Totoketchup/das | utils/postprocessing/representation.py | 1 | 1453 | import numpy as np
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
from sklearn.decomposition import FastICA
import matplotlib.pyplot as plt
def ICA_representation(data, n_components):
ica = FastICA(n_components=n_components, random_state=42)
return ica.fit_transform(data)
def PCA_representa... | mit | -1,679,975,838,649,600,500 | 32.790698 | 91 | 0.713008 | false | 2.731203 | false | false | false |
mdpiper/topoflow | topoflow/utils/outlets.py | 2 | 8375 |
# Copyright (c) 2014, Scott D. Peckham
# September 2014
#------------------------------------------------------------------------
# Note: Wrote this on 9/19/14 to eliminate a cyclic dependency between
# BMI_base.py and basins.py. basins.py inherits from BMI_base.py
# and BMI_base.py has initialize_basin_... | mit | 7,722,501,380,031,204,000 | 36.725225 | 84 | 0.450627 | false | 3.499791 | false | false | false |
Equitable/trump | trump/extensions/source/document.py | 2 | 1346 | from imp import find_module, load_module
import os
curdir = os.path.dirname(os.path.realpath(__file__))
extension_names = [n for n in os.listdir(curdir) if os.path.isdir(os.path.join(curdir, n)) ]
sources = {}
for name in extension_names:
ext = find_module(name, [curdir])
mod = load_module(name, *ext)
so... | bsd-3-clause | -8,825,098,600,566,387,000 | 28.933333 | 92 | 0.520802 | false | 3.433673 | false | false | false |
paolinux79/FTCryPTUploader | FTCryPTUploader/FtpCoord.py | 1 | 1473 | import threading
class FtpCoord:
shutdown = None
lock = None
stats = {}
def __init__(self):
self.shutdown = False
self.lock = threading.Lock()
def kill(self):
print("raising shutdown")
self.shutdown = True
def need_to_stop(self):
return self.shutdown
... | bsd-2-clause | 5,517,717,484,509,087,000 | 28.48 | 87 | 0.468432 | false | 4.12605 | false | false | false |
izyh/oweb | learningTopology/migrations/0001_initial.py | 1 | 17193 | # -*- 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):
# Adding model 'Node'
db.create_table(u'learningTopology_node', (
... | mit | -7,004,918,044,758,994,000 | 81.267943 | 195 | 0.577677 | false | 3.607428 | false | false | false |
CenterForOpenScience/SHARE | tests/share/metadata_formats/test_oai_dc_formatter.py | 2 | 3827 | from lxml import etree
from tests.share.metadata_formats.base import BaseMetadataFormatterTest
def xml_elements_equal(element_1, element_2):
return (
element_1.tag == element_2.tag
and element_1.text == element_2.text
and element_1.tail == element_2.tail
and element_1.attrib == el... | apache-2.0 | -5,439,439,050,747,447,000 | 44.559524 | 224 | 0.604651 | false | 3.144618 | false | false | false |
maas/maas | src/maasserver/utils/interfaces.py | 1 | 1783 | # Copyright 2014-2016 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
"""Utilities related to network and cluster interfaces."""
__all__ = [
"get_name_and_vlan_from_cluster_interface",
"make_name_from_interface",
]
from random import r... | agpl-3.0 | 6,400,013,859,364,894,000 | 33.960784 | 77 | 0.636007 | false | 3.769556 | false | false | false |
edx/edx-organizations | organizations/v0/views.py | 1 | 2984 | """
Views for organizations end points.
"""
from django.http import Http404
from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication
from rest_framework import mixins
from rest_framework import status
from rest_framework import viewsets
from rest_framework.authentication import SessionAuthent... | agpl-3.0 | 1,912,113,332,206,430,200 | 39.324324 | 89 | 0.688338 | false | 4.766773 | false | false | false |
StateOfTheArt89/Twitch.tv-on-XBMC | resources/lib/twitch_addon/routes/edit_sorting.py | 3 | 2436 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2012-2018 Twitch-on-Kodi
This file is part of Twitch-on-Kodi (plugin.video.twitch)
SPDX-License-Identifier: GPL-3.0-only
See LICENSES/GPL-3.0-only for more information.
"""
from ..addon import utils
from ..addon.common import kodi
from ..addon.utils import i1... | gpl-3.0 | 2,140,126,802,566,440,400 | 43.290909 | 127 | 0.593186 | false | 3.788491 | false | false | false |
bio2bel/hmdb | src/bio2bel_hmdb/to_bel.py | 1 | 3904 | # -*- coding: utf-8 -*-
import logging
from pybel.utils import ensure_quotes
def write_metabolites_proteins_bel(manager, file=None):
"""Writes the metabolite-protein association relations found in HMDB into a BEL document.
:param bio2bel_hmdb.Manager manager: Manager object connected to the local HMDB data... | mit | 8,444,917,688,066,239,000 | 37.254902 | 109 | 0.656843 | false | 3.702087 | false | false | false |
lailongwei/llbc | wrap/pyllbc/testsuite/communication/testcase_multisvc.py | 1 | 3628 | # -*- coding: utf-8 -*-
from llbc import Service, TestCase
from time import sleep
import llbc
TEST_REQ = 1
TEST_RES = 51
TEST_IP = '127.0.0.1'
TEST_PORT = 17788
class ClientComp(object):
def oninitialize(self, ev):
ev.svc.asyncconn(TEST_IP, TEST_PORT)
def onsessioncreate(self, ev):
print '... | mit | 2,399,712,955,282,599,400 | 27.793651 | 100 | 0.637266 | false | 3.736354 | true | false | false |
eubr-bigsea/tahiti | migrations/versions/223eb6c3933b_.py | 1 | 6620 | # -*- coding: utf-8 -*-
"""empty message
Revision ID: 223eb6c3933b
Revises: 20ba8618b49d
Create Date: 2017-08-16 16:03:57.007907
"""
import json
from alembic import op, context
from sqlalchemy import Integer, String, Text
from sqlalchemy.orm import sessionmaker
from sqlalchemy.sql import table, column
# revision id... | apache-2.0 | 8,596,546,022,621,986,000 | 33.097938 | 94 | 0.546939 | false | 3.479748 | false | false | false |
cemc/cscircles-wp-content | lesson_files/cheatsheet/cheatsheet-fr.py | 1 | 4778 | 3 * 4, 3 + 4, 3 - 4, 3 / 4 #==> 12, 7, -1, 0.75
3 ** 4, 3 // 4, 3 % 4 #==> 81, 0, 3
4 > 3, 4 >= 3, 3 == 3.0, 3 != 4, 3 <= 4 #==> True, True, True, True, True
# ordre des opérations: parenthèses, **, {* / // %}, {+ -}, {== != <= < > >=}
min(3, 4), max(3, 4), abs(-10) #==> ... | gpl-3.0 | 1,429,919,302,756,941,000 | 48.28125 | 81 | 0.552103 | false | 2.804386 | false | false | false |
droberson/davenavarrosgoatee | dave_navarros_goatee.py | 1 | 11576 | #!/usr/bin/env python3
"""
dave_navarros_goatee.py
This attempts to discover potential passwords leaked to the filesystem
via chat and program logs, shell histories, configuration files, and
anything else that is readable.
This is currently very terrible and shouldnt be used.
2/2017 -- Daniel Roberson
TODO:
- add m... | mit | -239,205,068,737,602,700 | 29.224543 | 90 | 0.598652 | false | 3.804141 | false | false | false |
kuggenhoffen/CoAPthon | coapthon/layer/blockwise.py | 1 | 3447 | from coapthon import defines
__author__ = 'Giacomo Tanganelli'
__version__ = "2.0"
class BlockwiseLayer(object):
"""
Handles the Blockwise feature.
"""
def __init__(self, parent):
"""
Initialize a Blockwise Layer.
:type parent: coapserver.CoAP
:param parent: the CoAP ... | mit | 342,313,515,061,690,000 | 34.183673 | 78 | 0.51262 | false | 4.031579 | false | false | false |
Bismarrck/tensorflow | tensorflow/python/keras/optimizer_v2/nadam.py | 2 | 5695 | # 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 | -3,490,780,553,245,612,500 | 38.006849 | 80 | 0.619315 | false | 3.167408 | false | false | false |
GoogleCloudPlatform/training-data-analyst | courses/machine_learning/deepdive/09_sequence_keras/sinemodel/model.py | 2 | 7881 | #!/usr/bin/env python
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | apache-2.0 | 288,156,145,079,207,800 | 38.808081 | 131 | 0.661718 | false | 3.512032 | false | false | false |
alephobjects/ohai-kit | ohai_kit/migrations/0004_auto_20151103_1900.py | 1 | 2972 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.core.files.storage
class Migration(migrations.Migration):
dependencies = [
('ohai_kit', '0003_Adding ohai-kit setting database'),
]
operations = [
migrations.AddField(
... | agpl-3.0 | 1,217,850,971,549,228,800 | 48.533333 | 226 | 0.657133 | false | 3.864759 | false | false | false |
markYoungH/chromium.src | tools/telemetry/telemetry/image_processing/screen_finder.py | 15 | 34484 | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# This script attempts to detect the region of a camera's field of view that
# contains the screen of the device we are testing.
#
# U... | bsd-3-clause | -7,052,650,907,545,187,000 | 39.23804 | 80 | 0.639862 | false | 3.738914 | false | false | false |
zvolsky/cnb | cnb.py | 1 | 14705 | # -*- coding: utf-8 -*-
"""Python lib to access exchange rates from the Czech National Bank.
Fork of (PyPI) cnb-exchange-rate (MIT licensed).
install_requires = ['six', 'pytz']
Usage:
import cnb
from datetime import date, datetime, timedelta
cnb.rate('USD')
24.688
cnb.convert(1000, 'USD')
24688.0
cn... | mit | 3,719,712,144,630,910,500 | 40.660057 | 121 | 0.642095 | false | 3.506199 | true | false | false |
Barrog/C4-Datapack | data/jscript/quests/259_RanchersPlea/__init__.py | 1 | 2538 | # Made by Mr. - Version 0.3 by DrLecter
import sys
from net.sf.l2j.gameserver.model.quest import State
from net.sf.l2j.gameserver.model.quest import QuestState
from net.sf.l2j.gameserver.model.quest.jython import QuestJython as JQuest
GIANT_SPIDER_SKIN = 1495
ADENA = 57
HEALING_POTION = 1061
WOODEN_ARROW = 17
class Q... | gpl-2.0 | 2,231,812,666,035,110,100 | 26.586957 | 74 | 0.648148 | false | 2.630052 | false | false | false |
xia2/xia2 | src/xia2/Wrappers/Dials/DetectBlanks.py | 1 | 3173 | import json
import os
from xia2.Driver.DriverFactory import DriverFactory
def DetectBlanks(DriverType=None):
"""A factory for DetectBlanksWrapper classes."""
DriverInstance = DriverFactory.Driver(DriverType)
class DetectBlanksWrapper(DriverInstance.__class__):
def __init__(self):
su... | bsd-3-clause | -7,976,982,671,987,241,000 | 35.895349 | 84 | 0.590923 | false | 4.153141 | false | false | false |
Social-projects-Rivne/Rv-025.Python | client/client_app/models/restaurant.py | 1 | 1257 | """Contain a model classes for restaurant and restaurant type.
"""
from client_app import db
class Restaurant(db.Model):
"""Model of Restaurant object
"""
__tablename__ = "restaurant_restaurant"
STATUS_ACTIVE = 0
STATUS_DELETED = 1
STATUS_HIDDEN = 2
id = db.Column(db.Integer, primary_... | mit | -5,022,933,337,496,336,000 | 27.568182 | 73 | 0.676213 | false | 3.434426 | false | false | false |
yjzhang/uncurl_python | tests/test_experiment_runner.py | 1 | 2054 | from __future__ import print_function
from unittest import TestCase
import numpy as np
from scipy import sparse
from scipy.io import loadmat
import uncurl
class ExperimentRunnerTest(TestCase):
# TODO: test dataset
def setUp(self):
dat = loadmat('data/SCDE_test.mat')
self.data = dat['dat'].t... | mit | -6,963,533,124,627,568,000 | 39.27451 | 115 | 0.653359 | false | 3.372742 | true | false | false |
trivago/Protector | protector/proxy/http_request.py | 1 | 1404 | from httplib import HTTPSConnection, HTTPConnection, IncompleteRead
import urlparse
import threading
class HTTPRequest(object):
"""
A simple, thread-safe wrapper around HTTP(S)Connection
"""
def __init__(self):
self.tls = threading.local()
self.tls.conns = {}
def request(self, ur... | bsd-3-clause | -8,402,188,319,132,165,000 | 33.243902 | 93 | 0.57906 | false | 4.346749 | false | false | false |
jotinha/scn2obj | python/lmaptest.py | 1 | 5123 | # -*- coding: utf-8 -*-
"""
Created on Fri Apr 19 02:01:37 2013
@author: jsousa
"""
from scn import Scn
from scntypes import *
from StringIO import StringIO
from collections import defaultdict
MAP = 'missiona'
scn = Scn(MAP + '.scn')
EXPORT_PATH = '/home/jsousa/dev/web/scn/'
TEXSIZE= 128
class Bunch:
def __init_... | bsd-3-clause | -3,001,508,112,180,294,700 | 29.494048 | 145 | 0.596916 | false | 2.739572 | false | false | false |
sabbir360/mvc-flask | helpers/loginhelper.py | 1 | 3094 | from hashlib import sha512
from functools import wraps
from flask import session, abort
from helpers.generic import set_message, FLASH_MESSAGE_WARNING
# sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../application/mod_authentication")
import application
class PasswordHelper:
salt = "jahdjagu... | mit | 1,863,446,378,534,252,500 | 31.568421 | 129 | 0.614092 | false | 4.01297 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.