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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
HaebinShin/tensorflow | tensorflow/contrib/learn/python/learn/utils/export.py | 1 | 7614 | # Copyright 2016 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,426,686,088,125,877,000 | 38.046154 | 82 | 0.678356 | false | 4.373349 | false | false | false |
iLampard/alphaware | alphaware/tests/utils/test_pandas_utils.py | 1 | 6717 | # -*- coding: utf-8 -*-
from unittest import TestCase
from parameterized import parameterized
import pandas as pd
import numpy as np
from numpy.testing.utils import assert_array_equal
from pandas import (MultiIndex,
Index)
from pandas.util.testing import assert_frame_equal, assert_series_equal
from... | apache-2.0 | -7,518,428,269,691,289,000 | 51.476563 | 120 | 0.450648 | false | 3.632774 | true | false | false |
citrix-openstack-build/ironic | ironic/drivers/modules/fake.py | 1 | 2494 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# -*- encoding: utf-8 -*-
#
# Copyright 2013 Hewlett-Packard Development Company, L.P.
#
# 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
#
# htt... | apache-2.0 | -7,277,306,020,164,892,000 | 28 | 78 | 0.639134 | false | 4.352531 | false | false | false |
Azure/azure-sdk-for-python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/resources/v2018_05_01/aio/_configuration.py | 1 | 3218 | # 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 may ... | mit | -4,927,705,798,240,208,000 | 47.029851 | 134 | 0.682101 | false | 4.558074 | true | false | false |
nanobox-io/nanobox-adapter-libcloud | nanobox_libcloud/controllers/meta.py | 1 | 3030 | from flask import render_template, request
from nanobox_libcloud import app
from nanobox_libcloud.adapters import get_adapter
from nanobox_libcloud.adapters.base import AdapterBase
from nanobox_libcloud.utils import output
# Overview and usage endpoints, to explain how this meta-adapter works
@app.route('/', methods=... | mit | -6,108,083,656,066,812,000 | 36.407407 | 152 | 0.705941 | false | 3.955614 | false | false | false |
dpausp/pyrailway | pyrailway/operation.py | 1 | 2267 | class Operation:
def __init__(self, *stations):
self.stations = stations
def __call__(self, params=None, **dependencies):
options = dict(params=(params or {}), **dependencies)
success = True
for station in self.stations:
if (success and station.runs_... | mit | -8,869,891,410,881,496,000 | 24.188889 | 99 | 0.574327 | false | 4.277358 | false | false | false |
cbitstech/Purple-Robot-Django | management/commands/extractors/builtin_rawlocationprobe.py | 1 | 3339 | # pylint: disable=line-too-long
import datetime
import psycopg2
import pytz
CREATE_PROBE_TABLE_SQL = 'CREATE TABLE builtin_rawlocationprobe(id SERIAL PRIMARY KEY, user_id TEXT, guid TEXT, timestamp BIGINT, utc_logged TIMESTAMP, latitude DOUBLE PRECISION, longitude DOUBLE PRECISION, altitude DOUBLE PRECISION, accuracy... | gpl-3.0 | -5,321,546,172,391,040,000 | 35.293478 | 327 | 0.575621 | false | 4.107011 | false | false | false |
teamtaverna/core | app/api/tests/utils.py | 1 | 1160 | from base64 import b64encode
from django.contrib.auth.models import User
admin_test_credentials = ('admin1', 'admin@taverna.com', 'qwerty123',)
normal_user_credentials = ('user1', 'user1@taverna.com', 'qwerty123',)
endpoint = '/api'
def obtain_api_key(client):
credentials = '{}:{}'.format(
admi... | mit | -72,517,511,289,812,450 | 28 | 90 | 0.631034 | false | 3.483483 | false | false | false |
canihavesomecoffee/sample-platform | decorators.py | 1 | 4344 | """define decorators for use across app."""
from datetime import date
from functools import wraps
from typing import Any, Callable, Dict, List, Optional, Union
from flask import g, render_template, request
from database import EnumSymbol
from mod_auth.models import User
def get_menu_entries(user: Optional[User], t... | isc | 5,094,530,706,758,486,000 | 34.317073 | 116 | 0.548803 | false | 4.365829 | false | false | false |
hgiemza/DIRAC | WorkloadManagementSystem/Agent/StalledJobAgent.py | 2 | 20827 | ########################################################################
# File : StalledJobAgent.py
########################################################################
""" The StalledJobAgent hunts for stalled jobs in the Job database. Jobs in "running"
state not receiving a heart beat signal for more than stalle... | gpl-3.0 | -8,255,214,876,684,673,000 | 37.426199 | 170 | 0.612954 | false | 3.884185 | true | false | false |
roryscarson/NOVUS | novus_pkg/F_cashFlow_B_pnl.py | 1 | 22178 | #!python
# -*- encoding: utf-8 -*-
# F_cashFlow_B_pnl.py
# Greg Wilson, 2012
# gwilson.sq1@gmail.com
# This software is part of the Public Domain.
# This file is part of the NOVUS Entrepreneurship Training Program.
# NOVUS is free software: you can redistribute it and/or modify
# it under the terms of the ... | gpl-3.0 | 8,315,200,174,922,877,000 | 53.762963 | 116 | 0.571287 | false | 3.086279 | false | false | false |
82Flex/DCRM | fluent_comments/templatetags/fluent_comments_tags.py | 1 | 5568 | import django
from django.conf import settings
from django.template import Library, Node
from django.template.loader import get_template
from fluent_comments.utils import get_comment_template_name, get_comment_context_data
from tag_parser import parse_token_kwargs
from tag_parser.basetags import BaseInclusionNode
from ... | agpl-3.0 | 6,444,168,918,875,907,000 | 34.018868 | 115 | 0.655352 | false | 3.988539 | false | false | false |
sysbot/CouchPotatoServer | couchpotato/core/plugins/scanner/main.py | 1 | 33209 | from couchpotato import get_session
from couchpotato.core.event import fireEvent, addEvent
from couchpotato.core.helpers.encoding import toUnicode, simplifyString, ss, sp
from couchpotato.core.helpers.variable import getExt, getImdb, tryInt, \
splitString
from couchpotato.core.logger import CPLog
from couchpotato.c... | gpl-3.0 | -6,318,653,490,351,516,000 | 35.898889 | 351 | 0.523202 | false | 4.019973 | false | false | false |
mppmu/secdec | nodist_examples/hexabox/generate_I73_1.py | 1 | 2168 | #! /usr/bin/env python
from pySecDec.loop_integral import loop_package
import pySecDec as psd
li = psd.loop_integral.LoopIntegralFromPropagators(
loop_momenta = ['k1','k2'],
external_momenta = ['p1','p2','p3','p4','p5'],
#Lorentz_indices = ['mu'],
propagators = ['k1**2','(k1-p1)**2','(k1-p1-p2)**2','(k1-p1-p2-p3)**... | gpl-3.0 | 7,686,921,309,786,268,000 | 29.111111 | 179 | 0.572417 | false | 2.793814 | false | false | false |
pkill-nine/qutebrowser | qutebrowser/config/configdata.py | 1 | 75773 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2014-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 | -5,174,265,861,828,115,000 | 40.019491 | 79 | 0.522313 | false | 4.154584 | false | false | false |
cuauv/software | shm_tools/shmlog/util/logbenchmark.py | 1 | 1703 | #!/usr/bin/env python2
from shm_tools.shmlog.parser import LogParser
import argparse
import sys
from datetime import datetime
from time import sleep, mktime, time
import os
import struct
import sys
'''
Utility for benchmarking log file access
Jeff Heidel 2013
'''
GROUP = 0xFFFF
END_STBL = 0xFFFFFFFFFFFFFFFF
ap = arg... | bsd-3-clause | -3,123,619,079,962,118,700 | 21.706667 | 74 | 0.660012 | false | 3.13628 | false | false | false |
hayd/leanpub | leanpub/watcher.py | 1 | 1473 | from watchdog.observers import Observer
from watchdog.watchmedo import observe_with
from leanpub.shellcommandtrick import ShellCommandTrick
def pandoc_cmd(book):
"""Create the command to convert the files (listed in `book`)
into a pdf. This is wrapped with echos that the build has started and
is complete... | mit | -9,163,009,473,004,781,000 | 31.021739 | 98 | 0.60964 | false | 3.64604 | false | false | false |
bsmithgall/wexplorer | wexplorer/explorer/models.py | 1 | 2184 | # -*- coding: utf-8 -*-
from wexplorer.database import (
Column,
db,
Model
)
from wexplorer.extensions import bcrypt
class FileUploadPassword(Model):
__tablename__ = 'file_upload_password'
password = Column(db.String(128), nullable=False, primary_key=True)
def __init__(self, password):
... | bsd-3-clause | 3,477,530,918,630,866,400 | 33.125 | 90 | 0.665293 | false | 3.461173 | false | false | false |
nelhage/taktician | python/scripts/allmoves.py | 1 | 1177 | import tak.ptn
import sqlite3
import os.path
import collections
import traceback
SIZE = 5
GAMES_DIR = os.path.join(os.path.dirname(__file__), "../../games")
DB = sqlite3.connect(os.path.join(GAMES_DIR, "games.db"))
cur = DB.cursor()
cur.execute('select day, id from games where size = ?', (SIZE,))
corpus = collectio... | mit | -6,197,537,536,854,740,000 | 27.707317 | 87 | 0.643161 | false | 2.75 | false | false | false |
Clinical-Genomics/scout | tests/adapter/mongo/test_user_handling.py | 1 | 4378 | from scout.build.user import build_user
def test_delete_user(adapter):
institutes = ["test-1", "test-2"]
## GIVEN an adapter with two users
for i, ins in enumerate(institutes, 1):
user_info = {
"email": "clark.kent{}@mail.com".format(i),
"id": "clke0" + str(i),
... | bsd-3-clause | 870,829,471,759,422,700 | 28.986301 | 71 | 0.584513 | false | 3.319181 | true | false | false |
diver-in-sky/django-threaded-multihost | threaded_multihost/test_app/settings.py | 1 | 3063 | # Django settings for mytest project.
from os.path import normpath, join, dirname
#ROOT : the django project root
ROOT = lambda *base : normpath(join(dirname(__file__), *base)).replace('\\','/')
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABAS... | bsd-3-clause | 6,086,891,033,615,040,000 | 34.206897 | 101 | 0.709435 | false | 3.52069 | false | false | false |
tsuru/healthcheck-as-a-service | tests/test_api.py | 1 | 9751 | # Copyright 2015 healthcheck-as-a-service 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 unittest
import json
import mock
import inspect
import os
from healthcheck import api, backends
from . import managers
class APITestCas... | bsd-3-clause | -8,438,007,150,804,135,000 | 31.503333 | 86 | 0.56948 | false | 3.777993 | true | false | false |
smartsheet-platform/smartsheet-python-sdk | smartsheet/models/contact.py | 1 | 2222 | # pylint: disable=C0111,R0902,R0904,R0912,R0913,R0915,E1101
# Smartsheet Python SDK.
#
# Copyright 2018 Smartsheet.com, 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-2.0 | -6,362,989,200,886,816,000 | 23.966292 | 75 | 0.613411 | false | 3.982079 | false | false | false |
originaltebas/chmembers | migrations/versions/f7f3dbae07bb_.py | 1 | 1302 | """empty message
Revision ID: f7f3dbae07bb
Revises: 1e4e2ceb943c
Create Date: 2019-06-05 17:52:42.855915
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision = 'f7f3dbae07bb'
down_revision = '1e4e2ceb943c'
branch_labels = None
depe... | mit | -7,327,431,518,141,573,000 | 30 | 65 | 0.62212 | false | 3.538043 | false | false | false |
thirdkey-solutions/multisig-recovery | multisigrecovery/commands.py | 1 | 5846 | from multisigcore.providers.insight import InsightBatchService
from multisigcore.hierarchy import MasterKey
from .branch import Branch, AccountPubkeys
from .recovery import CachedRecovery
from .batch import Batch
import json
from pycoin.encoding import EncodingError
try:
from termcolor import colored
except ImportErro... | bsd-2-clause | 2,622,204,806,939,911,700 | 37.715232 | 191 | 0.712624 | false | 3.173724 | false | false | false |
miniworld-project/miniworld_core | miniworld/model/spatial/Roads.py | 1 | 4215 | # encoding: utf-8
from miniworld.model.singletons.Singletons import singletons
from collections import OrderedDict
import geojson
from .Road import Road
__author__ = "Patrick Lampe"
__email__ = "uni at lampep.de"
class Roads:
"""
Attributes
----------
list_of_roads : ... | mit | 180,887,287,657,060,220 | 35.025641 | 122 | 0.515777 | false | 3.817935 | false | false | false |
laurybueno/MoniBus | mapa/urls.py | 1 | 1112 | """mapa URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-based... | agpl-3.0 | -3,757,937,932,243,510,300 | 31.647059 | 82 | 0.70991 | false | 3.490566 | false | false | false |
Linkid/fofix | fofix/core/Mod.py | 1 | 2968 | #####################################################################
# -*- coding: utf-8 -*- #
# #
# Frets on Fire #
# Copyright (C) 2006 Sami Ky?stil? ... | gpl-2.0 | 1,096,748,204,278,025,300 | 37.545455 | 109 | 0.523248 | false | 4.276657 | false | false | false |
Urinx/Project_Euler_Answers | 128.py | 1 | 1330 | #!/usr/bin/env python
#coding:utf-8
"""
Hexagonal tile differences
A hexagonal tile with number 1 is surrounded by a ring of six hexagonal tiles, starting at "12 o'clock" and numbering the tiles 2 to 7 in an anti-clockwise direction.
New rings are added in the same fashion, with the next rings being numbered 8 to 19,... | gpl-2.0 | -5,135,474,069,018,303,000 | 40.59375 | 166 | 0.67218 | false | 3.03653 | false | false | false |
akx/shoop | shoop/core/models/_order_lines.py | 1 | 5821 | # -*- coding: utf-8 -*-
# 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, with_statement
from django.core.ex... | agpl-3.0 | -6,166,658,032,504,064,000 | 37.806667 | 112 | 0.68356 | false | 3.837179 | false | false | false |
sissaschool/xmlschema | tests/test_files.py | 1 | 3234 | #!/usr/bin/env python
#
# Copyright (c), 2016-2020, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/licenses/MIT.
#
# @author Da... | mit | 6,779,808,727,647,150,000 | 38.439024 | 89 | 0.606988 | false | 4.037453 | true | false | false |
dwillis/dayspring | dayspring/settings.py | 1 | 5226 | # Django settings for dayspring project.
import os
PROJECT_PATH = os.path.realpath(os.path.dirname(__file__))
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@example.com'),
)
MANAGERS = ADMINS
# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https:/... | mit | -976,203,766,647,926,500 | 29.747059 | 79 | 0.69977 | false | 3.543051 | false | false | false |
andresriancho/moto | tests/test_s3/test_server.py | 1 | 1530 | import sure # noqa
import moto.server as server
'''
Test the different server responses
'''
def test_s3_server_get():
backend = server.create_backend_app("s3")
test_client = backend.test_client()
res = test_client.get('/')
res.data.should.contain('ListAllMyBucketsResult')
def test_s3_server_buc... | apache-2.0 | 8,750,110,255,723,227,000 | 26.818182 | 85 | 0.649673 | false | 3.269231 | true | false | false |
cojacoo/testcases_echoRD | gen_test2211.py | 1 | 4396 | import numpy as np
import pandas as pd
import scipy as sp
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import os, sys
try:
import cPickle as pickle
except:
import pickle
#connect echoRD Tools
pathdir='../echoRD' #path to echoRD
lib_path = os.path.abspath(pathdir)
#sys.path.append(lib_pa... | gpl-3.0 | 2,470,535,713,098,664,000 | 30.177305 | 296 | 0.720428 | false | 2.533718 | false | false | false |
bkuczenski/lca-tools | antelope_utilities/flowables/create_synonyms.py | 1 | 4679 | import os
import json
import re
from antelope_catalog.providers.ecospold2 import EcospoldV2Archive
from antelope_catalog.providers.ilcd import grab_flow_name, IlcdLcia
from antelope_catalog.providers.xml_widgets import find_tag, find_tags, find_common, find_ns
from lcatools.flowdb.synlist import Flowables, Inconsisten... | gpl-2.0 | -5,978,112,579,486,739,000 | 30.829932 | 119 | 0.602265 | false | 3.048208 | false | false | false |
dylanfried/yesterday-tomorrow | OperationOrganism.py | 1 | 7841 | from copy import copy
import random
from helpers import shift
class OperationOrganism:
length = 150
def __init__(self,genome=None,target=None,population=None):
self.population = population
if genome:
self.genome = genome[:]
else:
self.genome = [(random.sample([1,... | apache-2.0 | 6,161,296,623,014,132,000 | 43.050562 | 156 | 0.523275 | false | 3.879762 | false | false | false |
abelfunctions/abelfunctions | abelfunctions/riemann_theta/deprecated/riemanntheta.py | 1 | 31845 | """
Computing Riemann Theta Functions
This module implements the algorithms for computing Riemann theta
functions and their derivatives featured in the paper *"Computing
Riemann Theta Functions"* by Deconinck, Heil, Bobenko, van Hoeij, and
Schmies [CRTF].
**DEFINITION OF THE RIEMANN THETA FUNCTION:**
Let `g` be a ... | mit | -6,444,361,531,170,360,000 | 37.882784 | 250 | 0.583859 | false | 3.479187 | false | false | false |
clovertrail/cloudinit-bis | cloudinit/config/cc_ntp.py | 1 | 4063 | # vi: ts=4 expandtab
#
# Copyright (C) 2016 Canonical Ltd.
#
# Author: Ryan Harper <ryan.harper@canonical.com>
#
# 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.
#
# ... | gpl-3.0 | -5,945,354,172,292,923,000 | 28.442029 | 79 | 0.624169 | false | 3.657066 | true | false | false |
lexotero/try-it | apps/congress/admin.py | 1 | 1496 | from django.contrib import admin
from apps.congress.models import Edition, Company, Speaker, Tag, Track, ActivityFormat, Activity
class TagAdmin(admin.ModelAdmin):
search_fields = ["name"]
class EditionAdmin(admin.ModelAdmin):
list_display = ["start", "end", "name", "description"]
search_fields = ["nam... | apache-2.0 | -4,323,105,958,972,232,700 | 29.530612 | 96 | 0.701203 | false | 3.596154 | false | false | false |
miing/mci_migo | identityprovider/tests/openid_server/per_version/test_openid_teams.py | 1 | 1669 | from identityprovider.const import LAUNCHPAD_TEAMS_NS
from identityprovider.tests.helpers import OpenIDTestCase
class OpenIDTeamsTestCase(OpenIDTestCase):
def test(self):
# = Launchpad OpenID Teams Extension =
# The Launchpad OpenID server implements a custom team membership
# extension.... | agpl-3.0 | -9,369,407,362,418,992 | 40.725 | 79 | 0.65728 | false | 4.080685 | true | false | false |
lixun910/pysal | pysal/viz/splot/_viz_esda_mpl.py | 1 | 44623 | import matplotlib.pyplot as plt
import matplotlib as mpl
import geopandas as gpd
import numpy as np
from pysal.lib.weights.contiguity import Queen
from pysal.lib.weights.spatial_lag import lag_spatial
import seaborn as sbn
from pysal.explore.esda.moran import (Moran_Local, Moran_Local_BV,
Moran,... | bsd-3-clause | 2,072,672,532,014,773,200 | 33.943618 | 85 | 0.595164 | false | 3.581588 | false | false | false |
rrrrrr8/vnpy | vnpy/api/lbank/test.py | 1 | 1536 | # encoding: UTF-8
from six.moves import input
from time import time
from vnlbank import LbankRestApi, LbankWebsocketApi
API_KEY = '132a36ce-ad1c-409a-b48c-09b7877ae49b'
SECRET_KEY = '319320BF875297E7F4050E1195B880E8'
#----------------------------------------------------------------------
def restTest():
""""""... | mit | 5,003,571,435,686,934,000 | 21.522388 | 83 | 0.479443 | false | 3.016 | false | false | false |
crossroadchurch/paul | openlp/plugins/songs/forms/editsongform.py | 1 | 60260 | # -*- coding: utf-8 -*-
# vim: autoindent shiftwidth=4 expandtab textwidth=120 tabstop=4 softtabstop=4
###############################################################################
# OpenLP - Open Source Lyrics Projection #
# ------------------------------------------------------... | gpl-2.0 | -344,718,849,953,748,350 | 46.429921 | 143 | 0.552394 | false | 4.012523 | false | false | false |
zhuwbigdata/hadoop-admin-utils | ambari-utils/python2/getConfig2.py | 1 | 5465 | #!/usr/bin/python
# Get a handle to the API client
import ssl
import sys
import pprint
import argparse
import requests
SERVICE_TYPE_MAP = {
'zookeeper': 'ZOOKEEPER',
'hdfs': 'HDFS',
'hbase': 'HBASE',
'yarn': 'YARN',
'oozie': 'OOZIE',
'hbase': 'HBASE',
'kafka': 'KAFKA',
}
SERVICE_ROLE_TYPE_MAP = {
... | apache-2.0 | -7,083,016,760,662,906,000 | 30.959064 | 116 | 0.613358 | false | 3.115735 | true | false | false |
cpn18/track-chart | gps-pi/nmea.py | 1 | 1791 | #!/usr/bin/python3
"""
NMEA Utils
"""
def tpv_to_json(report):
if report is None:
return {"class": "TPV", "mode": 0}
tpv = {
'class': report['class'],
'mode': report['mode'],
}
for field in ['device', 'status', 'time', 'altHAE', 'altMSL', 'alt',
'climb', 'datum', 'de... | gpl-3.0 | 2,407,027,658,398,743,600 | 31.563636 | 75 | 0.47962 | false | 2.936066 | false | false | false |
PaulEcoffet/stonewallsgate | dunwallsgate/soundmanager.py | 1 | 1920 | import os.path
import pygame.mixer
import data
LOOP = -1
def load_music(music_ref):
"""
Charge une musique en mémoire mais ne la joue pas
music_ref - La référence de la musique
"""
music_path = data.get_sound_path(
os.path.join("music", music_ref + ".ogg"))
pygame.mixer.music.load(m... | gpl-2.0 | -166,225,870,081,417,380 | 21.951807 | 68 | 0.626247 | false | 2.830609 | false | false | false |
Joergen/zamboni | sites/landfill/settings_base.py | 1 | 5699 | """private_base will be populated from puppet and placed in this directory"""
import logging
import os
import dj_database_url
from lib.settings_base import CACHE_PREFIX, ES_INDEXES, KNOWN_PROXIES, LOGGING
from .. import splitstrip
import private_base as private
ENGAGE_ROBOTS = False
EMAIL_BACKEND = 'django.core.m... | bsd-3-clause | -8,507,801,712,565,959,000 | 28.225641 | 94 | 0.670819 | false | 2.954381 | false | false | false |
ddinsight/dd-streamworks | stream_worker/devmodule/production/vidnet/__init__.py | 1 | 40613 | # -*- coding: utf-8 -*-
#
# Copyright 2015 AirPlug 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 applic... | apache-2.0 | -2,276,425,715,459,409,000 | 38.855741 | 211 | 0.637161 | false | 2.839871 | false | false | false |
whitesmith/hawkpost | humans/migrations/0007_notification.py | 1 | 1205 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-27 15:52
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('auth', '0007_alter_validators_add_error_messages'),
... | mit | 1,414,934,465,553,693,700 | 35.515152 | 132 | 0.570124 | false | 4.16955 | false | false | false |
shivupa/pyci | methods/misc/asci_old2.py | 1 | 6642 | import scipy as sp
import scipy.linalg as spla
import scipy.sparse.linalg as splinalg
import numpy as np
from functools import reduce
import pyscf
import itertools
import h5py
from pyscf import gto, scf, ao2mo, fci
import pyscf.tools as pt
import copy
import matplotlib.pyplot as plt
from utils import *
#############
# ... | gpl-3.0 | 6,862,469,402,105,148,000 | 30.932692 | 166 | 0.606896 | false | 2.703297 | false | false | false |
dvl/cdzforever.net | cdzforever/apps/manga/migrations/0002_auto__add_field_pagina_image.py | 1 | 2062 | # -*- 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 field 'Pagina.image'
db.add_column(u'manga_pagina', 'image',
... | mit | 1,814,648,615,557,720,600 | 44.844444 | 120 | 0.549467 | false | 3.419569 | false | false | false |
vyzyv/university | python/Zestaw8/8_3.py | 1 | 1027 | from random import uniform
def calc_pi(n=100, r=1):
"""Function calculating approximation of pi number.
Based on Monte Carlo algorithm
Arguments are:
n - number of random numbers generated by uniform distribution
r - radius of a circle"""
circle_counter = 0
for i in range(n):
... | apache-2.0 | 4,753,075,106,202,006,000 | 34.413793 | 83 | 0.594937 | false | 3.291667 | false | false | false |
dougwig/a10-neutron-lbaas | a10_neutron_lbaas/db/models/scaling_group.py | 1 | 10831 | # 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 | -8,164,595,207,262,769,000 | 36.348276 | 96 | 0.599391 | false | 3.945719 | false | false | false |
ppolewicz/ant-colony | antcolony/simulator.py | 1 | 1673 | from stats import QueenStats
from ant_move import AntStartMove
from edge import DummyEdgeEnd
class Simulator(object):
def __init__(self, reality, simulation_class, reality_processors):
self.reality = reality
self.simulation_class = simulation_class
self.reality_processors = reality_processo... | bsd-3-clause | 257,776,731,439,886,800 | 41.897436 | 92 | 0.663479 | false | 3.685022 | false | false | false |
sixu05202004/newsmeme | newsmeme/newsmeme/views/account.py | 1 | 6900 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import uuid
from flask import Module, flash, request, g, current_app, \
abort, redirect, url_for, session, jsonify
from flask.ext.mail import Message
from flask.ext.babel import gettext as _
from flask.ext.principal import identity_changed, Identity, AnonymousIdentit... | bsd-3-clause | 1,973,843,528,547,501,600 | 26.733871 | 79 | 0.589852 | false | 4.079478 | false | false | false |
vwc/agita | src/vwcollective.simplecontact/vwcollective/simplecontact/browser/contactfolderview.py | 1 | 2856 | from zope.interface import implements, Interface
from Acquisition import aq_inner
from Products.Five import BrowserView
from Products.CMFCore.utils import getToolByName
from Products.Five.browser.pagetemplatefile import ViewPageTemplateFile
from vwcollective.simplecontact.interfaces import IContactFolder
from vwcolle... | mit | -2,913,841,775,823,524,000 | 41 | 98 | 0.569678 | false | 4.898799 | false | false | false |
RoyShulman/openstack-project | cinder_functions.py | 1 | 2028 | from cinderclient.v2 import client as cinderClient
import easygui
class Cinder:
def __init__(self, keystone_session):
self.cinder_client = cinderClient.Client(session=keystone_session)
def create_volume(self, instance_name):
"""
Create an empty block volume for an instance. Volume will... | mit | -8,199,254,290,680,970,000 | 32.245902 | 98 | 0.582347 | false | 4.506667 | false | false | false |
mtik00/yamicache | setup.py | 1 | 1167 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import setup, find_packages
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = []
setup_requirements = ['pytest-runne... | mit | 1,442,082,234,181,209,600 | 26.785714 | 56 | 0.652099 | false | 3.601852 | true | true | false |
fosfataza/protwis | common/diagrams_arrestin.py | 1 | 24369 | from common.diagrams import Diagram
from common.definitions import ARRESTIN_SEGMENTS
from residue.models import Residue
from residue.models import ResidueGenericNumber
from residue.models import ResidueNumberingScheme
from django.utils.safestring import mark_safe
from math import cos, sin, pi, floor, sqrt
from datet... | apache-2.0 | -5,423,738,260,072,005,000 | 40.443878 | 384 | 0.507448 | false | 3.370539 | false | false | false |
consbio/python-databasin | tests/test_client.py | 1 | 15329 | from __future__ import absolute_import
import copy
import json
import zipfile
import pytest
import requests_mock
import six
from requests.models import Request
from databasin.client import Client
from databasin.exceptions import DatasetImportError
from .utils import make_api_key_callback
try:
from unittest impo... | bsd-3-clause | -4,360,527,989,050,836,500 | 38.507732 | 120 | 0.591363 | false | 3.192876 | true | false | false |
ujdhesa/unisubs | unisubs_settings.py | 1 | 3595 | # Amara, universalsubtitles.org
#
# Copyright (C) 2013 Participatory Culture Foundation
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your op... | agpl-3.0 | 6,851,062,375,894,113,000 | 28.467213 | 86 | 0.691516 | false | 3.159051 | false | false | false |
chengsoonong/crowdastro | crowdastro/active_learning/random_sampler.py | 1 | 2413 | """Learning with random sampling.
Pool-based. Binary class labels.
Matthew Alger
The Australian National University
2016
"""
import numpy
from .sampler import Sampler
class RandomSampler(Sampler):
"""Pool-based learning with random sampling."""
def sample_index(self):
"""Finds index of a random u... | mit | 8,591,367,075,360,485,000 | 27.388235 | 72 | 0.581434 | false | 4.110733 | false | false | false |
0xF1/nessus_tools | mobile_devices_parser.py | 1 | 2836 | #!/usr/bin/env python
'''
mobile devices parser
Version 0.1
by Roy Firestein (roy@firestein.net)
Parse mobile devices audit plugin and export to CSV
'''
import os
import xml.dom.minidom
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-f", "--file", action="store", type="string", d... | apache-2.0 | -6,459,428,287,161,355,000 | 26.269231 | 107 | 0.554302 | false | 3.580808 | false | false | false |
tjsteele/battle-simulator | source/main.py | 1 | 3135 | import random, time
currPlayerHitToken = True
currOpponentHitToken = True
class GenerateMonster():
def __init__(self, name, health, gold, weapon, ac):
self.name = name
self.health = health
self.gold = gold
self.weapon = weapon
self.ac = ac
def checkMissPlayer(defender):
"... | mit | -4,317,210,588,742,869,500 | 22.75 | 93 | 0.708453 | false | 3.070519 | false | false | false |
TC01/calcpkg | calcrepo/repos/ticalc.py | 1 | 4723 | import urllib
from calcrepo import info
from calcrepo import repo
name = "ticalc"
url = "http://www.ticalc.org/"
enabled = True
class TicalcRepository(repo.CalcRepository):
def formatDownloadUrl(self, url):
return "http://www.ticalc.org" + url
def updateRepoIndexes(self, verbose=False):
self.printd("Rea... | mit | 8,673,408,777,575,601,000 | 34.780303 | 124 | 0.691086 | false | 3.263994 | false | false | false |
MayankGo/ec2-api | ec2api/api/__init__.py | 1 | 26399 | # Copyright 2014
# The Cloudscaling Group, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | apache-2.0 | -3,200,540,836,945,918,000 | 38.638138 | 97 | 0.466609 | false | 4.923349 | false | false | false |
houmie/duelify | duelify/settings.py | 1 | 12912 | # Django settings for duelify project.
LOGIN_URL = '/login/'
LOGIN_REDIRECT_URL = '/'
#LOGIN_ERROR_URL = '/error'
SOCIAL_AUTH_COMPLETE_URL_NAME = 'socialauth_complete'
SOCIAL_AUTH_ASSOCIATE_URL_NAME = 'socialauth_associate_complete'
SOCIAL_AUTH_NEW_USER_REDIRECT_URL = '/new-users-invited/'
SOCIAL_AUTH_LOGIN_REDIR... | gpl-2.0 | -3,736,456,069,093,995,000 | 36.865103 | 286 | 0.679445 | false | 3.324408 | false | false | false |
uogbuji/pybibframe | lib/writer/exhibitexplorer.py | 1 | 10035 | '''
'''
import re
import sys
import logging
import itertools
#from datachef.ids import simple_hashstring
from amara3 import iri
from versa import SUBJECT, RELATIONSHIP, VALUE
BFV = 'http://bibframe.org/vocab/'
WORKCLASS = iri.absolutize('Work', BFV)
INSTANCECLASS = iri.absolutize('Instance', BFV)
TYPE_REL = I(ir... | apache-2.0 | 325,627,981,747,450,900 | 41.163866 | 141 | 0.489686 | false | 4.479911 | false | false | false |
valmynd/MediaFetcher | src/plugins/youtube_dl/youtube_dl/extractor/wat.py | 1 | 5036 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..compat import compat_str
from ..utils import (
ExtractorError,
unified_strdate,
HEADRequest,
int_or_none,
)
class WatIE(InfoExtractor):
_VALID_URL = r'(?:wat:|https?://(?:www\.)?wat\.tv/video/.*-)(?P<id>[... | gpl-3.0 | -3,411,929,487,945,467,400 | 30.628931 | 108 | 0.626566 | false | 2.60705 | false | false | false |
benvanwerkhoven/kernel_tuner | examples/cuda/convolution_correct.py | 1 | 3195 | #!/usr/bin/env python
""" convolution with correctness checks
This example is mostly the same as the Convolution example. The only
difference is that a naive kernel is used to compute a reference
output. This reference output is used to check the correctness of
every kernel before it is benchmarked.
This is done usin... | apache-2.0 | -1,021,302,405,249,030,900 | 38.9375 | 103 | 0.692019 | false | 3.352571 | false | false | false |
lacatus/TFM | datasets/pets095.py | 1 | 3494 | #!/usr/bin/env python
from datasets import cp
from datasets import variables
from datasets import Camera
def loaddataset():
setglobalvariables()
loadcameras()
return getcameras(), loadconfiguration()
def setglobalvariables():
variables.current_dataset_path = variables.datasets_path + '/pets09'
... | apache-2.0 | 7,430,277,438,438,640,000 | 23.263889 | 76 | 0.655409 | false | 3.217311 | true | false | false |
noironetworks/heat | heat/common/policy.py | 1 | 6824 | #
# Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unles... | apache-2.0 | -8,548,374,885,071,395,000 | 37.994286 | 79 | 0.603605 | false | 4.305363 | false | false | false |
vlukes/dicom2fem | setup.py | 1 | 3448 | from setuptools import setup, find_packages # Always prefer setuptools over distutils
from os import path
here = path.abspath(path.dirname(__file__))
setup(
name='dicom2fem',
description='Generation of finite element meshes from DICOM images',
long_desctioption="Generation of finite element meshes using c... | bsd-3-clause | -117,617,626,211,072,220 | 42.1 | 98 | 0.657193 | false | 3.981524 | false | false | false |
Herpinemmanuel/Oceanography | intergrid.py | 1 | 8478 | """ interpolate data given on an Nd rectangular grid, uniform or non-uniform.
Purpose: extend the fast N-dimensional interpolator
`scipy.ndimage.map_coordinates` to non-uniform grids, using `np.interp`.
Background: please look at
http://en.wikipedia.org/wiki/Bilinear_interpolation
http://stackoverflow.com/questions/6... | mit | 2,374,753,777,518,892,500 | 40.763547 | 104 | 0.525124 | false | 3.372315 | false | false | false |
openstack/rally | rally/common/plugin/info.py | 1 | 4372 | # Copyright 2015: 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,733,923,676,359,351,300 | 30.912409 | 78 | 0.576624 | false | 4.220077 | false | false | false |
beefoo/hollywood-diversity | scripts/imdb_get_images.py | 1 | 2896 | # -*- coding: utf-8 -*-
# Description:
# This file takes in a .csv file of people and retrieves their images from IMDB if they exist
# Example usage:
# python imdb_get_images.py ../data/people_box_office_top_50_movies_1995-2014_imdb.csv
# python imdb_get_images.py ../data/people_box_office_top_10_movies_2011-20... | mit | -4,167,225,041,933,074,400 | 28.85567 | 99 | 0.56837 | false | 3.399061 | false | false | false |
sburnett/bismark-release-manager | main.py | 1 | 17515 | #!/usr/bin/env python2.7
import argparse
import logging
import os
import subcommands
import tree
def create_groups_subcommands(subparsers):
parser_list_group = subparsers.add_parser(
'list', help='list nodes in a groups')
parser_list_group.add_argument(
'name', type=str, nargs='?', action='s... | mit | -1,297,748,715,572,889,900 | 49.621387 | 109 | 0.686212 | false | 3.870718 | false | false | false |
Leonidas-from-XIV/whatsonair | parsers/fm4.py | 1 | 1241 | #!/usr/bin/env python
# -*- encoding: UTF-8 -*-
import base
class FM4Parser(base.StationBase):
"""The Parser for the austrian sidestream radio station
FM4, which is part of ORF.
Look at it's homepage http://fm4.orf.at
Maybe besser use this songlist?
http://fm4.orf.at/trackservicepopup/main
... | gpl-3.0 | -8,550,235,871,334,491,000 | 28.547619 | 73 | 0.593876 | false | 3.515581 | false | false | false |
plotly/plotly.py | packages/python/plotly/plotly/validators/barpolar/marker/_colorbar.py | 1 | 11475 | import _plotly_utils.basevalidators
class ColorbarValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="colorbar", parent_name="barpolar.marker", **kwargs):
super(ColorbarValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_nam... | mit | 1,426,902,938,938,346,500 | 46.8125 | 88 | 0.525229 | false | 4.897567 | false | false | false |
RicardoJohann/frappe | frappe/utils/user.py | 1 | 10944 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, json
from frappe import _dict
import frappe.share
from frappe.utils import cint
from frappe.boot import get_allowed_reports
from frappe.permissions import get_role... | mit | -2,402,520,111,732,548,000 | 28.106383 | 111 | 0.660636 | false | 2.911413 | false | false | false |
rwl/PyCIM | CIM15/IEC61970/Informative/InfWork/CUContractorItem.py | 1 | 3475 | # Copyright (C) 2010-2011 Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish... | mit | -7,500,218,546,023,297,000 | 40.86747 | 108 | 0.696691 | false | 4.248166 | false | false | false |
TusharAgey/seventhsem | AI/search_algos/home/dfs.py | 1 | 1653 | import json
class MyStack: # just an implementation of a queue
def __init__(self):
self.elements = []
def push(self,val):
self.elements.append(val)
def pop(self):
val = None
try:
val = self.elements[len(self.elements) - 1]
if len(self.elements) == 1:
self.elements = []
else:
self.element... | gpl-3.0 | 2,728,845,798,203,362,300 | 24.446154 | 110 | 0.628554 | false | 2.674757 | false | false | false |
sryza/freewaydata | python/traveltime.py | 1 | 2503 | import numpy as np
import pandas as pd
def datetime64_to_microseconds(dt):
return dt.astype('uint64')
def travel_time(start_time, path, measurements_by_station, station_metadata, time_granularity=60*60):
"""Calculate the travel time along the given path at the given start time
Args:
path - list of station ... | apache-2.0 | -3,499,258,868,963,724,300 | 40.716667 | 120 | 0.681582 | false | 3.310847 | false | false | false |
ahri/pycurlbrowser | pycurlbrowser/rest_client.py | 1 | 3465 | # coding: utf-8
"""
REST functionality based off pycurlbrowser's Browser.
"""
try:
import simplejson as json
except ImportError:
import json
from . import Browser
class StatusInformational(Exception):
"""
Represent 1xx status codes
"""
class StatusRedirection(Exception):
"""
Represent ... | agpl-3.0 | 3,467,552,450,697,954,300 | 24.858209 | 112 | 0.561328 | false | 3.897638 | false | false | false |
luoguanyang/google-python-exercises | basic/wordcount.py | 1 | 2854 | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Wordcount exercise
Google's Python class
The main() below is already defined and comp... | apache-2.0 | 5,757,111,439,567,327,000 | 28.729167 | 79 | 0.6822 | false | 3.626429 | false | false | false |
nzjoel1234/sprinkler | driver/input_thread.py | 1 | 3639 | import threading
SIMULATED = False
try:
import Adafruit_CharLCD as Lcd
except ImportError:
import lcd_simulator as Lcd
SIMULATED = True
DEBOUNCE_THRESHOLD = 2
SCREEN_TIMEOUT = 60
class InputThreadWrapper(threading.Thread):
def __init__(self, is_button_pressed, buttons, create_home_screen):
th... | mit | -8,851,845,360,741,925,000 | 35.39 | 97 | 0.573509 | false | 3.887821 | false | false | false |
eladnoor/small-molecule-regulation | oldcode/meta_analysis_clustering.py | 1 | 1640 | # -*- coding: utf-8 -*-
# Cluster and compare incidence of activation and inhibition across species
import settings as S
import pandas as pd
import os
import numpy as np
import pdb
import scipy.stats as st
import matplotlib.pyplot as plt
import seaborn as sns
plt.ion()
plt.close('all')
# Minimum number of interactio... | mit | 1,391,822,448,769,291,500 | 28.836364 | 119 | 0.704268 | false | 2.675367 | false | false | false |
yawd/yawd-elfinder | elfinder/widgets.py | 1 | 4686 | import json
from django import forms
from django.conf import settings
from django.core.urlresolvers import reverse
from django.forms.widgets import Input
from django.utils.safestring import mark_safe
from django.utils.translation import to_locale, get_language, ugettext as _
from fields import ElfinderFile
from conf im... | bsd-3-clause | 8,121,584,248,681,799,000 | 43.207547 | 223 | 0.541827 | false | 3.941127 | false | false | false |
A3sal0n/FalconGate | lib/objects.py | 1 | 18368 | import collections
from lib.logger import *
class HostAlertTemplate:
def __init__(self, homenet, alert):
self.homenet = homenet
self.alert = alert
self.subject = "A " + alert[6] + " alert was reported for host " + alert[7]
self.indicators = alert[8].replace('.', '[.]').split('|')
... | gpl-3.0 | -3,719,637,293,147,984,000 | 32.642857 | 182 | 0.520579 | false | 2.929973 | false | false | false |
raymondanthony/youtube-dl | youtube_dl/extractor/ustream.py | 1 | 3720 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
compat_urlparse,
)
class UstreamIE(InfoExtractor):
_VALID_URL = r'https?://www\.ustream\.tv/(?P<type>recorded|embed|embed/recorded)/(?P<videoID>\d+)'
IE_NAME = 'ustream'
_TEST = {
'url':... | unlicense | 8,401,983,062,399,923,000 | 35.831683 | 102 | 0.53414 | false | 3.526066 | false | false | false |
valdt/Wumpus | server/serverHandler.py | 1 | 1417 | import pickle, socket, time, threading
class ServerHandler:
def __init__(self,host,port):
self.activePlayers = []
self.serverSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Starting arguments for the socket are general default which i took
self.serverSocket.setsockopt(socket.SOL... | lgpl-3.0 | 3,241,649,935,972,491,000 | 47.862069 | 151 | 0.62103 | false | 4.455975 | false | false | false |
mcrav/pyxtal | xtal/xtal.py | 1 | 1634 | import numpy as np
def get_metric_matrix(a, b, c, alpha, beta, gamma):
'''
Create metric matrix as numpy array from unit cell parameters.
Return metric matrix.
'''
return np.array([[a**2, a*b*np.cos(gamma), a*c*np.cos(beta)],
[b*a*np.cos(gamma), b**2, b*c*np.cos(alpha)],
... | mit | 2,571,340,122,225,649,000 | 39.85 | 79 | 0.586903 | false | 2.881834 | false | false | false |
nischu7/paramiko | paramiko/client.py | 1 | 21630 | # Copyright (C) 2006-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko 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 | 8,268,515,702,681,514,000 | 39.204461 | 139 | 0.605594 | false | 4.301909 | false | false | false |
MWers/docker-docset | bin/add-dash-anchors.py | 1 | 1248 | #!/usr/bin/env python
"""
Add Dash docs anchor tags to html source.
"""
import argparse
import os
import re
import sys
import urllib
parser = argparse.ArgumentParser()
parser.add_argument('filename',
help=('The file to add dash doc anchors to.'))
parser.add_argument('-v', '--verbose',
... | mit | 5,308,139,273,396,154,000 | 25 | 76 | 0.584135 | false | 3.096774 | false | false | false |
sontek/bulby | setup.py | 1 | 1741 | '''
Setup configuration
'''
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
from os import path
from pip.req import parse_requirements
from pip.download import PipSession
# parse_requirements() returns generator of pip.req.InstallRequirement objects
install_reqs = p... | mit | -981,037,826,163,586,700 | 30.089286 | 78 | 0.677771 | false | 3.642259 | false | false | false |
ray-project/ray | python/ray/util/collective/tests/distributed_gpu_tests/test_distributed_allreduce.py | 1 | 5765 | """Test the collective allreduice API on a distributed Ray cluster."""
import pytest
import ray
from ray.util.collective.types import ReduceOp
import cupy as cp
import torch
from ray.util.collective.tests.util import create_collective_workers
@pytest.mark.parametrize("group_name", ["default", "test", "123?34!"])
@p... | apache-2.0 | -6,473,080,763,864,086,000 | 40.47482 | 79 | 0.608846 | false | 3.121278 | true | false | false |
emmanuelle/scikits.image | skimage/io/_io.py | 2 | 5788 | __all__ = ['Image', 'imread', 'imread_collection', 'imsave', 'imshow', 'show',
'push', 'pop']
from skimage.io._plugins import call as call_plugin
from skimage.color import rgb2grey
import numpy as np
try:
import cStringIO as StringIO
except ImportError:
import StringIO
# Shared image queue
_image... | bsd-3-clause | 2,946,779,465,856,008,000 | 24.724444 | 78 | 0.596579 | false | 4.167027 | false | false | false |
whcacademy/imageDownloader | googleImageDownload.py | 1 | 7660 | import requests
import os
import re
import time
from selenium import webdriver
import multiprocessing
import sys
from socket import error as SocketError
import errno
import argparse
import imghdr
import uuid
import csv
import codecs
import platform
import downloader
# define default chrome download path
global default... | mit | -4,718,019,722,629,552,000 | 32.160173 | 154 | 0.692298 | false | 3.20368 | false | false | false |
yashwardhan7/PiCapture | PiCapture.py | 1 | 8249 | #!/usr/bin/python
import os
import sys
import time
import glob
import shutil
import argparse
import datetime
import threading
import subprocess
logOnConsole = False
def log(str):
global logOnConsole
if logOnConsole:
print str
def initializeDir(dirname):
if not os.path.isdir(dirname):
os.makedirs(dirname)
log... | mit | 1,738,208,288,995,955,200 | 35.662222 | 142 | 0.697903 | false | 3.089513 | false | false | false |
RuthAngus/kalesalad | code/kalesalad.py | 1 | 6367 | # Uses acf method to measure rotation periods for downloaded everest light
# curves.
import numpy as np
import matplotlib.pyplot as plt
import pyfits
from Kepler_ACF import corr_run
import os
from simple_acf import simple_acf
import sys
from multiprocessing import Pool
import pandas as pd
import glob
import astropy.st... | mit | 9,121,794,386,829,699,000 | 31.484694 | 77 | 0.54594 | false | 3.031905 | false | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.