repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
bharathramh92/easy-ecom | store/migrations/0021_auto_20151008_0956.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0019_auto_20150827_1407'),
('store', '0020_auto_20151008_0946'),
]
operations = [
migrations.CreateModel... |
bharathramh92/easy-ecom | helper/__init__.py | <filename>helper/__init__.py
__author__ = 'bharathramh'
|
bharathramh92/easy-ecom | store/migrations/0022_auto_20151008_1006.py | <reponame>bharathramh92/easy-ecom
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('store', '0021_auto_20151008_0956'),
]
operations = [
migrations.RemoveField(
m... |
bharathramh92/easy-ecom | accounts/migrations/0006_auto_20150805_1757.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('accounts', '0005_auto_20150805_1747'),
]
operations = [
migrations.AlterField(
model_name='address',
... |
bharathramh92/easy-ecom | store/migrations/0003_auto_20150815_1608.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('accounts', '0016_auto_20150814_1727'),
migrations.swappable_dependency(... |
bharathramh92/easy-ecom | accounts/migrations/0004_auto_20150805_1732.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('accounts', '0003_auto_20150805_1723'),
]
operations = [
migrat... |
bharathramh92/easy-ecom | categories/admin.py | <gh_stars>0
from django.contrib import admin
from .models import Category
# Register your models here.
class CategoryAdmin(admin.ModelAdmin):
fieldsets = [
(None, {'fields': ['category_name', 'description', 'parent_category']})
]
list_display = ('category_name', 'parent_category')... |
bharathramh92/easy-ecom | store/views.py | from django.shortcuts import render, get_object_or_404
from django.http import HttpResponse, HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.contrib.auth.decorators import login_required
import datetime
from django.utils import timezone
from django.contrib.auth import authenticate, login, ... |
bharathramh92/easy-ecom | accounts/migrations/0001_initial.py | <filename>accounts/migrations/0001_initial.py<gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dep... |
bharathramh92/easy-ecom | accounts/constants.py | __author__ = 'bharathramh'
EMAIL_VERIFICATION_EXPIRATION_DAYS = 1
FORGOT_PASSWORD_EXPIRATION_DAYS = 1 |
bharathramh92/easy-ecom | sell/forms.py | <gh_stars>0
from django import forms
from store.models import BookStore, Item, Author, Publisher, Inventory
import autocomplete_light.shortcuts as autocomplete_light
from categories.category_helper import get_category_store_names, get_end_categories, get_store_end_categories
from accounts.models import Address
from dja... |
bharathramh92/easy-ecom | sell/autocomplete_light_registry.py | import autocomplete_light.shortcuts as autocomplete_light
from store.models import Author, Publisher
autocomplete_light.register(Author,
search_fields = ['^name'],
attrs={
# This will set the input placeholder attribute:
'placeholder': 'Add Authors',
# This will set the yourlabs.Autocom... |
bharathramh92/easy-ecom | helper/custom_http.py | <filename>helper/custom_http.py
def get_from_request_GET(request):
return '?' + ''.join([str(k + '=' + v + '&') for k,v in request.GET.items()])[:-1] |
bharathramh92/easy-ecom | store/migrations/0005_auto_20150815_1745.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('store', '0004_inventory_listing_end_datetime'),
]
operations = [
migrations.AlterField(
model_name='mainsubcateg... |
bharathramh92/easy-ecom | store/migrations/0007_auto_20150816_1634.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('store', '0006_auto_20150816_1601'),
]
operations = [
migrations.CreateModel(
name='Author',
fields=[... |
bharathramh92/easy-ecom | accounts/models.py | from django.db import models
from django.contrib.auth.models import User
from . import constants
from django.utils import timezone
import datetime
# Create your models here.
class UserExtended(models.Model):
user = models.OneToOneField(User)
profile_picture_url = models.CharField(max_length=200, null= True, bl... |
bharathramh92/easy-ecom | sell/urls.py | from django.conf.urls import include, url
from . import views
urlpatterns = [
# Examples:
# url(r'^$', 'easy_ecom.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^$', views.dashboardView, name= "dashboard"),
url(r'^edit/$', views.editView, name= "edit"),
url(r'^new/$'... |
btower-labz/django-dashboard-black | core/urls.py | <reponame>btower-labz/django-dashboard-black<gh_stars>0
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""
from django.contrib import admin
from django.urls import path, include
from django.conf.urls import url
import debug_toolbar
urlpatterns = [
# Health checks
url(r'^sta... |
btower-labz/django-dashboard-black | core/settings_cloud.py | <reponame>btower-labz/django-dashboard-black<filename>core/settings_cloud.py
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""
import os
from decouple import config
from unipath import Path
import dj_database_url
import boto3
from .ssm_parameter_store import SSMParameterStore
impor... |
btower-labz/django-dashboard-black | core/ssm_parameter_store.py | # Copyright (c) 2018 <NAME> <<EMAIL>>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, d... |
btower-labz/django-dashboard-black | core/settings.py | # -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""
import os
from decouple import config
from unipath import Path
import dj_database_url
class IPList(list):
def __init__(self, ips):
try:
#http://software.inl.fr/trac/wiki/IPy
#ubuntu: apt-get ins... |
btower-labz/django-dashboard-black | core/settings_local.py | <gh_stars>0
# -*- encoding: utf-8 -*-
"""
License: MIT
Copyright (c) 2019 - present AppSeed.us
"""
import os
from decouple import config
from unipath import Path
import dj_database_url
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = config('SECRET_KEY', default='S#perS3crEt_1122')
# S... |
zoranzhao/NoSDSE | examples/ecg_diagnosis/dse.py | <reponame>zoranzhao/NoSDSE<filename>examples/ecg_diagnosis/dse.py
import fileinput
import json
from subprocess import call
import os
"""
# sim_config.json:
{
"edge": {
"total_number": 6,
"edge_id": [0, 1, 2, 3, 4, 5],
"edge_type": ["0", "0", "0", "0", "0", "0"],
"edge_core_number": [1, 1, 1,... |
zoranzhao/NoSDSE | examples/deepthings/nsga.py | <gh_stars>1-10
import random
import array
import json
import numpy
import pprint
import deap
import multiprocessing
import time
from deap import algorithms
from deap import base
from deap import creator
from deap import tools
from deap import benchmarks
from deap.benchmarks.tools import diversity, convergence
import ... |
zoranzhao/NoSDSE | examples/ecg_diagnosis/ecg/plot.py | <reponame>zoranzhao/NoSDSE
import matplotlib.pyplot as plt
import numpy as np
Y=[]
with open("./data_360/data_101.txt") as f:
for line in f:
Y.append(float(line.split("\n")[0]))
if len(Y)>10000:
break;
X=range(len(Y));
#t = np.arange(0.0, 2.0, 0.01)
#s = np.sin(2*np.pi*t)
plt.plot(X, Y)
plt.xlabel('Ti... |
zoranzhao/NoSDSE | examples/deepthings/tools/dse.py | import fileinput
import json
from subprocess import call
import os
"""
# sim_config.json:
{
"edge": {
"total_number": 6,
"edge_id": [0, 1, 2, 3, 4, 5],
"edge_type": ["victim", "stealer", "stealer", "stealer", "stealer", "stealer"],
"edge_core_number": [1, 1, 1, 1, 1, 1],
"edge_ipv4_add... |
foxglove/proto-schemas | ros_foxglove_msgs/test/test_msgs.py | <reponame>foxglove/proto-schemas<filename>ros_foxglove_msgs/test/test_msgs.py
from foxglove_msgs.msg import Color
def test_instantiate_color():
Color()
|
ericwhester/volume-penalty-code | cylinder_penalized.py | import numpy as np
from mpi4py import MPI
comm = MPI.COMM_WORLD
rank, size = comm.rank, comm.size
import dedalus.public as de
import matplotlib.pyplot as plt
import os
from scipy.special import erf
import time
import logging
root = logging.root
for h in root.handlers: h.setLevel("INFO")
logger = logging.getLogger(__nam... |
coady/graphique | tests/test_service.py | import pyarrow as pa
import pytest
def test_slice(client):
data = client.execute('{ length slice(length: 3) { columns { zipcode { values } } } }')
assert data == {'length': 41700, 'slice': {'columns': {'zipcode': {'values': [501, 544, 601]}}}}
data = client.execute('{ slice(offset: 1) { columns { zipcode ... |
coady/graphique | setup.py | from setuptools import setup
setup() # needed for `sdist --formats zip`
|
coady/graphique | graphique/schema.py | """
Output graphql schema from a parquet data set.
"""
import argparse
import strawberry
from starlette.config import environ
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('parquet_path', help="path to parquet data set")
parser.add_argument('--index', help="partition keys or sorted composit... |
coady/graphique | tests/test_core.py | <reponame>coady/graphique<gh_stars>10-100
from datetime import time
import numpy as np
import pyarrow as pa
import pyarrow.compute as pc
import pytest
from graphique.core import Agg, ListChunk, Column as C, Table as T
def test_dictionary(table):
array = table['state'].dictionary_encode()
assert C.min(array) =... |
coady/graphique | graphique/service.py | """
GraphQL service and top-level resolvers.
"""
import functools
import itertools
from typing import List, Optional, no_type_check
import pyarrow as pa
import pyarrow.compute as pc
import pyarrow.dataset as ds
import strawberry
from strawberry.arguments import UNSET
from strawberry.utils.str_converters import to_camel... |
coady/graphique | graphique/core.py | <reponame>coady/graphique<gh_stars>10-100
"""
Core utilities that add pandas-esque features to arrow arrays and tables.
Arrow forbids subclassing, so the classes are for logical grouping.
Their methods are called as functions.
"""
import bisect
import contextlib
import functools
import itertools
import operator
from c... |
coady/graphique | graphique/middleware.py | <gh_stars>10-100
"""
Service related utilities which don't require knowledge of the schema.
"""
import functools
import inspect
import itertools
import operator
import types
from datetime import datetime, timedelta
from typing import Iterable, Iterator, List, Mapping, Optional, Union, no_type_check
import pyarrow as pa... |
coady/graphique | graphique/scalars.py | """
GraphQL scalars.
"""
import base64
import enum
from datetime import date, datetime, time, timedelta
from decimal import Decimal
import pyarrow as pa
import strawberry
Long = strawberry.scalar(int, name='Long', description="64-bit int")
Binary = strawberry.scalar(
bytes,
name='Binary',
description="base... |
coady/graphique | graphique/settings.py | import json
from pathlib import Path
from starlette.config import Config
from starlette.datastructures import CommaSeparatedStrings
config = Config('.env')
PARQUET_PATH = Path(config('PARQUET_PATH')).resolve()
INDEX = config('INDEX', cast=CommaSeparatedStrings, default=[])
FEDERATED = config('FEDERATED', default='')
D... |
coady/graphique | graphique/models.py | """
GraphQL output types and resolvers.
"""
import contextlib
import functools
import inspect
import operator
import types
from datetime import date, datetime, time, timedelta
from decimal import Decimal
from typing import Callable, List, Optional
import pyarrow as pa
import pyarrow.compute as pc
import strawberry
from... |
coady/graphique | graphique/inputs.py | """
GraphQL input types.
"""
import functools
import inspect
from datetime import date, datetime, time, timedelta
from decimal import Decimal
from typing import Callable, List, Optional
import strawberry
from strawberry.annotation import StrawberryAnnotation
from strawberry.arguments import StrawberryArgument, UNSET
fr... |
coady/graphique | tests/conftest.py | import json
import os
import sys
from pathlib import Path
import pyarrow as pa
import pyarrow.dataset as ds
import pytest
from starlette import testclient
fixtures = Path(__file__).parent / 'fixtures'
def pytest_report_header(config):
return f'pyarrow {pa.__version__}'
class TestClient(testclient.TestClient):
... |
coady/graphique | tests/test_dataset.py | <reponame>coady/graphique
from graphique import middleware
def test_extension(capsys):
ext = middleware.TimingExtension(execution_context=None)
assert ext.on_request_start() is None
assert ext.on_request_end() is None
assert capsys.readouterr().out.startswith('[')
def test_filter(dsclient):
data... |
coady/graphique | tests/test_models.py | <reponame>coady/graphique
import pyarrow as pa
import pytest
def test_case(executor):
data = executor('{ columns { snakeId { values } camelId { values } } }')
assert data == {'columns': {'snakeId': {'values': [1, 2]}, 'camelId': {'values': [1, 2]}}}
data = executor(
'''{ column(name: "camelId", ap... |
connahKendrickMMU/MiTiSegmentor | MiTiSegmenter.py | <reponame>connahKendrickMMU/MiTiSegmentor<gh_stars>0
import tkinter as tk
import traceback
import tkinter.messagebox
import tkinter as tk
from tkinter import filedialog
from tkinter import *
from tkinter.messagebox import showinfo, askquestion
from skimage import measure, morphology#
from dask_image import ndmeasure
... |
zero0911/PES-Learn | 1_Tutorials/1_water_pes_api/model7_data/compute_energy.py | from peslearn.ml import NeuralNetwork
from peslearn import InputProcessor
import torch
import numpy as np
from itertools import combinations
nn = NeuralNetwork('PES.dat', InputProcessor(''), molecule_type='A2B')
params = {'layers': (128, 128, 128), 'morse_transform': {'morse': False}, 'pip': {'degree_reduction': True,... |
zero0911/PES-Learn | peslearn/datagen/configuration_space.py | <gh_stars>1-10
"""
A class for building PES geometries
"""
from ..utils import geometry_transform_helper as gth
from ..utils import permutation_helper as ph
from ..ml.data_sampler import DataSampler
from collections import OrderedDict
import gc
import os
import json
import timeit
import pandas as pd
import numpy as ... |
zero0911/PES-Learn | 1_Tutorials/1_water_pes_api/model3_data/loadpt.py | <gh_stars>1-10
import torch
nn_model = torch.load("/home/dehui2/test/PES-Learn/1_Tutorials/1_water_pes_api/model3_data/model.pt")
out = nn_model(torch.tensor([3, 4, 5], dtype=torch.long))
print("Hello world") |
KrystalDodd/12-Web-Scrapping- | mission_to_mars.py | <gh_stars>0
import pandas as pd
from bs4 import BeautifulSoup as bs
import requests
import pymongo
from splinter import Browser
from webdriver_manager.chrome import ChromeDriverManager
import time
executable_path = {'executable_path': ChromeDriverManager().install()}
browser = Browser('chrome', **executable_path, hea... |
rgommers/uarray | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages, Extension
from setuptools.command.build_ext import build_ext
from pathlib import Path
import sys
import os
from typing import List
cwd = Path(os.path.dirname(os.path.abspath(__file__)))
def open_reqs_file(file, reqs_path=Path(cwd)):
with (reqs_p... |
Wang-Ao/info_01 | test/login.py | <gh_stars>1-10
sum1 : 1000
这是第一步操作 --- 操作者 --- 经理
sum2 : 2000
这是第二步操作 --- 操作者 --- 张三
sum3 : 3000
这是第三步操作 --- 操作者 --- 经理
sum4 : 4000
这是第四部操作 --- 操作者 --- 经理 --- 打标签测试
测试分之:dev状态下
添加分之内容:随意
|
snavely/UprightNet | data/image_folder.py | import torch.utils.data as data
import pickle
import PIL
import numpy as np
import torch
import os
import math, random
import os.path
import sys
import cv2
import skimage
from skimage.transform import rotate
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
WALL_THREAHOD = 5e-2
GC_THRESHOLD = 1e... |
arashdeveloper1380/information-gathering-Py | modules/whoiis.py | <gh_stars>0
from ipwhois import IPWhois
import whois,socket
class Information:
def __init__(self,domain) :
self.domain = domain
def Get_ip(self,domain):
ip = socket.gethostbyname(domain)
return ip
def Domain_info(self,domain):
return whois.whois(self.domain)
... |
arashdeveloper1380/information-gathering-Py | modules/port_scanner.py | <gh_stars>0
import socket
class Portscanner :
def __init__(self,ip,rrange,GREEN,RED,RESET) :
self.ip = ip
self.range = rrange
self.green = GREEN
self.red = RED
self.reset = RESET
def Scan(self) :
s = socket.socket(socket.AF_INET,socket.SOCK_STREAM... |
arashdeveloper1380/information-gathering-Py | functions.py | from colorama import init,Fore
init() # Call Colors
GREEN = Fore.GREEN
RED = Fore.RED
BLUE = Fore.BLUE
RESET = Fore.RESET
WHITE = Fore.WHITE
class Tools:
def banner(self=None):
print(f""" {BLUE}
.______ _______ _______ _______ _______ .__ __. _______
| _ \ | ____... |
arashdeveloper1380/information-gathering-Py | main.py | import functions
import os
from modules import whoiis,ddns,googlemap,subdomain,plugins,admin_finder,site_info,port_scanner,http_header
from pprint import pprint
GREEN = functions.GREEN
RED = functions.RED
BLUE = functions.BLUE
RESET = functions.RESET
WHITE = functions.WHITE
while True :
os.system('cls... |
arashdeveloper1380/information-gathering-Py | modules/subdomain.py | <filename>modules/subdomain.py<gh_stars>0
import requests
import time as t
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
def Discover_Subdomains(domain,WHITE,BLUE,RESET,RED,GREEN) :
file =open("modules/subdomains.txt")
session = requests.Session()
... |
arashdeveloper1380/information-gathering-Py | modules/googlemap.py | <gh_stars>0
from pyngrok import ngrok
import os
def generate():
domain = ngrok.connect()
print('Take This Domain to Your Target ===>',domain)
os.system("php -S localhost:80")
input()
|
arashdeveloper1380/information-gathering-Py | modules/http_header.py | <filename>modules/http_header.py
import requests
def http_header(domain) :
response = requests.get('http://'+domain)
return response.headers
|
arashdeveloper1380/information-gathering-Py | modules/plugins.py | import requests
import time as t
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
def Discover_Plugins(domain,BLUE,RESET,RED,GREEN) :
file =open("modules/plugins.txt")
session = requests.Session()
retry = Retry(connect=3, backoff_factor=0.5)
... |
arashdeveloper1380/information-gathering-Py | modules/site_info.py | import builtwith
def Fetch_info(domain,GREEN):
res = builtwith.builtwith("http://"+domain)
for i in res :
print(f"{GREEN} {i}",res[i]) |
arashdeveloper1380/information-gathering-Py | modules/ddns.py | <filename>modules/ddns.py
import dns.resolver
class Dns_Checker :
def __init__(self,domain):
self.domain = domain
def options(self=None) :
print(f"""
1 - A Record
2 - C Name
3 - MX Record
00 - Return To Main Menu
... |
arashdeveloper1380/information-gathering-Py | modules/admin_finder.py | import requests
from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.retry import Retry
def admin_finder(domain,GREEN,RED,RESET):
url = "http://"+domain
session = requests.Session()
retry = Retry(connect=3, backoff_factor=0.5)
adapter = HTTPAdapter(max_retries=retry)
... |
pandeyarjun242/yolo-auto | build/lib/yolo_auto/yolov3auto.py | <filename>build/lib/yolo_auto/yolov3auto.py<gh_stars>1-10
import git
import os
import shutil
def split(full_path_to_images,workingd):
os.chdir(full_path_to_images)
p = []
for current_dir, dirs, files in os.walk('.'):
for f in files:
if f.endswith('.jpg'):
path_to_save_into_txt_files = ful... |
pielet/HairNet | network/src/viz.py | # Author: <NAME>
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
from mpl_toolkits.mplot3d import Axes3D
from dataloader import load_root, get_mean_std
def visualize(data_dir, image, pos_gt, pos, angle):
# recover images and position
rgb_image = np.zeros((256, 256,... |
swap-nil7/Click-Handler | color.py | import logging
import click
from logging import Formatter, StreamHandler
class ClickHandler(StreamHandler):
"""
This is a derived class of implemented logging class
which overrides some of its functional definitions to add
color to the StreamHandler
"""
def emit(self, record):
colormap... |
bkdwei/kdStockStrategy | kdStockStrategy/kdStockStrategy.py | <filename>kdStockStrategy/kdStockStrategy.py
'''
Created on 2019年5月3日
@author: bkd
'''
from os.path import expanduser
import sqlite3
import sys
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QMainWindow, QApplication, QFileDialog
from xlrd import open_workbook
from .dlg_average import dlg_average
from... |
bkdwei/kdStockStrategy | kdStockStrategy/dlg_average_ui.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'D:/dev/workspace/kdStockStrategy/kdStockStrategy\dlg_average.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_dlg_aver... |
bkdwei/kdStockStrategy | kdStockStrategy/dlg_average.py | from os.path import expanduser, join
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QDialog
from .dlg_average_ui import Ui_dlg_average
class dlg_average(QDialog, Ui_dlg_average):
def __init__(self):
super().__init__()
self.setupUi(self)
@pyqtSlot()
def on_pb_calculate_st... |
bkdwei/kdStockStrategy | kdStockStrategy/kdStockStrategy_ui.py | <gh_stars>0
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'D:/dev/workspace/kdStockStrategy/kdStockStrategy\kdStockStrategy.ui'
#
# Created by: PyQt5 UI code generator 5.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
c... |
sflahertySMX/SafeMineCore | test/functional/rpc_verifychainlock.py | <filename>test/functional/rpc_verifychainlock.py
#!/usr/bin/env python3
# Copyright (c) 2021 The Dash Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import SafeMineTestFramework
... |
sflahertySMX/SafeMineCore | test/util/bitcoin-util-test.py | #!/usr/bin/env python3
# Copyright 2014 BitPay Inc.
# Copyright 2016-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test framework for bitcoin utils.
Runs automatically during `make check`.
Ca... |
BlazStojanovic/MPhil_Thesis | Figure_src/imag_sch_decomp_visual.py | <reponame>BlazStojanovic/MPhil_Thesis
import matplotlib.pyplot as plt
import numpy as np
import matplotlib
from matplotlib import rc
matplotlib.rcParams.update({'font.size': 30})
matplotlib.rcParams['text.usetex'] = True
# matplotlib.rcParams['text.latex.preamble'] = r'\usepackage{libertine}'
Ens = np.arange(1, 4)*np... |
BlazStojanovic/MPhil_Thesis | Figure_src/path_reweighting.py | <gh_stars>0
import matplotlib.pyplot as plt
import numpy as np
import matplotlib
from matplotlib import rc
matplotlib.rcParams.update({'font.size': 22})
matplotlib.rcParams['text.usetex'] = True
matplotlib.rcParams['text.latex.preamble'] = r'\usepackage{libertine}'
# Brownian motion
def bmotion(t=1, n=1001, N=30):
d... |
BlazStojanovic/MPhil_Thesis | Figure_src/fkac_1d_visualis.py | <reponame>BlazStojanovic/MPhil_Thesis
import matplotlib.pyplot as plt
import numpy as np
import matplotlib
from matplotlib import rc
matplotlib.rcParams.update({'font.size': 22})
matplotlib.rcParams['text.usetex'] = True
matplotlib.rcParams['text.latex.preamble'] = r'\usepackage{libertine}'
# Gaussian
def gaussian(X... |
BlazStojanovic/MPhil_Thesis | Figure_src/dmc_plot.py | import matplotlib.pyplot as plt
import matplotlib
from matplotlib import rc
import matplotlib.gridspec as gridspec
matplotlib.rcParams.update({'font.size': 22})
matplotlib.rcParams['text.usetex'] = True
matplotlib.rcParams['text.latex.preamble'] = r'\usepackage{libertine}'
from mpl_toolkits.mplot3d import Axes3D
im... |
BlazStojanovic/MPhil_Thesis | Figure_src/OUproc_brownian.py | import matplotlib.pyplot as plt
import numpy as np
import matplotlib
from matplotlib import rc
matplotlib.rcParams.update({'font.size': 22})
matplotlib.rcParams['text.usetex'] = True
matplotlib.rcParams['text.latex.preamble'] = r'\usepackage{libertine}'
np.random.seed(42070)
# Brownian motion
def bmotion(t=1, n=1001... |
BlazStojanovic/MPhil_Thesis | Figure_src/activation_functions.py | <gh_stars>0
import matplotlib.pyplot as plt
import numpy as np
import matplotlib
from matplotlib import rc
matplotlib.rcParams.update({'font.size': 22})
matplotlib.rcParams['text.usetex'] = True
matplotlib.rcParams['text.latex.preamble'] = r'\usepackage{libertine}'
def ReLu(x):
if x > 0:
return x
else:
return 0... |
BlazStojanovic/MPhil_Thesis | Figure_src/fkac_1d_visualis_intermediates.py | import matplotlib.pyplot as plt
import numpy as np
import matplotlib
from matplotlib import rc
matplotlib.rcParams.update({'font.size': 22})
matplotlib.rcParams['text.usetex'] = True
matplotlib.rcParams['text.latex.preamble'] = r'\usepackage{libertine}'
# Gaussian
def gaussian(X, mu=0.0, sig=1.0):
return 1/sig/np.s... |
BlazStojanovic/MPhil_Thesis | Figure_src/diffusion_mote_carlo.py | <filename>Figure_src/diffusion_mote_carlo.py<gh_stars>0
"""
Figure of DMC in 1D
"""
import matplotlib.pyplot as plt
import numpy as np
from numpy.random import default_rng
rng = default_rng(101010)
def V(x, k=1.0):
return 0.5*k*k*np.square(x)
def weight(x, xp, dt, E0):
return np.exp(-0.5*dt*(V(x) + V(xp)) + dt*E... |
tansey/bb-fdr | python/posterior_crt.py | <gh_stars>1-10
'''Conditional randomization test (CRT) implementation for whether a variable
has any effect on the posterior probability of coming from the alternative.'''
from __future__ import print_function
import sys
import os
import numpy as np
import torch
import torch.autograd as autograd
import torch.nn as nn
i... |
tansey/bb-fdr | python/normix.py | import numpy as np
from scipy.stats import norm as norm
from scipy.optimize import fmin_bfgs
from copy import deepcopy
class GridDistribution:
def __init__(self, x, y):
self.x = x
self.y = y
def pdf(self, data):
# Find the closest bins
rhs = np.searchsorted(self.x, data)
... |
tansey/bb-fdr | python/cancer.py | '''Case study of applying BB-FDR to a cancer drug screening.
The data are taken from the Genomics of Drug Sensitivity in Cancer (GDSC). We
preprocessed the max dosage readings and converted them into into z-scores.
BB-FDR performs two stages of selection.
Stage 1: Fit a (black box) neural network model using the mut... |
tansey/bb-fdr | python/two_groups_beta.py | '''Black box false discovery rate (FDR) control for treatment effects. We use
the two-groups empirical Bayes approach for the treatment effects and fit a
collection of deep networks as the empirical prior.'''
from __future__ import print_function
import sys
import numpy as np
import torch
import torch.autograd as autog... |
dndrsn/LSP | tests/test_session.py | <filename>tests/test_session.py<gh_stars>0
from LSP.plugin.core.protocol import WorkspaceFolder
from LSP.plugin.core.sessions import create_session, Session, InitializeError, ACQUIRE_READY_LOCK_TIMEOUT
from LSP.plugin.core.types import ClientConfig
from LSP.plugin.core.types import Settings
from test_mocks import MockC... |
dndrsn/LSP | plugin/configuration.py | import sublime
import sublime_plugin
from .core.settings import ClientConfig, client_configs
from .core.registry import windows
try:
from typing import List, Optional, Dict, Any
assert List and Optional and Dict and Any
assert ClientConfig
except ImportError:
pass
def create_config_items(configs: 'L... |
dndrsn/LSP | plugin/goto.py | <filename>plugin/goto.py
import sublime
from .core.registry import LspTextCommand
from .core.protocol import Request, Point
from .core.documents import get_document_position, get_position, is_at_word
from .core.url import uri_to_filename
from .core.logging import debug
from Default.history_list import get_jump_history... |
dndrsn/LSP | plugin/core/workspace.py | <filename>plugin/core/workspace.py
from .logging import debug
from .protocol import WorkspaceFolder
from .types import WindowLike
from .typing import List, Optional, Any, Callable
from os.path import commonprefix
class ProjectFolders(object):
def __init__(self, window: WindowLike) -> None:
self._window =... |
dndrsn/LSP | plugin/core/rpc.py | <reponame>dndrsn/LSP<filename>plugin/core/rpc.py
from .logging import debug, exception_log
from .protocol import Request, Notification, Response
from .transports import StdioTransport, Transport
from .types import Settings
from .typing import Any, Dict, Tuple, Callable, Optional, Union, Mapping
from threading import Co... |
dndrsn/LSP | tests/test_configs.py | from unittesting import DeferrableTestCase
import unittest
import sublime
from os.path import dirname
from LSP.plugin.core.settings import client_configs, read_client_config, update_client_config
from LSP.plugin.core.registry import windows
test_file_path = dirname(__file__) + "/testfile.txt"
class ConfigParsingTest... |
dndrsn/LSP | tests/test_windows.py | from LSP.plugin.core.diagnostics import DiagnosticsStorage
from LSP.plugin.core.sessions import create_session
from LSP.plugin.core.sessions import Session
from LSP.plugin.core.types import ClientConfig
from LSP.plugin.core.types import LanguageConfig
from LSP.plugin.core.windows import WindowManager
from LSP.plugin.co... |
ninadshr/DS-for-Telco | .local/lib/python2.7/site-packages/datarobot/utils/logger.py | <reponame>ninadshr/DS-for-Telco<gh_stars>0
import logging
import sys
def get_logger(name):
logger = logging.getLogger(name)
logger.addHandler(logging.StreamHandler(sys.stdout))
logger.setLevel(logging.INFO)
logger.propagate = False
return logger
|
ninadshr/DS-for-Telco | .local/lib/python2.7/site-packages/datarobot/models/feature.py | from six.moves.urllib.parse import quote
import trafaret as t
from datarobot.models.api_object import APIObject
from ..utils import deprecation_warning, encode_utf8_if_py2, from_api
class Feature(APIObject):
""" A feature from a project's dataset
Attributes
----------
id : int
the id for the... |
ninadshr/DS-for-Telco | .local/lib/python2.7/site-packages/datarobot/rest.py | """This module is not considered part of the public interface. As of 2.3, anything here
may change or be removed without warning."""
import platform
import os
import requests
import six
import trafaret as t
from requests_toolbelt.multipart.encoder import MultipartEncoder
from six.moves.urllib_parse import urlparse
f... |
ninadshr/DS-for-Telco | .local/lib/python2.7/site-packages/datarobot/async.py | import time
from . import errors
def wait_for_async_resolution(client, async_location, max_wait=600):
"""
Wait for successful resolution of the provided async_location.
Parameters
----------
client : RESTClientObject
The configured v2 requests session
async_location : str
The... |
ninadshr/DS-for-Telco | .local/lib/python2.7/site-packages/datarobot/__init__.py | <filename>.local/lib/python2.7/site-packages/datarobot/__init__.py
# flake8: noqa
from ._version import __version__
from .enums import (
SCORING_TYPE,
QUEUE_STATUS,
AUTOPILOT_MODE,
VERBOSITY_LEVEL,
)
from .client import Client
from .errors import AppPlatformError
from .helpers import *
from .models im... |
ninadshr/DS-for-Telco | .local/lib/python2.7/site-packages/datarobot/models/api_object.py | import six
import trafaret as t
from datarobot.client import get_client, staticproperty
from datarobot.utils import from_api
class APIObject(object):
_client = staticproperty(get_client)
_converter = t.Dict({}).allow_extra('*')
@classmethod
def _fields(cls):
return {k.to_name or k.name for k... |
ninadshr/DS-for-Telco | .local/lib/python2.7/site-packages/datarobot/utils/__init__.py | <filename>.local/lib/python2.7/site-packages/datarobot/utils/__init__.py
"""This module is not considered part of the public interface. As of 2.3, anything here
may change or be removed without warning."""
import re
from datetime import datetime, date
import pandas as pd
import six
from dateutil import parser, tz
fr... |
ninadshr/DS-for-Telco | .local/lib/python2.7/site-packages/datarobot/models/ruleset.py | import trafaret as t
from datarobot.models.api_object import APIObject
from datarobot.utils import get_id_from_response
class Ruleset(APIObject):
""" Represents an approximation of a model with DataRobot Prime
Attributes
----------
id : str
the id of the ruleset
rule_count : int
... |
ninadshr/DS-for-Telco | .local/lib/python2.7/site-packages/datarobot/models/prediction_dataset.py | import trafaret as t
from datarobot.models.api_object import APIObject
class PredictionDataset(APIObject):
""" A dataset uploaded to make predictions
Typically created via `project.upload_dataset`
Attributes
----------
id : str
the id of the dataset
project_id : str
the id ... |
ninadshr/DS-for-Telco | .local/lib/python2.7/site-packages/datarobot/helpers/partitioning_methods.py | import abc
from datetime import datetime
import pandas as pd
import trafaret as t
from datarobot.client import get_client, staticproperty
from datarobot.enums import CV_METHOD
from datarobot.utils import from_api, parse_time
__all__ = (
'RandomCV',
'StratifiedCV',
'GroupCV',
'UserCV',
'RandomTVH'... |
ninadshr/DS-for-Telco | .local/lib/python2.7/site-packages/datarobot/models/job.py | """
AbstractJob
^ ^
| |
+ +
Job AbstractSpecificJob
^ ^
| |
+ +
ModelJob PredictJob
Subclasses of AbstractJob can override _converter_extra and _extra_fields to indicate extra object
attributes whi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.