text
stringlengths
0
1.05M
meta
dict
__author__ = 'shawnmehan' """2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder. What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20? """ def test_divs(number, start, stop): no_remainder = [True] for n in ran...
{ "repo_name": "smehan/py-scratch", "path": "Euler/E5.py", "copies": "1", "size": "1455", "license": "apache-2.0", "hash": -3685475443118699000, "line_mean": 28.1, "line_max": 109, "alpha_frac": 0.5395189003, "autogenerated": false, "ratio": 3.3758700696055683, "config_test": false, "has_no_ke...
__author__ = 'shawnmehan' '''9*9*8*9 = 5832''' inString = '''73167176531330624919225119674426574742355349194934 96983520312774506326239578318016984801869478851843 85861560789112949495459501737958331952853208805511 12540698747158523863050715693290963295227443043557 66896648950445244523161731856403098711121722383113 62...
{ "repo_name": "smehan/py-scratch", "path": "Euler/E8.py", "copies": "1", "size": "1652", "license": "apache-2.0", "hash": 7664959060580119000, "line_mean": 33.4166666667, "line_max": 64, "alpha_frac": 0.8401937046, "autogenerated": false, "ratio": 2.5415384615384617, "config_test": false, "ha...
__author__ = 'shawnmehan' """ Calculate the greatest product of 4 sequential elements in an nXm matrix, all directions""" """There are edges to the matrix that must be treated differently, then there is everything that is n/2 in from the edge""" text = """08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08 ...
{ "repo_name": "smehan/py-scratch", "path": "Euler/E11.py", "copies": "1", "size": "4296", "license": "apache-2.0", "hash": 1477820008449243100, "line_mean": 38.4128440367, "line_max": 133, "alpha_frac": 0.5812383613, "autogenerated": false, "ratio": 3.2894333843797856, "config_test": false, "...
__author__ = 'shawnmehan' """Class to calculate the triangle numbers and then determine how many divisors they have. Objective is to find first triangle number with > 500 divisors""" import math, time ti = time.time() def nofactors2(num): count = 0 x = math.sqrt(num) y = int(math.ceil(x)) if x - y ...
{ "repo_name": "smehan/py-scratch", "path": "Euler/E12.py", "copies": "1", "size": "1103", "license": "apache-2.0", "hash": -2251755324120026600, "line_mean": 18.350877193, "line_max": 90, "alpha_frac": 0.5131459655, "autogenerated": false, "ratio": 2.8575129533678756, "config_test": false, "h...
__author__ = 'shawnmehan' import csv, re import xml.etree.cElementTree def write_csv(data): outfile = open('./Dataset1-Media-Example-EDGES.csv', 'wb') outwriter = csv.writer(outfile, delimiter=',') count = 0 for d in data: # iterate through each row outwriter.writerow(d) # write the row ...
{ "repo_name": "smehan/r-scratch", "path": "Networks/Network-src-loader.py", "copies": "1", "size": "1612", "license": "apache-2.0", "hash": 7583186640254554000, "line_mean": 29.4150943396, "line_max": 72, "alpha_frac": 0.6253101737, "autogenerated": false, "ratio": 3.263157894736842, "config_te...
__author__ = 'shawnmehan' class Graph(object): def __init__(self, graph_dict={}): """ initializes a graph object """ self.__graph_dict = graph_dict def vertices(self): """ returns the vertices of a graph """ return list(self.__graph_dict.keys()) def edges(self): ...
{ "repo_name": "smehan/py-scratch", "path": "graphs/SimpleGraphs.py", "copies": "1", "size": "2669", "license": "apache-2.0", "hash": -4573863224422531600, "line_mean": 25.69, "line_max": 60, "alpha_frac": 0.5133008617, "autogenerated": false, "ratio": 3.930780559646539, "config_test": false, ...
__author__ = 'shawnmehan' #!/usr/bin/env python from math import sqrt, ceil import numpy as np def rwh_primes(n): """ Returns a list of primes < n """ sieve = [True] * n for i in range(3,int(n**0.5)+1,2): if sieve[i]: sieve[i*i::2*i]=[False]*((n-i*i-1)/(2*i)+1) return [2] + [i...
{ "repo_name": "smehan/py-scratch", "path": "Euler/GetPrimes.py", "copies": "1", "size": "12527", "license": "apache-2.0", "hash": -5396789517982100000, "line_mean": 33.8, "line_max": 121, "alpha_frac": 0.4815997446, "autogenerated": false, "ratio": 2.738740708351552, "config_test": true, "has...
# Factors that make the data seem artifical # Addresses consisting of large amounts of numbers or start with numbers # Addresses that seem very long # ---- Imports ---- import random import string from sys import argv # ---- Set Globals ---- global commonEmailProviders global allTLDS, commonTLDS, commonTLDSx global...
{ "repo_name": "super3/PyDev", "path": "Old Projects/ident/EmailGen.py", "copies": "1", "size": "3419", "license": "mit", "hash": 8515658948130070000, "line_mean": 24.3333333333, "line_max": 111, "alpha_frac": 0.6493126645, "autogenerated": false, "ratio": 2.8070607553366176, "config_test": fals...
import ROOT from ROOT import TVector2, TLorentzVector, TMath ROOT.gROOT.SetBatch(True) #Do I want to run in batch mode? from CMSobservables import * from renormalize import * #------------------------------------------------------------------ class minhists: def __init__(self, tag, topdir, isdata, treetype, DSID, s...
{ "repo_name": "sschier/histMaker-repo", "path": "CMShistograms.py", "copies": "1", "size": "24616", "license": "unlicense", "hash": 5772953055287444000, "line_mean": 51.9376344086, "line_max": 209, "alpha_frac": 0.5999350016, "autogenerated": false, "ratio": 2.665511640498105, "config_test": fa...
import ROOT from ROOT import TVector2, TLorentzVector, TMath ROOT.gROOT.SetBatch(True) #Do I want to run in batch mode? from CMSobservables import * from renormalize import * #------------------------------------------------------------------ class lephists: def __init__(self, tag, topdir, isdata, treetype, DSID,...
{ "repo_name": "sschier/histMaker-repo", "path": "Effhistograms.py", "copies": "1", "size": "6738", "license": "unlicense", "hash": -2882392946130431000, "line_mean": 32.3564356436, "line_max": 209, "alpha_frac": 0.5844464233, "autogenerated": false, "ratio": 3.3472429210134127, "config_test": f...
import numpy as np import os from scipy.io import loadmat from sklearn.decomposition import PCA import matplotlib.pyplot as plt from sklearn.discriminant_analysis import LinearDiscriminantAnalysis def fisherDiscrimVowelDemo(): data = loadmat('../data/vowelTrain') Xtrain = data['Xtrain'] ytrain = data['yt...
{ "repo_name": "probml/pyprobml", "path": "scripts/fisherDiscrimVowelDemo.py", "copies": "1", "size": "1403", "license": "mit", "hash": 5346523536521713000, "line_mean": 23.1896551724, "line_max": 80, "alpha_frac": 0.60085531, "autogenerated": false, "ratio": 2.811623246492986, "config_test": fa...
__author__ = 'shekarnh' import json import subprocess import yaml import logging import sys class GetTags(object): def __init__(self, tagFile): self.outTagFile = tagFile self.logger = logging.getLogger(__name__) def update_tag_file(self): # requires awscli installed and credentials c...
{ "repo_name": "NUCyberEd/CloudWhip", "path": "cloudWhip/getTags.py", "copies": "1", "size": "1663", "license": "mit", "hash": -8421643873440144000, "line_mean": 31.6274509804, "line_max": 95, "alpha_frac": 0.6115453999, "autogenerated": false, "ratio": 3.849537037037037, "config_test": false, ...
__author__ = 'shekarnh' """ Recipe for creating and updating security groups programmatically. Orginal author: Mike Steder url: https://gist.github.com/steder/1498451 """ import collections import logging import sys import getTags import os import time class SecurityGroups(object): def __init__(self, ec2Conn...
{ "repo_name": "NUCyberEd/CloudWhip", "path": "cloudWhip/secGroups.py", "copies": "1", "size": "4917", "license": "mit", "hash": -8209361356438980000, "line_mean": 35.977443609, "line_max": 116, "alpha_frac": 0.5391498881, "autogenerated": false, "ratio": 4.152871621621622, "config_test": false,...
__author__ = 'shekar_n_h' import getTags import os import logging import sys import time import subprocess from boto import ec2 import netIps class PodSetUp(object): def __init__(self, ec2Connection, vpcConnection): self.conn = ec2Connection self.vpcConn = vpcConnection se...
{ "repo_name": "NUCyberEd/CloudWhip", "path": "cloudWhip/podSetUp.py", "copies": "1", "size": "11463", "license": "mit", "hash": 3196815106108865000, "line_mean": 52.8564593301, "line_max": 125, "alpha_frac": 0.5212422577, "autogenerated": false, "ratio": 4.504125736738703, "config_test": false,...
__author__ = 'shekar_n_h' import sys import logging import getTags import os import secGroups import time import netIps class VpcSetUp(object): def __init__(self, vpcConnection, ec2Connection): self.conn = vpcConnection self.ec2Conn = ec2Connection # ec2 connection for security gro...
{ "repo_name": "NUCyberEd/CloudWhip", "path": "cloudWhip/vpcSetUp.py", "copies": "1", "size": "10934", "license": "mit", "hash": 3387496061350465000, "line_mean": 47.0403587444, "line_max": 149, "alpha_frac": 0.5612767514, "autogenerated": false, "ratio": 3.9615942028985507, "config_test": false...
__author__ = 'shekkizh' # Utils used with tensorflow implemetation import tensorflow as tf import numpy as np import scipy.misc as misc import os, sys from six.moves import urllib import tarfile import zipfile from tqdm import trange import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from mpl_tool...
{ "repo_name": "melkonyan/BA_WassersteinGAN", "path": "utils.py", "copies": "1", "size": "7026", "license": "mit", "hash": -1965673119922677500, "line_mean": 34.3065326633, "line_max": 133, "alpha_frac": 0.6362083689, "autogenerated": false, "ratio": 3.218506642235456, "config_test": false, "h...
__author__ = 'shellyan' # == OAuth Authentication == # # This mode of authentication is the new preferred way # of authenticating with Twitter. # The consumer keys can be found on your application's Details # page located at https://dev.twitter.com/apps (under "OAuth settings") consumer_key="jirJSDlasEBd6MEeXc4hsA" c...
{ "repo_name": "shellyan/cs-339-chatapp", "path": "src/server/twitter.py", "copies": "1", "size": "1191", "license": "mit", "hash": -8246724624339255000, "line_mean": 37.4193548387, "line_max": 75, "alpha_frac": 0.7833753149, "autogenerated": false, "ratio": 3, "config_test": false, "has_no_ke...
__author__ = 'shengjia' import subprocess, threading import random import time import os import math # Runs a system command without timeout def run_command(command): p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) return [item....
{ "repo_name": "ShengjiaZhao/XORModelCount", "path": "SATModelCount/sat.py", "copies": "1", "size": "9007", "license": "mit", "hash": 3351017364979709000, "line_mean": 34.7420634921, "line_max": 132, "alpha_frac": 0.508049295, "autogenerated": false, "ratio": 4.0792572463768115, "config_test": f...
__author__ = 'shengjia' import threading import time class Timer: def __init__(self, max_time): self.max_time = max_time self.begin_time = time.time() self.time_out_flag = False self.time_out_flag_lock = threading.Lock() self.timer_thread = threading.Thread(target=self.tim...
{ "repo_name": "ShengjiaZhao/XORModelCount", "path": "SATModelCount/timer.py", "copies": "1", "size": "1371", "license": "mit", "hash": -7482211240712632000, "line_mean": 26.9795918367, "line_max": 88, "alpha_frac": 0.5616338439, "autogenerated": false, "ratio": 3.808333333333333, "config_test":...
__authors__ = "Heng Luo" from pylearn2.testing.skip import skip_if_no_gpu skip_if_no_gpu() import numpy as np from theano import shared from theano.tensor import grad, constant from pylearn2.sandbox.cuda_convnet.filter_acts import FilterActs from pylearn2.sandbox.cuda_convnet.filter_acts import ImageActs from theano....
{ "repo_name": "skearnes/pylearn2", "path": "pylearn2/sandbox/cuda_convnet/tests/test_image_acts_strided.py", "copies": "5", "size": "6085", "license": "bsd-3-clause", "hash": -5514414139275688000, "line_mean": 40.9655172414, "line_max": 131, "alpha_frac": 0.5636811832, "autogenerated": false, "ra...
__author__ = 'shenoisz' from django.conf import settings class GetPageRequest( object ): #======================================================= # add host, session and url for cache util #======================================================= def process_request( self, request ): set...
{ "repo_name": "SHENOISZ/django-pages-cache", "path": "Tests/pages_cache/middleware/PagesRequests.py", "copies": "2", "size": "1180", "license": "bsd-3-clause", "hash": 764992155024510600, "line_mean": 33.7058823529, "line_max": 92, "alpha_frac": 0.4262711864, "autogenerated": false, "ratio": 5.06...
__author__ = 'shenoisz' from django.core.cache import cache from django.conf import settings #from django.utils.decorators import available_attrs #from functools import wraps class CacheViews( ): """ Class util cache with memcache """ #====================================== # add views...
{ "repo_name": "SHENOISZ/django-pages-cache", "path": "Tests/pages_cache/pages_decorators.py", "copies": "3", "size": "5133", "license": "bsd-3-clause", "hash": -6159798424959396000, "line_mean": 33.6824324324, "line_max": 80, "alpha_frac": 0.3323592441, "autogenerated": false, "ratio": 6.08896797...
__author__ = 'shenojia' import pprint import re import sys import unittest import weakref import numpy as np from matplotlib.path import Path from matplotlib.patches import PathPatch import matplotlib.pyplot as plt sys.path.insert(0, '..') from R12_36211.RE import RE from R12_36211.RG import RG from R12_36211.PRB impo...
{ "repo_name": "shennjia/weblte", "path": "matplot/test_prb.py", "copies": "1", "size": "1891", "license": "mit", "hash": 9133696379090656000, "line_mean": 30, "line_max": 96, "alpha_frac": 0.6054997356, "autogenerated": false, "ratio": 2.6671368124118477, "config_test": true, "has_no_keywords...
__author__ = 'shenojia' import sys from matplotlib.path import Path from matplotlib.patches import PathPatch sys.path.insert(0, '.') sys.path.insert(0, '..') from R12_36211.RG import RG from R12_36xxx.HighLayer import conf from R12_36xxx.HighLayer import cell from R12_36xxx.TypesDefition import SubFrameType from xlsxwr...
{ "repo_name": "shennjia/weblte", "path": "R12_36211/SLOT.py", "copies": "1", "size": "3996", "license": "mit", "hash": 8538209631706650000, "line_mean": 33.1538461538, "line_max": 100, "alpha_frac": 0.4952452452, "autogenerated": false, "ratio": 3.4838709677419355, "config_test": false, "has_...
__author__ = 'shenojia' import sys import numpy as np from matplotlib.path import Path from matplotlib.patches import PathPatch sys.path.insert(0, '.') sys.path.insert(0, '..') from R12_36211.SLOT import SLOT from R12_36211.PRBPAIR import PRBPAIR from R12_36211.PCFICH import * from R12_36211.CRS import * from R12_36211...
{ "repo_name": "shennjia/weblte", "path": "R12_36211/SUBFRAME.py", "copies": "1", "size": "5430", "license": "mit", "hash": -7475652883175926000, "line_mean": 31.7108433735, "line_max": 117, "alpha_frac": 0.5572744015, "autogenerated": false, "ratio": 3.395872420262664, "config_test": false, "...
__author__ = 'shenojia' import sys import numpy as np from matplotlib.path import Path from matplotlib.patches import PathPatch sys.path.insert(0, '.') sys.path.insert(0, '..') from R12_36xxx.HighLayer import * from R12_36xxx.TypesDefition import * from R12_36211.RE import RE from R12_36211.SLOT import SLOT from R12_36...
{ "repo_name": "shennjia/weblte", "path": "R12_36211/MBSFNRS.py", "copies": "1", "size": "5065", "license": "mit", "hash": 1323541812518900700, "line_mean": 39.528, "line_max": 122, "alpha_frac": 0.4576505429, "autogenerated": false, "ratio": 3.571932299012694, "config_test": false, "has_no_ke...
__author__ = 'shenojia' import sys import weakref sys.path.insert(0, '.') sys.path.insert(0, '..') from R12_36xxx.HighLayer import * from R12_36xxx.TypesDefition import * from R12_36211.RE import RE from R12_36211.REG import REG from R12_36211.PRB import * from matplotlib.path import Path from matplotlib.patches impor...
{ "repo_name": "shennjia/weblte", "path": "R12_36211/RG.py", "copies": "1", "size": "15561", "license": "mit", "hash": -1711594199082842000, "line_mean": 38.7979539642, "line_max": 142, "alpha_frac": 0.4675149412, "autogenerated": false, "ratio": 3.222406295299234, "config_test": false, "has_n...
__author__ = 'shenojia' import sys sys.path.insert(0, '.') sys.path.insert(0, '..') from R12_36xxx.HighLayer import * from R12_36211.REG import REG from math import floor from matplotlib.path import Path from matplotlib.patches import PathPatch from xlsxwriter.worksheet import Worksheet class PRB: """ Resource ...
{ "repo_name": "shennjia/weblte", "path": "R12_36211/PRB.py", "copies": "1", "size": "4004", "license": "mit", "hash": 1211850327685366500, "line_mean": 34.4336283186, "line_max": 98, "alpha_frac": 0.5087412587, "autogenerated": false, "ratio": 3.5654496883348172, "config_test": false, "has_no...
__author__ = 'shenojia' import sys sys.path.insert(0, '.') sys.path.insert(0, '..') import numpy def PNlfsr(taps, c__init:int, M__PN:int): """Function implements a linear feedback shift register 36211-c20 7.2 taps: List of Polynomial exponents for non-zero terms other than 1 and n x(n+1),x(n+2)...x(n+30)...
{ "repo_name": "shennjia/weblte", "path": "R12_math_util/pn.py", "copies": "1", "size": "2181", "license": "mit", "hash": -6904246616795215000, "line_mean": 42.62, "line_max": 122, "alpha_frac": 0.5502063274, "autogenerated": false, "ratio": 2.908, "config_test": false, "has_no_keywords": fals...
__author__ = 'shenojia' import sys import numpy as np from math import floor from matplotlib.path import Path from matplotlib.patches import PathPatch sys.path.insert(0, '.') sys.path.insert(0, '..') from R12_36211.SLOT import SLOT from R12_36xxx.TypesDefition import * from R12_36xxx.HighLayer import conf class PCFIC...
{ "repo_name": "shennjia/weblte", "path": "R12_36211/PCFICH.py", "copies": "1", "size": "4392", "license": "mit", "hash": 2913610920446885400, "line_mean": 36.547008547, "line_max": 132, "alpha_frac": 0.5562386157, "autogenerated": false, "ratio": 3.3732718894009217, "config_test": false, "has...
__author__ = 'shenojia' class CyclicPrefix: """ defition of cyclicPrefix type """ def __init__(self, cyclickPrefix = 0): self.cyclicPrefix = 0 self.cyclicPrefixSymbolLen = 0 self.cyclicPrefixName = '' if cyclickPrefix == 0: self.cyclicPrefix = 0 ...
{ "repo_name": "shennjia/weblte", "path": "R12_36xxx/TypesDefition.py", "copies": "1", "size": "1895", "license": "mit", "hash": -8917964944202180000, "line_mean": 27.2985074627, "line_max": 79, "alpha_frac": 0.6005277045, "autogenerated": false, "ratio": 3.812877263581489, "config_test": false,...
""" Simple CodePlex style wiki writer. """ __docformat__ = 'reStructuredText' import sys import os import os.path import time import re from types import ListType try: import Image # check for the Python Imaging Library except ImportError: Image = None import docutils from docutils ...
{ "repo_name": "shibu/pyspec", "path": "sample/rst2codeplex/rst2codeplex.py", "copies": "1", "size": "49962", "license": "mit", "hash": -2655031932694727000, "line_mean": 34.2093023256, "line_max": 79, "alpha_frac": 0.5470357472, "autogenerated": false, "ratio": 3.933086672439581, "config_test":...
__author__ = 'shihhau' # Shih-Hau Tan # # Copyright 2016-2020 Cuemacro # # 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...
{ "repo_name": "cuemacro/findatapy", "path": "findatapy_examples/cryptodata_example.py", "copies": "1", "size": "6072", "license": "apache-2.0", "hash": 7606080889383279000, "line_mean": 43.3284671533, "line_max": 121, "alpha_frac": 0.5752635046, "autogenerated": false, "ratio": 4.0751677852349, ...
__author__ = 'shikun' # -*- coding: utf-8 -*- from selenium.webdriver.support.ui import WebDriverWait from selenium.common.exceptions import WebDriverException from common.variable import Constants as common import time from common import log # 此脚本主要用于查找元素是否存在,操作页面元素 class OperateElement: def __init__(self, driv...
{ "repo_name": "pqpo/appiumn_auto_re-develope", "path": "common/operateElement.py", "copies": "1", "size": "5696", "license": "apache-2.0", "hash": 466175927227273860, "line_mean": 34.5512820513, "line_max": 142, "alpha_frac": 0.6258564731, "autogenerated": false, "ratio": 3.237594862813777, "co...
__author__ = 'shikun' # -*- coding: utf-8 -*- import os import subprocess import re # 得到手机信息 def get_phone_info(devices): l_list = {'release': 'unknown', 'model': 'unknown', 'brand': 'unknown', 'device': 'unknown'} cmd = "adb -s " + devices + " shell cat /system/build.prop" (output, err) = subprocess.Pope...
{ "repo_name": "pqpo/appiumn_auto_re-develope", "path": "testDAL/phoneBase.py", "copies": "1", "size": "2878", "license": "apache-2.0", "hash": -1064317926265839700, "line_mean": 30.7528089888, "line_max": 96, "alpha_frac": 0.5661712668, "autogenerated": false, "ratio": 3.252013808975834, "confi...
__author__ = 'shikun' # -*- coding: utf-8 -*- import re, os from common import log num_re = re.compile("\d+\.?\d*") # 常用的性能监控 def top_cpu(devices, pkg_name): cmd = "adb -s "+devices+" shell dumpsys cpuinfo | findstr " + pkg_name+":" get_cmd = os.popen(cmd).read() match = re.compile(pkg_name + ":\s+(\d+\....
{ "repo_name": "pqpo/appiumn_auto_re-develope", "path": "common/appPerformance.py", "copies": "1", "size": "2390", "license": "apache-2.0", "hash": -1015742012346731600, "line_mean": 29.6164383562, "line_max": 117, "alpha_frac": 0.5416293644, "autogenerated": false, "ratio": 2.479467258601554, "...
__author__ = 'shikun' # -*- coding: utf-8 -*- import unittest from appium import webdriver from common.variable import Constants from testBLL import apkBase def appium_test_case(device): app_path = device["appPath"] apk_base = apkBase.ApkInfo(app_path) desired_caps = {} desired_caps['platformName'] = ...
{ "repo_name": "pqpo/appiumn_auto_re-develope", "path": "testRunner/runnerBase.py", "copies": "1", "size": "1804", "license": "apache-2.0", "hash": -5484467456664180000, "line_mean": 33.0377358491, "line_max": 69, "alpha_frac": 0.6579822616, "autogenerated": false, "ratio": 3.651821862348178, "c...
__author__ = 'shikun' from math import floor import subprocess import os import re class ApkInfo: def __init__(self, apkpath): self.apkpath = apkpath self.dump_badging = None def get_dump_badging(self): if not self.dump_badging: (output, err) = subprocess.Popen("aapt dum...
{ "repo_name": "pqpo/appiumn_auto_re-develope", "path": "testDAL/apkBase.py", "copies": "1", "size": "2068", "license": "apache-2.0", "hash": 4898636692855292000, "line_mean": 26.8611111111, "line_max": 108, "alpha_frac": 0.5503489531, "autogenerated": false, "ratio": 3.3322259136212624, "config...
__author__ = 'shikun' import math from common import log def phone_avg_use_cpu(cpu): result = "0%" if len(cpu) > 0: result = "%.1f" % (sum(cpu) / len(cpu)) + "%" return result def phone_avg_use_raw(men): result = "0M" if len(men) > 0: result = str(math.ceil(sum(men) / len(men) / ...
{ "repo_name": "pqpo/appiumn_auto_re-develope", "path": "common/reportPhone.py", "copies": "1", "size": "1201", "license": "apache-2.0", "hash": 7607659580809021000, "line_mean": 18.0634920635, "line_max": 69, "alpha_frac": 0.4970857619, "autogenerated": false, "ratio": 2.662971175166297, "confi...
__author__ = 'shikun' import os from common import log class OperateFile: def __init__(self, file, method='w+'): self.file = file self.method = method self.fileHandle = None def write_txt(self, line): OperateFile(self.file).check_file() self.fileHandle = open(self.file...
{ "repo_name": "pqpo/appiumn_auto_re-develope", "path": "common/operateFile.py", "copies": "1", "size": "1334", "license": "apache-2.0", "hash": -2568958405141611500, "line_mean": 26.7916666667, "line_max": 58, "alpha_frac": 0.5607196402, "autogenerated": false, "ratio": 3.6648351648351647, "con...
__author__ = 'shikun' from schematics.models import Model from schematics.types import StringType,IntType, FloatType from schematics.types.compound import ListType,MultiType class GetAppCase(Model): element_info = StringType() # (查找类型:name/id/xpah) operate_type = StringType() # 具体的详情,如xpath:“/android.widge...
{ "repo_name": "pqpo/appiumn_auto_re-develope", "path": "testModel/appCase.py", "copies": "1", "size": "1589", "license": "apache-2.0", "hash": -8686433670999805000, "line_mean": 33.5526315789, "line_max": 106, "alpha_frac": 0.6656511805, "autogenerated": false, "ratio": 2.4314814814814816, "con...
__author__ = 'shikun' class Constants(object): TEST_ID = "test_id" TEST_DESC = "test_desc" FIND_TYPE = "find_type" SWIPE_DIRECTION = "direction" SWIPE_TIMES = "times" WAITE_TIMEOUT = "timeout" TAP_POINT = "point" OPERATION_TYPE = "operate_type" ELEMENT_INFO = "element_info" FI...
{ "repo_name": "pqpo/appiumn_auto_re-develope", "path": "common/variable.py", "copies": "1", "size": "1377", "license": "apache-2.0", "hash": 5739017338017265000, "line_mean": 25.2156862745, "line_max": 46, "alpha_frac": 0.6222887061, "autogenerated": false, "ratio": 2.546666666666667, "config_t...
__author__ = 'ShivamMistry' class Menu: """ A wrapper for a Dominos menu """ def __init__(self, client, data): self.pizzas = [Product(x) for x in data["pizzas"][0]] self.starters = [Product(x) for x in data["starters"][0]] self.desserts = [Product(x) for x in data["desserts"][0]] ...
{ "repo_name": "freecode/dominos-cli", "path": "dominoscli/menu.py", "copies": "1", "size": "3156", "license": "mit", "hash": 142942163781718900, "line_mean": 40.5263157895, "line_max": 75, "alpha_frac": 0.5627376426, "autogenerated": false, "ratio": 3.5580608793686586, "config_test": false, "...
__author__ = "Shivam Shekhar" import os import sys import pygame import random from pygame import * pygame.mixer.pre_init(44100, -16, 2, 2048) # fix audio delay pygame.init() scr_size = (width,height) = (600,150) FPS = 60 gravity = 0.6 black = (0,0,0) white = (255,255,255) background_col = (235,235,235) high_scor...
{ "repo_name": "shivamshekhar/Chrome-T-Rex-Rush", "path": "main.py", "copies": "1", "size": "16277", "license": "mit", "hash": -4467983112845631000, "line_mean": 30.9156862745, "line_max": 95, "alpha_frac": 0.5358481293, "autogenerated": false, "ratio": 3.5469601220309435, "config_test": false, ...
__author__ = 'shkiper' from . import morph def get_best_parse(word: str, part: str): possibilities = [x for x in morph.parse(word) if x.tag.POS == part] if len(possibilities) == 0: return None else: return max(possibilities, key=lambda x: (x.score, x.word)) WHO_PARSE = get_best_parse('кт...
{ "repo_name": "hatbot-team/hatbot_resources", "path": "preparation/lang_utils/morphology/replace_with_gap.py", "copies": "1", "size": "2900", "license": "mit", "hash": 5497285231975757000, "line_mean": 32.7195121951, "line_max": 83, "alpha_frac": 0.6385672938, "autogenerated": false, "ratio": 2.9...
__author__ = 'shkiper' # noinspection PyProtectedMember from preparation.resources.book_titles import _raw_data from preparation.resources.Resource import gen_resource from hb_res.explanations import Explanation from preparation import modifiers import re import copy @modifiers.modifier_factory def add_common_prefix(...
{ "repo_name": "hatbot-team/hatbot_resources", "path": "preparation/resources/book_titles/parse_book_titles.py", "copies": "1", "size": "1970", "license": "mit", "hash": -2703557629420150300, "line_mean": 30.5, "line_max": 89, "alpha_frac": 0.6021505376, "autogenerated": false, "ratio": 3.72, "c...
__author__ = 'shkiper' # noinspection PyProtectedMember from preparation.resources.crosswords import _raw_data from preparation.resources.Resource import gen_resource from hb_res.explanations import Explanation from preparation import modifiers crosswords_mods = [ modifiers.re_replace('p', 'р'), modifiers.str...
{ "repo_name": "hatbot-team/hatbot_resources", "path": "preparation/resources/crosswords/parse_crosswords.py", "copies": "1", "size": "1032", "license": "mit", "hash": 5810879810310250000, "line_mean": 33.3666666667, "line_max": 75, "alpha_frac": 0.6411251212, "autogenerated": false, "ratio": 3.30...
__author__ = 'shkiper' # noinspection PyProtectedMember from preparation.resources.film_titles import _raw_data from preparation.resources.Resource import gen_resource from hb_res.explanations import Explanation from preparation import modifiers import re import copy @modifiers.modifier_factory def add_common_prefix(...
{ "repo_name": "hatbot-team/hatbot_resources", "path": "preparation/resources/film_titles/parse_film_titles.py", "copies": "1", "size": "1460", "license": "mit", "hash": 6669594193957870000, "line_mean": 31.3333333333, "line_max": 87, "alpha_frac": 0.6323024055, "autogenerated": false, "ratio": 3....
__author__ = 'ShlomiB' import socket import json class HCRequestsFactory(object): def __init__(self): pass def get_request_from_json(self, json_string): loaded_object = json.loads(json_string) ret_obj = None if loaded_object['RequestType'] == 'ListMayors': ret_obj...
{ "repo_name": "shlomibe/Homechestrator", "path": "HCProtocol/HCRequests.py", "copies": "1", "size": "2439", "license": "unlicense", "hash": 2200822088520500200, "line_mean": 29.8860759494, "line_max": 74, "alpha_frac": 0.594095941, "autogenerated": false, "ratio": 3.8591772151898733, "config_te...
__author__ = 'ShlomiB' import sys import socket from time import sleep from HCProtocol.HCRequests import HCRequestsFactory from HCShared.HCLogger import * import uuid class HCRequestHandler(object): def __init__(self, name, in_socket): self._name = name self._socket = in_socket # TODO: pr...
{ "repo_name": "shlomibe/Homechestrator", "path": "HCServer/HCRequestHandler.py", "copies": "1", "size": "1921", "license": "unlicense", "hash": -6526094035792639000, "line_mean": 35.9423076923, "line_max": 105, "alpha_frac": 0.5663716814, "autogenerated": false, "ratio": 4.562945368171022, "con...
#Modification of the server(even from here) can result in additional security issues. #YOU have been WARNED! #If you want output to be a file(good if output is large to save ram)use Output_File_Path,only used if Output_Content is empty. #BE CAREFUL Output_File_Path bypasses the allowed folders security checks so it c...
{ "repo_name": "Shb743/HT-PY", "path": "Custom.py", "copies": "1", "size": "6292", "license": "bsd-3-clause", "hash": -8080054651334875000, "line_mean": 31.6010362694, "line_max": 177, "alpha_frac": 0.7217101081, "autogenerated": false, "ratio": 3.121031746031746, "config_test": false, "has_no...
import time from threading import Thread import datetime import os #Imports #Globals File_Path = os.getcwd()+"/" DOS_Candidates = {} Blocked_Candidates = [] On = 1#Is HouseKeeping Active Log_Out = []#Logging ELog_Out = []#Error Logging TLock = None#Thread Lock for safe cross threading #FileName & path for Logs(For HTT...
{ "repo_name": "Shb743/HT-PY", "path": "HouseKeeping.py", "copies": "1", "size": "2936", "license": "bsd-3-clause", "hash": 5762957302434876000, "line_mean": 26.9714285714, "line_max": 132, "alpha_frac": 0.7108310627, "autogenerated": false, "ratio": 2.904055390702275, "config_test": false, "h...
HDANA = ["content-type","accept-ranges","content-length","etag"]#-MUST BE IN LOWER CASE-HeaderDuplicatesAreNotALlowed these headers will have their values replaced if duplicate custom headers are present #Construct Output Header def Construct_Header(Custom_Headers,Keep_Alive,Mime,Cont_Size,Code="200 OK",Ranges="bytes"...
{ "repo_name": "Shb743/HT-PY", "path": "GF.py", "copies": "1", "size": "1857", "license": "bsd-3-clause", "hash": 5375847385539932000, "line_mean": 52.0857142857, "line_max": 203, "alpha_frac": 0.7199784599, "autogenerated": false, "ratio": 3.1315345699831365, "config_test": false, "has_no_key...
#Imports import socket import threading from threading import Thread from multiprocessing import Process import datetime#Needed for logging purposes import os,sys import urllib#Unquote urls import json#Decoding Settings Files import uuid#Generating Temporary file names & Service Thread ID's ~ import GF#Global Function...
{ "repo_name": "Shb743/HT-PY", "path": "Server.py", "copies": "1", "size": "31012", "license": "bsd-3-clause", "hash": -1987197843247004200, "line_mean": 32.0628997868, "line_max": 178, "alpha_frac": 0.6875080614, "autogenerated": false, "ratio": 3.0380094043887147, "config_test": false, "has_...
__author__ = "shoe116" class HLLRegister(list): def __init__(self, registerIndexSize): list.__init__(self) self.registerIndexSize = registerIndexSize self.mask = int('1' * registerIndexSize, 2) ## all value is 0 as init for i in xrange(0, 2**registerIndexSize): ...
{ "repo_name": "PhysicsEngine/kHLL", "path": "kHLL/HLL/hyperloglog.py", "copies": "1", "size": "1281", "license": "mit", "hash": 1185772706778833700, "line_mean": 31.025, "line_max": 66, "alpha_frac": 0.6151444184, "autogenerated": false, "ratio": 3.8238805970149254, "config_test": false, "has...
__author__ = 'shreyas' import twitter import time from datetime import datetime import math import pytz from nltk.corpus import stopwords api = twitter.Api( consumer_key='*****', consumer_secret='*****', access_token_key='*****', access_token_secret='*****', ) companies = ['aapl','msft','goog','crm'] stopwo...
{ "repo_name": "ss4609/SS4609-Github", "path": "FetchAndProcessTwitterData.py", "copies": "2", "size": "3755", "license": "mit", "hash": -444648001361482700, "line_mean": 33.4495412844, "line_max": 494, "alpha_frac": 0.5379494008, "autogenerated": false, "ratio": 3.193027210884354, "config_test"...
import sys import random import numpy as np import pdb from collections import defaultdict from itertools import combinations from pyspark import SparkConf, SparkContext from pyspark.mllib.linalg.distributed import MatrixEntry from pyspark.mllib.linalg.distributed import RowMatrix from pyspark.mllib.linalg import Vect...
{ "repo_name": "shreyas15/Product-Recommender-Engine", "path": "User_based_cos_sim_parallelized/final.py", "copies": "1", "size": "7155", "license": "mit", "hash": -8600201756875235000, "line_mean": 40.3583815029, "line_max": 128, "alpha_frac": 0.6644304682, "autogenerated": false, "ratio": 3.4103...
__author__ = 'shuai' class ListNode(object): def __init__(self, x): self.val = x self.next = None class Solution(object): def addTwoNumbers(self, l1, l2): """ :type l1: ListNode :type l2: ListNode :rtype: ListNode """ ret = ListNode(0) ...
{ "repo_name": "shuaizi/leetcode", "path": "leetcode-python/num002.py", "copies": "1", "size": "1088", "license": "apache-2.0", "hash": 236160411723583040, "line_mean": 22.170212766, "line_max": 45, "alpha_frac": 0.4577205882, "autogenerated": false, "ratio": 3.228486646884273, "config_test": fa...
__author__ = 'shuai' class Solution(object): def countSmaller(self, nums): """ :type nums: List[int] :rtype: List[int] """ count = [] ret = [0] * len(nums) for i in range(len(nums)): count.append({'index': i, 'value': num...
{ "repo_name": "shuaizi/leetcode", "path": "leetcode-python/num315.py", "copies": "1", "size": "1742", "license": "apache-2.0", "hash": 7276113327916469000, "line_mean": 24.6176470588, "line_max": 62, "alpha_frac": 0.3777267509, "autogenerated": false, "ratio": 3.629166666666667, "config_test": ...
__author__ = 'shuai' class Solution(object): def findLongestWord(self, s, d): """ :type s: str :type d: List[str] :rtype: str """ def _compare(a, b): if len(a) < len(b): return 1 elif len(a) == len(b): return 0 ...
{ "repo_name": "shuaizi/leetcode", "path": "leetcode-python/num524.py", "copies": "1", "size": "1046", "license": "apache-2.0", "hash": 1679614205635905000, "line_mean": 22.7727272727, "line_max": 54, "alpha_frac": 0.3652007648, "autogenerated": false, "ratio": 3.8175182481751824, "config_test":...
__author__ = 'shuai' class Solution(object): def findMedianSortedArrays(self, nums1, nums2): """ :type nums1: List[int] :type nums2: List[int] :rtype: float """ ret = [] len1 = len(nums1) len2 = len(nums2) dst = (len1 + len2)/2 pos1 = ...
{ "repo_name": "shuaizi/leetcode", "path": "leetcode-python/num004.py", "copies": "1", "size": "1432", "license": "apache-2.0", "hash": 3260205277902042600, "line_mean": 28.8333333333, "line_max": 59, "alpha_frac": 0.4092178771, "autogenerated": false, "ratio": 3.588972431077694, "config_test": ...
__author__ = 'shuai' class Solution(object): def maximumGap(self, nums): """ :type nums: List[int] :rtype: int """ if not nums: return 0 min_val = nums[0] max_val = nums[0] for i in range(len(nums)): if nums[i] < min_val: ...
{ "repo_name": "shuaizi/leetcode", "path": "leetcode-python/num164.py", "copies": "1", "size": "1393", "license": "apache-2.0", "hash": 5338041377777560000, "line_mean": 26.86, "line_max": 69, "alpha_frac": 0.4443646805, "autogenerated": false, "ratio": 3.364734299516908, "config_test": false, ...
__author__ = 'shuai' # Definition for a binary tree node. class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None class Solution(object): def largestValues(self, root): """ :type root: TreeNode :rtype: List[int] """...
{ "repo_name": "shuaizi/leetcode", "path": "leetcode-python/num515.py", "copies": "1", "size": "1539", "license": "apache-2.0", "hash": -9127119960239513000, "line_mean": 25.0847457627, "line_max": 56, "alpha_frac": 0.4470435348, "autogenerated": false, "ratio": 3.529816513761468, "config_test":...
__author__ = 'shuai' # Definition for a binary tree node. class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None class Solution(object): def convertBST(self, root): """ :type root: TreeNode :rtype: TreeNode """ ...
{ "repo_name": "shuaizi/leetcode", "path": "leetcode-python/num538.py", "copies": "1", "size": "1330", "license": "apache-2.0", "hash": 2123808125316393500, "line_mean": 21.5423728814, "line_max": 42, "alpha_frac": 0.4744360902, "autogenerated": false, "ratio": 3.5656836461126007, "config_test":...
__author__ = 'shuai' # Definition for an interval. class Interval(object): def __init__(self, s=0, e=0): self.start = s self.end = e def __str__(self): return str(self.start) + "-" + str(self.end) class Solution(object): def merge(self, intervals): """ :type interv...
{ "repo_name": "shuaizi/leetcode", "path": "leetcode-python/num056.py", "copies": "1", "size": "1145", "license": "apache-2.0", "hash": -5073549447853623000, "line_mean": 25.6279069767, "line_max": 52, "alpha_frac": 0.4969432314, "autogenerated": false, "ratio": 3.65814696485623, "config_test": ...
__author__ = 'shua' import argparse import numpy as np import wave import os from os import listdir from os.path import isfile, join import math from scipy.fftpack.realtransforms import dct from scipy.signal import lfilter, hamming from copy import deepcopy from scipy.fftpack import fft, ifft from scikits.talkbox.linp...
{ "repo_name": "MLSpeech/DeepFormants", "path": "extract_features.py", "copies": "1", "size": "9226", "license": "mit", "hash": -8166171227048243000, "line_mean": 29.856187291, "line_max": 111, "alpha_frac": 0.5802081075, "autogenerated": false, "ratio": 3.2123955431754876, "config_test": false,...
__author__ = 'shubham_dokania' #from django.db import models #from models import Controller def ConvertAndSave(s = '000000000000000000000000000000111111111111110101'): array = [] for i in range(0, 6): array.append(s[(i*8):((i+1)*8)]) #idno = int(str(int(array[0], 2))+str(int(array[1], 2...
{ "repo_name": "shubham1810/aquabrim_project", "path": "machine/receiver.py", "copies": "1", "size": "6021", "license": "mit", "hash": -837828421625557000, "line_mean": 29.8677248677, "line_max": 82, "alpha_frac": 0.387809334, "autogenerated": false, "ratio": 3.4965156794425085, "config_test": f...
__author__ = 'shubham_dokania' def ConvertAndSave(Controller, s = '000000000000000000000000000000111111111111110101'): array = [] for i in range(0, 6): array.append(s[(i*8):((i+1)*8)]) idno = int(str(int(array[0], 2))+str(int(array[1], 2))+str(int(array[2], 2))) # print idno com...
{ "repo_name": "nikaashpuri/aquabrim_project", "path": "machine/receiver.py", "copies": "1", "size": "6313", "license": "mit", "hash": 3325225012762434000, "line_mean": 30.0558375635, "line_max": 87, "alpha_frac": 0.3931569777, "autogenerated": false, "ratio": 3.480154355016538, "config_test": f...
import urllib2 import cookielib from getpass import getpass import sys import os from stat import * def regain(): message = raw_input("Enter text: ") number = raw_input("Enter number: ") message = "+".join(message.split(' ')) #logging into the sms site url ='http://site24.way2sms.com/Login1.action?'...
{ "repo_name": "Shubham05178/Pythonmobilemessage", "path": "MessageByWay2Sms.py", "copies": "1", "size": "1492", "license": "mit", "hash": -3027171868475877400, "line_mean": 26.1272727273, "line_max": 132, "alpha_frac": 0.6327077748, "autogenerated": false, "ratio": 3.1880341880341883, "config_t...
__author__ = 'ShubhamTripathi' import re from nltk import word_tokenize as wt from batchio import * from random import randint #main = get_training_data() #cleaned = clean(main['utter_x'], main['utter_y']) class engTextSeparate: cleaned_1=[] def __init__(self,cleaned_1): self.cleaned_1 = cleaned_1 ...
{ "repo_name": "saatvikshah1994/hline", "path": "Subtask1-Revised/engTextSeparate.py", "copies": "1", "size": "4536", "license": "mit", "hash": 5004679116326688000, "line_mean": 33.1052631579, "line_max": 160, "alpha_frac": 0.4905202822, "autogenerated": false, "ratio": 3.699836867862969, "confi...
__author__ = 'Shyue Ping Ong' __copyright__ = 'Copyright 2013, The Materials Project' __version__ = '0.1' __maintainer__ = 'Shyue Ping Ong' __email__ = 'ongsp@ucsd.edu' __date__ = '1/31/14' import logging from pymatgen import Structure from fireworks import FireTaskBase, FWAction, explicit_serialize from custodian imp...
{ "repo_name": "materialsvirtuallab/fireworks-vasp", "path": "fireworks_vasp/tasks.py", "copies": "1", "size": "3990", "license": "mit", "hash": -785811105756976100, "line_mean": 35.6055045872, "line_max": 79, "alpha_frac": 0.6152882206, "autogenerated": false, "ratio": 3.667279411764706, "confi...
__author__ = 'Shyue Ping Ong' __copyright__ = 'Copyright 2014, The Materials Virtual Lab' __version__ = '0.1' __maintainer__ = 'Shyue Ping Ong' __email__ = 'ongsp@ucsd.edu' __date__ = '1/24/14' import unittest import numpy as np import json import datetime import six from monty.json import MSONable, MSONError, Monty...
{ "repo_name": "gpetretto/monty", "path": "tests/test_json.py", "copies": "1", "size": "3133", "license": "mit", "hash": -8300203540013810000, "line_mean": 28.2803738318, "line_max": 74, "alpha_frac": 0.5738908395, "autogenerated": false, "ratio": 3.3329787234042554, "config_test": true, "has_...
__authors__ = "Ian Goodfellow, David Warde-Farley" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow, David Warde-Farley"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" from pylearn2.testing.skip import skip_if_no_gpu skip_if_...
{ "repo_name": "shiquanwang/pylearn2", "path": "pylearn2/sandbox/cuda_convnet/tests/test_common.py", "copies": "49", "size": "2802", "license": "bsd-3-clause", "hash": 6380040596456535000, "line_mean": 31.9647058824, "line_max": 73, "alpha_frac": 0.5867237687, "autogenerated": false, "ratio": 3.79...
__authors__ = "Ian Goodfellow" __copyright__ = "Copyright 2010-2012, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "LISA Lab" __email__ = "pylearn-dev@googlegroups" from pylearn2.models.model import Model from pylearn2.utils import sharedX import numpy as np impo...
{ "repo_name": "jamessergeant/pylearn2", "path": "pylearn2/models/mnd.py", "copies": "49", "size": "4148", "license": "bsd-3-clause", "hash": 1736454755651706400, "line_mean": 23.5443786982, "line_max": 108, "alpha_frac": 0.543876567, "autogenerated": false, "ratio": 3.222999222999223, "config_t...
__authors__ = ["Ian Goodfellow", "Vincent Dumoulin"] __copyright__ = "Copyright 2012-2013, Universite de Montreal" __credits__ = ["Ian Goodfellow"] __license__ = "3-clause BSD" __maintainer__ = "Ian Goodfellow" import time import warnings import numpy as np from theano import tensor as T, function, config import thea...
{ "repo_name": "thompsonj/deepspeechsynthesis", "path": "layer.py", "copies": "1", "size": "123353", "license": "bsd-3-clause", "hash": 9024829040472325000, "line_mean": 29.6543240557, "line_max": 315, "alpha_frac": 0.5311666518, "autogenerated": false, "ratio": 4.000810845874416, "config_test":...
from OpenGL.GL import GL_ARRAY_BUFFER, GL_DYNAMIC_DRAW, glFlush import pyopencl as cl import sys import numpy class CLKernel(object): def __init__(self, filename): plats = cl.get_platforms() from pyopencl.tools import get_gl_sharing_context_properties import sys if ...
{ "repo_name": "cjld/adventures_in_opencl", "path": "experiments/reduce/clutil.py", "copies": "5", "size": "1838", "license": "mit", "hash": -713886345426934900, "line_mean": 29.6896551724, "line_max": 81, "alpha_frac": 0.528835691, "autogenerated": false, "ratio": 4.205949656750572, "config_tes...
__author__ = 'sibirrer' # description of the polar shapelets in potential space import numpy as np import math import numpy.polynomial.hermite as hermite class CartShapelets(object): """ this class contains the function and the derivatives of the cartesian shapelets """ def function(self, x, y, coe...
{ "repo_name": "sibirrer/astrofunc", "path": "astrofunc/LensingProfiles/shapelet_pot_2.py", "copies": "1", "size": "8671", "license": "mit", "hash": -1789807527746215000, "line_mean": 34.8347107438, "line_max": 174, "alpha_frac": 0.537077615, "autogenerated": false, "ratio": 3.1599854227405246, ...
__author__ = 'sibirrer' # description of the polar shapelets in potential space import numpy as np import scipy.special import math import astrofunc.util as util class PolarShapelets(object): """ this class contains the function and the derivatives of the Singular Isothermal Sphere """ def __init__(...
{ "repo_name": "sibirrer/astrofunc", "path": "astrofunc/LensingProfiles/shapelet_pot.py", "copies": "1", "size": "9958", "license": "mit", "hash": 7851743750203683000, "line_mean": 37.90234375, "line_max": 127, "alpha_frac": 0.5248041775, "autogenerated": false, "ratio": 3.2864686468646864, "con...
__author__ = 'sibirrer' #file which contains class for lens model routines class LensModel(object): """ class for handling different lens models """ def __init__(self, lens_type): if lens_type == 'SIS': from easylens.FunctionSet.sis import SIS self.func = SIS() ...
{ "repo_name": "DES-SL/EasyLens", "path": "easylens/DeLens/lens_model.py", "copies": "1", "size": "2767", "license": "mit", "hash": 1266278618231949600, "line_mean": 32.756097561, "line_max": 111, "alpha_frac": 0.5283700759, "autogenerated": false, "ratio": 3.144318181818182, "config_test": fals...
__author__ = 'sibirrer' from astrofunc.LensingProfiles.shapelet_pot import PolarShapelets from astrofunc.LensingProfiles.shapelet_pot_2 import CartShapelets import numpy as np import numpy.testing as npt import pytest class TestPolarShapelets(object): """ tests the Gaussian methods """ def setup(sel...
{ "repo_name": "sibirrer/astrofunc", "path": "test/test_shapelet_pot.py", "copies": "1", "size": "2221", "license": "mit", "hash": 7762030565547535000, "line_mean": 26.775, "line_max": 75, "alpha_frac": 0.5416479063, "autogenerated": false, "ratio": 2.997300944669366, "config_test": true, "has...
__author__ = 'sibirrer' from astrofunc.LensingProfiles.sis_truncate import SIS_truncate import numpy as np import pytest class TestSIS_truncate(object): """ tests the Gaussian methods """ def setup(self): self.SIS = SIS_truncate() def test_function(self): x = np.array([1]) ...
{ "repo_name": "sibirrer/astrofunc", "path": "test/test_sis_truncate.py", "copies": "1", "size": "2375", "license": "mit", "hash": -8005046318962058000, "line_mean": 29.0759493671, "line_max": 64, "alpha_frac": 0.5258947368, "autogenerated": false, "ratio": 2.7712952158693116, "config_test": tru...
__author__ = 'sibirrer' from astrofunc.LensingProfiles.spep import SPEP from astrofunc.LensingProfiles.spp import SPP from astrofunc.LensingProfiles.sis import SIS import numpy as np import numpy.testing as npt import pytest class TestSPEP(object): """ tests the Gaussian methods """ def setup(self): ...
{ "repo_name": "sibirrer/astrofunc", "path": "test/test_spp.py", "copies": "1", "size": "4841", "license": "mit", "hash": 4501388276592535000, "line_mean": 36.2461538462, "line_max": 83, "alpha_frac": 0.5224127246, "autogenerated": false, "ratio": 2.3603120429058997, "config_test": true, "has_...
__author__ = 'sibirrer' from astrofunc.LensingProfiles.spp import SPP from astrofunc.LensingProfiles.spemd_smooth import SPEMD_SMOOTH class SPEMD(object): """ class for smooth power law ellipse mass density profile """ def __init__(self): self.s2 = 0.00000001 self.spp = SPP() ...
{ "repo_name": "sibirrer/astrofunc", "path": "astrofunc/LensingProfiles/spemd.py", "copies": "1", "size": "1551", "license": "mit", "hash": 4484887943812052000, "line_mean": 33.4888888889, "line_max": 105, "alpha_frac": 0.6054158607, "autogenerated": false, "ratio": 2.9655831739961758, "config_t...
__author__ = 'sibirrer' from easylens.DeLens.de_lens import DeLens from easylens.FunctionSet.shapelets import Shapelets import numpy as np class DeLensMultiBand(DeLens): """ multi-band reconstruction """ def get_param_WLS_multi_band(self, A_list, C_D_inv_list, d_list, w_SED, inv_bool=True): ...
{ "repo_name": "DES-SL/EasyLens", "path": "easylens/DeLens/de_lens_multi_band.py", "copies": "1", "size": "4360", "license": "mit", "hash": 1810346792028449800, "line_mean": 39.7570093458, "line_max": 117, "alpha_frac": 0.5637614679, "autogenerated": false, "ratio": 3.2708177044261064, "config_t...
__author__ = 'sibirrer' from easylens.DeLens.de_lens import DeLens import numpy as np class DeLensMultiExp(DeLens): """ class to deal with multiple exposures of the same band """ def get_param_WLS_multi(self, A_list, C_D_inv_list, d_list, inv_bool=True): """ returns the parameter val...
{ "repo_name": "DES-SL/EasyLens", "path": "easylens/DeLens/de_lens_multi_exposure.py", "copies": "1", "size": "1332", "license": "mit", "hash": 269865434326059700, "line_mean": 37.0857142857, "line_max": 106, "alpha_frac": 0.5960960961, "autogenerated": false, "ratio": 3.1714285714285713, "confi...
__author__ = 'sibirrer' from scipy import fftpack import numpy as np import util class Correlation(object): """ class to analyse correlations in an image or in the residuals """ def correlation_2D(self, image): """ :param residuals: :return: """ # Take the fou...
{ "repo_name": "sibirrer/astrofunc", "path": "astrofunc/correlation.py", "copies": "1", "size": "1085", "license": "mit", "hash": -5221520449213652000, "line_mean": 26.8461538462, "line_max": 79, "alpha_frac": 0.6175115207, "autogenerated": false, "ratio": 3.557377049180328, "config_test": false...
__author__ = 'sibirrer' import astrofunc.util as util import numpy as np class ExternalShear_old(object): """ class to deal with external shear. We do not include external convergence at this stage """ def function(self, x, y, gamma_ext, psi_ext): # change to polar coordinates theta, ...
{ "repo_name": "sibirrer/astrofunc", "path": "astrofunc/LensingProfiles/external_shear.py", "copies": "1", "size": "2333", "license": "mit", "hash": 5015787095481448000, "line_mean": 29.2987012987, "line_max": 91, "alpha_frac": 0.5340762966, "autogenerated": false, "ratio": 2.7840095465393793, "...
__author__ = 'sibirrer' import easylens.util as util import numpy as np class ExternalShear(object): """ new class for external shear e1, e2 expression """ def function(self, x, y, e1, e2): # change to polar coordinates psi_ext, gamma_ext = util.ellipticity2phi_gamma(e1, e2) t...
{ "repo_name": "DES-SL/EasyLens", "path": "easylens/FunctionSet/external_shear.py", "copies": "1", "size": "1237", "license": "mit", "hash": 7294241827748065000, "line_mean": 26.5111111111, "line_max": 65, "alpha_frac": 0.5084882781, "autogenerated": false, "ratio": 2.7427937915742793, "config_t...
__author__ = 'sibirrer' import MultiLens.Utils.constants as const import numpy as np class PointMass(object): """ class to compute the physical deflection angle of a point mass, given as an Einstein radius """ def __init__(self): self.r_min = 10**(-8) # alpha = 4*const.G * (mass*const...
{ "repo_name": "sibirrer/astrofunc", "path": "astrofunc/LensingProfiles/point_mass.py", "copies": "1", "size": "2425", "license": "mit", "hash": -8722230130640406000, "line_mean": 30.9210526316, "line_max": 95, "alpha_frac": 0.4890721649, "autogenerated": false, "ratio": 2.859669811320755, "conf...
__author__ = 'sibirrer' import numpy as np from fastell4py import fastell4py from astrofunc.LensingProfiles.spp import SPP class SPEMD_SMOOTH(object): """ class for smooth power law ellipse mass density profile """ def __init__(self): self.spp = SPP() def _parameter_constraints(self, the...
{ "repo_name": "sibirrer/astrofunc", "path": "astrofunc/LensingProfiles/spemd_smooth.py", "copies": "1", "size": "4255", "license": "mit", "hash": -4233791128842148400, "line_mean": 33.048, "line_max": 186, "alpha_frac": 0.5271445358, "autogenerated": false, "ratio": 2.6896333754740835, "config_...
__author__ = 'sibirrer' import numpy as np from fastell4py import fastell4py import easylens.util as util from easylens.FunctionSet.external_shear import ExternalShear class SPEMD(object): """ class for smooth power law ellipse mass density profile """ def __init__(self): self.s2 = 0.01 d...
{ "repo_name": "DES-SL/EasyLens", "path": "easylens/FunctionSet/spemd.py", "copies": "1", "size": "6808", "license": "mit", "hash": -5656607925766709000, "line_mean": 34.6492146597, "line_max": 127, "alpha_frac": 0.5304054054, "autogenerated": false, "ratio": 2.428826257581163, "config_test": fa...
__author__ = 'sibirrer' import numpy as np import astropy.wcs as pywcs import astropy.io.fits as pyfits def array2image(array): """ returns the information contained in a 1d array into an n*n 2d array (only works when lenght of array is n**2) :param array: image values :type array: array of size n**...
{ "repo_name": "DES-SL/EasyLens", "path": "easylens/util.py", "copies": "1", "size": "6893", "license": "mit", "hash": -4206560997179010600, "line_mean": 27.0243902439, "line_max": 114, "alpha_frac": 0.5984331931, "autogenerated": false, "ratio": 2.8637307852098046, "config_test": false, "has_...
__author__ = 'sibirrer' import numpy as np import astropy.wcs as pywcs import easylens.util as util class LensSystem(object): """ data class for handling the different exposures/bands of an object """ def __init__(self, name, ra, dec): self.name = name self.available_frames = [] ...
{ "repo_name": "DES-SL/EasyLens", "path": "easylens/Data/lens_system.py", "copies": "1", "size": "7572", "license": "mit", "hash": -7460751692333467000, "line_mean": 34.5492957746, "line_max": 100, "alpha_frac": 0.5515055468, "autogenerated": false, "ratio": 3.544943820224719, "config_test": fal...
__author__ = 'sibirrer' import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import AxesGrid, make_axes_locatable import easylens.util as util class ShowLens(object): """ class to plot the lens system """ def __init__(self, lensSystem): """ :param lensDES:...
{ "repo_name": "DES-SL/EasyLens", "path": "easylens/Data/show_lens.py", "copies": "1", "size": "7592", "license": "mit", "hash": -1427395227349401000, "line_mean": 39.8225806452, "line_max": 132, "alpha_frac": 0.5605900948, "autogenerated": false, "ratio": 3.415204678362573, "config_test": false...
__author__ = 'sibirrer' import numpy as np import numpy.polynomial.hermite as hermite import math import scipy.interpolate as interpolate class Shapelets(object): """ """ def __init__(self, interpolation=False, precalc=True): """ load interpolation of the Hermite polynomials in a range [-...
{ "repo_name": "DES-SL/EasyLens", "path": "easylens/FunctionSet/shapelets.py", "copies": "1", "size": "3642", "license": "mit", "hash": -1970217420460855800, "line_mean": 33.6952380952, "line_max": 178, "alpha_frac": 0.5354200988, "autogenerated": false, "ratio": 3.2870036101083033, "config_test...
__author__ = 'sibirrer' import numpy as np import numpy.polynomial.hermite as hermite import math import astrofunc.util as util class Shapelets(object): """ """ def __init__(self, interpolation=False, precalc=True): """ load interpolation of the Hermite polynomials in a range [-30,30] in...
{ "repo_name": "sibirrer/astrofunc", "path": "astrofunc/LightProfiles/shapelets.py", "copies": "1", "size": "8688", "license": "mit", "hash": -8809175969699259000, "line_mean": 33.2047244094, "line_max": 178, "alpha_frac": 0.4989640884, "autogenerated": false, "ratio": 3.2551517422255527, "confi...
__author__ = 'sibirrer' import numpy as np import pickle import os.path from scipy import integrate import astrofunc.util as util class BarkanaIntegrals(object): def I1(self, nu1, nu2, s_, gamma): """ integral of Barkana et al. (18) :param nu2: :param s_: :param gamma: ...
{ "repo_name": "sibirrer/astrofunc", "path": "astrofunc/LensingProfiles/barkana_integrals.py", "copies": "1", "size": "6043", "license": "mit", "hash": -6247289817162277000, "line_mean": 26.8525345622, "line_max": 91, "alpha_frac": 0.5129902366, "autogenerated": false, "ratio": 3.0184815184815186,...
__author__ = 'sibirrer' import numpy as np import scipy.ndimage.interpolation as interp import astropy.io.fits as pyfits import pyextract.pysex as pysex import easylens.util as util class ImageAnalysis(object): """ class for analysis routines acting on a single image """ def __init__(self): ...
{ "repo_name": "DES-SL/EasyLens", "path": "easylens/Data/image_analysis.py", "copies": "1", "size": "7851", "license": "mit", "hash": 4386949266567468500, "line_mean": 35.0137614679, "line_max": 188, "alpha_frac": 0.5596739269, "autogenerated": false, "ratio": 3.350832266325224, "config_test": f...
__author__ = 'sibirrer' import numpy as np import sys import scipy.ndimage as ndimage import scipy.signal as signal from easylens.FunctionSet.shapelets import Shapelets import easylens.util as util class DeLens(object): """ class for the de-lensing algorithm """ def __init__(self): self.sha...
{ "repo_name": "DES-SL/EasyLens", "path": "easylens/DeLens/de_lens.py", "copies": "1", "size": "6737", "license": "mit", "hash": 306186146530633800, "line_mean": 35.2204301075, "line_max": 149, "alpha_frac": 0.542526347, "autogenerated": false, "ratio": 3.465534979423868, "config_test": false, ...
__author__ = 'sibirrer' import numpy as np class SIS(object): """ this class contains the function and the derivatives of the Singular Isothermal Sphere """ def function(self, x, y, phi_E, center_x=0, center_y=0): x_shift = x - center_x y_shift = y - center_y f_ = phi_E * np.sq...
{ "repo_name": "DES-SL/EasyLens", "path": "easylens/FunctionSet/sis.py", "copies": "1", "size": "2708", "license": "mit", "hash": -1706052903300190200, "line_mean": 31.25, "line_max": 90, "alpha_frac": 0.4804283604, "autogenerated": false, "ratio": 2.754832146490336, "config_test": false, "has...