repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
shoujungu/2022_RNASeq
b02_analysis/b03_go_02_plt-kegg.py
<gh_stars>0 import pandas as pd from pathlib import Path import matplotlib.pyplot as plt import seaborn as sns #------------------------------------------ n=10 #number of kegg terms to plot fd_out='./out/b03_go_02_plt-kegg' fd_in='./out/b03_go_00_gene/go' ##################################################### Path(f...
shoujungu/2022_RNASeq
b02_analysis/a00_pca_00_pca.py
<gh_stars>0 import pandas as pd import numpy as np from pathlib import Path from sklearn.decomposition import PCA from sklearn.preprocessing import MinMaxScaler import matplotlib.pyplot as plt import seaborn as sns #------------------------------------------------ fd_out='./out/a00_pca_00_pca' fd_in='/home/shoujun/Des...
shoujungu/2022_RNASeq
b02_analysis/b01_convert-gene_00_table.py
#parse GTF to get gene name convert table import pandas as pd from pathlib import Path #------------------------------------------- fd_out='./out/b01_convert-gene_00_table' f_in='/home/shoujun/Desktop/b01_tmp/z00/a01_tool/ref/gencode.v39.primary_assembly.annotation.gtf' ##############################################...
shoujungu/2022_RNASeq
b00_fastq/a00_sra_03_trim.py
<filename>b00_fastq/a00_sra_03_trim.py import subprocess import pandas as pd from pathlib import Path from multiprocessing import Pool #------------------------------------------ fd_out='./out/a00_sra_03_trim' fd_in='./out/a00_sra_01_fastq' f_meta='/home/shoujun/Desktop/b01_tmp/z00/a00_raw/SraRunTable.txt' ##########...
shoujungu/2022_RNASeq
b02_analysis/b01_convert-gene_01_convert.py
import pandas as pd from pathlib import Path from multiprocessing import Pool #------------------------------------------- fd_out='./out/b01_convert-gene_01_convert' fd_in='./out/b00_de_04_filter' f_table='./out/b01_convert-gene_00_table/gene_name.csv' ####################################################### Path(fd_o...
shoujungu/2022_RNASeq
b01_align/a00_star_02_count.py
import pandas as pd from pathlib import Path #----------------------------------------------- fd_out='./out/a00_star_02_count' fd_in='./out/a00_star_01_align' f_meta='/home/shoujun/Desktop/b01_tmp/z00/a00_raw/SraRunTable.txt' ######################################################### Path(fd_out).mkdir(exist_ok=True, ...
shoujungu/2022_RNASeq
b02_analysis/d00_motif_01_bed.py
from pathlib import Path import pandas as pd import random from multiprocessing import Pool #----------------------------------------------------------------- up=1000 #upstream size down=0 #downstream size n_ctrl=3 n=500 #number of genes used fd_out='./out/d00_motif_01_bed' fd_in='./out/b01_convert-gene_...
shoujungu/2022_RNASeq
b02_analysis/b00_de_04_filter.py
<filename>b02_analysis/b00_de_04_filter.py import pandas as pd from pathlib import Path from multiprocessing import Pool #---------------------------------------- p=0.05 fc=1 fd_out='./out/b00_de_04_filter' fd_in='./out/b00_de_02_clean' ###################################################### Path(fd_out).mkdir(exist...
shoujungu/2022_RNASeq
b02_analysis/d00_motif_02_fa.py
from pathlib import Path import pandas as pd from multiprocessing import Pool #------------------------------------------------------- fd_out='./out/d00_motif_02_fa' fd_in='./out/d00_motif_01_bed' f_fa='/home/shoujun/Desktop/b01_tmp/z00/a01_tool/ref/GRCh38.primary_assembly.genome.fa' #--------------------------------...
shoujungu/2022_RNASeq
b02_analysis/b00_de_03_plt-vol.py
import pandas as pd import numpy as np from pathlib import Path import matplotlib.pyplot as plt import seaborn as sns from multiprocessing import Pool #----------------------------------------------- p=0.05 fc=1 fd_out='./out/b00_de_03_plt-voc' fd_in='./out/b00_de_02_clean' ##########################################...
shoujungu/2022_RNASeq
b00_fastq/a00_sra_01_fastq.py
<filename>b00_fastq/a00_sra_01_fastq.py import subprocess from pathlib import Path from multiprocessing import Pool #------------------------------------------ fd_out='./out/a00_sra_01_fastq' fd_in='./out/a00_sra_00_prefetch' f_cmd='/home/shoujun/Desktop/b01_tmp/z00/a01_tool/sratools/bin/fastq-dump' #################...
shoujungu/2022_RNASeq
b02_analysis/b02_de-plt_00_barplot.py
<filename>b02_analysis/b02_de-plt_00_barplot.py<gh_stars>0 import pandas as pd from pathlib import Path import matplotlib.pyplot as plt import seaborn as sns from multiprocessing import Pool #------------------------------------------ n=20 #number of top genes to plot fd_out='./out/b02_de-plt_00_barplot' fd_in='./...
shoujungu/2022_RNASeq
b02_analysis/b03_go_00_gene.py
import pandas as pd from pathlib import Path from multiprocessing import Pool #------------------------------------------ fc=3 #min fold change fd_out='./out/b03_go_00_gene' fd_in='./out/b01_convert-gene_01_convert' ##################################################### Path(fd_out).mkdir(exist_ok=True, parents=True)...
shoujungu/2022_RNASeq
b02_analysis/d00_motif_00_promoter.py
from pathlib import Path import pandas as pd #--------------------------------------------------- fd_out='./out/d00_motif_00_promoter' f_in='/home/shoujun/Desktop/b01_tmp/z00/a01_tool/ref/gencode.v39.primary_assembly.annotation.gff3' l_col=['seqid', 'source', 'type', 'start', 'end', 'score', 'strand', 'phase', 'attrib...
shoujungu/2022_RNASeq
b01_align/a00_star_01_align.py
import subprocess import pandas as pd from pathlib import Path #------------------------------------------ fd_out='./out/a00_star_01_align' fd_in='/home/shoujun/Desktop/b01_tmp/z00/b00_fastq/out/a00_sra_03_trim' f_meta='/home/shoujun/Desktop/b01_tmp/z00/a00_raw/SraRunTable.txt' fd_ref='./out/a00_star_00_index' f_star=...
shoujungu/2022_RNASeq
b00_fastq/a00_sra_00_prefetch.py
import subprocess import pandas as pd from pathlib import Path #------------------------------------------ fd_out='./out/a00_sra_00_prefetch' f_in='/home/shoujun/Desktop/b01_tmp/z00/a00_raw/SraRunTable.txt' f_cmd='/home/shoujun/Desktop/b01_tmp/z00/a01_tool/sratools/bin/prefetch' ######################################...
shoujungu/2022_RNASeq
b02_analysis/c00_wilco_01_wilco.py
<gh_stars>0 import scanpy as sc import pandas as pd from pathlib import Path #-------------------------------------------- fd_out='./out/c00_wilco_01_wilco' f_in='./out/c00_wilco_00_ada.py/ada.h5ad' ################################################### Path(fd_out).mkdir(exist_ok=True, parents=True) ada=sc.read(f_in) ...
shoujungu/2022_RNASeq
b02_analysis/b02_de-plt_01_heatmap.py
import pandas as pd import numpy as np from pathlib import Path import matplotlib.pyplot as plt import seaborn as sns from multiprocessing import Pool from scipy.stats import zscore #------------------------------------------------ n=20 fd_out='./out/b02_de-plt_01_heatmap' fd_in='./out/b01_convert-gene_01_convert' f_...
shoujungu/2022_RNASeq
b02_analysis/d00_motif_03_clean.py
from pathlib import Path import pandas as pd #----------------------------------------------------- name='de' #file name of DE genes fd_out='./out/d00_motif_03_clean' fd_in='./out/d00_motif_02_fa/meme' ############################################################### Path(fd_out).mkdir(exist_ok=True, parents=True) d...
shoujungu/2022_RNASeq
b00_fastq/a00_sra_04_trim-qc.py
<reponame>shoujungu/2022_RNASeq import subprocess import pandas as pd from pathlib import Path from multiprocessing import Pool #------------------------------------------ fd_out='./out/a00_sra_04_trim-qc' fd_in='./out/a00_sra_03_trim' f_meta='/home/shoujun/Desktop/b01_tmp/z00/a00_raw/SraRunTable.txt' ###############...
shoujungu/2022_RNASeq
b00_fastq/a00_sra_02_qc.py
import subprocess from pathlib import Path from multiprocessing import Pool #------------------------------------------ fd_out='./out/a00_sra_02_qc' fd_in='./out/a00_sra_01_fastq' ################################################ Path(fd_out).mkdir(exist_ok=True, parents=True) l_fname=list(Path(fd_in).glob('*.fastq'))...
shoujungu/2022_RNASeq
b02_analysis/b00_de_02_clean.py
import pandas as pd from pathlib import Path from multiprocessing import Pool #------------------------------------------------ fd_out='./out/b00_de_02_clean' fd_in='./out/b00_de_01_de' ########################################################## Path(fd_out).mkdir(exist_ok=True, parents=True) l_fname=list(Path(fd_in)....
shoujungu/2022_RNASeq
b02_analysis/c00_wilco_02_heatmap.py
<filename>b02_analysis/c00_wilco_02_heatmap.py<gh_stars>0 import pandas as pd import scanpy as sc from pathlib import Path import matplotlib.pyplot as plt import seaborn as sns from multiprocessing import Pool from scipy.stats import zscore #------------------------------------------------ n=20 #number of genes to pl...
shoujungu/2022_RNASeq
b02_analysis/b00_de_00_pp.py
<gh_stars>0 import pandas as pd from pathlib import Path #----------------------------------------- fd_out='./out/b00_de_00_pp' fd_in='/home/shoujun/Desktop/b01_tmp/z00/b01_align/out/a00_star_02_count' ################################################# Path(fd_out).mkdir(exist_ok=True, parents=True) #load df_cnt=pd.r...
shoujungu/2022_RNASeq
b02_analysis/c00_wilco_00_ada.py
<reponame>shoujungu/2022_RNASeq import pandas as pd import scanpy as sc import anndata as ad from pathlib import Path #------------------------------------- fd_out='./out/c00_wilco_00_ada.py' f_cnt='/home/shoujun/Desktop/b01_tmp/z00/b01_align/out/a00_star_02_count/count.csv' f_table='./out/b01_convert-gene_00_table/ge...
shoujungu/2022_RNASeq
b01_align/a00_star_00_index.py
<reponame>shoujungu/2022_RNASeq<gh_stars>0 import subprocess from pathlib import Path #--------------------------------------- fd_out='./out/a00_star_00_index' f_fa='/home/shoujun/Desktop/b01_tmp/z00/a01_tool/ref/GRCh38.primary_assembly.genome.fa' f_gtf='/home/shoujun/Desktop/b01_tmp/z00/a01_tool/ref/gencode.v39.prima...
DataXujing/termgraph
termgraph/termgraph.py
<filename>termgraph/termgraph.py #!/usr/bin/env python3 # coding=utf-8 # termgraph.py - draw basic graphs on terminal # https://github.com/mkaz/termgraph from __future__ import print_function from colorama import init from itertools import * from datetime import datetime from datetime import timedelta import random ...
rasekar2000/omdb-hcl
image/code/omdb/main.py
<filename>image/code/omdb/main.py from flask import Flask,Response,request import json import omdb_access import os app = Flask(__name__) @app.route("/") def hello(): """Returns simple Hello World message""" return "Hello World!" def getSpecificRating(ratings): """Returns rating dictionary with value (i...
rasekar2000/omdb-hcl
image/code/omdb/omdb_access.py
<filename>image/code/omdb/omdb_access.py from flask import Flask import requests def getMovieFromOmdb(movieId,movieTitle,apikey): """ Summary line. Extended description of getMovieFromOmdb. Parameters: movieId (int): movieId if known movieTitle (String): movieTitle if known ap...
rasekar2000/omdb-hcl
misc/code/hello.py
from __future__ import print_function from __future__ import division # https://youtu.be/xLovcfIugy8 print("Hello " + "Python")
Lexis-BrainStorm/Gideon
connected.py
from kivy.app import App from kivy.uix.screenmanager import Screen, SlideTransition,FadeTransition,RiseInTransition from kivy.core.window import Window from kivy.uix.textinput import TextInput from kivy.uix.boxlayout import BoxLayout from kivy.uix.gridlayout import GridLayout from kivy.uix.label import Label from ...
Lexis-BrainStorm/Gideon
main.py
<reponame>Lexis-BrainStorm/Gideon from kivy.app import App from kivy.properties import StringProperty from kivy.uix.screenmanager import ScreenManager, Screen, SlideTransition import os import sqlite3 from kivy.core.window import Window from kivy.uix.settings import SettingsWithSidebar from kivy.properties import Strin...
virantha/photokeeper
photokeeper/filecopy.py
# Copyright 2016 <NAME> All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
virantha/photokeeper
photokeeper/utils.py
<filename>photokeeper/utils.py import yaml from collections import OrderedDict def ordered_load(stream, Loader=yaml.Loader, object_pairs_hook=OrderedDict): """ Helper function to allow yaml load routine to use an OrderedDict instead of regular dict. This helps keeps things sane when ordering the runs and p...
virantha/photokeeper
photokeeper/flickr.py
# -*- coding: utf-8 -*- # Copyright 2016 <NAME> All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by a...
virantha/photokeeper
photokeeper/target.py
# Copyright 2016 <NAME> All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
virantha/photokeeper
photokeeper/photokeeper.py
# Copyright 2016 <NAME> All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
virantha/photokeeper
test/test_photokeeper.py
<reponame>virantha/photokeeper<filename>test/test_photokeeper.py import photokeeper.photokeeper as P import pytest import os import logging import smtplib from mock import Mock from mock import patch, call from mock import MagicMock from mock import PropertyMock class Testphotokeeper: def setup(self): s...
mwhoffman/ezplot
ezplot.py
""" A simple drop-in replacement for the matplotlib's object-oriented plotting behavior. The only functions exported are `figure` and `show` which can be used as replacements for the `pylab` function of the same name. The resulting figure and axes objects work as before, but have some additional functionality and diffe...
Heliodex/PythonCalculators
segmentArea.py
# Heliodex 2021/12/01 # Last edited 2021/12/02 # This is gonna be a long one. from math import pi, sin, cos, radians print("Calculates the area of a segment from angle and radius") while True: rad = float(input("Radius? ")) deg = float(input("Angle degrees? ")) print(" ") adj = cos(radians(deg/2)) *...
Heliodex/PythonCalculators
converseOfPythagoras.py
<filename>converseOfPythagoras.py<gh_stars>0 # Heliodex <2021/08/18 # Last edited 2021/12/01 -- new program style print("Calculates whether a triangle is a right-angled triangle ") while True: a = input("Side 1? ") b = input("Side 2? ") c = input("Hypoteneuse? ") a = float(a) b = float(b) c = ...
Heliodex/PythonCalculators
interestCalculatorNew.py
# Heliodex 2021/08/24 # Last edited 2022/02/16 -- count number of steps and add reverse mode # edit of vatRemover # uses Short Method print("Calculates amount after adding a percentage a number of times") while True: c = input("1 for normal, 2 for reverse, 3 for catchup ") if c == "1": val =...
Heliodex/PythonCalculators
volume.py
<filename>volume.py # Heliodex 2020/11/19 # Last edited 2022/03/18 -- add sphere etc # 2021/08/20 I come back to fix this program and I see "2020/12/12" then i see the code from math import pi print("Calculates the volume of various 3D shapes") def cyl(h, w): return str((pi*((w/2)**2))*h) def tri(b...
Heliodex/PythonCalculators
arcs.py
# Heliodex 2021/08/17 # Last edited 2022/03/27 -- allow using radius too from math import pi print("Calculates the size/lenth of an arc") while True: deg = float(input("Degrees? ")) dia = float(input("Diameter? ") or float( input("Radius? "))*2) # best i could come up with f = deg/360 ...
Heliodex/PythonCalculators
circumference.py
# Heliodex 2020/11/13 # Last edited 2021/12/01 -- new program style from math import pi print("Calculates diameter or area of circle") while True: x = input("1 for diameter, 2 for area ") if (x == "1"): c = float(input("Circumference? ")) print("Diameter:") print(c/pi) print(" ") ...
Heliodex/PythonCalculators
trapezium.py
<filename>trapezium.py # Heliodex 2020/11/04 # Last edited 2021/12/03 -- new program style print("Calculates the area of trapezium") while True: s1 = float(input("Side 1? ")) s2 = float(input("Side 2? ")) h = float(input("Height? ")) print("Area:") print((s1 + s2) / 2 * h) print(" ") # s...
Heliodex/PythonCalculators
angleFromArcOrSector.py
# Heliodex 2021/08/19 # Last edited 2021/12/01 -- new program style from math import pi print("Calculates angle of a sector from arc+radius") while True: c = input("1 for with arc, 2 for with area ") if (c == "1"): arc = float(input("Arc? ")) rad = float(input("Radius? ")) ...
Heliodex/PythonCalculators
gradient.py
<filename>gradient.py # Heliodex 2022/01/18 # Last edited 2022/01/24 -- forgot new program style print("Calculates the gradient of a straight line given 2 points") while True: x1 = float(input("X of point 1? ")) y1 = float(input("Y of point 1? ")) x2 = float(input("X of point 2? ")) y2 = float(input("...
Heliodex/PythonCalculators
triangle.py
<filename>triangle.py # Heliodex 2020/11/03 # Last edited 2021/12/03 -- new program style print("Calculates area and perimiter of a triangle") # most useless program out of the bunch while True: print(" ") c = input("1 for area, 2 for perimiter ") if (c == "1"): ph = float(input("Heigh...
Heliodex/PythonCalculators
order.py
<filename>order.py # Heliodex 2021/11/12 # Last edited 2021/12/03 -- new program style print("Orders a comma-separated list of data") while True: list = input("List? ") print(" ") if not(list): break list2 = list.split(",") list3 = str(sorted(list2)) print("Ordered list:") print(list3) prin...
Heliodex/PythonCalculators
interestCalculatorOld.py
<reponame>Heliodex/PythonCalculators<filename>interestCalculatorOld.py<gh_stars>0 # Heliodex 2021/08/24 # Last edited 2021/12/01 -- new program style # edit of vatRemover print("Calculates amount after adding a percentage a number of times") while True: val = float(input("Current value? ")) int = float(in...
Heliodex/PythonCalculators
chordToSegment.py
# Heliodex 2021/09/22 # Last edited 2021/12/03 -- calculate second depth print("Calculates segment depth from chord and circle") while True: rad = float(input("Circle radius? ")) chd = float(input("Chord length? ")) segmDepth = rad-((rad**2)-((chd/2)**2))**0.5 # Least optimal equation ever ...
Heliodex/PythonCalculators
sectorArea.py
<reponame>Heliodex/PythonCalculators<gh_stars>0 # Heliodex 2021/08/18 # Last edited 2021/11/30 -- new program style from math import pi # no more "import *" print("Calculates area of a sector of a circle") while True: deg = float(input("Degrees? ")) rad = float(input("Radius? ")) print(" ") f = deg/360 #...
Heliodex/PythonCalculators
trigger.py
<reponame>Heliodex/PythonCalculators<gh_stars>0 # Heliodex 2022/01/13 # Last edited 2022/01/21 # Likely my biggest ever calculator program. Almost FOUR KILOBYTES!!! # Prior warning: I was trying to program this to put on my calculator for the maths test on Friday 2022/01/21. # It is all hastily hacked together,...
Heliodex/PythonCalculators
vatRemover.py
# Heliodex 2020/10/08 # Last edited 2021/12/03 -- new program style # first program i wrote during maths class lmao print("Calculates original price based off current price and discount") while True: print(" ") c = input("1 for add, 2 for subtract ") if (c == "1"): val = float(input("Current value...
Heliodex/PythonCalculators
average.py
<gh_stars>0 # Heliodex 2021/08/24 # Last edited 2021/12/01 -- new program style print("Averages 2 numbers") while True: a = float(input("Number 1? ")) b = float(input("Number 2? ")) print("Average:") print((a+b)/2) print(" ")
Heliodex/PythonCalculators
polygonAngles.py
# Heliodex 2021/10/07 # Last edited 2021/12/01 -- new program style print("Finds internal angles of polygons") while True: a = float(input("Number of sides? ")) # ...float? print(" ") print("Internal angle:") print((180*(a-2))/a) print("Total internal angle:") print(180*(a-2)) print(" ")
Heliodex/PythonCalculators
radiusFromArc.py
# Heliodex 2021/08/23 # Last edited 2022/03/27 -- make the program ACTUALLY WORK from math import pi, radians print("Calculates the length of radius based on arc length") while True: arc = float(input("Arc? ")) deg = float(input("Degrees? ")) f = radians(deg) print(" ") print("Radius:...
averkij/multipunct
prepare_data.py
<filename>prepare_data.py import argparse import logging import os import random import re import string import requests CHARS = ".,?!" def process_sentences( in_file: str, out_file: str, num_samples: int = -1, chars_to_restore: str = ".,!?", percent_to_cut=0.02, num_to_combine: int = 2, ): ...
averkij/multipunct
get_tatoeba.py
<filename>get_tatoeba.py<gh_stars>0 import argparse import logging import os import requests URL = "https://downloads.tatoeba.org/exports/sentences.csv" def maybe_download_file(destination: str): if not os.path.exists(destination): file = requests.get(URL, allow_redirects=True) with open(destina...
OdooTestNet/School-Mangement
model/__init__.py
from.import school from.import funds from.import invo
OdooTestNet/School-Mangement
wizard/__init__.py
<reponame>OdooTestNet/School-Mangement<gh_stars>0 from . import school_event from . import fund_check
OdooTestNet/School-Mangement
reports/__init__.py
# from.import invoice_report
OdooTestNet/School-Mangement
wizard/school_event.py
<filename>wizard/school_event.py from odoo import models, fields class School_events_wiz(models.TransientModel): _name = "school.event.wizard" _description = "Create School Event Wizard" event_name = fields.Many2one("school.name",string='School Name', required=True) appointment_date = fields.Date(str...
OdooTestNet/School-Mangement
model/invo.py
from odoo import api, fields, models from odoo.exceptions import ValidationError class Invoice(models.Model): _name = 'school.invoice' _description="School Invoice Description" _rec_name="school_name" school_name=fields.Many2one('school.name', string='School Name') date=fields.Date("Invoice Da...
OdooTestNet/School-Mangement
__manifest__.py
# -*- coding: utf-8 -*- { 'name' : 'School Event Mangement ', 'version' : '14.0.1.0.0', 'summary': 'School Annual Funtion Organisation ', 'sequence': 20, 'description': """ Organisaiton School Fuction """, 'category': 'Accounting/Accounting', 'depends' : ['board','project','mail','web','web_...
OdooTestNet/School-Mangement
reports/invoice_report.py
from odoo import api, models class InvoiceCardReport(models.AbstractModel): _name = 'report.school.report_invoice_details' _description = 'Invoice Report' @api.model def _get_report_values(self, docids, data=None): docs = self.env['school.invoice'].browse(docids[0]) appointments = sel...
OdooTestNet/School-Mangement
model/school.py
<reponame>OdooTestNet/School-Mangement from odoo import api, fields, models from odoo.exceptions import ValidationError from odoo.tools import format_time from datetime import date, datetime, timedelta, time from time import time import datetime import time import calendar import logging _logger=logging.getLogger(__na...
OdooTestNet/School-Mangement
wizard/fund_check.py
<reponame>OdooTestNet/School-Mangement from odoo import models, fields import logging _logger=logging.getLogger(__name__) class confirm_wizard(models.TransientModel): _name = 'school.fund.wizard' _description = "Funds Validate for use" event_name = fields.Many2one("school.name",string='School Name', ...
OdooTestNet/School-Mangement
__init__.py
from.import model from.import wizard from.import reports
OdooTestNet/School-Mangement
model/funds.py
<gh_stars>0 from odoo import api, fields, models class Funds(models.Model): _name = 'school.funds' _rec_name="school_name" school_name=fields.Many2one('school.name', string='School Name') fund_id = fields.Integer(string='Amount Collection',related='school_name.school_goal_amount',tracking=True) as...
milnner/gere
gere/auth.py
<gh_stars>0 import jwt from functools import wraps from flask import request, jsonify from main import ( app ) def authorization(func): @wraps(func) def wrap(): try: token = request.json['token'] payload = jwt.decode(token, app.config['SECRET KEY'], ...
milnner/gere
gere/validations.py
<filename>gere/validations.py import re import datetime import jwt from flask import request from main import app from main import ( maximum_age, minimum_age, ) from models import User, db def validate_phonenumber_and_email_in_db(email, phonenumber): email_exists = db.session.query(User).filter_b...
milnner/gere
gere/methods.py
import smtplib from pathlib import Path from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from main import email_and_pass def send_token_to_email(uri, email_to): html = '' with open(Path('gere/template_emails/verification_email.html').absolute(), encoding='utf-8') a...
milnner/gere
gere/main.py
<reponame>milnner/gere import json from pathlib import Path from flask import Flask from flask_sqlalchemy import SQLAlchemy #url url = '127.0.0.1:5000' #use in validation age minimum_age = (1, 1, 2015) maximum_age = (1, 1, 1950) app = Flask(__name__) #keys app.config['SECRET KEY'] = 'key' key_to_verify_email = 'ke...
milnner/gere
gere/routes.py
<filename>gere/routes.py import jwt import datetime as dt import validations import methods import auth from pathlib import Path from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from flask import request, jsonify from main import ( app, key_to_verify_email, url ) from models imp...
milnner/gere
gere/models.py
import bcrypt from sqlalchemy import (String, DateTime, Integer, Column, ForeignKey) from sqlalchemy.dialects.postgresql import JSONB, BYTEA from main import db from datetime import datetime class User(db.Model): __tablename__ = 'users' id = Column(Integer, primary_key=True, autoincrem...
moki/aoc2015
day/day_02/solution.py
<reponame>moki/aoc2015 from functools import reduce def part_1(input): lines = input.split("\n") paper = 0 for line in lines: if len(line) == 0: continue ds = list(map(lambda d: int(d), line.split("x"))) sides = [ds[0] * ds[1], ds[1] * ds[2], ds[0] * ds[2]] ...
moki/aoc2015
day/day_05/solution.py
def count_vowel(line): return len([c for c in line if c in "aeiou"]) def is_vowelly(line): return count_vowel(line) > 2 def is_doublly(line): return len( [line[i] for i in range(len(line) - 1) if line[i] == line[i + 1]]) def is_valid(line): return not sum(c in line for c in ['ab', 'cd', 'p...
moki/aoc2015
day/day_06/solution.py
<reponame>moki/aoc2015 M = 1000 N = 1000 def grid_pretty_print(grid): print() print("{: >3}".format(""), end="") for j, c in enumerate(grid[0]): print("{: >3}".format(j), end="") print("\n") for i, row in enumerate(grid): print("{: >3}".format(i), end="") for j, col in ...
moki/aoc2015
day/day_01/solution.py
<reponame>moki/aoc2015 def part_1(input): floor = 0 for c in input: floor += 1 if c == '(' else -1 if c == ')' else 0 return floor def part_2(input): counter = 0 floor = 0 for c in input: counter = counter + 1 floor += 1 if c == '(' else -1 if c == ')' else 0 ...
moki/aoc2015
day/day_03/solution.py
<filename>day/day_03/solution.py def _hash(x, y): return hash(str(x) + "," + str(y)) def part_1(input): x, y = 0, 0 move_map = {"^": (0, 1), ">": (1, 0), "<": (-1, 0), "v": (0, -1)} house_map = dict() house_map[_hash(x, y)] = 1 for c in input: _x, _y = move_map.get(c, (0, 0)) ...
moki/aoc2015
day/day_04/solution.py
from hashlib import md5 from itertools import count def part_1(input, zeroes=5): input = input.strip() target = "0" * zeroes for i in count(0): s = input + str(i) hash = md5(s.encode("utf-8")).hexdigest() if hash[0:zeroes] == target: return i return 0 def part...
moki/aoc2015
main.py
<reponame>moki/aoc2015 import unittest import os from day.day_01.solution import part_1 as day_1_part_1, part_2 as day_1_part_2 from day.day_02.solution import part_1 as day_2_part_1, part_2 as day_2_part_2 from day.day_03.solution import part_1 as day_3_part_1, part_2 as day_3_part_2 from day.day_04.solution import p...
layday/build
src/build/env.py
""" Creates and manages isolated build environments. """ import abc import os import platform import shutil import subprocess import sys import sysconfig import tempfile from types import TracebackType from typing import Iterable, Optional, Tuple, Type from ._compat import abstractproperty, add_metaclass try: imp...
layday/build
tests/test_main.py
<filename>tests/test_main.py # SPDX-License-Identifier: MIT import contextlib import io import os import sys import pytest import build import build.__main__ if sys.version_info >= (3,): # pragma: no cover build_open_owner = 'builtins' else: # pragma: no cover build_open_owner = 'build' cwd = os.getcwd(...
layday/build
tests/test_env.py
<gh_stars>0 # SPDX-License-Identifier: MIT import json import os import platform import shutil import subprocess import sys import pytest import build.env @pytest.mark.isolated def test_isolation(): subprocess.check_call([sys.executable, '-c', 'import build.env']) with build.env.IsolatedEnvBuilder() as env:...
jvanvalkenburgh/md_server
mdserver/dnsmasq.py
# # Copyright 2020 Australian National University # # Please see the LICENSE.txt file for details. import os import shutil from pathlib import Path config_template = """ ## WARNING: THIS IS AN AUTO-GENERATED FILE. MANUAL CHANGES WILL BE ## OVERWRITTEN. # # This file is managed by mdserver - changes should be made th...
jvanvalkenburgh/md_server
mdserver/libvirt.py
<reponame>jvanvalkenburgh/md_server # # libvirt.py: extract data from libvirt and libvirt domain XML # # Copyright 2020 Australian National University # # Please see the LICENSE.txt file for details. import xmltodict from mdserver.database import Database def get_domain_data(domain, net): """Extract key data fro...
jvanvalkenburgh/md_server
setup.py
<reponame>jvanvalkenburgh/md_server<gh_stars>10-100 from setuptools import find_packages from setuptools import setup setup(name='mdserver', description='Simple metadata server', version='0.6.0', url='https://github.com/sjjf/md_server', author='<NAME>', author_email='<EMAIL>', lice...
jvanvalkenburgh/md_server
mdserver/database.py
<filename>mdserver/database.py # # mdserver/database.py: a simple single-file database of domain information # used to manage data for the md_server system. # # Data is stored on disk in a simple JSON format, with data being stored as a # list of JSON objects, each specifying domain information. In memory the data # is...
jvanvalkenburgh/md_server
tests.py
<reponame>jvanvalkenburgh/md_server # /usr/bin/env python import unittest from mdserver.database import Database from mdserver.libvirt import get_domain_data from unittest.mock import patch # Note: this is /not/ a usable domain definition! domxml = """ <domain type='kvm' id='7'> <name>test</name> <uuid>aecb25c7...
HarryGuerrilla/keyforge_deck_insert
bootstrap.py
import urllib.request import os from PIL import Image icons = { 'brobnar': 'https://cdn.keyforgegame.com/media/houses/Brobnar.png', 'dis': 'https://cdn.keyforgegame.com/media/houses/Dis.png', 'logos': 'https://cdn.keyforgegame.com/media/houses/Logos.png', 'mars': 'https://cdn.keyforgegame.com/media/hou...
HarryGuerrilla/keyforge_deck_insert
generate_insert.py
<filename>generate_insert.py import requests import time from datetime import date import json import os import sys import getopt from include.read_csv import decks from reportlab.pdfgen import canvas from reportlab.lib.colors import white, black from reportlab.lib.pagesizes import letter, legal, A4 from reportlab.lib....
HarryGuerrilla/keyforge_deck_insert
include/read_csv.py
<reponame>HarryGuerrilla/keyforge_deck_insert import pandas as pd import os import glob def get_newest_file(dir): list_of_files = glob.iglob(dir) filename = max(list_of_files, key=os.path.getmtime) return filename def cards(cards_f): if cards_file == '': cards_file = get_newest_file(os.path.jo...
vira0223/extract_files
app/extract_files.py
import sys, os, re, shutil from os.path import join import argparse class ExtractFiles: LAST_MONTH_FILE_NAME = ".last_month" def get_args(self): parser = argparse.ArgumentParser() parser.add_argument("copyto", help = "directory path of copy to", type = str) parser.add_argument("--all",...
osam7a/Jarvide-1
src/cogs/misc.py
import disnake, aiohttp, random from disnake.ext import commands # Misc cog class Misc(commands.Cog): """ Misc cog for randomly assorted commands that don't fall into any specific category. """ def __init__(self, bot: commands.Bot) -> None: self.bot = bot async def overlay(ctx: ...
NickNaso/kerberos
binding.gyp
<filename>binding.gyp { 'targets': [ { 'target_name': 'kerberos', 'include_dirs': [ '<!(node -e "require(\'nan\')")' ], 'conditions': [ ['OS=="mac" or OS=="linux"', { 'sources': [ 'src/base64.cc', 'src/kerberos.cc', 'src/kerberos_client.cc', ...
shnhrtkyk/satellite-super-resolution
dataset.py
import torch.utils.data as data import torch import numpy as np import os from os import listdir from os.path import join from PIL import Image, ImageOps import random from random import randrange def is_image_file(filename): return any(filename.endswith(extension) for extension in [".png", ".jpg", ".jpeg", ".tif"...
shnhrtkyk/satellite-super-resolution
eval.py
from __future__ import print_function import argparse import os import torch import torch.nn as nn import torch.optim as optim from torch.autograd import Variable from torch.utils.data import DataLoader from dbpn import Net as DBPN from dbpn_v1 import Net as DBPNLL from dbpn_iterative import Net as DBPNITER from data ...