repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
CyberDani/personal-roadmap
webPage/generator/modules/uTest.py
<filename>webPage/generator/modules/uTest.py import sys import unittest from defTypes import appDecisionType from modules import checks def runAndEvaluateUnitTests(relativeDirPath, filePattern, outputStream = None): lines = [] unitTestsResult = collectAndRunUnitTestsByFilePattern(relativeDirPath, filePattern, o...
CyberDani/personal-roadmap
webPage/generator/modules/webLibs.py
from modules import htmlBuilder from modules import checks def addFontAwesome_v611(htmlFile, indentDepth): htmlBuilder.addCssLinkHrefToHtmlOutputFile(htmlFile, indentDepth, "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css", "<KEY> "anonymous", "no-referrer") ...
CyberDani/personal-roadmap
webPage/generator/unitTests/appDecisionType_test.py
import unittest import sys sys.path.append('..') from defTypes import appDecisionType class AppDecisionTypeTests(unittest.TestCase): def test_values(self): appDecisionType.AppDecisionType.STOP_APP appDecisionType.AppDecisionType.CONTINUE_RUNNING def test_validateLength(self): self.assertEqual(len(a...
CyberDani/personal-roadmap
webPage/generator/modules/htmlHead.py
<gh_stars>0 from modules import checks from modules import htmlBuilder from modules import webLibs class HtmlHead: def __init__(self, htmlFile, indentDepth): checks.checkIntIsBetween(indentDepth, 1, 30) checks.checkIfFile(htmlFile) self.htmlFile = htmlFile self.indentDepth = indentDepth self.titl...
CyberDani/personal-roadmap
webPage/generator/unitTests/stringUtil_test.py
import sys import unittest sys.path.append('..') from modules import stringUtil class StringUtilTests(unittest.TestCase): def test_getStringStartsWithEndsWith_nonSense(self): with self.assertRaises(Exception): stringUtil.getStringStartsWithEndsWithNoOverlap(None, None, None) with self.assertRaises(Ex...
CyberDani/personal-roadmap
webPage/generator/defTypes/buildSettings.py
import io from dataclasses import dataclass from defTypes import buildType from defTypes import dbBranchType from modules import counter @dataclass class BuildSettings: buildOption: buildType.BuildType dbBranch: dbBranchType.DbBranchType stepsCounter: counter.SimpleCounter htmlOutputFile: io.TextIOBas...
CyberDani/personal-roadmap
webPage/generator/modules/checks.py
import io import json def checkIfValidJsonFile(file): checkIfFile(file) try: return json.load(file) except ValueError as e: raise Exception('Invalid json: {0}'.format(e)) def checkIfValidJsonFileByFilePath(filePath): checkIfString(filePath, 2, 300) f = open(filePath, "r") return checkIfValidJsonFi...
CyberDani/personal-roadmap
webPage/generator/unitTests/learningTests_test.py
import unittest class UnitTestLearningTests(unittest.TestCase): def setUp(self): self.a = 2 def tearDown(self): self.a = 22 @unittest.skip("demonstrating skipping") def test_nothing(self): self.fail("shouldn't happen") @unittest.expectedFailure def test_fail(self): self.assertEqual(1, 0...
CyberDani/personal-roadmap
webPage/generator/modules/filerw.py
import os from modules import checks from modules import stringUtil ###### Reads ###### def fileExists(filePath): checks.checkIfString(filePath, 2, 300) return os.path.isfile(filePath) def getLinesByFilePathWithEndingNewLine(filePath): checks.checkIfString(filePath, 2, 300) f = open(filePath, "r") return ...
CyberDani/personal-roadmap
webPage/generator/unitTests/dbBranchType_test.py
<gh_stars>0 import unittest import sys sys.path.append('..') from defTypes import dbBranchType class DbBranchTypeTests(unittest.TestCase): def test_values(self): dbBranchType.DbBranchType.MASTER dbBranchType.DbBranchType.DEVEL def test_validateLength(self): self.assertEqual(len(dbBranchType.DbBranc...
CyberDani/personal-roadmap
webPage/generator/unitTests/buildSettings_test.py
<reponame>CyberDani/personal-roadmap<filename>webPage/generator/unitTests/buildSettings_test.py import unittest import sys sys.path.append('..') from defTypes import buildSettings from defTypes import buildType from defTypes import dbBranchType from modules import counter class BuildSettingsTests(unittest.TestCase)...
CyberDani/personal-roadmap
webPage/generator/modules/git.py
from modules import cmd from modules import stringUtil def getRepoRootDirectory(): ans = cmd.getOutputFromCommand("git rev-parse --show-toplevel") return stringUtil.rTrimNewLines(ans) def getCurrentBranch(): f = open(getRepoRootDirectory() + "/.git/HEAD", "r") content = f.read().splitlines() for line in con...
CyberDani/personal-roadmap
webPage/generator/unitTests/uTest_test.py
<filename>webPage/generator/unitTests/uTest_test.py import os import sys import unittest sys.path.append('..') from defTypes import appDecisionType from modules import checks from modules import uTest class UnitTestTests(unittest.TestCase): def test_collectAndRunUnitTestsByFilePattern_nonSense(self): void = ...
CyberDani/personal-roadmap
webPage/generator/unitTests/htmlBody_test.py
<gh_stars>0 import sys import unittest sys.path.append('..') from modules import htmlBuilder from modules import filerw from modules import htmlBody class HtmlBodyTests(unittest.TestCase): def test_constructor_nonSense(self): file = open("./unitTests/temp/test.txt", "w") with self.assertRaises(Exception):...
CyberDani/personal-roadmap
webPage/generator/unitTests/db_test.py
<gh_stars>0 import unittest import sys sys.path.append('..') from defTypes import dbBranchType from modules import db from modules import git class DbTests(unittest.TestCase): def test_getDbBranchByGitBranch_nonSense(self): with self.assertRaises(Exception): db.getDbBranchByGitBranch("") with self.a...
CyberDani/personal-roadmap
webPage/generator/generator.py
<gh_stars>0 import os import sys from defTypes import appDecisionType from defTypes import buildSettings from defTypes import buildType from modules import argumentParser from modules import counter from modules import htmlBody from modules import htmlBuilder from modules import htmlHead from modules import uTest # ...
CyberDani/personal-roadmap
webPage/generator/modules/stringUtil.py
<reponame>CyberDani/personal-roadmap<gh_stars>0 from modules import checks # <endsWithStr> must be after <startsWithStr> # Return empty string if def getStringStartsWithEndsWithNoOverlap(src, startsWithStr, endsWithStr): checks.checkIfString(src, 2, 500) checks.checkIfString(startsWithStr, 1, 500) checks.checkI...
CyberDani/personal-roadmap
webPage/generator/unitTests/htmlHead_test.py
import sys import unittest sys.path.append('..') from modules import htmlBuilder from modules import filerw from modules import htmlHead from modules import webLibs class HtmlHeadTests(unittest.TestCase): def test_constructor_nonSense(self): file = open("./unitTests/temp/test.txt", "w") with self.assertRa...
CyberDani/personal-roadmap
webPage/generator/defTypes/appDecisionType.py
<reponame>CyberDani/personal-roadmap from enum import Enum class AppDecisionType(Enum): STOP_APP = 0 CONTINUE_RUNNING = 1
commodo/pep517
tests/samples/test-for-issue-104/setup.py
import sys from setuptools import setup from os import path, environ, listdir import json children = listdir(sys.path[0]) out = path.join(environ['PEP517_ISSUE104_OUTDIR'], 'out.json') with open(out, 'w') as f: json.dump(children, f) setup()
commodo/pep517
tests/test_meta.py
from __future__ import unicode_literals, absolute_import, division import re import pytest from pep517 import meta pep517_needs_python_3 = pytest.mark.xfail( 'sys.version_info < (3,)', reason="pep517 cannot be built on Python 2", ) def test_meta_for_this_package(): dist = meta.load('.') assert re...
commodo/pep517
tests/samples/buildsys_pkgs/buildsys_minimal.py
"""Test backend defining only the mandatory hooks. Don't use this for any real code. """ from glob import glob from os.path import join as pjoin import tarfile from zipfile import ZipFile def build_wheel(wheel_directory, config_settings, metadata_directory=None): whl_file = 'pkg2-0.5-py2.py3-none-any.whl' wi...
commodo/pep517
tests/samples/buildsys_pkgs/buildsys_minimal_editable.py
from buildsys_minimal import build_sdist, build_wheel # noqa build_editable = build_wheel
williamGOC/IFCOM-II-2020-
N-Body/figure.py
<filename>N-Body/figure.py import matplotlib.pyplot as plt import numpy as np import gif @gif.frame def plot_bodies(data): pass plt.figure(figsize=(5, 3), dpi=100) plt.title(r'$N = 3$', fontsize=20) plt.xlim(xmin=-2, xmax=3.1) plt.ylim(ymin=-3, ymax=3.3) plt.xlabel(r'$x(t)$', fontsize=15) plt.ylabel(r'$...
williamGOC/IFCOM-II-2020-
Simple Runge-Kutta method/lowPassFilter.py
<filename>Simple Runge-Kutta method/lowPassFilter.py from math import sin,cos,exp,sqrt,log from numpy import arange import sys import matplotlib.pyplot as plt # Parâmetros da exibição dos gráficos plt.rcParams['xtick.labelsize'] = 24 plt.rcParams['ytick.labelsize'] = 24 plt.rcParams['axes.labelsize'] = 28 RC = float(...
williamGOC/IFCOM-II-2020-
Molecular_Dynamic_2D_System/molecularDynamic2D.py
<filename>Molecular_Dynamic_2D_System/molecularDynamic2D.py import gif import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from random import randint # Global variables os the system L = 27.386127875258307 NC = 15 RHO = 0.3 EMPTY = -1 N = 225 class particles(object): """docst...
williamGOC/IFCOM-II-2020-
N-Body/pybody.py
""" Author: <NAME> Date: April 19, 2020, Neuqué, Argentina module body: This module has implemented a series of functions and objects that will be useful when solving the problem of the N bodies. """ # necessary modules import numpy as np from copy import copy class body(object): def __init__(self, mass, r...
williamGOC/IFCOM-II-2020-
EDO_2_ORDER/EDO_2.py
import numpy as np class EDO_Solver(object): """docstring for EDO_Solver""" def __init__(self, f, x, v, dt): super(EDO_Solver, self).__init__() self.f = f self.x = x self.v = v self.dt = dt self.a = self.f(self.x) self.counter = 0 def totalEnergy(self): return (self.v**2 + self.x**2)/2 def e...
williamGOC/IFCOM-II-2020-
N-Body/nBody.py
import numpy as np import matplotlib.pyplot as plt from pybody import * def totalForce(element, system): """ Total force acting on the body "element" which is in the body system "system" Keyword Arguments: system ---> is a list object with each element as body object element ---> is a body object Return...
williamGOC/IFCOM-II-2020-
Simple Runge-Kutta method/inftyIntegrator.py
from math import sin,cos,exp,sqrt,log,tanh from numpy import arange import matplotlib.pyplot as plt # Parâmetros da exibição dos gráficos plt.rcParams['xtick.labelsize'] = 24 plt.rcParams['ytick.labelsize'] = 24 plt.rcParams['axes.labelsize'] = 28 gama, omega = 1.0, 10.0 def g(x,u): t = 0.5*log((1.0+u)/(1.0-u)) ...
sentashani/stolgo
lib/stolgo/nse_data.py
<gh_stars>0 import os import requests import concurrent.futures import io from datetime import datetime,timedelta import pandas as pd from pandas import ExcelWriter from requests.exceptions import HTTPError from bs4 import BeautifulSoup from stolgo.nse_urls import NseUrls from stolgo.helper import get_for...
sentashani/stolgo
lib/stolgo/request.py
import requests from requests.adapters import HTTPAdapter from requests.packages.urllib3.util.retry import Retry DEFAULT_TIMEOUT = 5 # seconds MAX_RETRIES = 2 #class TimeoutHTTPAdapter credit : https://github.com/psf/requests/issues/3070#issuecomment-205070203 class TimeoutHTTPAdapter(HTTPAdapter): def __init__(s...
sentashani/stolgo
lib/stolgo/nse_urls.py
<filename>lib/stolgo/nse_urls.py<gh_stars>0 from datetime import datetime,date import pandas as pd from stolgo.helper import get_formated_date,get_formated_dateframe class NseUrls: def __init__(self): self.__OPTION_CHAIN_BASE_URL = r"https://www1.nseindia.com/live_market/dynaContent/"\ ...
sentashani/stolgo
lib/stolgo/helper.py
<reponame>sentashani/stolgo from datetime import date as dt import pandas as pd import requests def get_formated_date(date=None,format=None,dayfirst=False): """string date to format date """ try: if not date: date = dt.today() date_time = pd.to_datetime(date,dayfirst=dayfirs...
sentashani/stolgo
tests/test_nse_option_chain.py
<reponame>sentashani/stolgo from stolgo.nse_data import NseData def main(): nse_data = NseData() nse_data.get_option_chain_excel('BANKNIFTY','30APR2020') if __name__ == "__main__": main()
Emgalai/mpd_queue_random_album
mpdrandom/mpdrandom.py
<filename>mpdrandom/mpdrandom.py #!/usr/bin/env python3 # -*- coding: UTF-8 -*- import json import random from argparse import ArgumentParser from datetime import datetime from pathlib import Path from typing import Any, Dict, List, Optional import mpd # Default Server info, change these values to match yours. HOST =...
Emgalai/mpd_queue_random_album
tests/test_cache.py
<reponame>Emgalai/mpd_queue_random_album from mpdrandom.mpdrandom import get_cache_size, enforce_cache_size def test_larger(): assert 100 == get_cache_size(1010, 10) def test_smaler(): assert 10 == get_cache_size(100, 10) assert 0 == get_cache_size(1, 10) assert 0 == get_cache_size(0, 10) assert...
Emgalai/mpd_queue_random_album
setup.py
#!/usr/bin/env python3 from setuptools import setup setup( name="mpdrandom", packages=["mpdrandom"], version="1.0.0", description="mpd albums randomizing script", author="IbeeX", author_email="", url="", install_requires=["python-mpd2"], keywords=["mpd", "album", "random", "shuffle"...
PACerv/gmm-torch
test.py
<reponame>PACerv/gmm-torch<filename>test.py import numpy as np import sklearn.mixture import torch from gmm import GaussianMixture import unittest class CpuCheck(unittest.TestCase): """ Basic tests for CPU. """ def testPredictClasses(self): """ Assert that torch.FloatTensor is handle...
PACerv/gmm-torch
utils.py
import torch def calculate_matmul_n_times(n_components, mat_a, mat_b): """ Calculate matrix product of two matrics with mat_a[0] >= mat_b[0]. Bypasses torch.matmul to reduce memory footprint. args: mat_a: torch.Tensor (n, k, 1, d) mat_b: torch.Tensor (1, k, d, d) ...
The-SocialLion/Sentence-Prediction-Using-BERT
spub.py
# -*- coding: utf-8 -*- """SPUB.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1cqgT4kKo8l52Rs_hozQQBVFZK8atvd8g #**Sentence Prediction using Bert** """ pip install transformers from transformers import BertTokenizer, BertForNextSentencePredic...
Erechtheus/mutation-ner
toIOB.py
# Script to transform corpus from .ann to .iob format import pandas as pd import urllib.request # handles url import spacy # spacing and tokenization #conda install -c conda-forge spacy #python -m spacy download en_core_web_sm nlp = spacy.load('en_core_web_sm') url_corpus = "https://raw.githubusercontent.com/Erecht...
Erechtheus/mutation-ner
NER_evaluation.py
<reponame>Erechtheus/mutation-ner<filename>NER_evaluation.py # -*- coding: utf-8 -*- # Transformer based Mutation Recognition of SETH Corpus (NLP-NER) # Final Evaluation Run of final hyperparameters # inspired by: https://github.com/huggingface/notebooks/blob/master/transformers_doc/custom_datasets.ipynb # conda insta...
Erechtheus/mutation-ner
NER_prediction.py
<gh_stars>0 # -*- coding: utf-8 -*- # Transformer based Mutation Recognition of SETH Corpus (NLP-NER) # Pipeline for prediciton of IOB-Tags in a given text using the best tuned model # inspired by: https://huggingface.co/dslim/bert-base-NER import torch # conda install pytorch=1.5 from transformers import AutoTokenize...
Erechtheus/mutation-ner
data-analysis.py
import pandas as pd from sklearn.model_selection import train_test_split, KFold import matplotlib.pyplot as plt import seaborn as sns def main(): print("\n -- Load & Preprocess Data -- \n") # load data data_path = "corpus_IOB.csv" data_raw = pd.read_csv(data_path, encoding="latin1" ) data_raw = da...
dowellde/workshop2
workshop2/__init__.py
import os import argparse import configparser import sys def run(): parser = argparse.ArgumentParser(description='This is a test package') parser.add_argument('--display',help='Prints a statement',default='No display message') parser.add_argument('--config',help='Reads a config.ini file.',default=False) if len(sys...
dowellde/workshop2
workshop2/__main__.py
<filename>workshop2/__main__.py import __init__ __init__.run()
ThallyssonKlein/DjangoBasicAuth
core/views.py
<filename>core/views.py from rest_framework.views import APIView from rest_framework.response import Response from rest_framework.permissions import IsAuthenticated class Home(APIView): permission_classes = (IsAuthenticated, ) def get(self, request, format=None): return Response('Ok', status=200)
isswaroop/Alpha-Beta-Pruning-For-Connect-Four
ConnectFourMinimaxAI.py
import copy import ConnectFourEngine import ConnectFourBoard import random def other(token): if token == ConnectFourBoard.RED: return ConnectFourBoard.BLUE elif token == ConnectFourBoard.BLUE: return ConnectFourBoard.RED else: return None def state_score(board, red_tu...
isswaroop/Alpha-Beta-Pruning-For-Connect-Four
AlphaBetaAI.py
import copy import ConnectFourEngine import ConnectFourBoard import math import random p_inf = float("inf") n_inf = float("-inf") def other(token): if token == ConnectFourBoard.RED: return ConnectFourBoard.BLUE elif token == ConnectFourBoard.BLUE: return ConnectFourBoard.RED ...
isswaroop/Alpha-Beta-Pruning-For-Connect-Four
ConnectFourGraphics.py
import pygame # This module takes care of the graphical interface: drawing the shapes and # printing the text that together make the game window. # display constants (these are not crucial to the game or pygame) FONTSIZE = 24 CELL_SIZE = 48 OFFSET_CANVAS = 20 TOP_OFFSET = 24 BOTTOM_SPACING = 64 # colour constants BL...
isswaroop/Alpha-Beta-Pruning-For-Connect-Four
ConnectFour1Player.py
<reponame>isswaroop/Alpha-Beta-Pruning-For-Connect-Four import ConnectFourRandomAI import ConnectFourMinimaxAI import AlphaBetaAI import ConnectFourEngine if __name__ == '__main__': # Initialise the game engine # Modify these parameters to tweak the game app = ConnectFourEngine.ConnectFour( ai...
isswaroop/Alpha-Beta-Pruning-For-Connect-Four
ConnectFourEngine.py
# import all of the necessary libraries import pygame, sys from pygame.locals import * # import helper libraries import ConnectFourGraphics import ConnectFourBoard class ConnectFour: # The `__init__` method is called to initialise the `ConnectFour` game. def __init__(self, height = 9, width = ...
isswaroop/Alpha-Beta-Pruning-For-Connect-Four
ConnectFour0Player.py
<reponame>isswaroop/Alpha-Beta-Pruning-For-Connect-Four<gh_stars>0 import ConnectFourRandomAI import ConnectFourMinimaxAI import AlphaBetaAI import ConnectFourEngine if __name__ == '__main__': # Initialise the game engine for i in range(4): app = ConnectFourEngine.ConnectFour( ai_delay ...
isswaroop/Alpha-Beta-Pruning-For-Connect-Four
ConnectFourBoard.py
<filename>ConnectFourBoard.py<gh_stars>0 import copy # Board tokens RED = 1 BLUE = 2 # A few helper functions to manage board initialisation def new_empty_board(height, width): return [([0] * height) for k in range(width)] def valid_board(board): # Checks that the board is a rectangle. If it isn't, this func...
NetEase-FuXi/EET
example/python/bert_transformers_example.py
import torch import numpy as np from eet.transformers.modeling_bert import EETBertModel from transformers import BertModel import time using_half = True seq_len = 128 batch = 4 loop = 100 def main(): torch.set_grad_enabled(False) input = np.random.randint(1000,9000,seq_len * batch,dtype="int64"...
NetEase-FuXi/EET
example/python/gpt2_fairseq_example.py
<filename>example/python/gpt2_fairseq_example.py import torch import time import numpy as np from torch import nn from fairseq.data.dictionary import Dictionary from eet.fairseq.transformer import EETTransformerDecoder using_pytorch = True using_eet = True using_half = False prompt_seq_len = 4 # eet sup...
NetEase-FuXi/EET
example/python/gpt2_transformers_example.py
<reponame>NetEase-FuXi/EET import torch import numpy as np from eet.transformers.modeling_gpt2 import EETGPT2Model using_half = False seq_len = 128 batch = 5 def main(): input = np.random.randint(1000,9000,seq_len * batch,dtype="int64") inputs = np.random.randint(1000,9000,1 * batch,dtype="int64") ...
NetEase-FuXi/EET
python/eet/transformers/__init__.py
<filename>python/eet/transformers/__init__.py from .modeling_bert import * from .modeling_gpt2 import *
NetEase-FuXi/EET
setup.py
from setuptools import find_packages, setup, Extension from torch.utils import cpp_extension import glob import os import subprocess __version__ = "0.0.1" current_dir = os.path.dirname(os.path.abspath(__file__)) cuda_sources = glob.glob(os.path.join(current_dir, 'csrc', 'core', '*.cu')) cpp_sources = glob.glob(os.path...
NetEase-FuXi/EET
example/python/gpt2_from_buffer_example.py
<reponame>NetEase-FuXi/EET import torch import time import numpy as np from torch import nn from fairseq.data.dictionary import Dictionary from fairseq.models.transformer import TransformerDecoder from eet.fairseq.transformer import EETTransformerDecoder import sys context_len = 512 batch = 4 max_seq_len =...
NetEase-FuXi/EET
python/eet/transformers/modeling_bert.py
# # Created by djz on 2021/01/21. # """EET transformers bert model. """ import math import time import torch import torch.nn as nn import numpy as np from torch import Tensor from typing import Any, Dict, List, Optional, Tuple from transformers import BertModel from EET import MetaDesc as meta_desc from EET import F...
y-labo/RealSenseViewer
rs_viewer.py
import pyrealsense2 as rs import numpy as np import cv2 def main(): # RealSense L515 Setting pipeline = rs.pipeline() config = rs.config() config.enable_stream(rs.stream.depth, 1024, 768, rs.format.z16, 30) config.enable_stream(rs.stream.color, 1920, 1080, rs.format.bgr8, 30) align_to = rs.st...
scarelang/scarelang
scare/init.py
from pyparsing import * import sys # String data sg = QuotedString('"',escquoute='""') # Add string usage example "Hello my name is ""<NAME>""" will output "Hello my name is "<NAME>"" # Variable data vars = {} varname = "" varvalue = "" # Number data real = Regex(r"[+-]?\d+\.\d*").setParseAction(lambda t:float(t[0])...
plant-phenotyping/rpi-phenotyping
capture_image.py
#!/usr/bin/env python3 import RPi.GPIO as gp import os import socket import datetime as dt gp.setwarnings(False) gp.setmode(gp.BOARD) gp.setup(7, gp.OUT) gp.setup(11, gp.OUT) gp.setup(12, gp.OUT) gp.output(11, True) gp.output(12, True) def main(): gp.output(7, False) gp.output(11, False) gp.output...
ghaughian/kdb-doc-manager
tests/test_kdb_doc_manager.py
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
ghaughian/kdb-doc-manager
tests/test_kdb.py
# -*- encoding: utf-8 -*- # Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
ghaughian/kdb-doc-manager
mongo_connector/doc_managers/kdb_doc_manager.py
# Author: <NAME> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # dist...
sdesimone/ML4iOS
ML4iOSTests/data/pythonTests.py
<filename>ML4iOSTests/data/pythonTests.py #!/usr/bin/env python from bigml.api import BigML from bigml.model import Model from bigml.ensemble import Ensemble from bigml.anomaly import Anomaly from bigml.cluster import Cluster from bigml.logistic import LogisticRegression api = BigML(dev_mode=False) #clusterJson = ap...
osaukh/pollenpub
pollen_library/plot_pollen_sample.py
<filename>pollen_library/plot_pollen_sample.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Jul 13 12:26:07 2020 @author: khoanam """ import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1 import ImageGrid import numpy as np import os from collections import Counter import cv2 #%% Helper f...
osaukh/pollenpub
code/create_folds.py
'''Copyright (C) 2019 <NAME> of Technology (ETH Zurich), <NAME> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program i...
osaukh/pollenpub
code/test.py
<filename>code/test.py<gh_stars>1-10 '''Copyright (C) 2019 <NAME>, Swiss Federal Institute of Technology (ETH Zurich), <NAME> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the L...
osaukh/pollenpub
code/utils/logger.py
<gh_stars>1-10 '''Copyright (C) 2019 <NAME>, Swiss Federal Institute of Technology (ETH Zurich), <NAME> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your op...
osaukh/pollenpub
code/utils/parse_config.py
'''Copyright (C) 2019 <NAME>, Swiss Federal Institute of Technology (ETH Zurich), <NAME> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later...
JustHitTheCore/JHtC4BSK2017
public/phdh/generate.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from random import randint from Crypto.Util.number import isPrime, getPrime from hashlib import sha256 from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.ciphers import ( Cipher, algorithms, modes ) def encrypt(k...
JustHitTheCore/JHtC4BSK2017
hosted/barsa/src/app.py
from flask import Flask from flask import render_template from flask import make_response from flask import request from flask import redirect from flask import url_for from flask import send_from_directory from flask_sqlalchemy import SQLAlchemy from flask_bcrypt import Bcrypt from CryptoLib import SecureKey import s...
JustHitTheCore/JHtC4BSK2017
hosted/power_man/src/pow_test.py
<reponame>JustHitTheCore/JHtC4BSK2017 #!/usr/bin/env python3 from random import randint print("Calculate a**b mod m") print("You don't have a lot of time!") for _ in range(120): a=randint(10**100, 10**200) b=randint(10**100, 10**200) m=randint(10**100, 10**200) print("a =", a) print("b =", b) print("m =", m) ...
JustHitTheCore/JHtC4BSK2017
hosted/translatespeak/src/app.py
<reponame>JustHitTheCore/JHtC4BSK2017 # <!-- import os import shlex import subprocess import logging from uuid import uuid4 from flask import Flask, request, redirect from googletrans import Translator logging.basicConfig(level=logging.DEBUG) app = Flask(__name__) flag_1 = os.environ['JHtC4BSK_FIRST_FLAG'] base =...
JustHitTheCore/JHtC4BSK2017
hosted/barsa/src/CryptoLib.py
<gh_stars>1-10 #!/usr/bin/env python from random import randint, randrange import subprocess, json from hashlib import sha256 old_bin = bin def bin(a): return old_bin(a)[2:] def eh(a): try: return a.encode('hex') except: return hex(a)[2:].strip('L') def dh(a): a = a.strip() retu...
gadial/qiskit-terra
qiskit/pulse/transforms/canonicalization.py
<reponame>gadial/qiskit-terra # This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any ...
gadial/qiskit-terra
qiskit/pulse/instructions/delay.py
# This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
gadial/qiskit-terra
qiskit/quantum_info/operators/channel/kraus.py
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
gadial/qiskit-terra
qiskit/pulse/library/discrete.py
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
gadial/qiskit-terra
qiskit/quantum_info/operators/channel/transformations.py
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
gadial/qiskit-terra
qiskit/algorithms/phase_estimators/hamiltonian_phase_estimation_result.py
<reponame>gadial/qiskit-terra # This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any ...
gadial/qiskit-terra
qiskit/algorithms/phase_estimators/phase_estimator.py
<filename>qiskit/algorithms/phase_estimators/phase_estimator.py # This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache....
gadial/qiskit-terra
qiskit/algorithms/optimizers/spsa.py
<gh_stars>1-10 # This code is part of Qiskit. # # (C) Copyright IBM 2018, 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modificat...
gadial/qiskit-terra
qiskit/providers/basicaer/basicaertools.py
# This code is part of Qiskit. # # (C) Copyright IBM 2017. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
gadial/qiskit-terra
qiskit/circuit/library/arithmetic/polynomial_pauli_rotations.py
<reponame>gadial/qiskit-terra # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # ...
gadial/qiskit-terra
qiskit/quantum_info/operators/dihedral/random.py
<reponame>gadial/qiskit-terra # This code is part of Qiskit. # # (C) Copyright IBM 2019, 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # ...
gadial/qiskit-terra
qiskit/circuit/library/n_local/excitation_preserving.py
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
gadial/qiskit-terra
test/python/circuit/library/test_grover_operator.py
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or deriva...
gadial/qiskit-terra
qiskit/transpiler/passes/__init__.py
<filename>qiskit/transpiler/passes/__init__.py # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2018. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/license...
gadial/qiskit-terra
qiskit/circuit/classicalfunction/boolean_expression.py
<gh_stars>1-10 # This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications o...
gadial/qiskit-terra
test/python/compiler/test_compiler.py
<reponame>gadial/qiskit-terra<filename>test/python/compiler/test_compiler.py # This code is part of Qiskit. # # (C) Copyright IBM 2017. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http:...
gadial/qiskit-terra
qiskit/circuit/library/standard_gates/rxx.py
<filename>qiskit/circuit/library/standard_gates/rxx.py<gh_stars>1-10 # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://...
gadial/qiskit-terra
qiskit/opflow/evolutions/evolved_op.py
<filename>qiskit/opflow/evolutions/evolved_op.py<gh_stars>1-10 # This code is part of Qiskit. # # (C) Copyright IBM 2020. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.o...
gadial/qiskit-terra
qiskit/circuit/library/standard_gates/ecr.py
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...
gadial/qiskit-terra
qiskit/algorithms/linear_solvers/linear_solver.py
<filename>qiskit/algorithms/linear_solvers/linear_solver.py # This code is part of Qiskit. # # (C) Copyright IBM 2020, 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apach...
gadial/qiskit-terra
qiskit/quantum_info/operators/mixins/group.py
# This code is part of Qiskit. # # (C) Copyright IBM 2017, 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivat...