repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
zf020114/CHPDet | src/DOTA_devkit/datapipeline_Visualization.py | import mmcv
import numpy as np
from mmcv import Config
import cv2
from mmdet.datasets import build_dataloader, build_dataset
import numpy as np
import matplotlib.pyplot as plt
import os
from DOTA import DOTA
import dota_utils as util
import pylab
pylab.rcParams['figure.figsize'] = (10.0, 10.0)
import math
from matplotl... |
zf020114/CHPDet | src/compute_angle_acc_rate.py | <filename>src/compute_angle_acc_rate.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 15 15:39:49 2020
@author: zf
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
import os, sys
import cv2
import numpy as np
import shutil
import s... |
zf020114/CHPDet | src/lib/models/networks/orn/demo.py | <filename>src/lib/models/networks/orn/demo.py
import torch
import math
import numbers
import random
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import Dataset
from PIL import Image, ImageOps
from tqdm import tqdm
from torchvision... |
zf020114/CHPDet | src/DOTA_devkit/HRSC2DOTA.py | <reponame>zf020114/CHPDet<filename>src/DOTA_devkit/HRSC2DOTA.py
import json
import os
import os.path as osp
import numpy as np
import xmltodict
from dota_poly2rbox import rbox2poly_single
def parse_ann_info(objects):
bboxes, labels, bboxes_ignore, labels_ignore = [], [], [], []
# only one annotation
if t... |
zf020114/CHPDet | src/eval_xml.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 15 23:00:51 2020
@author: zf
"""
# import pycocotools.coco as coco
# from pycocotools.coco import COCO
import os
import shutil
from tqdm import tqdm
import skimage.io as io
import matplotlib.pyplot as plt
import cv2
from PIL import Image, ImageDra... |
zf020114/CHPDet | src/inference.py | <filename>src/inference.py
import sys
sys.path.insert(0, '/home/zf/CenterNet')
from lib.detectors.detector_factory import detector_factory
from opts import opts
import glob
import numpy as np
from utils.post_process import multi_pose_post_process
try:
from external.nms import soft_nms_39
except:
print('NMS not impo... |
zf020114/CHPDet | src/5eval_json.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 15 23:00:51 2020
@author: zf
"""
# import pycocotools.coco as coco
from pycocotools.coco import COCO
import os
import shutil
from tqdm import tqdm
import skimage.io as io
import matplotlib.pyplot as plt
import cv2
from PIL import Image, ImageDraw
im... |
zf020114/CHPDet | src/eval_json_CenR.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 15 23:00:51 2020
@author: zf
"""
# import pycocotools.coco as coco
from pycocotools.coco import COCO
import os
import shutil
from tqdm import tqdm
import skimage.io as io
import matplotlib.pyplot as plt
import cv2
from PIL import Image, ImageDraw
im... |
grafixoner/ownphotos | api/autoalbum.py | from api.models import Photo
from api.models import Person
from api.models import AlbumAuto
from api.models import LongRunningJob
from datetime import datetime, timedelta
from itertools import groupby
import os
import shutil
import numpy as np
import ipdb
from django_rq import job
from tqdm import tqdm
import rq
f... |
GusSMoraes/shopee-case-study | casestudy.py | """
Sales Management
Author: <NAME>
License: MIT
Status: 0.0.1
"""
import os
os.system("cls")
class colors:
GREEN = '\033[0;32m'
RED = '\033[0;31m'
BLUE = '\033[0;36m'
END = '\033[m'
# Add a sale
def add(list, sellers):
global id
id += 1
sales = {
"ID"... |
hetdev/hackerrank-solutions | py_set_difference_operation.py | <reponame>hetdev/hackerrank-solutions<gh_stars>0
n_1, students_list_1 = input(), list(input().split(" "))
n_2, students_list_2 = input(), list(input().split(" "))
answer_list = list(map(lambda s: s not in students_list_2, students_list_1))
print(sum(answer_list))
|
hetdev/hackerrank-solutions | any_or_all.py | n, n_list = list(input()), list(input().split(" "))
n_positive = (all(list(map(lambda v: False if int(v) < 0 else True, n_list)))) and (
any(list(map(lambda v: True if v == v[::-1] else False, n_list)))
)
print(n_positive)
|
hetdev/hackerrank-solutions | ginorts.py | n = list(input())
lowers = []
uppers = []
nums_odd = []
nums_even = []
nums_zeros = []
for word in n:
if word.islower():
lowers.append(word)
elif word.isupper():
uppers.append(word)
else:
if int(word) % 2 == 0:
nums_even.append(str(word))
elif int(word) == 0:
... |
hetdev/hackerrank-solutions | py_introduction_to_sets.py | <filename>py_introduction_to_sets.py
def average(array):
# your code goes here
set_a = set(array)
return sum(set_a) / len(set_a)
|
hetdev/hackerrank-solutions | itertools_permutations.py | from itertools import permutations
inputt = input().split()
for prod in sorted(list(permutations(inputt[0], int(inputt[1])))):
print("".join(prod))
|
hetdev/hackerrank-solutions | itertools_combinations_with_replacement.py | <reponame>hetdev/hackerrank-solutions<gh_stars>0
from itertools import combinations, combinations_with_replacement
word, size = input().split()
words_list = list(combinations_with_replacement(sorted(word), int(size)))
for word_l in words_list:
print("".join(word_l))
|
hetdev/hackerrank-solutions | py_check_strict_superset.py | set_a = set(input().split())
num_sets = int(input())
i = 0
resp = []
while i < num_sets:
set_b = set(input().split())
resp.append(
len(set_b.intersection(set_a)) == len(set_b) and len(set_a) > len(set_b)
)
i += 1
print(all(resp))
|
hetdev/hackerrank-solutions | py_check_subset.py | <gh_stars>0
num_cases = int(input())
i = 0
while i < num_cases:
num_set_a = int(input())
set_a = set(input().split())
# print(set_a)
num_set_b = int(input())
set_b = set(input().split())
print(len(set_a.intersection(set_b)) == num_set_a)
i += 1
|
hetdev/hackerrank-solutions | itertools_product.py | <gh_stars>0
from itertools import product
a = [int(i) for i in (input().split())]
b = [int(i) for i in (input().split())]
srt = ""
for prod in tuple(product(a, b)):
srt += f"{prod} "
print(srt)
|
hetdev/hackerrank-solutions | py_set_symmetric_difference.py | n_1, students_list_1 = input(), set(input().split(" "))
n_2, students_list_2 = input(), set(input().split(" "))
print(len(students_list_1.symmetric_difference(students_list_2)))
|
ShayanRiyaz/BitUGrading | Teacher/DigitalHistory/Assignments_To_Be_Graded/123456789/Week_Two/Now_Try_This/5.py | # Please note that if you uncomment and press multiple times, the program will keep appending to the file.
def cap_four(name):
new_name = name[0].upper() + name[1:3] + name[3].upper() + name[4:]
return new_name
# Check
answer = cap_four('macdonald')
print(answer) |
ShayanRiyaz/BitUGrading | Teacher/BitGrading.py | <reponame>ShayanRiyaz/BitUGrading<gh_stars>0
import numpy as np
import pandas as pd
import os
import shutil
import ast
import subprocess
def get_student_ids(move_dir,change_dir = True):
'''
This function will read inside the provided move_dir directory and will list out all the folders inside.
We are as... |
ShayanRiyaz/BitUGrading | Teacher/DigitalHistory/Assignments_To_Be_Graded/123456789/Week_Two/Now_Try_This/3.py | <filename>Teacher/DigitalHistory/Assignments_To_Be_Graded/123456789/Week_Two/Now_Try_This/3.py
# Please note that if you uncomment and press multiple times, the program will keep appending to the file.
t = (1,2,3) # An example
print(type(t)) |
ShayanRiyaz/BitUGrading | Teacher/DigitalHistory/Assignments_To_Be_Graded/123456789/Week_Two/Now_Try_This/2.py | <filename>Teacher/DigitalHistory/Assignments_To_Be_Graded/123456789/Week_Two/Now_Try_This/2.py<gh_stars>0
# Please note that if you uncomment and press multiple times, the program will keep appending to the file.
answer1 = [0]*3
print(answer1)# Please note that if you uncomment and press multiple times, the program wi... |
ShayanRiyaz/BitUGrading | Teacher/DigitalHistory/Assignments_To_Be_Graded/123456789/Week_Two/Now_Try_This/6.py | # Please note that if you uncomment and press multiple times, the program will keep appending to the file.
x = 5
y = 0
try:
z = x/y
except ZeroDivisionError:
print("Can't divide by Zero!")
finally:
print('All Done!') |
ShayanRiyaz/BitUGrading | Teacher/DigitalHistory/Assignments_To_Be_Graded/016993270/Week_Two/Now_Try_This/1.py | # Please note that if you uncomment and press multiple times, the program will keep appending to the file.
s = 'Amsterdam'
# Print out 'e' using indexing
answer1 = s[2]
print(answer1)# Please note that if you uncomment and press multiple times, the program will keep appending to the file.
s ='Amsterdam'
# Reverse the... |
ShayanRiyaz/BitUGrading | Teacher/DigitalHistory/Assignments_To_Be_Graded/123456789/Week_Two/Now_Try_This/4.py | # Please note that if you uncomment and press multiple times, the program will keep appending to the file.
d = {'simple_key':'hello'}
answer1 = d['simple_key']
print(answer1)# Please note that if you uncomment and press multiple times, the program will keep appending to the file.
d = {'k1':{'k2':'hello'}}
answer2 =... |
ShayanRiyaz/BitUGrading | Teacher/BitGrader.py | <reponame>ShayanRiyaz/BitUGrading<filename>Teacher/BitGrader.py
import BitGrading
import pandas as pd
import numpy as np
import os
import ast
import shutil
import subprocess
grading_done = False
initialize = False
DIRECTORY = 'DigitalHistory/Assignments_To_Be_Graded'
while not grading_done:
while not initialize... |
PhilMcDaniel/python-crash-course | 2_variables_and_data_types.py | #simple print with var
message = "hello world!"
print(message)
#print same after changing var
message = "hola globa"
print(message)
#string manip and formatting
name = "<NAME>"
print(name.title())
print(name.upper())
print(name.lower())
first_name = "john"
last_name = "doe"
full_name = f"{first_name} {last_name}"
p... |
PhilMcDaniel/python-crash-course | 8_pizza.py | def make_pizza(size,*toppings):
"""summarize the pizza"""
print(f"\nMaking a {size}-inch pizza with the following toppings")
for topping in toppings:
print(f" - {topping}") |
PhilMcDaniel/python-crash-course | 5_if_statements.py | <reponame>PhilMcDaniel/python-crash-course
cars = ["audi","bmw","subaru","toyota"]
print(cars)
for car in cars:
if car == "bmw":
print(car.upper())
else:
print(car.title())
#set value
car = 'bmw'
#compare value
car =='bmw'
print(car == 'bmw')
#equality check is case-sensitive
car = 'Audi'
print(car =='audi')
... |
PhilMcDaniel/python-crash-course | 4_working_with_lists.py | <gh_stars>0
magicians = ['alice','david','carolina']
#print each entry in list
for magician in magicians:
print(magician)
#for loop with formatted text
for magician in magicians:
print(f"{magician.title()}, that was a great trick!")
print(f"I can't wait to see your next trick, {magician.title()}.\n")
print("Thank y... |
PhilMcDaniel/python-crash-course | 3_lists.py | #list ex
bikes = ['trek','giant','cannondale','redline']
print (bikes)
#print first value in list
print(bikes[0])
print(bikes[0].title())
print(bikes[1])
print(bikes[3])
#-1 position is last, -2 second from last
print(bikes[-1])
print(bikes[-2])
#formatted example
print(f"My first bike was a {bikes[0].title()}.")
... |
PhilMcDaniel/python-crash-course | 7_user_input_and_while_loops.py | <reponame>PhilMcDaniel/python-crash-course
# input() has a single prompt parameter. Pauses execution and waits for input
message = input("Tell me something about yourself and I will tell it back to you")
print(message)
name = input("Please enter your name: ")
print(f"\nHello, {name}")
# multi-line prompt
prompt = "If... |
PhilMcDaniel/python-crash-course | 9_classes.py | <gh_stars>0
#capital for classes
#function inside a class is called a method
#class is set of instructions to call a specific instance
class Dog:
"""A simple attempt to model a dog"""
#__init__ is special method that python runs automatically when we create new instance of class
#self is needed and mus... |
PhilMcDaniel/python-crash-course | 6_dictionaries.py | #dictionary is group of key-value pairs
alien_0 = {'color':'green','points':'5'}
print(alien_0['color'])
print(alien_0['points'])
new_points = alien_0['points']
print(f"You just earned {new_points} points.")
#adding values to dictionary
alien_0['x_position'] = 0
alien_0['y_position'] = 25
print(alien_0)
#start ... |
PhilMcDaniel/python-crash-course | 10_files_and_exceptions.py | <filename>10_files_and_exceptions.py
with open('10_pi_digits.txt') as file_object:
contents = file_object.read()
print(contents)
#reading file like this ends up with extra blank string at end of file
print(contents.rstrip())
#read line by line
file_name = '10_pi_digits.txt'
with open(file_name) as file:
for li... |
PhilMcDaniel/python-crash-course | 8_functions.py | #simple example
def greet_user():
#docstring for automating documentation. Triple quotes
"""Display a simple greeting."""
print("Hello!")
greet_user()
#pass information to function
def greet_user(username):
#docstring for automating documentation. Triple quotes
"""Display a simple greeting."""
... |
ParkvilleData/MetaGenePipe | scripts/query_ena.py | import json
import pandas as pd
import os
import urllib.request
from bs4 import BeautifulSoup
import argparse
import sys
import logging
parser = argparse.ArgumentParser(description='A script to query the European Nucleotide Archive (ENA) website to create a CSV file with information for each read sequence file.')
par... |
ParkvilleData/MetaGenePipe | scripts/xml_parser-v4.py | import xml.etree.ElementTree as ET
import sys
import re
import argparse
import pandas as pd
import shelve
parser = argparse.ArgumentParser()
parser.add_argument('xmls', help="The XML files to search for the hits.", nargs='+')
parser.add_argument('--outfile', help="The name of the output file. Default: OTU.tsv", defau... |
ParkvilleData/MetaGenePipe | scripts/inputArgMaker.v.1.0.3.py | <reponame>ParkvilleData/MetaGenePipe<gh_stars>0
# -*- coding: utf-8 -*-
""" inputMaker.py
05/03/2020 - <NAME>, <NAME>
Description:
This script will take in a number of parameters and will create an
input file that can be used for the HPGAP WDL workflow
Example:
$ python ./scripts/inputMaker.py -f f... |
ParkvilleData/MetaGenePipe | setup.py | ############### download metagenepipe databases ######################
# -*- coding: utf-8 -*-
""" download_databases.py
Description:
Download hmmer, blast and swissprot databases
Requirements:
Args:
packages:
os
sys
pathlib
usage:
python download_databases.py --blast mito --hmmer_... |
ParkvilleData/MetaGenePipe | scripts/xml_parser-v3.py | <reponame>ParkvilleData/MetaGenePipe<filename>scripts/xml_parser-v3.py
import xml.etree.ElementTree as ET
import sys
import json
import re
import argparse
import pandas as pd
def search( node, query, parent_lineage=[] ):
code = node["name"].split()[0]
# Append this node to the lineage
my_linage = list(parent_line... |
ParkvilleData/MetaGenePipe | scripts/inputMaker.py | # -*- coding: utf-8 -*-
""" inputMaker.py
05/03/2020 - <NAME>, <NAME>
Description:
This script will take in a number of parameters and will create an
input file that can be used for the HPGAP WDL workflow
Example:
$ python ./scripts/inputMaker.py -f fasta -d /data/cephfs/punim1165/bshaban/hpgap_dev... |
ParkvilleData/MetaGenePipe | scripts/rerunTaxon.py | import paramiko
import pysftp
from pathlib import Path
from base64 import decodebytes
from .mediaflux import get_asset_content
from .mma import get_upload_success
from .paths import get_output_dir_name
from .mfclient import mfclient
import xml_parser-v4
parser = argparse.ArgumentParser()
parser.add_argument('xmls', ... |
ParkvilleData/MetaGenePipe | scripts/download_ena.py | <reponame>ParkvilleData/MetaGenePipe
#!/usr/bin/env python3
import pandas as pd
import argparse
from pathlib import Path
import hashlib
import os
import numpy as np
import multiprocessing
def str2bool(v):
"""
Converts a string to a boolean value for parsing in argparse.
From https://stackoverflow.com/a/4... |
ParkvilleData/MetaGenePipe | scripts/benchmark_assembly.py | <filename>scripts/benchmark_assembly.py<gh_stars>0
#!/usr/bin/env python3
import subprocess
import itertools
import os
assemblers = {
'megahit': "../MEGAHIT-1.2.9-Linux-x86_64-static/bin/megahit",
'metaspades': "../SPAdes-3.14.1-Linux/bin/metaspades.py",
'idba': "idba_ud"
}
def run_benchmark(assembler, r... |
ParkvilleData/MetaGenePipe | scripts/megaGraph.py | import sys
import glob
import os
import argparse
import fnmatch
def main():
parser = argparse.ArgumentParser()
parser.add_argument('-d', '--directory', type=str, required=True,
help='The directory containing megahit contig fasta files')
parser.add_argument('-s', '--sampleName', type=str, help='Sample name for o... |
ParkvilleData/MetaGenePipe | scripts/taxonfile.py | <gh_stars>0
import shelve
import json
with open('/data/gpfs/projects/punim0639/databases/metaGenePipe/taxon/br08610.json') as f:
tax = json.load(f)
def get_lineage(tree, current = []):
if "children" in tree:
for child in tree["children"]:
if isinstance(child, dict):
yield from... |
ParkvilleData/MetaGenePipe | scripts/hmm_parser-v1.py | #!/usr/bin/env python
from collections import defaultdict
import pandas as pd
import numpy as np
import sys
import pprint
from Bio import SearchIO
import argparse
def hmmer_to_df(hmmTbl, only_top_hit=False):
"""
Takes a table from HMMER 3 and converts it to a Pandas Dataframe
Adapted from https://stackoverflow.c... |
jbaugh/pixel-palette | parse.py | import os, sys
from PIL import Image
import numpy
# Converts a number to a 'hex chunk' which is a 0 padded hex nunber as a string
def hex_chunk(num):
s = str(hex(num)).replace('0x', '')
if len(s) == 1:
s = '0' + s
return s
# Converts a pixel: (r, g, b, a) to a hexcode: rrggbbaa
def pixel_to_rgba(pixel):
r... |
musabalfarizi/Application-Python-Flask | app/tests.py | <reponame>musabalfarizi/Application-Python-Flask<filename>app/tests.py<gh_stars>1-10
# tests.py
import flask_testing
import unittest
from flask import Flask
from flask_testing import TestCase
from app import create_app, db
from app.models import Employee
class TestBase(TestCase):
def create_app(self):
... |
Abhi-thecoder/Split-Load-System | services/recvFile.py | <reponame>Abhi-thecoder/Split-Load-System
import os
import logging
import enlighten
SEPARATOR = "<SEPARATOR>"
BUFFER_SIZE = 655350
FORMAT = '[%(asctime)-15s] {%(filename)s} {%(funcName)s} {%(lineno)d} %(message)s'
logging.basicConfig(format=FORMAT, level=logging.WARNING)
def recvFile(args):
# logging.warning("Sta... |
Abhi-thecoder/Split-Load-System | Test Scripts/SDL-1.6/SDL-1.6-test Script.py | <reponame>Abhi-thecoder/Split-Load-System<filename>Test Scripts/SDL-1.6/SDL-1.6-test Script.py
import requests
import socket
import os
import sys
import json
sys.path.append('../../')
from services.getFileDetails import getFileDetails
class MSG:
master = None
msg = None
data = None
def __in... |
Abhi-thecoder/Split-Load-System | services/recvFile - Copy.py | <reponame>Abhi-thecoder/Split-Load-System<filename>services/recvFile - Copy.py
import os
import logging
SEPARATOR = "<SEPARATOR>"
BUFFER_SIZE = 655350
FORMAT = '[%(asctime)-15s] {%(filename)s} {%(funcName)s} {%(lineno)d} %(message)s'
logging.basicConfig(format=FORMAT, level=logging.WARNING)
def recvFile(args):
# ... |
Abhi-thecoder/Split-Load-System | ui/ds2.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ds2.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Fo... |
Abhi-thecoder/Split-Load-System | Test Scripts/MPF-1.11/MPF-1.10 Test Script.py | <reponame>Abhi-thecoder/Split-Load-System<gh_stars>1-10
import requests
import socket
import os
import sys
import json
sys.path.append('../../')
from services.merge import merge
class MSG:
master = None
msg = None
data = None
def __init__(self, data, msg="", master=False):
self.mas... |
Abhi-thecoder/Split-Load-System | Test Scripts/SFP-1.10/tcps.py | <filename>Test Scripts/SFP-1.10/tcps.py
import socket
import sys
import os
import tqdm
SERVER_HOST = "0.0.0.0"
SERVER_PORT = 5001
BUFFER_SIZE = 4096
SEPARATOR = "<SEPARATOR>"
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((SERVER_HOST, SERVER_PORT))
s.listen(5)
print(f"[*] Listening as {SERVER_... |
Abhi-thecoder/Split-Load-System | ui/ds5.py | <filename>ui/ds5.py
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ds5.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Fo... |
Abhi-thecoder/Split-Load-System | services/merge.py | <reponame>Abhi-thecoder/Split-Load-System
import os
def merge(distributionMsg):
fileString = ''
filenameWithExt = distributionMsg.data['filenameWithExt']
filename = filenameWithExt.split('.')[0]
for segment in distributionMsg.data['clientIpSegmentMap'].values():
fileString = fileString + filename ... |
Abhi-thecoder/Split-Load-System | services/divideFile.py | import requests
import re
import logging
FORMAT = '[%(asctime)-15s] {%(filename)s} {%(funcName)s} {%(lineno)d} %(message)s'
logging.basicConfig(format=FORMAT, level=logging.WARNING)
def divideFile(url, clientList):
#clientList = ['192.168.1.1', '192.168.1.2', '192.168.1.3','192.168.3.11']
#url = 'http://release... |
Abhi-thecoder/Split-Load-System | services/startDownload.py | <reponame>Abhi-thecoder/Split-Load-System
import os
import logging
import time
def startDownload(segment, fileLink, filenameWithExt):
# url = fileLink.split('/')
fileName = filenameWithExt.split('.')[0] + str(segment) + '.spld'
os.system('curl -s -L -o ' + '"' + fileName + '"' +' --range ' + segment + ' '... |
Abhi-thecoder/Split-Load-System | services/portServices.py |
import socket
import struct,json
def get_free_tcp_port():
tcp = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
tcp.bind(('', 0))
addr, port = tcp.getsockname()
tcp.close()
return port |
Abhi-thecoder/Split-Load-System | Test Scripts/RCN-1.5/RCN-1.5 Test Script.py | <gh_stars>1-10
import requests
import socket
import os
import sys
sys.path.append('../../')
from services.divideFile import divideFile
EXPECTED_SEGMENT = "0-323892"
EXPECTED_NAME = "ChromeSetup.exe"
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("8.8.8.8", 80))
clientList = [s.getsock... |
Abhi-thecoder/Split-Load-System | ui/ds.py | import ds1,ds1,ds3
from PyQt5 import QtCore, QtGui, QtWidgets
ui1 = "abc"
ui2="abc"
ui3="abc"
def abc():
ui1.label.setText("abc")
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
Form = QtWidgets.QWidget()
ui1 = ds1.Ui_Form()
ui1.setupUi(Form)
ui1.Master.clicked.conn... |
Abhi-thecoder/Split-Load-System | ui/ds3.py | <reponame>Abhi-thecoder/Split-Load-System<gh_stars>1-10
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ds3.ui'
#
# Created by: PyQt5 UI code generator 5.13.0
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
... |
Abhi-thecoder/Split-Load-System | Test Scripts/FPS-1.12/FPS-1.12-TestScript.py | <reponame>Abhi-thecoder/Split-Load-System
import requests
import socket
import os
import sys
import json
sys.path.append('../../')
from services.portServices import get_free_tcp_port
response = get_free_tcp_port()
if(response<=65536):
print("Test Passed! Port: "+str(response))
else:
print("Tes... |
Abhi-thecoder/Split-Load-System | Test Scripts/DFP-1.9/DFP-1.9-Test Script.py | import requests
import socket
import os
import sys
import json
sys.path.append('../../')
from services.startDownload import startDownload
EXPECTED_SIZE = 323893
EXPECTED_NAME = "ChromeSetup0-323892.spld"
SEGMENT = "0-323892"
FILENAME_EXT="ChromeSetup.exe"
url = 'https://dl.google.com/tag/s/appguid%3D... |
Abhi-thecoder/Split-Load-System | services/sendFile.py | import os
import logging
from time import sleep
from alive_progress import alive_bar
import enlighten
BUFFER_SIZE = 655350
SEPARATOR = "<SEPARATOR>"
FORMAT = '[%(asctime)-15s] {%(filename)s} {%(funcName)s} {%(lineno)d} %(message)s'
logging.basicConfig(format=FORMAT, level=logging.WARNING)
def sendFile(args):
# lo... |
Abhi-thecoder/Split-Load-System | ui/ds1.py | <gh_stars>1-10
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ds1.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.se... |
Abhi-thecoder/Split-Load-System | ui/ds4.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ds4.ui'
#
# Created by: PyQt5 UI code generator 5.14.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Fo... |
Abhi-thecoder/Split-Load-System | Test Scripts/CTM-1.4/tcpc.py | <filename>Test Scripts/CTM-1.4/tcpc.py
import socket
import sys
import os
import tqdm
SEPARATOR = "<SEPARATOR>"
BUFFER_SIZE = 4096
host = "192.168.43.78"
port = 5001
filename = "Dynamic Prog.pdf"
filesize = os.path.getsize(filename)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
print(f"[+] Connecti... |
Abhi-thecoder/Split-Load-System | SplitLoad.py | import threading
import time
import socket
import struct
import json
import sys
from services.portServices import get_free_tcp_port
from services.divideFile import divideFile
from services.startDownload import startDownload
from services.getOwnIp import getOwnIp
from services.sendFile import sendFile
from services.recv... |
Abhi-thecoder/Split-Load-System | services/getFileDetails.py | import logging
FORMAT = '[%(asctime)-15s] {%(filename)s} {%(funcName)s} {%(lineno)d} %(message)s'
logging.basicConfig(format=FORMAT, level=logging.WARNING)
def getFileDetails(OWNIP,distributionMsg,socket,flag=True):
laddr= socket.getsockname()[0]
raddr = socket.getpeername()[0]
if flag:
addr = laddr if laddr!=OW... |
Kolyamba-mamba/technology-partner-search-module | modules/helpers/dbHelper.py | import psycopg2
def create_connection(db_name, db_user, db_password, db_host, db_port):
connection = None
try:
connection = psycopg2.connect(
database=db_name,
user=db_user,
password=<PASSWORD>,
host=db_host,
port=db_port,
)
p... |
Kolyamba-mamba/technology-partner-search-module | modules/dbActions/insertTables.py | <filename>modules/dbActions/insertTables.py
import os
import sys
sys.path.append(os.path.abspath('../../mySite/mySite'))
from modules.models.patent import Patent
from modules.models.sao import Sao
from modules.helpers.dbHelper import execute_query_with_params
def insert_patent(connection, patent: Patent):
insert_... |
Kolyamba-mamba/technology-partner-search-module | modules/parsers/patentParser.py | <gh_stars>1-10
from bs4 import BeautifulSoup as BS
import uuid
import multiprocessing
import time
import os
import sys
from modules.models.parsedPatent import ParsedPatent
from modules.models.patent import Patent
from modules.helpers.dbHelper import create_connection, create_tables
from modules.dbActions.insertTables i... |
Kolyamba-mamba/technology-partner-search-module | modules/helpers/argParser.py | import argparse
import os
def parse_args(args):
parser = argparse.ArgumentParser(description='Скачиватель патентов')
parser.add_argument('-startDownloader', type=bool, dest='startDownloader',
default=False, help='Запускать ли скачватель патентов')
parser.add_argument('-startUnpacke... |
Kolyamba-mamba/technology-partner-search-module | modules/helpers/main.py | <reponame>Kolyamba-mamba/technology-partner-search-module
import os
import sys
import modules.helpers.argParser as ap
import modules.helpers.patentDownloader as pd
import modules.helpers.unpacker as up
import modules.parsers.patentParser as pp
def main():
args = ap.parse_args(sys.argv[1:])
if not ap.validate... |
Kolyamba-mamba/technology-partner-search-module | modules/models/sao.py | class Sao:
"""Класс sao (Subject-Action-Object)"""
def __init__(self, id, subject, action, obj, patent_id):
self.id = id
self.subject = subject
self.action = action
self.object = obj
self.patent_id = patent_id
|
Kolyamba-mamba/technology-partner-search-module | modules/dbActions/getTables.py | <gh_stars>1-10
import os
import sys
from modules.helpers.dbHelper import execute_select_all_query, get_cursor_query
def get_count_table_rows(connection, table_name):
query = f"SELECT COUNT(*) FROM {table_name}"
count = execute_select_all_query(connection, query)
return count
def get_entities(connection,... |
Kolyamba-mamba/technology-partner-search-module | modules/helpers/saoSelector.py | import stanza
import re
import uuid
from typing import List
import os
import sys
from modules.models.patent import Patent
from modules.models.sao import Sao
from modules.dbActions.getTables import get_entities
from modules.helpers.dbHelper import create_connection
from modules.dbActions.insertTables import insert_sao
f... |
Kolyamba-mamba/technology-partner-search-module | modules/analyzer/psComparator.py | import stanza
import os
import sys
from gensim.models import Word2Vec
from modules.helpers.dbHelper import create_connection
from modules.dbActions.getTables import get_entities_by_condition
from modules.models.sao import Sao
# объединение списков
def merge_list(lst1, lst2):
for i in lst2:
if i not in lst... |
Kolyamba-mamba/technology-partner-search-module | modules/models/parsedPatent.py | class ParsedPatent:
"""Класс патентных данных после парсинга"""
def __init__(self, application_reference, publication_reference, main_classification_type, main_classification,
title, inventors, abstract, description, claims, assignee):
self.application_reference = application_reference... |
Kolyamba-mamba/technology-partner-search-module | modules/helpers/logHelper.py | from typing import List
import os
import sys
from modules.models.sao import Sao
def record_sao_log(patent_number: str, description_text: str, sentences: List[str], saos: List[Sao], filePath: str):
try:
with open(filePath, 'a', encoding="utf-8") as file:
file.write(patent_number + '\n')
... |
Kolyamba-mamba/technology-partner-search-module | mySite/searchPartners/views.py | from django.shortcuts import render
import os
import sys
sys.path.append(os.path.abspath('..'))
from modules.analyzer.psComparator import get_patents
from modules.helpers.dbHelper import create_connection
from modules.dbActions.getTables import get_entities_by_condition
def index(request):
if request.method == "P... |
Kolyamba-mamba/technology-partner-search-module | modules/helpers/unpacker.py | <filename>modules/helpers/unpacker.py
import os
from os import path
import zipfile
def unpacker(input_file, output_path):
try:
fantasy_zip = zipfile.ZipFile(input_file)
fantasy_zip.extractall(output_path)
fantasy_zip.close()
except:
print('Ошибка при распаковке архива')
def m... |
Kolyamba-mamba/technology-partner-search-module | mySite/searchPartners/urls.py | from django.conf.urls import url
from django.urls import path
from . import views
urlpatterns = [
path('patent/<uuid:id>/', views.patent, name='patent'),
url(r'^$', views.index, name='index')
] |
Kolyamba-mamba/technology-partner-search-module | modules/helpers/patentDownloader.py | <filename>modules/helpers/patentDownloader.py
import requests
import os
from bs4 import BeautifulSoup as BS
def urls_saver(args, url):
filename = args.path + 'urls.txt'
for year in range(2010, 2021):
year_url = url + str(year) + "/"
req = requests.get(year_url)
html = BS(req.content, '... |
Kolyamba-mamba/technology-partner-search-module | modules/models/patent.py | <gh_stars>1-10
class Patent:
"""Класс патента"""
def __init__(self, id, publication_reference, main_classification_type, main_classification,
title, inventors, abstract_path, description_path, claims_path, assignee):
self.id = id
self.publication_reference = publication_referen... |
Kolyamba-mamba/technology-partner-search-module | modules/analyzer/w2v_module/word2vec.py | import nltk
import os
import re
from nltk.corpus import stopwords
from gensim.models import Word2Vec
def prepare_dataset(dataset):
stop_words = stopwords.words('english')
# Очистка
print("Привеодим к нижнему регистру")
processed_article = dataset.lower()
print("Удаляем все кроме слов")
process... |
Kolyamba-mamba/technology-partner-search-module | modules/analyzer/save_txt.py | <reponame>Kolyamba-mamba/technology-partner-search-module
import os
import sys
sys.path.append(os.path.abspath('../../mySite/mySite'))
from modules.dbActions.getTables import get_abstract_and_descr_path
from modules.helpers.saoSelector import rem, split_description
def save_text_db_to_txt(con, filename_base = 'C:/Use... |
xtrp/studio-filters | main.py | from PIL import Image, ImageDraw
from flask import Flask, Response
from mss import mss
import face_recognition, cv2, io, numpy
SCREENSHOT_COORDS = (78,0,1200,800)
# map but converts to list
def map_to_list(func, iter_obj):
return list(map(func, iter_obj))
def toBytes(image):
imageByteArr = io.BytesIO()
image.s... |
Mahmoud-Khaled-Nasr/opencv-python-training | assets/classifier.py | <reponame>Mahmoud-Khaled-Nasr/opencv-python-training<gh_stars>1-10
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
__version__ = '1.0.0'
__author__ = '<NAME>'
import os
import cv2
import timeit
import numpy as np
import tensorflow as tf
camera = cv2.VideoC... |
jsirois/pants | src/python/pants/testutil/rule_runner.py | # Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import multiprocessing
import os
from contextlib import contextmanager
from dataclasses import dataclass
from io import StringIO
from pathlib import Pat... |
jsirois/pants | src/python/pants/goal/run_tracker.py | <gh_stars>0
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import annotations
import getpass
import logging
import os
import socket
import sys
import time
import uuid
from collections import OrderedDict
from pathlib im... |
Bonder-liang/007 | test/login.py | num1=10
num2=20
num3=300
num3=30
num4=40
|
sunyymq/crawlers | txsp/encrypt.py | <filename>txsp/encrypt.py
#!/usr/bin/env python
import struct
DELTA = 0x9e3779b9
ROUNDS = 16
SALT_LEN = 2
ZERO_LEN = 7
SEED = 0xdead
def rand():
global SEED
if SEED == 0:
SEED = 123459876
k1 = 0xffffffff & (-2836 * (SEED / 127773))
k2 = 0xffffffff & (16807 * (SEED % 127773))
SEED = 0... |
sunyymq/crawlers | xlkk/kkdl.py | <gh_stars>1-10
#!/usr/bin/env python
from mechanize import Browser
from lxml import etree, html
import hashlib
import os
import re
import random
import sys
import time
USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:33.0) Gecko/20100101 Firefox/33.0'
AGENT_VER = '5050'
def md5(data):
m = hashlib.m... |
sunyymq/crawlers | letv/letv.py | <filename>letv/letv.py
#!/usr/bin/env python
from mechanize import Browser
from lxml import html, etree
import json
import os
import random
import re
import sys
import time
import urllib
import urlparse
USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:33.0) Gecko/20100101 Firefox/33.0'
OSTYPE = 'MacOS... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.