text stringlengths 0 1.05M | meta dict |
|---|---|
from copy import deepcopy
from datetime import datetime as dt
import os.path as op
import re
import numpy as np
from scipy import linalg
from .pick import channel_type
from .constants import FIFF
from .open import fiff_open
from .tree import dir_tree_find
from .tag import read_tag, find_tag
from .proj import _read_p... | {
"repo_name": "alexandrebarachant/mne-python",
"path": "mne/io/meas_info.py",
"copies": "1",
"size": "61238",
"license": "bsd-3-clause",
"hash": 4684016627424548000,
"line_mean": 37.3456480902,
"line_max": 79,
"alpha_frac": 0.5583951141,
"autogenerated": false,
"ratio": 3.521854152288935,
"conf... |
from copy import deepcopy
from datetime import datetime as dt
import os.path as op
import numpy as np
from scipy import linalg
from .pick import channel_type
from .constants import FIFF
from .open import fiff_open
from .tree import dir_tree_find
from .tag import read_tag, find_tag
from .proj import _read_proj, _writ... | {
"repo_name": "ARudiuk/mne-python",
"path": "mne/io/meas_info.py",
"copies": "2",
"size": "58356",
"license": "bsd-3-clause",
"hash": -5960851694912034000,
"line_mean": 37.5188118812,
"line_max": 79,
"alpha_frac": 0.5592398382,
"autogenerated": false,
"ratio": 3.5262553628618045,
"config_test":... |
from copy import deepcopy
from math import sqrt
import numpy as np
from scipy import linalg
from ._eloreta import _compute_eloreta
from ..fixes import _safe_svd
from ..io.constants import FIFF
from ..io.open import fiff_open
from ..io.tag import find_tag
from ..io.matrix import (_read_named_matrix, _transpose_named_m... | {
"repo_name": "teonlamont/mne-python",
"path": "mne/minimum_norm/inverse.py",
"copies": "2",
"size": "68283",
"license": "bsd-3-clause",
"hash": -6025863213077966000,
"line_mean": 37.4476351351,
"line_max": 100,
"alpha_frac": 0.5708009314,
"autogenerated": false,
"ratio": 3.8249495854806184,
"c... |
from copy import deepcopy
from math import sqrt
import numpy as np
from scipy import linalg
from ..io.constants import FIFF
from ..io.open import fiff_open
from ..io.tag import find_tag
from ..io.matrix import (_read_named_matrix, _transpose_named_matrix,
write_named_matrix)
from ..io.proj im... | {
"repo_name": "ARudiuk/mne-python",
"path": "mne/minimum_norm/inverse.py",
"copies": "7",
"size": "58008",
"license": "bsd-3-clause",
"hash": 5725781632611657000,
"line_mean": 35.7139240506,
"line_max": 100,
"alpha_frac": 0.5624741415,
"autogenerated": false,
"ratio": 3.820588816439439,
"config... |
from warnings import warn
from copy import deepcopy
from datetime import datetime as dt
import os.path as op
import numpy as np
from scipy import linalg
from .pick import channel_type
from .constants import FIFF
from .open import fiff_open
from .tree import dir_tree_find
from .tag import read_tag, find_tag
from .pro... | {
"repo_name": "cmoutard/mne-python",
"path": "mne/io/meas_info.py",
"copies": "1",
"size": "54086",
"license": "bsd-3-clause",
"hash": 3070496083588113400,
"line_mean": 37.0619282196,
"line_max": 79,
"alpha_frac": 0.5559849129,
"autogenerated": false,
"ratio": 3.50979883192732,
"config_test": f... |
from warnings import warn
from copy import deepcopy
import os.path as op
import numpy as np
from scipy import linalg
from ..externals.six import BytesIO, string_types
from datetime import datetime as dt
from .pick import channel_type
from .constants import FIFF
from .open import fiff_open
from .tree import dir_tree_f... | {
"repo_name": "effigies/mne-python",
"path": "mne/io/meas_info.py",
"copies": "1",
"size": "35635",
"license": "bsd-3-clause",
"hash": 9196523345549300000,
"line_mean": 34.635,
"line_max": 79,
"alpha_frac": 0.5517609092,
"autogenerated": false,
"ratio": 3.509800059095834,
"config_test": false,
... |
import warnings
from copy import deepcopy
from math import sqrt
import numpy as np
from scipy import linalg
from ..io.constants import FIFF
from ..io.open import fiff_open
from ..io.tag import find_tag
from ..io.matrix import (_read_named_matrix, _transpose_named_matrix,
write_named_matrix)
f... | {
"repo_name": "leggitta/mne-python",
"path": "mne/minimum_norm/inverse.py",
"copies": "5",
"size": "57964",
"license": "bsd-3-clause",
"hash": 8480254370644575000,
"line_mean": 35.7791878173,
"line_max": 100,
"alpha_frac": 0.5622282796,
"autogenerated": false,
"ratio": 3.822726373408956,
"confi... |
from numpy.testing import assert_array_equal, assert_allclose
import numpy as np
from scipy import stats, sparse
from mne.stats import permutation_cluster_1samp_test
from mne.stats.permutations import permutation_t_test, _ci, _bootstrap_ci
from mne.utils import run_tests_if_main
def test_permutation_t_test():
"... | {
"repo_name": "adykstra/mne-python",
"path": "mne/stats/tests/test_permutations.py",
"copies": "5",
"size": "2803",
"license": "bsd-3-clause",
"hash": 5032741088977094000,
"line_mean": 35.8815789474,
"line_max": 75,
"alpha_frac": 0.6386014984,
"autogenerated": false,
"ratio": 3.0904079382579934,
... |
import numpy as np
from scipy import linalg
from . import io, Epochs
from .utils import check_fname, logger, verbose, _check_option
from .io.pick import pick_types, pick_types_forward
from .io.proj import Projection, _has_eeg_average_ref_proj
from .event import make_fixed_length_events
from .parallel import parallel_... | {
"repo_name": "adykstra/mne-python",
"path": "mne/proj.py",
"copies": "1",
"size": "16166",
"license": "bsd-3-clause",
"hash": 6599713803204646000,
"line_mean": 34.6865342163,
"line_max": 79,
"alpha_frac": 0.5619819374,
"autogenerated": false,
"ratio": 3.623851154449675,
"config_test": false,
... |
import numpy as np
from scipy import linalg
from . import io, Epochs
from .utils import check_fname, logger, verbose
from .io.pick import pick_types, pick_types_forward
from .io.proj import Projection, _has_eeg_average_ref_proj
from .event import make_fixed_length_events
from .parallel import parallel_func
from .cov ... | {
"repo_name": "jaeilepp/eggie",
"path": "mne/proj.py",
"copies": "1",
"size": "13099",
"license": "bsd-2-clause",
"hash": 7441012192085821000,
"line_mean": 34.6920980926,
"line_max": 82,
"alpha_frac": 0.5694327811,
"autogenerated": false,
"ratio": 3.6015947209238384,
"config_test": false,
"ha... |
import os.path as op
import warnings
import numpy as np
from nose.tools import assert_true, assert_raises
from numpy.testing import assert_allclose
from mne.viz.utils import compare_fiff, _fake_click, _compute_scalings
from mne.viz import ClickableImage, add_background_image, mne_analyze_colormap
from mne.utils impor... | {
"repo_name": "ARudiuk/mne-python",
"path": "mne/viz/tests/test_utils.py",
"copies": "1",
"size": "3900",
"license": "bsd-3-clause",
"hash": 7049962336432143000,
"line_mean": 31.5,
"line_max": 78,
"alpha_frac": 0.6487179487,
"autogenerated": false,
"ratio": 3.175895765472313,
"config_test": tru... |
import os.path as op
import warnings
import numpy as np
from nose.tools import assert_true, assert_raises
from numpy.testing import assert_allclose
from mne.viz.utils import (compare_fiff, _fake_click, _compute_scalings,
_validate_if_list_of_axes)
from mne.viz import ClickableImage, add_bac... | {
"repo_name": "jaeilepp/mne-python",
"path": "mne/viz/tests/test_utils.py",
"copies": "3",
"size": "4893",
"license": "bsd-3-clause",
"hash": -7640368089187222000,
"line_mean": 33.4577464789,
"line_max": 78,
"alpha_frac": 0.6511342735,
"autogenerated": false,
"ratio": 3.1446015424164524,
"confi... |
import os.path as op
import warnings
import numpy as np
from nose.tools import assert_true, assert_raises
from numpy.testing import assert_allclose
from mne.viz.utils import compare_fiff, _fake_click
from mne.viz import ClickableImage, add_background_image, mne_analyze_colormap
from mne.utils import run_tests_if_main... | {
"repo_name": "matthew-tucker/mne-python",
"path": "mne/viz/tests/test_utils.py",
"copies": "12",
"size": "2643",
"license": "bsd-3-clause",
"hash": 1445263747621974500,
"line_mean": 29.3793103448,
"line_max": 78,
"alpha_frac": 0.6564510026,
"autogenerated": false,
"ratio": 3.066125290023202,
"... |
def parse_config(fname):
"""Parse a config file (like .ave and .cov files)
Parameters
----------
fname : string
config file name
Returns
-------
conditions : list of dict
Each condition is indexed by the event type.
A condition contains as keys::
tmin... | {
"repo_name": "wronk/mne-python",
"path": "mne/misc.py",
"copies": "24",
"size": "3173",
"license": "bsd-3-clause",
"hash": -2037796636142627800,
"line_mean": 28.3796296296,
"line_max": 78,
"alpha_frac": 0.5102426725,
"autogenerated": false,
"ratio": 3.7773809523809523,
"config_test": false,
... |
def parse_config(fname):
"""Parse a config file (like .ave and .cov files).
Parameters
----------
fname : string
config file name
Returns
-------
conditions : list of dict
Each condition is indexed by the event type.
A condition contains as keys::
tmi... | {
"repo_name": "jaeilepp/mne-python",
"path": "mne/misc.py",
"copies": "3",
"size": "3174",
"license": "bsd-3-clause",
"hash": -400325554400406100,
"line_mean": 28.9433962264,
"line_max": 79,
"alpha_frac": 0.5100819156,
"autogenerated": false,
"ratio": 3.774078478002378,
"config_test": false,
... |
def parse_config(fname):
"""Parse a config file (like .ave and .cov files)
Parameters
----------
fname : string
config file name
Returns
-------
conditions : list of dict
Each condition is indexed by the event type.
A condition contains as keys:
tmin, ... | {
"repo_name": "jaeilepp/eggie",
"path": "mne/misc.py",
"copies": "3",
"size": "3188",
"license": "bsd-2-clause",
"hash": -7650049826763273000,
"line_mean": 30.88,
"line_max": 79,
"alpha_frac": 0.497804266,
"autogenerated": false,
"ratio": 3.8595641646489103,
"config_test": false,
"has_no_keyw... |
import numpy as np
from scipy import linalg
from ..defaults import _handle_default
from ..io.pick import _pick_data_channels, _picks_by_type, pick_info
from ..utils import verbose
def _yule_walker(X, order=1):
"""Compute Yule-Walker (adapted from statsmodels).
Operates in-place.
"""
assert X.ndim =... | {
"repo_name": "nicproulx/mne-python",
"path": "mne/time_frequency/ar.py",
"copies": "8",
"size": "2687",
"license": "bsd-3-clause",
"hash": -4697875698883346000,
"line_mean": 31.3734939759,
"line_max": 77,
"alpha_frac": 0.6122069222,
"autogenerated": false,
"ratio": 3.3172839506172838,
"config_... |
import numpy as np
from scipy import linalg
from ..defaults import _handle_default
from ..io.pick import _picks_to_idx, _picks_by_type, pick_info
from ..utils import verbose, _apply_scaling_array
def _yule_walker(X, order=1):
"""Compute Yule-Walker (adapted from statsmodels).
Operates in-place.
"""
... | {
"repo_name": "adykstra/mne-python",
"path": "mne/time_frequency/ar.py",
"copies": "2",
"size": "2363",
"license": "bsd-3-clause",
"hash": 5320470885888424000,
"line_mean": 29.2948717949,
"line_max": 77,
"alpha_frac": 0.603470165,
"autogenerated": false,
"ratio": 3.1889338731443995,
"config_tes... |
import numpy as np
from scipy.linalg import toeplitz
from ..io.pick import pick_types
from ..utils import verbose
# XXX : Back ported from statsmodels
def yule_walker(X, order=1, method="unbiased", df=None, inv=False,
demean=True):
"""
Estimate AR(p) parameters from a sequence X using Yule-... | {
"repo_name": "dgwakeman/mne-python",
"path": "mne/time_frequency/ar.py",
"copies": "10",
"size": "5070",
"license": "bsd-3-clause",
"hash": 1402906469433484500,
"line_mean": 29.7272727273,
"line_max": 105,
"alpha_frac": 0.6023668639,
"autogenerated": false,
"ratio": 3.616262482168331,
"config_... |
import numpy as np
from scipy.linalg import toeplitz
# XXX : Back ported from statsmodels
def yule_walker(X, order=1, method="unbiased", df=None, inv=False, demean=True):
"""
Estimate AR(p) parameters from a sequence X using Yule-Walker equation.
Unbiased or maximum-likelihood estimator (mle)
See,... | {
"repo_name": "jaeilepp/eggie",
"path": "mne/time_frequency/ar.py",
"copies": "3",
"size": "4667",
"license": "bsd-2-clause",
"hash": 1945910392994236200,
"line_mean": 29.7039473684,
"line_max": 92,
"alpha_frac": 0.6050996357,
"autogenerated": false,
"ratio": 3.6150271107668472,
"config_test": ... |
import numpy as np
from ...utils import get_config, verbose
from ...fixes import partial
from ..utils import has_dataset, _data_path, _doc
has_somato_data = partial(has_dataset, name='somato')
@verbose
def data_path(path=None, force_update=False, update_path=True,
download=True, verbose=None):
r... | {
"repo_name": "jaeilepp/eggie",
"path": "mne/datasets/somato/somato.py",
"copies": "2",
"size": "1207",
"license": "bsd-2-clause",
"hash": -9195181900535120000,
"line_mean": 33.4857142857,
"line_max": 80,
"alpha_frac": 0.6230323115,
"autogenerated": false,
"ratio": 3.1846965699208445,
"config_t... |
__author__ = ['Salvador Aguinaga', 'Rodrigo Palacios', 'David Chaing', 'Tim Weninger']
from collections import defaultdict
import itertools
import networkx as nx
import traceback
from .num_to_word import num_to_word
def make_clique(graph, nodes):
for v1 in nodes:
for v2 in nodes:
if v1 != v2:
graph[v1].ad... | {
"repo_name": "nddsg/TreeDecomps",
"path": "xplodnTree/core/tree_decomposition.py",
"copies": "1",
"size": "7424",
"license": "mit",
"hash": -7040464253886568000,
"line_mean": 21.9845201238,
"line_max": 100,
"alpha_frac": 0.6158405172,
"autogenerated": false,
"ratio": 2.5424657534246577,
"confi... |
__author__ = ['Salvador Aguinaga', 'Rodrigo Palacios', 'David Chaing', 'Tim Weninger']
import networkx as nx
import matplotlib.pyplot as plt
import matplotlib.pylab as pylab
params = {'legend.fontsize':'small',
'figure.figsize': (1.6 * 8, 1.0 * 8),
'axes.labelsize': 'small',
'axes.titlesi... | {
"repo_name": "nddsg/TreeDecomps",
"path": "xplodnTree/tdec/netsys.py",
"copies": "1",
"size": "53641",
"license": "mit",
"hash": 6883847048466339000,
"line_mean": 37.4523297491,
"line_max": 158,
"alpha_frac": 0.5545757909,
"autogenerated": false,
"ratio": 2.838298322662575,
"config_test": fals... |
__author__ = ['Salvador Aguinaga', 'Rodrigo Palacios', 'David Chaing', 'Tim Weninger']
import networkx as nx
import numpy as np
class Rule(object):
def __init__(self, id, lhs, rhs, prob, translate=True):
self.id = id
self.lhs = lhs
if translate:
self.rhs = rhs
self... | {
"repo_name": "nddsg/TreeDecomps",
"path": "xplodnTree/core/david.py",
"copies": "1",
"size": "8158",
"license": "mit",
"hash": 2883989553661566000,
"line_mean": 35.9140271493,
"line_max": 117,
"alpha_frac": 0.440181417,
"autogenerated": false,
"ratio": 3.7681293302540415,
"config_test": false,... |
__author__ = ['Salvador Aguinaga', 'Rodrigo Palacios', 'David Chaing', 'Tim Weninger']
import networkx as nx
import numpy as np
class Rule(object):
def __init__(self, id, lhs, rhs, prob, translate=True):
self.id = id
self.lhs = lhs
if translate:
self.rhs = rhs
self.cfg_rhs = self.hrg_to_cfg... | {
"repo_name": "nddsg/TreeDecomps",
"path": "xplodnTree/core/prs_tst.py",
"copies": "1",
"size": "7336",
"license": "mit",
"hash": -2719884885484372500,
"line_mean": 29.9535864979,
"line_max": 109,
"alpha_frac": 0.5309432933,
"autogenerated": false,
"ratio": 2.796797560045749,
"config_test": fal... |
__author__ = ['Salvador Aguinaga', 'Rodrigo Palacios', 'David Chaing', 'Tim Weninger']
import os
import pprint as pp
import re
import networkx as nx
#import david as pcfg
from .probabilistic_cfg import Grammar, Rule
from .graph_sampler import rwr_sample
from .tree_decomposition import quickbb, new_visit, make_rooted
#... | {
"repo_name": "nddsg/TreeDecomps",
"path": "xplodnTree/core/PHRG.py",
"copies": "1",
"size": "9491",
"license": "mit",
"hash": -1063191542821466100,
"line_mean": 24.5134408602,
"line_max": 106,
"alpha_frac": 0.5907702034,
"autogenerated": false,
"ratio": 2.4499225606608155,
"config_test": false... |
__author__ = ['Salvador Aguinaga', 'Rodrigo Palacios', 'David Chiang', 'Tim Weninger']
import networkx as nx
import matplotlib
matplotlib.use('pdf')
import matplotlib.pyplot as plt
import matplotlib.pylab as pylab
params = {'legend.fontsize':'small',
'figure.figsize': (1.6 * 10, 1.0 * 10),
'axes.labelsize': ... | {
"repo_name": "nddsg/TreeDecomps",
"path": "xplodnTree/core/net_metrics.py",
"copies": "1",
"size": "48665",
"license": "mit",
"hash": 6810885677952313000,
"line_mean": 33.8104434907,
"line_max": 155,
"alpha_frac": 0.5971231892,
"autogenerated": false,
"ratio": 2.4836684699397775,
"config_test"... |
__author__ = 'Salvatore Cassano'
from pydblite.pydblite import Base
from items import SapItem
import re
import os.path
class DataStoring():
#Inizialize an instantiated object by opening json file and the database
def __init__(self):
self.out_file = open("scnscraper/abap.json", "a")
self.out_f... | {
"repo_name": "collab-uniba/qa-scrapers",
"path": "scn/scnscraper/dataStoring.py",
"copies": "1",
"size": "6359",
"license": "mit",
"hash": 3676478400896054300,
"line_mean": 44.0992907801,
"line_max": 279,
"alpha_frac": 0.4577763799,
"autogenerated": false,
"ratio": 3.9277331686226065,
"config_... |
__author__ = 'Salvatore Cassano'
from scraper import Scraper
from dataStoring import DataStoring
class MainApp():
if __name__ == '__main__':
startUrl = "http://scn.sap.com/community/abap/content?filterID=contentstatus[published]~objecttype~objecttype[thread]&start="
storing = DataStoring()
... | {
"repo_name": "collab-uniba/qa-scrapers",
"path": "scn/scnscraper/main.py",
"copies": "1",
"size": "1123",
"license": "mit",
"hash": -9093502196547734000,
"line_mean": 34.09375,
"line_max": 133,
"alpha_frac": 0.5690115761,
"autogenerated": false,
"ratio": 3.8197278911564627,
"config_test": fals... |
__author__ = 'samantha'
def checkio(words):
#l = list()
#for word in words.split():
# l.append(word.isalpha())
print(words)
res = False
l = [wd.isalpha() for wd in words.split()]
#r = [l[i:i+3] for i in range(0,len(l)-3) ]
#print ('r=',r)
print ('l=',l)
if len(l)>3:
p... | {
"repo_name": "hkaushalya/CheckIO",
"path": "checkio_library_ThreeWords.py",
"copies": "1",
"size": "1093",
"license": "apache-2.0",
"hash": 1339046845717261800,
"line_mean": 32.1212121212,
"line_max": 80,
"alpha_frac": 0.5205855444,
"autogenerated": false,
"ratio": 2.9224598930481283,
"config_... |
__author__ = 'Samantha'
#Samantha Holloway, Joseph Pannizzo 11/2014
#Help/code pieces from Dr. Ganesh Baliga
#Rock Paper Scissors implementation of Player class
#A gambit is a predetermined RPS strategy
#AI uses 1 of 8 famous gambits randomly for a match
import Player
import Message
import random
class SHJPPlayer(Pla... | {
"repo_name": "geebzter/game-framework",
"path": "SHJPPlayer.py",
"copies": "1",
"size": "4060",
"license": "apache-2.0",
"hash": 7720155637220536000,
"line_mean": 32.2786885246,
"line_max": 70,
"alpha_frac": 0.5677339901,
"autogenerated": false,
"ratio": 4.039800995024875,
"config_test": false... |
__author__ = 'samarthshah'
from project import Project
import json
ok_now = Project('karnav2014', support=0.3)
ok_now.shoot_eager()
# restaurantList = []
# with open('Files/restaurants_list.txt', 'r') as r:
# for line in r.readlines():
# restaurantList = json.loads(line)
# print 'Res list = ',rest... | {
"repo_name": "SomePlaceElse/SomePlaceElse",
"path": "test_project.py",
"copies": "1",
"size": "3961",
"license": "mit",
"hash": 7561801570381420000,
"line_mean": 26.3172413793,
"line_max": 61,
"alpha_frac": 0.5188083817,
"autogenerated": false,
"ratio": 2.7992932862190814,
"config_test": false... |
__author__ = 'sambyers'
import urllib2
import paramiko
import getpass
from time import sleep
import sys
import re
def main():
def disable_paging(remote_conn):
'''Dsiable paging on a Cisco device'''
remote_conn.send("terminal length 0\n")
sleep(1)
# Assign the output from the rout... | {
"repo_name": "sambyers/mac.discovery",
"path": "mac.discovery.py",
"copies": "1",
"size": "2276",
"license": "mit",
"hash": 8400484510198505000,
"line_mean": 29.7567567568,
"line_max": 141,
"alpha_frac": 0.5579964851,
"autogenerated": false,
"ratio": 3.4328808446455503,
"config_test": false,
... |
__author__ = "sam diefenbacher"
# piggetty.py
#CIS - 125
#This program takes a file with text, and converts it to pig latin, and outputs it to a different file!
vowels = "AEIOUaeiou"
# Define a function called piggy(string) that returns a string
def piggy(word):
x = 0
endWord =""
for letter in word:
if letter in... | {
"repo_name": "samdief/Week-Four-Assignment",
"path": "piggetty.py",
"copies": "1",
"size": "1198",
"license": "mit",
"hash": -8742862556809216000,
"line_mean": 22.0576923077,
"line_max": 103,
"alpha_frac": 0.6569282137,
"autogenerated": false,
"ratio": 2.838862559241706,
"config_test": false,
... |
def extendedEuclid(a,b):
"""
Preconditions - a and b are both positive integers.
Posconditions - The equation for ax+by=gcd(a,b) has been returned where
x and y are solved.
Input - a : int, b : int
Output - ax+by=gcd(a,b) : string
"""
b,a=max(a,b),min(a,b)
# Format o... | {
"repo_name": "ActiveState/code",
"path": "recipes/Python/578631_Extended_Euclidean_Algorithm/recipe-578631.py",
"copies": "1",
"size": "1142",
"license": "mit",
"hash": 6034062017421601000,
"line_mean": 34.6875,
"line_max": 79,
"alpha_frac": 0.5770577933,
"autogenerated": false,
"ratio": 2.77184... |
"""
This script will check if the environment setup is correct for the workshop.
To run, please execute the following command from the command prompt
>>> python check_env.py
The output will indicate if any of the libraries are missing or need to be updated.
This script is inspire... | {
"repo_name": "amitkaps/machine-learning",
"path": "check_env.py",
"copies": "1",
"size": "2767",
"license": "mit",
"hash": 4677078323267781000,
"line_mean": 28.4361702128,
"line_max": 106,
"alpha_frac": 0.5782435851,
"autogenerated": false,
"ratio": 3.1230248306997743,
"config_test": false,
... |
__doc__ = 'This module contains a series of classes which contribute to the \
overall game play'
from math import sin, cos, pi, acos, asin, radians, ceil
from random import uniform, choice
from library import System,Global,Sprite,Vector, Text, Time, Draw
class Logo(Sprite):
""" Main logo object """
def... | {
"repo_name": "ichpuchtli/Geometry-Genocide",
"path": "game.py",
"copies": "1",
"size": "15996",
"license": "mit",
"hash": -8482650408708274000,
"line_mean": 22.99375,
"line_max": 89,
"alpha_frac": 0.6175293823,
"autogenerated": false,
"ratio": 2.8077935755660874,
"config_test": false,
"has_n... |
__author__ = "Sam Maurer"
__date__ = "October 14, 2016"
__license__ = "MIT"
import json
import os
import time
import zipfile
from datetime import datetime as dt
from TwitterAPI import TwitterAPI
from keys import * # keys.py in same directory
OUTPUT_PATH = 'data/' # output path relative to the script calling thi... | {
"repo_name": "smmaurer/twitter-streaming",
"path": "stream_automator/stream_automator.py",
"copies": "1",
"size": "4636",
"license": "mit",
"hash": -1283753336385344800,
"line_mean": 31.6478873239,
"line_max": 95,
"alpha_frac": 0.5161777394,
"autogenerated": false,
"ratio": 4.353051643192488,
... |
__author__ = 'sam'
from nltk.corpus import sentiwordnet as swn
from Preprocessing import Preprocess
#Vedi documento proposto dai prof per calcolo score
def senti_analisys(tokens):
#print tokens
scorePosTot = 0
scoreNegTot = 0
scoreObjTot = 0
scoreObjNorm = scoreNegNorm = scorePosNorm = 0
co... | {
"repo_name": "samzek/sentiment_analysis",
"path": "prgVerucchiZecchini/src/SentiAnalisys.py",
"copies": "1",
"size": "3949",
"license": "apache-2.0",
"hash": 6400125875722298000,
"line_mean": 32.7521367521,
"line_max": 133,
"alpha_frac": 0.6021777665,
"autogenerated": false,
"ratio": 3.427951388... |
__author__ = 'sam'
import webargs
from .string import lowercase, strip
def not_null(value):
"""A validation function that checks that a value isn't None."""
return True if value is not None else False
def not_empty(value):
"""
Check if a value is not empty.
This is a simple check that blocks n... | {
"repo_name": "marcellarius/webargscontrib.utils",
"path": "webargscontrib/utils/validate.py",
"copies": "1",
"size": "2307",
"license": "mit",
"hash": -7040980855703227000,
"line_mean": 30.1891891892,
"line_max": 83,
"alpha_frac": 0.655396619,
"autogenerated": false,
"ratio": 4.328330206378987,
... |
__author__ = 'sam'
import xml.dom.minidom
def parse_XML(file,lang):
nostm = stm = exp = org = trs = ""
buf = ''
dom = xml.dom.minidom.parse(file)
rootel = dom.documentElement
topnodes = rootel.childNodes
for i in topnodes:
child = i.childNodes
if len(child) == 0:
... | {
"repo_name": "samzek/sentiment_analysis",
"path": "prgVerucchiZecchini/src/XML_parser.py",
"copies": "1",
"size": "1552",
"license": "apache-2.0",
"hash": -9216251352764756000,
"line_mean": 32.7391304348,
"line_max": 88,
"alpha_frac": 0.4961340206,
"autogenerated": false,
"ratio": 3.832098765432... |
__author__ = 'sam'
"""
Sample code to learn socket programming in python through socket module use.
Here we are opening a port and receving on it.
Clients can connect to the port to have communication.
"""
import socket # Import socket module
import os
import subprocess
import sys
s = socket.socket() ... | {
"repo_name": "bourneagain/pythonBytes",
"path": "socketProgramming/remoteWorker.py",
"copies": "1",
"size": "2022",
"license": "mit",
"hash": -4670172258361814000,
"line_mean": 33.2711864407,
"line_max": 107,
"alpha_frac": 0.5989119683,
"autogenerated": false,
"ratio": 4.32051282051282,
"confi... |
__author__ = 'sam'
"""
This is the client which starts connecting to the servers and then issues commands
"""
import socket
import sys
import os
# Create a TCP/IP socket
# Connect the socket to the port where the server is listening
#server_addressList = [('localhost', 12345)]
#server_addressList = [ ('173.230.11.20... | {
"repo_name": "bourneagain/pythonBytes",
"path": "socketProgramming/distributedWorkAllocator.py",
"copies": "1",
"size": "1323",
"license": "mit",
"hash": 1662518715081885400,
"line_mean": 29.0681818182,
"line_max": 82,
"alpha_frac": 0.5986394558,
"autogenerated": false,
"ratio": 3.48157894736842... |
__author__ = 'sample-endpoint'
#ref: https://cloud.google.com/appengine/docs/python/endpoints/getstarted/backend/write_api
import endpoints
from protorpc import messages
from protorpc import message_types
from protorpc import remote
package = 'Hello'
class Greeting(messages.Message):
"""Greeting that stores a ... | {
"repo_name": "dev0x10/gae-endpoints-python-sample",
"path": "helloendpoints/helloworld.py",
"copies": "1",
"size": "2136",
"license": "mit",
"hash": 1975514911333626000,
"line_mean": 31.8615384615,
"line_max": 91,
"alpha_frac": 0.6601123596,
"autogenerated": false,
"ratio": 4.06083650190114,
"... |
__author__ = 'sam.royston'
import csv
import numpy as np
import sys
from matplotlib import pyplot as plt
epochs = []
train_perp = []
valid_perp = []
wps = []
dw_norm = []
time_taken = []
def read_file(file):
with open(file, mode='r') as f:
return [row for row in csv.reader(f)]
def parse_row(row):
if ... | {
"repo_name": "PorkShoulderHolder/lstm",
"path": "visualize.py",
"copies": "1",
"size": "1498",
"license": "apache-2.0",
"hash": -7572664435602222000,
"line_mean": 21.0441176471,
"line_max": 67,
"alpha_frac": 0.6221628838,
"autogenerated": false,
"ratio": 2.8210922787193975,
"config_test": fals... |
__author__ = 'Sam Stern, samuelostern@gmail.com'
from random import gauss
from pybrain.rl.environments.environment import Environment
from numpy import array, matrix, empty, append
from math import log, exp
import pandas as pd
import csv
import time
class TSEnvironment(Environment):
""" test time-series environm... | {
"repo_name": "samstern/MSc-Project",
"path": "pybrain/rl/environments/timeseries/timeseries.py",
"copies": "1",
"size": "6887",
"license": "bsd-3-clause",
"hash": 567471966100472300,
"line_mean": 31.4858490566,
"line_max": 94,
"alpha_frac": 0.6033105852,
"autogenerated": false,
"ratio": 3.561013... |
__author__ = 'Sam Stern, samuelostern@gmail.com'
#from .timeseries import AR1Environment
from pybrain.rl.environments.task import Task
from numpy import sign
from math import log
class MaximizeReturnTask(Task):
def getReward(self):
# TODO: make sure to check how to combine the returns (sum or product) d... | {
"repo_name": "samstern/MSc-Project",
"path": "pybrain/rl/environments/timeseries/maximizereturntask.py",
"copies": "1",
"size": "1694",
"license": "bsd-3-clause",
"hash": -1039997893712436500,
"line_mean": 33.5714285714,
"line_max": 155,
"alpha_frac": 0.660566706,
"autogenerated": false,
"ratio"... |
__author__ = 'samsung'
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
def find_middle(head):
if head is None:
return head
slow = head
fast = head
while fast.next != None and fast.next.next != None:
fast = fast.next.next
slow = slow.next
... | {
"repo_name": "deepbluech/leetcode",
"path": "Reorder List.py",
"copies": "1",
"size": "1643",
"license": "mit",
"hash": 6891476863960878000,
"line_mean": 22.4857142857,
"line_max": 55,
"alpha_frac": 0.5496043822,
"autogenerated": false,
"ratio": 3.540948275862069,
"config_test": false,
"has_... |
__author__ = 'samsung'
import numpy as np
import matplotlib.pyplot as plt
# Make sure that caffe is on the python path:
caffe_root = '../../' # this file is expected to be in {caffe_root}/examples
import sys
sys.path.insert(0, caffe_root + 'python')
import caffe
plt.rcParams['figure.figsize'] = (10, 10)
plt.rcPar... | {
"repo_name": "deepbluech/leetcode",
"path": "Filter_Visulize.py",
"copies": "1",
"size": "3423",
"license": "mit",
"hash": -5932842052886508000,
"line_mean": 31.6095238095,
"line_max": 106,
"alpha_frac": 0.668419515,
"autogenerated": false,
"ratio": 2.7253184713375798,
"config_test": false,
... |
__author__ = 'samsung'
#
class Solution:
# @param board, a 9x9 2D array
# @return a boolean
def isValidSudoku(self, board):
n = 9
#row
print 'row'
for i in range(n):
visited = []
for j in range(n):
if self.process(board[i][j], visited... | {
"repo_name": "deepbluech/leetcode",
"path": "soduku valid.py",
"copies": "1",
"size": "1489",
"license": "mit",
"hash": 5733246371045428000,
"line_mean": 28.8,
"line_max": 132,
"alpha_frac": 0.395567495,
"autogenerated": false,
"ratio": 3.897905759162304,
"config_test": false,
"has_no_keywor... |
__author__ = 'samsung'
#!/bin/env python
#coding=utf-8
"Get local Configruation info and report it to remote admin server."
import socket
import os
import subprocess
import httplib
import urllib
class NetworkInfo:
def __init__(self):
self.hostname=socket.gethostname()
self.wip=No... | {
"repo_name": "swenker/studio",
"path": "python/cpp-ops/hc/local_checker.py",
"copies": "1",
"size": "3463",
"license": "apache-2.0",
"hash": 7912094631079564000,
"line_mean": 24.4351145038,
"line_max": 124,
"alpha_frac": 0.5365290211,
"autogenerated": false,
"ratio": 3.8435072142064373,
"confi... |
__author__ = 'samsung'
import os
from math import *
class Tree():
def __init__(self,root,similarity=1):
self.root=root
self.similarity=similarity
def contains(self,node):
return self.root.has_node(node)
def add(self,node):
if node.id == self.root.id:
... | {
"repo_name": "swenker/studio",
"path": "python/3mlog/log_parser.py",
"copies": "1",
"size": "8218",
"license": "apache-2.0",
"hash": 2100174694780417000,
"line_mean": 25.1221122112,
"line_max": 124,
"alpha_frac": 0.4477975176,
"autogenerated": false,
"ratio": 3.7507987220447285,
"config_test":... |
__author__ = 'samsung'
import httplib
import base64
import hmac
import time
import hashlib
import urllib
#http://oss-example.oss-cn-hangzhou.aliyuncs.com/oss-api.pdf?OSSAccessKeyId=44CF9590006BF252F707&Expires=1141889120&Signature=vjbyPxybdZaNmGa%2ByT272YEAiv4%3D
access_id="nhkyOTAlyeaBbPvm"
access_k... | {
"repo_name": "swenker/studio",
"path": "python/cloud/alioss/oss_browser.py",
"copies": "1",
"size": "2628",
"license": "apache-2.0",
"hash": -8865836779163674000,
"line_mean": 26.5652173913,
"line_max": 158,
"alpha_frac": 0.6103500761,
"autogenerated": false,
"ratio": 3.412987012987013,
"confi... |
__author__ = 'samsung'
import unittest
from log_parser import *
v1=[1,1,1]
v2=[1,1,1]
v1=[0,0,1]
v2=[1,1,0]
v1=[1,2,0]
v2=[0,1]
log_parser = LogParser()
class TestLogParser(unittest.TestCase):
@unittest.skip("Skipping")
def test_cal(self):
#print LogParser().calculate_sim_Euclid(v1,... | {
"repo_name": "swenker/studio",
"path": "python/3mlog/test_log_parser.py",
"copies": "1",
"size": "2260",
"license": "apache-2.0",
"hash": 3110607519457006600,
"line_mean": 22.8351648352,
"line_max": 118,
"alpha_frac": 0.560619469,
"autogenerated": false,
"ratio": 3.0790190735694822,
"config_te... |
#This program graphs the probability of landing on each integer in a given interval for a 1D random-walk simulation
#If called with a -i flag, it will prompt for user input on the following variables:
#Boundary numbers, starting position, number of steps per simulation, number of simulations
import sys
import random... | {
"repo_name": "sdlwdr/misc",
"path": "random_walk.py",
"copies": "1",
"size": "2610",
"license": "mit",
"hash": 1515185896998324000,
"line_mean": 28.6590909091,
"line_max": 115,
"alpha_frac": 0.724137931,
"autogenerated": false,
"ratio": 3.2422360248447206,
"config_test": false,
"has_no_keywo... |
"""Author: Samuel DeLaughter
12/6/14
This program graphs the probability of landing on each integer in a given interval for a 1D random-walk simulation
If called with a -i flag, it will prompt for user input on the following variables:
Boundary numbers, starting position, number of steps per simulation, number of sim... | {
"repo_name": "sdelaughter/misc",
"path": "random_walk.py",
"copies": "1",
"size": "2614",
"license": "mit",
"hash": 5034472447849722000,
"line_mean": 28.0444444444,
"line_max": 114,
"alpha_frac": 0.7230298393,
"autogenerated": false,
"ratio": 3.2512437810945274,
"config_test": false,
"has_no... |
__author__ = 'Samuele'
from flask import Flask, jsonify
import serial
app = Flask(__name__)
ser = serial.Serial('/dev/ttymxc3', 115200, timeout=1)
ser.flushOutput()
current_fan_status = 0
current_irrigation_status = 0
current_light_value = 0
@app.route("/fan", methods=['GET'])
def get_fan_status():
return json... | {
"repo_name": "AppsThor/CooltivateActuator",
"path": "serverUdoo.py",
"copies": "1",
"size": "1659",
"license": "mit",
"hash": 9124508495366450000,
"line_mean": 24.1515151515,
"line_max": 70,
"alpha_frac": 0.650994575,
"autogenerated": false,
"ratio": 3.227626459143969,
"config_test": false,
... |
"""
Routines to replace MARTINI lipids with MARTINI cholesterol
This module defines a single public function:
replace_lipid
Can be executed from the command line as a stand-alone program
"""
import os
import numpy as np
import numpy.random as random
import pdb
import fitting
lipids = ["POPC","DOPC"]
mapping = {}... | {
"repo_name": "SGenheden/Scripts",
"path": "Membrane/lipid2chol.py",
"copies": "1",
"size": "6961",
"license": "mit",
"hash": -7773965445152639000,
"line_mean": 30.6409090909,
"line_max": 131,
"alpha_frac": 0.6598189915,
"autogenerated": false,
"ratio": 3.1655297862664846,
"config_test": false,... |
"""
Calculate interaction energy between the protein and a ligand, by extracing
Gromacs xvg-files
"""
import argparse
import numpy as np
from sgenlib import pdb
from sgenlib import parsing
def _make_stats(data) :
mean = data.mean()
std = data.std()/np.sqrt(data.shape[0])
nhalf = int(0.5*data.shape[0])
... | {
"repo_name": "SGenheden/Scripts",
"path": "Projects/Lpmo/calc_interene.py",
"copies": "1",
"size": "2686",
"license": "mit",
"hash": -8458117262064222000,
"line_mean": 34.8133333333,
"line_max": 140,
"alpha_frac": 0.5688756515,
"autogenerated": false,
"ratio": 3.024774774774775,
"config_test":... |
import argparse
import os
import openpyxl as xl
import numpy as np
import scipy.stats as stats
import sheetslib
import quality
def _extract_stride(filename, offset):
if filename is None : return []
secondary = []
with open(filename, "r") as f:
for line in f.readlines():
if line[:3]... | {
"repo_name": "SGenheden/Scripts",
"path": "Projects/Orderparam/compare_methods.py",
"copies": "1",
"size": "3419",
"license": "mit",
"hash": 8175705112885563000,
"line_mean": 35.7634408602,
"line_max": 105,
"alpha_frac": 0.6109973677,
"autogenerated": false,
"ratio": 3.1775092936802976,
"confi... |
import argparse
import os
import openpyxl as xl
import numpy as np
import scipy.stats as stats
import sheetslib
import quality
def _make_array(data1, data2, error1, error2, residues):
array = []
for res in residues :
if res in data1 and res in data2 :
array.append([data1[res],error1[res... | {
"repo_name": "SGenheden/Scripts",
"path": "Projects/Orderparam/opt_mad.py",
"copies": "1",
"size": "3147",
"license": "mit",
"hash": 3876988670602389500,
"line_mean": 32.8387096774,
"line_max": 116,
"alpha_frac": 0.5738798856,
"autogenerated": false,
"ratio": 3.115841584158416,
"config_test": ... |
import argparse
import numpy as np
import matplotlib.pylab as plt
import sheetslib
from sgenlib import colors
def _make_plot(data, errors, axis):
left = np.asarray([0.8,1.6,2.4,4.0,4.8,5.6,7.2,8.0,8.8])
#color = [colors.color(0),colors.color(1),colors.color(2)]*3
color = [(255.0/255.0,255.0/255.0,255.0... | {
"repo_name": "SGenheden/Scripts",
"path": "Projects/Orderparam/plot_hbonds.py",
"copies": "1",
"size": "3309",
"license": "mit",
"hash": 34856804883207216,
"line_mean": 34.5806451613,
"line_max": 97,
"alpha_frac": 0.5699607132,
"autogenerated": false,
"ratio": 2.6408619313647246,
"config_test"... |
import argparse
import numpy as np
import matplotlib.pylab as plt
import sheetslib
from sgenlib import colors
def _make_plot(data, lbls, axis):
left = np.asarray([0.8,1.6,2.4,4.0,4.8,5.6,7.2,8.0,8.8])
#color = [colors.color(0),colors.color(1),colors.color(2)]*3
color = [(255.0/255.0,255.0/255.0,255.0/2... | {
"repo_name": "SGenheden/Scripts",
"path": "Projects/Orderparam/plot_bars.py",
"copies": "1",
"size": "3314",
"license": "mit",
"hash": 4014788196582967300,
"line_mean": 32.8163265306,
"line_max": 92,
"alpha_frac": 0.5817742909,
"autogenerated": false,
"ratio": 2.9695340501792113,
"config_test"... |
import argparse
import numpy as np
import matplotlib.pylab as plt
import sheetslib
from sgenlib import colors
def _make_plot(residue, analytical, observed, error, axis):
left1 = np.arange(0.4,0.4+2.0*len(residue),2.0)
left2 = left1 + 0.8
abar = axis.bar(left1, analytical, width=0.8, color='w')
oba... | {
"repo_name": "SGenheden/Scripts",
"path": "Projects/Orderparam/plot_bedroc.py",
"copies": "1",
"size": "3043",
"license": "mit",
"hash": -2690153518025966000,
"line_mean": 37.5189873418,
"line_max": 111,
"alpha_frac": 0.6138678935,
"autogenerated": false,
"ratio": 2.9716796875,
"config_test": ... |
import argparse
import numpy as np
import numpy.random as random
from sgenlib import pdb
if __name__ == '__main__' :
parser = argparse.ArgumentParser(description="Split a membrane, making a hole in the middle")
parser.add_argument('-b','--box',help="the membrane box")
parser.add_argument('-o','--out',h... | {
"repo_name": "SGenheden/Scripts",
"path": "Membrane/split_membrane.py",
"copies": "1",
"size": "1260",
"license": "mit",
"hash": 671981508576770000,
"line_mean": 33.0540540541,
"line_max": 103,
"alpha_frac": 0.6420634921,
"autogenerated": false,
"ratio": 3.351063829787234,
"config_test": false... |
import argparse
import numpy as np
from sgenlib import umbrella
from sgenlib import parsing
from sgenlib.units import *
if __name__ == '__main__':
parser = argparse.ArgumentParser(description="Calculationg PMF from umbrella sampling simulations")
parser.add_argument('-f','--files',nargs="+",help="the outpu... | {
"repo_name": "SGenheden/Scripts",
"path": "Md/calc_1d_pmf.py",
"copies": "1",
"size": "5145",
"license": "mit",
"hash": 3296549994158162400,
"line_mean": 45.7727272727,
"line_max": 145,
"alpha_frac": 0.6621963071,
"autogenerated": false,
"ratio": 3.4414715719063547,
"config_test": false,
"ha... |
import csv
import sys
from collections import namedtuple
import numpy as np
import dblib
ZhangEntry = namedtuple("ZhangEntry",["Solvent","SoluteName","Exper_","katritzky",
"katritzky_Difference","COSMO_RS","COSMO_RS_Difference",
"TI","TI_error","TI_Difference","Simula... | {
"repo_name": "SGenheden/Scripts",
"path": "Projects/Solvation/test_zhangdb.py",
"copies": "1",
"size": "3738",
"license": "mit",
"hash": -8023297685194550000,
"line_mean": 40.5333333333,
"line_max": 232,
"alpha_frac": 0.6134296415,
"autogenerated": false,
"ratio": 3.0639344262295083,
"config_t... |
import numpy as np
def density_scaling(xvals, area) :
dx = (xvals[1] - xvals[0])
lenz = xvals[-1]+dx-xvals[0]
return len(xvals) / (area * lenz)
def density_intercept(dens1, dens2) :
n1 = np.sum(dens1)
n2 = np.sum(dens2)
fi = 0
while dens1[fi] / n1 == 0.0 or dens2[fi] / n2 < dens1[fi] /... | {
"repo_name": "SGenheden/Scripts",
"path": "sgenlib/mol.py",
"copies": "1",
"size": "2719",
"license": "mit",
"hash": 9198741677397286000,
"line_mean": 32.1585365854,
"line_max": 92,
"alpha_frac": 0.6005884516,
"autogenerated": false,
"ratio": 2.800205973223481,
"config_test": false,
"has_no_... |
import openpyxl as xl
def _extract_residues(sheet, rowstart=1, sysoffset=0):
n = rowstart
reserial = 0
while True:
if sheet.cell(column=1+sysoffset,row=n+1).value is None or \
len(sheet.cell(column=1+sysoffset,row=n+1).value) == 0 :
break
n += 1
lst = [str(she... | {
"repo_name": "SGenheden/Scripts",
"path": "Projects/Orderparam/sheetslib.py",
"copies": "1",
"size": "1813",
"license": "mit",
"hash": -1680578209877132800,
"line_mean": 27.7777777778,
"line_max": 106,
"alpha_frac": 0.583563155,
"autogenerated": false,
"ratio": 3.2607913669064748,
"config_test... |
import os
import tempfile
import shutil
import subprocess
import numpy as np
import numpy.random as random
import matplotlib.pylab as plt
from units import *
from . import binning
from . import parsing
#######################################################################
# Classes to read and analyse results fr... | {
"repo_name": "SGenheden/Scripts",
"path": "sgenlib/umbrella.py",
"copies": "1",
"size": "22400",
"license": "mit",
"hash": 2069196837347775500,
"line_mean": 30.5937940762,
"line_max": 171,
"alpha_frac": 0.6316071429,
"autogenerated": false,
"ratio": 3.3273915626856803,
"config_test": false,
... |
import sys
import math
avogrado = 6.022 * math.pow(10.0,23.0)
n_water = n_total = 5120.0
molmass_water = 18.02
mol_water = n_water / avogrado
mass_water = molmass_water * mol_water
mass_water_kg = math.pow(10.0,-3.0) * mass_water
dens_water = 997.0
vol_water = mass_water_kg / dens_water
vol_water_litre = math.pow(10... | {
"repo_name": "SGenheden/Scripts",
"path": "Projects/Yeast/calc_nmol.py",
"copies": "1",
"size": "1377",
"license": "mit",
"hash": -5204738641847293000,
"line_mean": 28.2978723404,
"line_max": 66,
"alpha_frac": 0.605664488,
"autogenerated": false,
"ratio": 2.411558669001751,
"config_test": fals... |
import sys
import os
import numpy as np
import matplotlib.pylab as plt
import scipy.stats as stats
from sgenlib import colors
from sgenlib import parsing
def _plot_data(figure, datalist, labels, ylabels, xlabels, ncols=3):
if isinstance(ylabels,str):
ylabels = [ylabels]*len(datalist)
xlabels = [... | {
"repo_name": "SGenheden/Scripts",
"path": "Projects/Sampl5/plot_correlations.py",
"copies": "1",
"size": "1809",
"license": "mit",
"hash": 8399552093464904000,
"line_mean": 32.5,
"line_max": 110,
"alpha_frac": 0.6102819237,
"autogenerated": false,
"ratio": 2.8046511627906976,
"config_test": fa... |
"""
Classes and routines to handle atom groups
"""
from __future__ import division, print_function, absolute_import
import sys
import os
import copy
import re
from operator import attrgetter
from ConfigParser import SafeConfigParser
import numpy as np
class AtomGroup :
"""
Class to store an atom group, the ... | {
"repo_name": "SGenheden/Scripts",
"path": "sgenlib/groups.py",
"copies": "1",
"size": "6242",
"license": "mit",
"hash": 6628542198552754000,
"line_mean": 27.7649769585,
"line_max": 91,
"alpha_frac": 0.5611983339,
"autogenerated": false,
"ratio": 3.9936020473448495,
"config_test": false,
"has... |
"""
Classes and routines to read, write and manipulate LAMMPS files
Note that only a sub-set of the versatile datafile and include
file can be read, written and manipulated.
The selection has been made on a need-basis to handle ELBA force field
and dual resolution techniques.
"""
import sys
import os
import copy
fr... | {
"repo_name": "SGenheden/Scripts",
"path": "sgenlib/lammps.py",
"copies": "1",
"size": "65558",
"license": "mit",
"hash": -3281085837450851000,
"line_mean": 33.54056902,
"line_max": 273,
"alpha_frac": 0.5847646359,
"autogenerated": false,
"ratio": 3.1516754002211433,
"config_test": false,
"ha... |
"""
Classes to help with the processing of MD trajectories
"""
import argparse
import sys
import MDAnalysis as md
class TrajectoryProcessor(object):
"""
Class to process an MD trajectory
The program that uses this initialises an instance that setups up an
argparse command-line interpreter.
The ... | {
"repo_name": "SGenheden/Scripts",
"path": "sgenlib/moldyn.py",
"copies": "1",
"size": "5176",
"license": "mit",
"hash": -5367974188696679000,
"line_mean": 34.6965517241,
"line_max": 110,
"alpha_frac": 0.6188176198,
"autogenerated": false,
"ratio": 4.331380753138076,
"config_test": false,
"ha... |
"""
Classes to perform actions on MD trajectories
"""
import os
from collections import namedtuple
import MDAnalysis as md
import MDAnalysis.core.AtomGroup as AtomGroup
import MDAnalysis.analysis.align as align
import MDAnalysis.lib.util as mdutil
import numpy as np
try :
import pyvoro
except:
pass
from scip... | {
"repo_name": "SGenheden/Scripts",
"path": "sgenlib/mdactions.py",
"copies": "1",
"size": "58085",
"license": "mit",
"hash": -5498006063873295000,
"line_mean": 41.0905797101,
"line_max": 151,
"alpha_frac": 0.5742790738,
"autogenerated": false,
"ratio": 3.5617488349276427,
"config_test": false,
... |
"""
Classes to read and manipulate some Gromacs files
"""
import os
from . import geo
#
# Class to hold an AtomType record
#
class AtomType :
def __init__(self,record=None) :
self.name = ""
self.atnum = 0
self.mass = 0.0
self.charge = 0.0
self.sigma = 0.0
self.epsilon = 0.0
self.recor... | {
"repo_name": "SGenheden/Scripts",
"path": "sgenlib/gmx.py",
"copies": "1",
"size": "13123",
"license": "mit",
"hash": 6280320656803347000,
"line_mean": 33.1744791667,
"line_max": 138,
"alpha_frac": 0.5959765298,
"autogenerated": false,
"ratio": 3.1659831121833535,
"config_test": false,
"has_... |
"""
Classes to read, write and manipulate PDB files
The module contains the following public classes:
- PDBFile -- the top-level structural class,
contains chains, residues and atoms
- Residue -- class to hold a collection of atoms
- Atom -- class to represent an ATOM or HETATOM record
"""
import sys
impor... | {
"repo_name": "SGenheden/Scripts",
"path": "sgenlib/pdb.py",
"copies": "1",
"size": "26405",
"license": "mit",
"hash": 9067833834189073000,
"line_mean": 30.0282021152,
"line_max": 258,
"alpha_frac": 0.5975004734,
"autogenerated": false,
"ratio": 3.0593210520217817,
"config_test": false,
"has_... |
"""
Helper routines for dealing with CUBE files
"""
import numpy as np
import sys,os
import matplotlib.pylab as plt
import matplotlib.colors as colors
import matplotlib
#
# Read a file in CUBE format and return the grid, the atoms and the center of coordinates
#
def read_cube(filename) :
f = open(filename,'r')
... | {
"repo_name": "SGenheden/Scripts",
"path": "sgenlib/cube.py",
"copies": "1",
"size": "2699",
"license": "mit",
"hash": 3357011473341117000,
"line_mean": 30.0229885057,
"line_max": 89,
"alpha_frac": 0.6369025565,
"autogenerated": false,
"ratio": 2.7044088176352705,
"config_test": false,
"has_n... |
"""
Helper routines for density processing, from the Gpcr project originally
"""
import numpy as np
def read_simple(filename,lownam,uppnam) :
mat = np.load(filename)
return mat[lownam],mat[uppnam]
def read_and_scale(filename,lownam,uppnam,scaling=None) :
lowmat,uppmat = read_simple(filename,lownam,uppnam)
... | {
"repo_name": "SGenheden/Scripts",
"path": "sgenlib/mat_routines.py",
"copies": "1",
"size": "1520",
"license": "mit",
"hash": 5953299899969885000,
"line_mean": 27.1481481481,
"line_max": 110,
"alpha_frac": 0.6875,
"autogenerated": false,
"ratio": 2.7838827838827838,
"config_test": false,
"ha... |
"""
Helper routines for plotting programs
"""
import numpy as np
def color(idx) :
"""
Returns a color of index
For instances when the index is larger than the number of defined colors,
this routine takes care of this by periodicity, i.e.
color at idx=0 is the same color as idx=n
Parameters
----------... | {
"repo_name": "SGenheden/Scripts",
"path": "sgenlib/colors.py",
"copies": "1",
"size": "1446",
"license": "mit",
"hash": 3805173123999359500,
"line_mean": 26.2830188679,
"line_max": 75,
"alpha_frac": 0.6307053942,
"autogenerated": false,
"ratio": 2.438448566610455,
"config_test": false,
"has_... |
"""
Module to read in the Minnesota Solvation database
and then supply generators that can be used to iterate over
the entries
"""
import csv
from collections import namedtuple
import re
Entry = namedtuple("Entry",['No', 'FileHandle', 'SoluteName', 'Formula', 'Subset',
'Charge', 'Level1'... | {
"repo_name": "SGenheden/Scripts",
"path": "Projects/Solvation/dblib.py",
"copies": "1",
"size": "4708",
"license": "mit",
"hash": 6192323954715124000,
"line_mean": 36.664,
"line_max": 99,
"alpha_frac": 0.5395072218,
"autogenerated": false,
"ratio": 3.9331662489557226,
"config_test": false,
"... |
"""
Program align a PDB structure to a specific axis
Examples
--------
pdb_align.py prot.pdb -a z
"""
import argparse
import os
import sys
import numpy as np
from sgenlib import fitting
from sgenlib import geo
from sgenlib import pdb
if __name__ == "__main__":
# Setup a parser of the command-line arguments
... | {
"repo_name": "SGenheden/Scripts",
"path": "Pdb/pdb_align.py",
"copies": "1",
"size": "1612",
"license": "mit",
"hash": 9053673312041467000,
"line_mean": 27.2807017544,
"line_max": 101,
"alpha_frac": 0.6960297767,
"autogenerated": false,
"ratio": 3.0763358778625953,
"config_test": false,
"has... |
"""
Program plot time series of molecular densities
Examples
--------
gpcr_plot_densityseries.py -f r{1..5}_densities1.npz -o densities_series -d chol -m b2
"""
import os
import argparse
import matplotlib
if not "DISPLAY" in os.environ or os.environ["DISPLAY"] == "" :
matplotlib.use('Agg')
import matplotlib.pyplo... | {
"repo_name": "SGenheden/Scripts",
"path": "Projects/Gpcr/gpcr_plot_densityseries.py",
"copies": "1",
"size": "2585",
"license": "mit",
"hash": -5928406556062969000,
"line_mean": 40.0317460317,
"line_max": 146,
"alpha_frac": 0.6700193424,
"autogenerated": false,
"ratio": 2.9746835443037973,
"co... |
"""
Program reduce the number of a specific residue, e.g. waters,
by replacing them with a residue at the group centroid.
"""
import argparse
import os
import numpy as np
import pdb
if __name__ == "__main__":
# Setup a parser of the command-line arguments
parser = argparse.ArgumentParser(description="Program ... | {
"repo_name": "SGenheden/Scripts",
"path": "Pdb/reduce_residues.py",
"copies": "1",
"size": "2200",
"license": "mit",
"hash": 7197629469668543000,
"line_mean": 30.884057971,
"line_max": 114,
"alpha_frac": 0.6618181818,
"autogenerated": false,
"ratio": 3.2983508245877062,
"config_test": false,
... |
"""
Program to analyse a MD trajectory with one or more acions
The command file can contain all actions that are defined in sgenlib.mdactions
Examples:
md_analysis.py -f sim.dcd -s ref.pdb -c commands
"""
import argparse
import inspect
import sys
import shlex
from sgenlib import moldyn
from sgenlib import mdac... | {
"repo_name": "SGenheden/Scripts",
"path": "Md/md_analysis.py",
"copies": "1",
"size": "1747",
"license": "mit",
"hash": -1218237088787037400,
"line_mean": 30.1964285714,
"line_max": 92,
"alpha_frac": 0.614768174,
"autogenerated": false,
"ratio": 4.006880733944954,
"config_test": false,
"has_... |
"""
Program to analyse chemical groups of solutes from the Minnesota solvation database
Examples:
analyse_chemicalgroups.py -db MNSol_alldata.txt -solvent hexanol -solutes hexanolwater.txt
"""
import argparse
import os
import subprocess
import tempfile
import dblib
from sgenlib import ambertools
babel_str = "babel... | {
"repo_name": "SGenheden/Scripts",
"path": "Projects/Solvation/analyse_chemicalgroups.py",
"copies": "1",
"size": "3729",
"license": "mit",
"hash": 1719721385974176300,
"line_mean": 35.2038834951,
"line_max": 117,
"alpha_frac": 0.6055242692,
"autogenerated": false,
"ratio": 3.6920792079207922,
... |
"""
Program to analyse chemical groups of solutes
Requires that the program checkmol is downloaded and installed
Examples:
chemical_groups.py -f mol1.sdf mol2.sdf
chemical_groups.py -f mol1.sdf mol2.sdf -o Groups/
"""
import argparse
import os
import subprocess
import tempfile
checkmol_str = "checkmol %s"
def _ge... | {
"repo_name": "SGenheden/Scripts",
"path": "Mol/chemical_groups.py",
"copies": "1",
"size": "1818",
"license": "mit",
"hash": -5175968503846760000,
"line_mean": 33.9615384615,
"line_max": 117,
"alpha_frac": 0.6677667767,
"autogenerated": false,
"ratio": 3.6143141153081513,
"config_test": false,... |
"""
Program to analyse hydrogen bonds in a two-component system
It will classifies hydrogen bonds as trehalose-water (T-W),
trehalose-trehalose (T-T) or water-water (W-W). And for each
donor or acceptor atom it will write out the average number of hydrogen
bonds in each class.
Recognized donor atoms: H2O H3O H4O H6O... | {
"repo_name": "SGenheden/Scripts",
"path": "Projects/Trehalose/anal_hbonds_twocomp.py",
"copies": "1",
"size": "6807",
"license": "mit",
"hash": -7271403718914042000,
"line_mean": 32.2048780488,
"line_max": 98,
"alpha_frac": 0.5677978551,
"autogenerated": false,
"ratio": 3.2199621570482497,
"co... |
"""
Program to analyse state files in order plot statistics of residue contacts.
It will analyse group of files, each group with a number of repeats. Three plots
will be produced
* a residue-residue contact joint probability plot, one for each group
* a residue contact probability plot, one for each group
* an amino-... | {
"repo_name": "SGenheden/Scripts",
"path": "Projects/Gpcr/gpcr_plot_rescontacts.py",
"copies": "1",
"size": "14493",
"license": "mit",
"hash": 2661881370228476400,
"line_mean": 37.2401055409,
"line_max": 140,
"alpha_frac": 0.6588697992,
"autogenerated": false,
"ratio": 3.1431359791802214,
"conf... |
"""
Program to analyse state files in order to count molecules
The state series can be files on disc or logical combinations of already open state
series. It will analyse group of files, each group with a number of repeats.
Average and standard deviation of the counts will be written out to standard output,
as wel... | {
"repo_name": "SGenheden/Scripts",
"path": "Projects/Gpcr/gpcr_anal_counts.py",
"copies": "1",
"size": "4328",
"license": "mit",
"hash": -5911811565696882000,
"line_mean": 33.624,
"line_max": 133,
"alpha_frac": 0.6621996303,
"autogenerated": false,
"ratio": 3.41594317284925,
"config_test": fals... |
"""
Program to analyse the elements of all solutes in a list
The solutes are taken from the Minnesota solvation database
"""
import argparse
import re
import dblib
def _elements(form) :
"""
Parse elements from molecular formula
"""
elements = []
for part in re.findall("[A-Z]+[0-9]+",form):
... | {
"repo_name": "SGenheden/Scripts",
"path": "Projects/Solvation/analyse_elements.py",
"copies": "1",
"size": "1294",
"license": "mit",
"hash": 529756613432530560,
"line_mean": 33.0789473684,
"line_max": 96,
"alpha_frac": 0.6684698609,
"autogenerated": false,
"ratio": 3.4142480211081794,
"config_... |
"""
Program to analyse the errors of the predictions compared to experiments.
Work with an Excel sheet created by collect_results.py
Create box plots of the error distribution and perform BEDROC and p-value
analysis of individual chemical groups
"""
import argparse
import os
from collections import namedtuple
import... | {
"repo_name": "SGenheden/Scripts",
"path": "Projects/Solvation/analyse_errors.py",
"copies": "1",
"size": "9288",
"license": "mit",
"hash": 7917586234348882000,
"line_mean": 41.801843318,
"line_max": 113,
"alpha_frac": 0.6082041344,
"autogenerated": false,
"ratio": 3.2842998585572842,
"config_t... |
"""
Program to analyse the metal site in LPMO simulations
Examples:
"""
import numpy as np
import MDAnalysis as md
import MDAnalysis.lib.distances as mddist
import MDAnalysis.analysis.align as align
from sgenlib import moldyn
from sgenlib import mdactions
from sgenlib import geo
class MetalSiteAnalysis(mdactions.... | {
"repo_name": "SGenheden/Scripts",
"path": "Projects/Lpmo/anal_metal.py",
"copies": "1",
"size": "4100",
"license": "mit",
"hash": -6608061391921369000,
"line_mean": 40,
"line_max": 119,
"alpha_frac": 0.6168292683,
"autogenerated": false,
"ratio": 3.5714285714285716,
"config_test": false,
"ha... |
"""
Program to analyse the molecular radius of all solutes in a list
The solutes coordinates are taken from the Minnesota solvation database
"""
import argparse
import os
import numpy as np
import dblib
def _calc_radii(filename):
with open(filename,"r") as f :
data = [s.strip().split() for s in f.read... | {
"repo_name": "SGenheden/Scripts",
"path": "Projects/Solvation/analyse_molradii.py",
"copies": "1",
"size": "1509",
"license": "mit",
"hash": 6989382730849586000,
"line_mean": 31.8260869565,
"line_max": 115,
"alpha_frac": 0.648111332,
"autogenerated": false,
"ratio": 3.2804347826086957,
"config... |
"""
Program to analyse the neighbors of lipids
Examples:
"""
import numpy as np
import MDAnalysis as md
import MDAnalysis.lib.distances as mddist
import scipy.spatial.distance as scidist
from sgenlib import moldyn
from sgenlib import mdactions
from sgenlib import pbc
class LipidNeighborAnalysis(mdactions.Trajecto... | {
"repo_name": "SGenheden/Scripts",
"path": "Md/md_lipid_neigh.py",
"copies": "1",
"size": "2681",
"license": "mit",
"hash": -2623274493785070600,
"line_mean": 37.3,
"line_max": 136,
"alpha_frac": 0.6434166356,
"autogenerated": false,
"ratio": 3.3936708860759492,
"config_test": false,
"has_no_... |
"""
Program to analyse the overlap of solutes in two solvents
The solutes are taken from the Minnesota solvation database
"""
import argparse
import re
import dblib
def _parse_info(form) :
"""
Parse weight, number of atoms and number of heavy atoms from molecular formula
"""
w = 0
n = 0
nh =... | {
"repo_name": "SGenheden/Scripts",
"path": "Projects/Solvation/analyse_overlap.py",
"copies": "1",
"size": "1833",
"license": "mit",
"hash": 6297224554817282000,
"line_mean": 30.0677966102,
"line_max": 107,
"alpha_frac": 0.5886524823,
"autogenerated": false,
"ratio": 3.160344827586207,
"config_... |
"""
Program to analyse the overlap of solutes in two solvents
The solutes are taken from the Minnesota solvation database
"""
import argparse
import re
import dblib
if __name__ == '__main__':
argparser = argparse.ArgumentParser(description="Script to analyse overlap of solutes in two solvents")
argparser.a... | {
"repo_name": "SGenheden/Scripts",
"path": "Projects/Solvation/analyse_overlap_hybrid.py",
"copies": "1",
"size": "1275",
"license": "mit",
"hash": 3726119407988858400,
"line_mean": 30.0975609756,
"line_max": 107,
"alpha_frac": 0.6321568627,
"autogenerated": false,
"ratio": 3.418230563002681,
"... |
"""
Program to analyse the radius and area per lipid of a liposome
Examples:
md_liposome.py -s ref.gro -f sim.xtc --inner "name PO4 and resid 8161:9107" --outer "name PO4 and resid 9108:10688"
"""
import numpy as np
import MDAnalysis as md
import MDAnalysis.lib.distances as mddist
from sgenlib import moldyn
from ... | {
"repo_name": "SGenheden/Scripts",
"path": "Md/md_liposome.py",
"copies": "1",
"size": "4014",
"license": "mit",
"hash": -1461048272022447900,
"line_mean": 43.1098901099,
"line_max": 117,
"alpha_frac": 0.6509715994,
"autogenerated": false,
"ratio": 3.472318339100346,
"config_test": false,
"ha... |
"""
Program to analyse the RDF of a solute with the centre of liposome
Examples:
md_liposome_rdf.py -s ref.gro -f sim.xtc --lipids "resname DPPG or DPPC" --solute "resname 5al"
"""
import numpy as np
import MDAnalysis as md
import MDAnalysis.lib.distances as mddist
from sgenlib import moldyn
from sgenlib import m... | {
"repo_name": "SGenheden/Scripts",
"path": "Md/md_liposome_rdf.py",
"copies": "1",
"size": "2618",
"license": "mit",
"hash": 3560305845390866400,
"line_mean": 38.0746268657,
"line_max": 117,
"alpha_frac": 0.6294881589,
"autogenerated": false,
"ratio": 3.280701754385965,
"config_test": false,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.