repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
R0htg0r/Microsoft-Windows-ISO | models/openSource/2.0.5/executable.py | <filename>models/openSource/2.0.5/executable.py
from colorama import Fore, Back, Style, init
import os
import time
import random
import requests
class Microsoft():
try:
def __init__(Microsoft_Init):
Microsoft_Address_INI = Microsoft_Init.Microsoft_Informations()
Microsoft_Addre... |
kpalin/pysam | pysam/version.py | # pysam versioning information
__version__ = "0.17.0"
__samtools_version__ = "1.14"
__bcftools_version__ = "1.14"
__htslib_version__ = "1.14"
|
CodeBleu/rabbitmqStats | rabbitmqStats/_config.py | <filename>rabbitmqStats/_config.py<gh_stars>1-10
VERSION = '0.1.2.post1'
|
CodeBleu/rabbitmqStats | rabbitmqStats/main.py | <reponame>CodeBleu/rabbitmqStats
#!/usr/bin/python
import click
import json
from rabbitmqStats import rabbitmqStats
from _config import VERSION
import time
import sys
@click.command()
@click.option('--host', default='localhost',
help='Specify RabbitMQ host (default = localhost)')
@click.option('--port',... |
CodeBleu/rabbitmqStats | rabbitmqStats/rabbitmqStats.py | <reponame>CodeBleu/rabbitmqStats
#!/usr/bin/python
import requests
import time
import json
import sys
class rabbitmqStats():
"""This is the class docstring"""
# defined array to hold queue names
r = []
timestamp = ""
def __init__(self, host, port, url, user, pwd):
# Get epoch. can be ... |
beaulian/pdfkp | doParse.py | <gh_stars>1-10
#-*- coding: utf-8 -*-
import os, re, sys
import multiprocessing
from collections import deque
from itertools import groupby
from bs4 import BeautifulSoup
def get_filename(_dir):
pdf_dir = os.path.join(os.getcwd(), _dir)
for path in os.listdir(pdf_dir):
if not path.startswith(".") and pa... |
other-juju/track-viz | src/track_viz/webserver.py | """Run a Flask web server to create heatmap and speed graph."""
from base64 import b64encode
from io import BytesIO
from io import StringIO
from pathlib import Path
from secrets import token_hex
from tempfile import gettempdir
import flask.typing as ft
from flask import Flask
from flask import Markup # type: ignore
f... |
other-juju/track-viz | tests/__init__.py | """Test suite for the track_viz package."""
|
other-juju/track-viz | src/track_viz/input_file.py | <gh_stars>0
"""Process a TCX or GPX file into a dataframe."""
from pathlib import Path
from typing import Any
from typing import Dict
from typing import List
from typing import Optional
import numpy as np
import pandas as pd
from defusedxml.ElementTree import parse
class TrackingColumn:
"""Names of columns in a ... |
other-juju/track-viz | src/track_viz/speed.py | """Create a speed graph from a tracking dataframe."""
from pathlib import Path
import matplotlib as mpl
import matplotlib.dates as mdates
import matplotlib.figure
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from geopy import distance
from .input_file import TrackingCol... |
other-juju/track-viz | src/track_viz/heatmap.py | """Create a heatmap from the tracking information, superimposes on a background image."""
from pathlib import Path
import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
import seaborn as sns
import yaml
from .input_file import TrackingColumn
def heatmap_from_dataframe(track: pd.DataFrame, con... |
other-juju/track-viz | tests/test_input_file.py | <reponame>other-juju/track-viz<filename>tests/test_input_file.py<gh_stars>1-10
"""Test cases for the __main__ module."""
from pathlib import Path
from track_viz import gpx_to_dataframe
from track_viz import tcx_to_dataframe
def test_gpx() -> None:
"""It exits with a status code of zero."""
df = gpx_to_datafr... |
other-juju/track-viz | src/track_viz/__init__.py | """Visualize Tracking Data."""
from .__main__ import main
from .heatmap import heatmap
from .heatmap import heatmap_from_dataframe
from .input_file import gpx_to_dataframe
from .input_file import tcx_to_dataframe
from .input_file import TrackingColumn
from .speed import plot_acceleration
from .speed import plot_movemen... |
other-juju/track-viz | tests/test_main.py | """Test cases for the __main__ module."""
import pytest
from click.testing import CliRunner
from track_viz import main
@pytest.fixture
def runner() -> CliRunner:
"""Fixture for invoking command-line interfaces."""
return CliRunner()
def test_main(runner: CliRunner) -> None:
"""It exits with a status co... |
Binary-Thoughts/52wkDataCollection | 52wkHigh.py | <gh_stars>0
import os
import pandas as pd
import datetime
### Getting Data Folder Location ###
datapath = input("\n\ninsert folders :- ").replace('"','')
# print(datapath)
### for total file read counter #
fileread = 0
### DateTime Stamp For Excel File Name ###
ts = datetime.datetime.now()
ts = ts... |
WitchKing-Helkar/John_Barlow_RTBKIT | jml-build/to_junit.py | <reponame>WitchKing-Helkar/John_Barlow_RTBKIT
#make test | python junit.py > testresults.xml
import os, fileinput
from xml.sax.saxutils import escape
passed = set()
failed = set()
for l in fileinput.input():
pieces = l.strip().replace("\x1b[0m", "").replace("\x1b[32m","").replace("\x1b[31m", "").split()
if n... |
qoddi/hikopenapi-node | src/linux/x64/binding.gyp | <reponame>qoddi/hikopenapi-node<filename>src/linux/x64/binding.gyp
{
"targets": [
{
"target_name": "hikopenapi",
"sources": [ "hikopenapi.cpp" ],
"include_dirs": ["./headers","./"],
"dependencies": [],
"library_dirs": [ './lib',"./"],
'defines': [],
'conditions' : [ ... |
Prabindchuahan/templates | pk5/rk1/views.py | from django.shortcuts import render
# Create your views here.
def home(request):
name = 'Prabind'
cname = 'Java'
price = 52
course_details = {'nm':name,'cn':cname, 'pr':price}
return render(request,'coursename/home.html',course_details)
def define(request):
emp_name = 'hari'
branch ... |
Prabindchuahan/templates | pk5/rk1/apps.py | <gh_stars>0
from django.apps import AppConfig
class Rk1Config(AppConfig):
name = 'rk1'
|
metabrainz/brainzbot-plugins | botbot_plugins/tests/test_bangmotivate_redux.py | <reponame>metabrainz/brainzbot-plugins<gh_stars>1-10
import pytest
from botbot_plugins.base import DummyApp
from botbot_plugins.plugins import bangmotivate_redux
@pytest.fixture
def app():
return DummyApp(test_plugin=bangmotivate_redux.Plugin(), command_prefix="!")
def test_motivate(app):
responses = app.re... |
metabrainz/brainzbot-plugins | botbot_plugins/tests/test_vote.py | <reponame>metabrainz/brainzbot-plugins
# -*- coding: utf-8 -*-
import pytest
from botbot_plugins.base import DummyApp
from botbot_plugins.plugins import vote
@pytest.fixture
def app():
return DummyApp(test_plugin=vote.Plugin(), command_prefix="!")
def test_no_concurrent_voting(app):
assert app.respond("!star... |
metabrainz/brainzbot-plugins | botbot_plugins/plugins/jira.py | <gh_stars>1-10
import requests
import json
import re
import time
from urlparse import urljoin
from .. import config
from ..base import BasePlugin
from ..decorators import listens_to_all, listens_to_mentions
class Config(config.BaseConfig):
jira_url = config.Field(help_text="JIRA Link, eg: 'https://tickets.metabr... |
metabrainz/brainzbot-plugins | botbot_plugins/tests/test_github.py | <filename>botbot_plugins/tests/test_github.py
import pytest
from mock import patch, call
import requests
from botbot_plugins.base import DummyApp
from botbot_plugins.plugins import github
class FakeResponse(object):
"""Dummy response from GitHub"""
status_code = 200
json = lambda x: {
'title': 'PI... |
metabrainz/brainzbot-plugins | botbot_plugins/plugins/github.py | import requests
from ..base import BasePlugin
from .. import config
from ..decorators import listens_to_all, listens_to_mentions
class Config(config.BaseConfig):
organization = config.Field(help_text="GitHub organization")
repo = config.Field(required=False,
help_text="GitHub repositor... |
metabrainz/brainzbot-plugins | botbot_plugins/plugins/bangmotivate_redux.py | from ..base import BasePlugin
from ..decorators import listens_to_command
class Plugin(BasePlugin):
"""
Rewrite of bangmotivate using the new listens_to_command decorator.
Notifies people of the excellent work they are doing.
Let me know who is doing good work:
(Assuming COMMAND_PREFIX is !)
... |
metabrainz/brainzbot-plugins | botbot_plugins/plugins/vote.py | <gh_stars>1-10
# -*- coding: utf-8 -*-
import json
import re
from functools import wraps
from collections import namedtuple, OrderedDict
from .. import config
from ..base import BasePlugin
from ..decorators import (listens_to_all, listens_to_command,
listens_to_regex_command)
DEFAULT_VOTE_O... |
metabrainz/brainzbot-plugins | botbot_plugins/plugins/metabrain.py | import json
from ..base import BasePlugin
from ..decorators import listens_to_command, listens_to_regex_command
class Plugin(BasePlugin):
"""
More advanced version of the brainz plugin using the new
listens_to_regex_command decorator.
Remembers and recalls arbitrary information.
To have me reme... |
metabrainz/brainzbot-plugins | botbot_plugins/tests/test_jira.py | <reponame>metabrainz/brainzbot-plugins<filename>botbot_plugins/tests/test_jira.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
import pytest
import json
import time
from mock import patch, call
import requests
from botbot_plugins.base import DummyApp
from botbot_plugins.plugins import jira
class FakeProjectResponse(obj... |
metabrainz/brainzbot-plugins | botbot_plugins/tests/test_metabrain.py | # -*- coding: utf-8 -*-
import pytest
from botbot_plugins.base import DummyApp
from botbot_plugins.plugins import metabrain
@pytest.fixture
def app():
return DummyApp(test_plugin=metabrain.Plugin(), command_prefix="!")
def test_empty(app):
responses = app.respond("!braindump")
assert responses == ["I h... |
metabrainz/brainzbot-plugins | botbot_plugins/decorators.py | def listens_to_mentions(regex):
"""
Decorator to add function and rule to routing table
Returns Line that triggered the function.
"""
def decorator(func):
func.route_rule = ('mentions', regex)
return func
return decorator
def listens_to_all(regex):
"""
Decorator to add... |
jameskabbes/smart_documentation | src/smart_documentation/__main__.py | <filename>src/smart_documentation/__main__.py
import sys
from smart_documentation import generate
import py_starter as ps
args, kwargs = ps.find_kwargs_in_strings( sys.argv[1:] )
generate( *args, **kwargs )
|
jameskabbes/smart_documentation | src/smart_documentation/BaseDocumentation.py | <reponame>jameskabbes/smart_documentation<gh_stars>0
from pypi_builder import BasePackage
import py_starter as ps
#import pypandoc
class BaseDocumentation( BasePackage ):
CONFIG_ATTS_NEEDED = ['author','version','name']
DEFAULT_KWARGS = {
'readme_rst': '',
}
def __init__( self, *args, **kwar... |
jameskabbes/smart_documentation | src/smart_documentation/Templates/jameskabbes/jameskabbes.py | <reponame>jameskabbes/smart_documentation<gh_stars>0
from smart_documentation import BaseDocumentation
from pypi_builder.Templates.jameskabbes.jameskabbes import Package
import dir_ops as do
import py_starter as ps
import os
from smart_documentation.Templates.default.default import Documentation as default_Documentati... |
jameskabbes/smart_documentation | src/smart_documentation/Templates/github_workflows_yml/github_workflows_yml.py | from smart_documentation import BaseDocumentation
from pypi_builder.Templates.default.default import Package
import dir_ops as do
import py_starter as ps
import os
class Documentation( BaseDocumentation, Package ):
template_Dir = do.Dir( do.Path( os.path.abspath(__file__) ).ascend().join( 'Template' ) )
DEFAU... |
jameskabbes/smart_documentation | src/smart_documentation/smart_documentation_main.py | <reponame>jameskabbes/smart_documentation
import dir_ops as do
import py_starter as ps
import smart_documentation
def get_template( *args, template = None, **kwargs ):
#list_contents_Paths()
module_Dirs = smart_documentation.templates_Dir.list_contents_Paths( block_paths=True,block_dirs=False )
if te... |
jameskabbes/smart_documentation | setup.py | from setuptools import setup
if __name__ == '__main__':
setup(
package_data={'smart_documentation':
[
'Templates/default/Template/docs/_static/*.css',
'Templates/default/Template/docs/_templates/*.rst',
'Templates/default/Template/docs/*.py',
'Templ... |
Mohitkaushal97/Data | news/admin.py | from django.contrib import admin
# Register your models here.
from .models import Headline, UserProfile
admin.site.register(Headline)
admin.site.register(UserProfile) |
Mohitkaushal97/Data | notepad/forms.py | <reponame>Mohitkaushal97/Data
from django import forms
from .models import Note
class NoteModelForm(forms.ModelForm):
class Meta:
model = Note
fields = ['title','url','image'] |
Mohitkaushal97/Data | notepad/views.py | from django.shortcuts import render, redirect, get_object_or_404
from .forms import NoteModelForm
from .models import Note
# CRUD
# create, update, retrieve, delete
def create_view(request):
form = NoteModelForm(request.POST or None, request.FILES or None)
if form.is_valid():
form.instance.user = request.user
... |
Mohitkaushal97/Data | news/models.py | <reponame>Mohitkaushal97/Data
from datetime import datetime
from django.conf import settings
from django.contrib.auth import get_user_model
from django.db import models
from django.db.models.signals import post_save
User = get_user_model()
class Headline(models.Model):
title = models.CharField(max_length=120)
image... |
Mohitkaushal97/Data | bin/lib/python3.6/site-packages/_plotly_utils/compat.py | import six
str_types = six.string_types + (six.text_type,)
|
Mohitkaushal97/Data | notepad/admin.py | <gh_stars>10-100
from django.contrib import admin
from .models import Note
admin.site.register(Note) |
Mohitkaushal97/Data | bin/lib/python3.6/site-packages/plotly/validators/scatter3d/_transforms.py | import _plotly_utils.basevalidators
class TransformsValidator(_plotly_utils.basevalidators.CompoundArrayValidator):
def __init__(
self, plotly_name='transforms', parent_name='scatter3d', **kwargs
):
super(TransformsValidator, self).__init__(
plotly_name=plotly_name,
pa... |
Mohitkaushal97/Data | finance/models.py | from django.db import models
# Create your models here.
class Company(models.Model):
name = models.CharField(max_length=120)
articles = models.IntegerField()
def __str__(self):
return self.name |
Mohitkaushal97/Data | dashboard/urls.py | from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
from finance.views import company_article_list, ChartData, dash, dash_ajax
from news.views import scrape
from .views import home
urlpatterns = [
path('admin/', admin.... |
Mohitkaushal97/Data | bin/lib/python3.6/site-packages/plotly/graph_objs/sankey/_transform.py | <gh_stars>10-100
from plotly.basedatatypes import BaseTraceHierarchyType
class Transform(BaseTraceHierarchyType):
# property parent name
# --------------------
@property
def _parent_path_str(self):
return 'sankey'
# Self properties description
# ---------------------------
@prope... |
Mohitkaushal97/Data | notepad/models.py | from django.conf import settings
from django.db import models
from django.urls import reverse
class Note(models.Model):
user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
title = models.CharField(max_length=120)
image = models.ImageField(null=True, blank=True)
url = models.URLField(null=T... |
Mohitkaushal97/Data | notepad/urls.py | from django.urls import path
from .views import create_view, list_view, delete_view, update_view
app_name = 'nodepad'
urlpatterns = [
path('create/', create_view, name='create'),
path('list/', list_view, name='list'),
path('<id>/delete/', delete_view, name='delete'),
path('<id>/update/', update_view, ... |
Mohitkaushal97/Data | bin/bin/django-admin.py | <filename>bin/bin/django-admin.py
#!/home/techstriker/Downloads/My_Dashboard-master/bin/bin/python3
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
|
Mohitkaushal97/Data | news/views.py | from django.shortcuts import render, redirect
import math
import requests
requests.packages.urllib3.disable_warnings()
from bs4 import BeautifulSoup
from datetime import timedelta, timezone, datetime
import os
import shutil
from .models import Headline, UserProfile
def scrape(request):
user_p = UserProfile.objects... |
iguanaus/EmailToText | helloworld2.py | import logging
import webapp2
from google.appengine.ext.webapp.mail_handlers import InboundMailHandler
from google.appengine.api import mail
import smtplib
from datetime import datetime, date , timedelta
class LogSenderHandler(InboundMailHandler):
def receive(self, mail_message):
#THis gets triggered. So ... |
iguanaus/EmailToText | settings_template.py | <filename>settings_template.py
replyToEmail = "<NAME> <<EMAIL>>"
ccEmail = "<EMAIL>"
carrierLookupKey = "23902390adasdf9023940234"
|
iguanaus/EmailToText | convertCarrier.py | <filename>convertCarrier.py
from settings import *
#This takes in the message and parses it for the phone number, then returns the emailaddress to send it to.
def convertMessage(message):
mylines = message.splitlines()
val = 0
emailnum = ""
for line in mylines:
print "line: " , line
val ... |
iguanaus/EmailToText | helloworld.py | <gh_stars>0
import logging
import webapp2
from google.appengine.ext.webapp.mail_handlers import InboundMailHandler
from google.appengine.api import mail
import smtplib
from datetime import datetime, date , timedelta
from convertCarrier import *
from settings import *
class LogSenderHandler(InboundMailHandler):
def... |
s-nandi/sample-cpp-project | docs/source/conf.py | <gh_stars>0
# -- Project information -----------------------------------------------------
import time
project = 'sample_cpp_project'
author = 's-nandi'
copyright = str(time.localtime().tm_year) + ', ' + author
# -- General configuration ---------------------------------------------------
# Add any Sphinx extension ... |
AffectedArc07/PySS13Bot | Topic.py | import socket
class Topic:
def __init__(self, host="localhost", port=3665, key="default_pwd"):
self.host = host
self.port = port
self.key = key
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, proto=socket.IPPROTO_TCP)
sock.connect((self.host, self.port))... |
AffectedArc07/PySS13Bot | Discord.py | import discord
import Topic
import math
import pymysql
import yaml
from urllib.parse import parse_qs
with open("config\config.yml", "r") as ymlfile:
cfg = yaml.load(ymlfile)
client = discord.Client()
@client.event
async def on_message(message):
if message.author == client.user:
return
... |
gianscarpe/udacity_deep_reinforcement_learning | p2_continuous-control/train.py | <reponame>gianscarpe/udacity_deep_reinforcement_learning
#!/usr/bin/env python
# coding: utf-8
# # Continuous Control
#
# ---
#
# In this notebook, you will learn how to use the Unity ML-Agents environment for the second project of the [Deep Reinforcement Learning Nanodegree](https://www.udacity.com/course/deep-rein... |
gianscarpe/udacity_deep_reinforcement_learning | p2_continuous-control/ddpg_agent.py | import numpy as np
import copy
from collections import namedtuple, deque
import random
from model import Actor, Critic
import torch
import torch.nn.functional as F
import torch.optim as optim
BUFFER_SIZE = int(1e6) # replay buffer size
BATCH_SIZE = 1024 # minibatch size
GAMMA = 0.99 # discount facto... |
Daniel1586/Initiative_deep_learning | 01_multi_layer_perceptron/mnist_mlp.py | # -*- coding: utf-8 -*-
from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
print('1.Loadind train/test/validation data...')
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
print('2.Creatind the model...')
in_units = 784
h1_units = 300
W1 = tf.Variable(tf.truncated_norma... |
Daniel1586/Initiative_deep_learning | 02_convolutional_neural_network/mnist_cnn.py | # -*- coding: utf-8 -*-
from tensorflow.examples.tutorials.mnist import input_data
import tensorflow as tf
print('1.Loadind train/test/validation data...')
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
print('2.Creatind the model...')
def weight_variable(shape):
initial = tf.truncated_normal(sha... |
Daniel1586/Initiative_deep_learning | 04_recurrent_neural_network/cws_bilstm_cnn_crf/bilstm_cnn_crf_.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
"""
@file: bilstm_cnn_crf.py
"""
import codecs
import pickle
import gensim
from keras.layers import *
from keras_contrib.layers import CRF
from keras.models import *
from keras.utils import plot_model
from keras.utils import np_utils
from keras.preprocessing import sequence
fro... |
Daniel1586/Initiative_deep_learning | 04_recurrent_neural_network/sequence_labeling_BiLSTM_CRF/train.py | <reponame>Daniel1586/Initiative_deep_learning
import time
import helper
import argparse
import numpy as np
import pandas as pd
import tensorflow as tf
from BILSTM_CRF import BILSTM_CRF
# python train.py train.in model -v validation.in -c char_emb -e 10 -g 2
# python train.py train.in model -v validation.in -e 10
# 命令行... |
Daniel1586/Initiative_deep_learning | 04_recurrent_neural_network/cws_bilstm_cnn_crf/embedding_model.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
"""
@file: embedding_model.py
"""
import os
import gensim
import codecs
# 读取corpus语料,预训练词向量
class MySentences(object):
def __init__(self, dirname_list):
self.dirname_list = dirname_list
def __iter__(self):
for dirname in self.dirname_list:
... |
Daniel1586/Initiative_deep_learning | 04_recurrent_neural_network/sequence_labeling_BiLSTM_CRF/test.py | import time
import helper
import argparse
import numpy as np
import pandas as pd
import tensorflow as tf
from BILSTM_CRF import BILSTM_CRF
# python test.py model test.in test.out
parser = argparse.ArgumentParser()
parser.add_argument("model_path", help="the path of model file")
parser.add_argument("test_path", help="... |
slarse/pygitviz | setup.py | <reponame>slarse/pygitviz
import re
import pathlib
from setuptools import setup, find_packages
with open("README.md", mode="r", encoding="utf-8") as f:
readme = f.read()
# parse the version instead of importing it to avoid dependency-related crashes
with open(
pathlib.Path("src") / "_pygitviz" / "__version.py... |
slarse/pygitviz | src/_pygitviz/graphviz.py | """Functions for converting Git objects to a Graphviz representation."""
import pathlib
from itertools import groupby
from typing import List
from _pygitviz import git
from _pygitviz import gitobject
from _pygitviz.gitobject import Type
_COLOR = {
Type.BLOB: "azure",
Type.TREE: "darkolivegreen1",
Type.COM... |
slarse/pygitviz | src/_pygitviz/git.py | <reponame>slarse/pygitviz<filename>src/_pygitviz/git.py
"""Utility functions for interacting with Git."""
import sys
import pathlib
import enum
import zlib
import itertools
import tempfile
import subprocess
from typing import List, Dict, Optional
from collections import namedtuple
from _pygitviz import util
from _pyg... |
slarse/pygitviz | src/_pygitviz/util.py | """Standalone utility functions."""
import subprocess
import pathlib
import sys
import collections
import enum
ENCODING = sys.getdefaultencoding()
OS = collections.namedtuple("OS", "name open_pdf_cmd shell_setting".split())
Linux = OS(name="Linux", open_pdf_cmd="xdg-open", shell_setting=False)
MacOS = OS(name="macOS"... |
slarse/pygitviz | src/_pygitviz/cli.py | <reponame>slarse/pygitviz
"""The command line interface for PyGitViz."""
import time
import tempfile
import argparse
import sys
import logging
import contextlib
from pathlib import Path
import daiquiri
from _pygitviz import graphviz
from _pygitviz import util
from _pygitviz import git
from _pygitviz.graphviz import g... |
slarse/pygitviz | scripts/create_expected_dot_files.py | <reponame>slarse/pygitviz
"""Script that creates dot files from the repositories stored in
tests/resources with the current version of pygitviz.
"""
import pathlib
import tempfile
import shutil
from _pygitviz.graphviz import git_to_dot
TEST_GIT_REPOS_DIR = (
pathlib.Path(__file__).parent.parent / "tests" / "resou... |
slarse/pygitviz | tests/graphviz_test.py | <gh_stars>1-10
import collections
import pathlib
import shutil
import tempfile
import pytest
from _pygitviz import graphviz
_RepoTestCase = collections.namedtuple("_RepoTestCase", "repo_zip expected_dot_file")
def _to_repo_test_case(repo_zip: pathlib.Path) -> _RepoTestCase:
expected_dot_file = repo_zip.parent /... |
slarse/pygitviz | src/_pygitviz/gitobject.py | """A class that represents a Git object."""
import enum
from collections import namedtuple
from typing import List, Optional
from _pygitviz import util
class Child(namedtuple("_Child", "name obj".split())):
"""A wrapper class for a GitObject that associates it with a name."""
def __getattr__(self, key):
... |
Im-Kristy2/pdisk-bot | mtb.py | <filename>mtb.py
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
class mtb(object):
START_TXT = """
<b>Hello {},👋
I Am A Pdisk Uploader Bot... 🤖
I Can Upload Links To Your PDisk Account... Read Help Carefully & Do Follow Given Instructions 😉!
👨💻 Developer : <a href='https://teleg... |
Im-Kristy2/pdisk-bot | plugins/mainfuc.py | from pyrogram import Client, filters
from time import time
from datetime import datetime
from mtb import mtb
from pyrogram.types import (
InlineKeyboardButton,
InlineKeyboardMarkup,
ForceReply,
Message
)
from pdisk import pdisk_url , api_check
from database import insert , find , set , getid
import os
... |
anuragrao04/test | Untitled-1.py | dictionary_username_password = {} #dictionary definition
def go_to_mainpage():
print(''' ***SWEEP***
***SELECT SERVICE***
1. hair dressing
2. bathroom cleaning
3. house cleaning
4. fan cleaning
5. idk whatever \U0001F602''')
... |
Bratah123/MALScraper | scraper.py | import bs4
from urllib.request import urlopen
import json
import time
with open("anime_characters.json", "r") as f:
characters = json.load(f) # Refer to the README.md to check how the data is organized
def main():
page_num = int(input("How many pages would you like to scrape? "))
print(f"Estimated {page... |
uktrade/python-streaming-left-join | tests.py | <gh_stars>1-10
import unittest
from streaming_left_join import UnusedDataException, join
class TestJoin(unittest.TestCase):
def test_list(self):
cities = [
{'city_id': 1, 'name': 'London'},
{'city_id': 2, 'name': 'Paris'},
]
museums = [
{'city_id': 1, ... |
uktrade/python-streaming-left-join | streaming_left_join.py |
class UnusedDataException(ValueError):
pass
def join(left_iter_left_key, *right_iters_with_keys):
unused = False
left_iter, left_key = left_iter_left_key
# Magic "left" item to match all right items to empty the right iterables at the end
match_any = object()
# Magic "right" item that signal... |
uktrade/python-streaming-left-join | setup.py | <reponame>uktrade/python-streaming-left-join
import setuptools
def long_description():
with open('README.md', 'r') as file:
return file.read()
setuptools.setup(
name='streaming-left-join',
version='0.0.7',
author='Department for International Trade',
author_email='<EMAIL>',
descripti... |
d9w/6858-android-intents | analyzer/xmlparse.py | <gh_stars>1-10
#!/usr/bin/python
# Finds vulnerabilites in manifest files
import sys
from xml.dom.minidom import Element
from androguard.core.bytecodes import apk
from androguard.core.bytecodes import dvm
import permissions
# Component Types Enum
ACTIVITY = 0
SERVICE = 1
RECEIVER = 2
PROVIDER = 3
tag2type = { "act... |
d9w/6858-android-intents | analyzer/main.py | #!/usr/bin/python
import sys
import os
import traceback
from optparse import OptionParser
from androlyze import *
from permissions import *
from androguard.decompiler.dad import decompile
from androguard.core.analysis.analysis import *
from xmlparse import get_exploitable_methods
from codeparse import get_permission_a... |
d9w/6858-android-intents | analyzer/androguard/core/androconf.py | <gh_stars>1-10
# This file is part of Androguard.
#
# Copyright (C) 2010, <NAME> <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version ... |
d9w/6858-android-intents | analyzer/codeparse.py | #!/usr/bin/python
# Finds vulnerabilites in Dalvik bytecode
from androguard.core.analysis.analysis import PathP
def get_permission_access(d,dx, perms=[]):
cm = d.get_class_manager()
permissions = dx.get_permissions(perms)
methods ={}
for p in permissions:
methods[p]=[]
for path in perm... |
d9w/6858-android-intents | analyzer/permissions.py | #!/usr/bin/python
# List of all known system permissions
NORMAL = 0
DANG = 1
SIG = 2
SIGSYS = 3
text2perm = {
"0": NORMAL,
"normal": NORMAL,
"1": DANG,
"dangerous": DANG,
"signature": SIG,
"2": SIG,
"signatureOrSystem":SIGSYS,
"3":SIGSYS,
"signature|system":SIGSYS}
permissions = {... |
skiphansen/litex-buildenv | targets/arty/etherbone.py | from litex.soc.integration.soc_core import mem_decoder
from litex.soc.integration.soc_sdram import *
from liteeth.common import convert_ip
from liteeth.core import LiteEthUDPIPCore
from liteeth.frontend.etherbone import LiteEthEtherbone
from liteeth.mac import LiteEthMAC
from liteeth.phy import LiteEthPHY
from target... |
skiphansen/litex-buildenv | test/test_xadc.py | from litex.tools.litex_client import RemoteClient
wb = RemoteClient("192.168.1.50", 1234, csr_data_width=8)
wb.open()
regs = wb.regs
# # #
print("temperature: %f°C" %(regs.xadc_temperature.read()*503.975/4096 - 273.15))
print("vccint: %fV" %(regs.xadc_vccint.read()/4096*3))
print("vccaux: %fV" %(regs.xadc_vccaux.rea... |
skiphansen/litex-buildenv | test/test_dump.py | #!/usr/bin/env python3
from litex.tools.litex_client import RemoteClient
rom_base = 0x00000000
dump_size = 0x8000
words_per_packet = 128
wb = RemoteClient()
wb.open()
# # #
print("dumping cpu rom to dump.bin...")
dump = []
for n in range(dump_size//(words_per_packet*4)):
dump += wb.read(rom_base + n*words_per_p... |
skiphansen/litex-buildenv | targets/ice40_up5k_b_evn/bridge.py | from litex.soc.cores import uart
from litex.soc.cores.uart import UARTWishboneBridge
from litescope import LiteScopeAnalyzer
from litescope import LiteScopeIO
from targets.ice40_up5k_b_evn.base import BaseSoC
class BridgeSoC(BaseSoC):
def __init__(self, platform, *args, **kwargs):
kwargs['cpu_type'] = N... |
skiphansen/litex-buildenv | targets/waxwing/net.py | # Support for the Numato Saturn (http://numato.com/product/saturn-spartan-6-fpga-development-board-with-ddr-sdram)
# Original code from : https://github.com/timvideos/litex-buildenv/blob/master/targets/waxwing/base.py
# By <NAME>
from fractions import Fraction
from migen import *
from migen.genlib.resetsync import As... |
skiphansen/litex-buildenv | platforms/matrix_voice.py | <gh_stars>100-1000
# Support for the MATRIX Voice
# https://www.matrix.one/products/voice
# Author: <NAME> <<EMAIL>>
# FPGA: Spartan 6 xc6slx9-2-ftg256
# Copyright 2020 MATRIX Labs
# License: BSD
from litex.build.generic_platform import *
from litex.build.xilinx import XilinxPlatform
_io = [
("clk50", 0, Pins("T7... |
skiphansen/litex-buildenv | test/test_alignment.py | <reponame>skiphansen/litex-buildenv<filename>test/test_alignment.py
#!/usr/bin/env python3
import time
from litex.tools.litex_client import RemoteClient
from litescope.software.driver.analyzer import LiteScopeAnalyzerDriver
wb = RemoteClient()
wb.open()
# # #
DVISAMPLER_DELAY_RST = 0x1
DVISAMPLER_DELAY_INC = 0x2
DV... |
skiphansen/litex-buildenv | targets/ice40_hx8k_b_evn/crg.py | <filename>targets/ice40_hx8k_b_evn/crg.py
#!/usr/bin/env python3
from migen import *
from migen.genlib.resetsync import AsyncResetSynchronizer
class _CRG(Module):
def __init__(self, platform, sys_clk_freq):
clk12 = platform.request("clk12")
self.clock_domains.cd_sys = ClockDomain()
self.... |
skiphansen/litex-buildenv | targets/pano_logic_g2/crg.py | # Support for the Pano Logic Zero Client G2
from migen import *
from migen.genlib.resetsync import AsyncResetSynchronizer
class _CRG(Module):
def __init__(self, platform, sys_clk_freq):
self.clock_domains.cd_sys = ClockDomain()
self.clock_domains.cd_sdram_half = ClockDomain()
self.clock_d... |
skiphansen/litex-buildenv | targets/netv2/base.py | # Support for the NeTV2 board
from migen import *
from migen.genlib.resetsync import AsyncResetSynchronizer
from litex.soc.integration.soc_core import mem_decoder
from litex.soc.integration.soc_sdram import *
from litex.soc.integration.builder import *
from litex.soc.interconnect import wishbone
from litedram.modules... |
skiphansen/litex-buildenv | targets/galatea/base.py | # Support for Numato Galatea - https://numato.com/product/galatea-pci-express-spartan-6-fpga-development-board
from migen import *
from litex.soc.integration.soc_sdram import *
from litex.soc.integration.builder import *
from litedram.modules import MT41J128M16
from litedram.phy import s6ddrphy
from litedram.core im... |
skiphansen/litex-buildenv | platforms/sim.py | <reponame>skiphansen/litex-buildenv<gh_stars>100-1000
# FIXME: it seems broken
from litex.boards.platforms import sim
from litex.boards.platforms.sim import *
__all__ = ['SimPins', 'Platform']
|
skiphansen/litex-buildenv | mkimage.py | <filename>mkimage.py
#!/usr/bin/env python3
"""
Flash image creation tool.
"""
import os
import argparse
import make
from collections import namedtuple
from targets.utils import round_up_to_4
_Region = namedtuple("Region", ["name", "desc", "start", "size"])
class Region(_Region):
def __init__(self, name, desc,... |
skiphansen/litex-buildenv | targets/arty/tf.py | <filename>targets/arty/tf.py<gh_stars>100-1000
# Support for the Digilent Arty Board
from migen import *
from migen.genlib.resetsync import AsyncResetSynchronizer
from litex.build.generic_platform import *
from litex.soc.cores.bitbang import I2CMaster
from targets.arty.base import BaseSoC
i2c_pmod_d = [
("i2c... |
skiphansen/litex-buildenv | targets/atlys/net.py | from litex.soc.integration.soc_sdram import *
from liteeth.core.mac import LiteEthMAC
from liteeth.phy import LiteEthPHY
from .base import BaseSoC
class NetSoC(BaseSoC):
mem_map = {**BaseSoC.mem_map, **{
"ethmac": 0xb0000000,
}}
def __init__(self, platform, *args, **kwargs):
# Need a la... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.