repo_name stringlengths 6 97 | path stringlengths 3 341 | text stringlengths 8 1.02M |
|---|---|---|
dls-controls/scanpointgenerator | tests/test_core/test_compoundgenerator.py | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from test_util import ScanPointGeneratorTest
from scanpointgenerator import CompoundGenerator, Mutator, Generator, Excluder
from scanpointgenerator import LineGenerator
from scanpointgenerator import SpiralGenerator
fro... |
dls-controls/scanpointgenerator | scanpointgenerator/__init__.py | <reponame>dls-controls/scanpointgenerator
###
# Copyright (c) 2016, 2017 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or ini... |
dls-controls/scanpointgenerator | scanpointgenerator/rois/rectangular_roi.py | <gh_stars>1-10
###
# Copyright (c) 2016 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
#
###
from annotypes import Anno, Union, Array, Sequence
from math import cos, sin
from scanpointgenerator.core import ROI
from scanpointgenerator.compat impor... |
dls-controls/scanpointgenerator | tests/test_rois/test_linear_roi.py | <filename>tests/test_rois/test_linear_roi.py
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from math import pi, sqrt
from test_util import ScanPointGeneratorTest
from scanpointgenerator.rois.linear_roi import LinearROI
from scanpointgenerator.compat import np
clas... |
dls-controls/scanpointgenerator | tests/test_core/test_generator.py | <gh_stars>1-10
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from test_util import ScanPointGeneratorTest
from scanpointgenerator import Generator
from pkg_resources import require
require("mock")
from mock import MagicMock
class ScanPointGeneratorBaseTest(ScanP... |
dls-controls/scanpointgenerator | tests/test_rois/test_elliptical_roi.py | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from math import pi
from test_util import ScanPointGeneratorTest
from scanpointgenerator.rois.elliptical_roi import EllipticalROI
from scanpointgenerator.compat import np
class EllipticalROITest(unittest.TestCase):
... |
dls-controls/scanpointgenerator | tests/test_generators/test_lissajousgenerator.py | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from test_util import ScanPointGeneratorTest
from scanpointgenerator import LissajousGenerator
class LissajousGeneratorTest(ScanPointGeneratorTest):
def test_init(self):
g = LissajousGenerator(["x", "y"],... |
dls-controls/scanpointgenerator | scanpointgenerator/rois/linear_roi.py | ###
# Copyright (c) 2016 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
#
###
from annotypes import Anno, Union, Array, Sequence
from math import cos, sin
from scanpointgenerator.core import ROI
from scanpointgenerator.compat import np
with Anno... |
dls-controls/scanpointgenerator | tests/test_rois/test_sector_roi.py | <reponame>dls-controls/scanpointgenerator<filename>tests/test_rois/test_sector_roi.py
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from math import pi
from test_util import ScanPointGeneratorTest
from scanpointgenerator.rois.sector_roi import SectorROI
from scanpo... |
dls-controls/scanpointgenerator | tests/test_core/test_dimension.py | <filename>tests/test_core/test_dimension.py
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from test_util import ScanPointGeneratorTest
from scanpointgenerator.compat import np
from scanpointgenerator.core.dimension import Dimension
from pkg_resources import requir... |
dls-controls/scanpointgenerator | tests/test_core/test_random.py | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from pkg_resources import require
require("mock")
from mock import patch
from test_util import ScanPointGeneratorTest
from scanpointgenerator import Random
class RandomTest(unittest.TestCase):
@patch('scanpointg... |
dls-controls/scanpointgenerator | tests/test_generators/test_linegenerator.py | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from test_util import ScanPointGeneratorTest
from scanpointgenerator import LineGenerator
class LineGeneratorTest(ScanPointGeneratorTest):
def test_init(self):
g = LineGenerator("x", "mm", 1.0, 9.0, 5, al... |
dls-controls/scanpointgenerator | scanpointgenerator/core/roi.py | <filename>scanpointgenerator/core/roi.py<gh_stars>1-10
###
# Copyright (c) 2016 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and... |
dls-controls/scanpointgenerator | scanpointgenerator/mutators/randomoffsetmutator.py | ###
# Copyright (c) 2016, 2017 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or initial documentation
#
###
import collections
from annotypes import Anno, Union, Array, Sequence
from scanpointgene... |
dls-controls/scanpointgenerator | scanpointgenerator/excluders/__init__.py | <filename>scanpointgenerator/excluders/__init__.py
from scanpointgenerator.excluders.roiexcluder import ROIExcluder
from scanpointgenerator.excluders.squashingexcluder import SquashingExcluder |
dls-controls/scanpointgenerator | scanpointgenerator/compat.py | ###
# Copyright (c) 2016 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or initial documentation
#
###
import os
try:
range_ = xrange
except NameError:
# For Python3
range_ = range
impo... |
dls-controls/scanpointgenerator | scanpointgenerator/rois/circular_roi.py | <reponame>dls-controls/scanpointgenerator<gh_stars>1-10
###
# Copyright (c) 2016, 2017 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or initial documentation
#
###
from annotypes import Anno, Union,... |
dls-controls/scanpointgenerator | scanpointgenerator/core/excluder.py | <filename>scanpointgenerator/core/excluder.py
###
# Copyright (c) 2016, 2017 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or initial documentation
#
###
from annotypes import Serializable, Anno, Ar... |
dls-controls/scanpointgenerator | scanpointgenerator/core/random.py | <gh_stars>1-10
###
# Copyright (c) 2016 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
#
###
class Random(object):
# See: https://en.wikipedia.org/wiki/Mersenne_Twister - MT19937
w = 32 # Word size
n = 624 # D... |
dls-controls/scanpointgenerator | tests/test_rois/test_point_roi.py | <gh_stars>1-10
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from test_util import ScanPointGeneratorTest
from scanpointgenerator.rois.point_roi import PointROI
from scanpointgenerator.compat import np
class PointROITest(unittest.TestCase):
def test_init(sel... |
dls-controls/scanpointgenerator | scanpointgenerator/core/point.py | <filename>scanpointgenerator/core/point.py<gh_stars>1-10
###
# Copyright (c) 2016 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - Points implementation
#
###
fro... |
dls-controls/scanpointgenerator | tests/test_rois/test_rectangular_roi.py | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from math import pi
from test_util import ScanPointGeneratorTest
from scanpointgenerator.rois.rectangular_roi import RectangularROI
from scanpointgenerator.compat import np
class InitTest(unittest.TestCase):
def ... |
dls-controls/scanpointgenerator | tests/test_excluders/test_roiexcluder.py | <filename>tests/test_excluders/test_roiexcluder.py
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from pkg_resources import require
require("mock")
from mock import patch, MagicMock
from test_util import ScanPointGeneratorTest
from scanpointgenerator import ROIExcl... |
dls-controls/scanpointgenerator | tests/test_mutators/test_randomoffsetmutator.py | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from test_util import ScanPointGeneratorTest
from scanpointgenerator.compat import range_
from scanpointgenerator.generators import LineGenerator, LissajousGenerator
from scanpointgenerator.mutators import RandomOffsetM... |
dls-controls/scanpointgenerator | tests/test_core/test_get_points_performance.py | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
import time
from test_util import ScanPointGeneratorTest
from scanpointgenerator import CompoundGenerator
from scanpointgenerator import LineGenerator, StaticPointGenerator, LissajousGenerator, SpiralGenerator
from scan... |
dls-controls/scanpointgenerator | tests/test_generators/test_concatgenerator.py | import unittest
from scanpointgenerator import LineGenerator, ConcatGenerator, ArrayGenerator, \
CompoundGenerator
from tests.test_util import ScanPointGeneratorTest
class ConcatGeneratorTest(ScanPointGeneratorTest):
def test_init(self):
genone = LineGenerator("x", "mm", 1.0, 9.0, 5)
gentwo =... |
dls-controls/scanpointgenerator | plot_check.py | from scanpointgenerator import LineGenerator, CompoundGenerator
from scanpointgenerator import RectangularROI
from scanpointgenerator import CircularROI
from scanpointgenerator import SpiralGenerator
from scanpointgenerator import LissajousGenerator
from scanpointgenerator import RandomOffsetMutator
from scanpointgener... |
dls-controls/scanpointgenerator | tests/test_core/test_mutator.py | <gh_stars>1-10
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from scanpointgenerator import Mutator
from pkg_resources import require
require("mock")
from mock import MagicMock
class MutatorTest(unittest.TestCase):
def test_mutate_raises(self):
m = ... |
dls-controls/scanpointgenerator | scanpointgenerator/generators/lissajousgenerator.py | ###
# Copyright (c) 2016, 2017 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or initial documentation
#
###
import math as m
from annotypes import Anno, Union, Array, Sequence
from scanpointgenera... |
dls-controls/scanpointgenerator | scanpointgenerator/core/mutator.py | <filename>scanpointgenerator/core/mutator.py
###
# Copyright (c) 2016, 2017 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or ... |
dls-controls/scanpointgenerator | scanpointgenerator/plotgenerator.py | ###
# Copyright (c) 2016, 2017 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or initial documentation
#
###
from scanpointge... |
dls-controls/scanpointgenerator | tests/test_util.py | <gh_stars>1-10
import unittest
import os
import sys
# module import
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
class ScanPointGeneratorTest(unittest.TestCase):
def assertListAlmostEqual(self, actual, expected, delta=1e-15):
self.assertEqual(len(actual), len(expected))
for a, e... |
dls-controls/scanpointgenerator | scanpointgenerator/core/dimension.py | <reponame>dls-controls/scanpointgenerator<filename>scanpointgenerator/core/dimension.py
###
# Copyright (c) 2017 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
#
###
import itertools
from scanpointgenerator.compat import np
class Dimension(object... |
dls-controls/scanpointgenerator | scanpointgenerator/core/compoundgenerator.py | ###
# Copyright (c) 2016, 2017 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - Points im... |
dls-controls/scanpointgenerator | tests/test_generators/test_spiralgenerator.py | <filename>tests/test_generators/test_spiralgenerator.py
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from test_util import ScanPointGeneratorTest
from scanpointgenerator import SpiralGenerator
class SpiralGeneratorTest(ScanPointGeneratorTest):
def setUp(sel... |
dls-controls/scanpointgenerator | tests/test_generators/test_zipgenerator.py | from scanpointgenerator import LineGenerator, ZipGenerator, Generator
from tests.test_util import ScanPointGeneratorTest
class ZipGeneratorTest(ScanPointGeneratorTest):
def test_init(self):
genone = LineGenerator("x", "mm", 1.0, 9.0, 5)
g = ZipGenerator([genone])
self.assertEqual(["x"], g... |
dls-controls/scanpointgenerator | tests/test_excluders/test_squashingexcluder.py | <filename>tests/test_excluders/test_squashingexcluder.py
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from test_util import ScanPointGeneratorTest
from scanpointgenerator import SquashingExcluder
from scanpointgenerator.compat import np
class TestCreateMask(Scan... |
dls-controls/scanpointgenerator | tests/test_core/test_get_points.py | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from test_util import ScanPointGeneratorTest
from scanpointgenerator import CompoundGenerator
from scanpointgenerator import LineGenerator
from scanpointgenerator import CircularROI, ROIExcluder
from scanpointgenerator ... |
dls-controls/scanpointgenerator | tests/test_core/test_excluder.py | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from test_util import ScanPointGeneratorTest
from scanpointgenerator import Excluder
from pkg_resources import require
require("mock")
from mock import MagicMock
class ExcluderTest(unittest.TestCase):
def test_i... |
dls-controls/scanpointgenerator | scanpointgenerator/core/__init__.py | <reponame>dls-controls/scanpointgenerator
###
# Copyright (c) 2016, 2017 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or ini... |
dls-controls/scanpointgenerator | scanpointgenerator/generators/arraygenerator.py | ###
# Copyright (c) 2016, 2017 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or initial documentation
#
###
from annotypes i... |
dls-controls/scanpointgenerator | scanpointgenerator/generators/zipgenerator.py | from annotypes import Anno, deserialize_object, Array, Sequence, Union
from scanpointgenerator.core import Generator, AAlternate
with Anno("List of Generators to zip"):
AGenerators = Array[Generator]
UGenerators = Union[AGenerators, Sequence[Generator], Generator]
@Generator.register_subclass(
"scanpointgene... |
dls-controls/scanpointgenerator | tests/test_generators/test_arraygenerator.py | <reponame>dls-controls/scanpointgenerator
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from test_util import ScanPointGeneratorTest
from scanpointgenerator import ArrayGenerator
class ArrayGeneratorTest(ScanPointGeneratorTest):
def test_1d_init(self):
... |
dls-controls/scanpointgenerator | tests/test_rois/test_circular_roi.py | <filename>tests/test_rois/test_circular_roi.py
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from test_util import ScanPointGeneratorTest
from scanpointgenerator.rois.circular_roi import CircularROI
from scanpointgenerator.compat import np
class InitTest(unittest... |
dls-controls/scanpointgenerator | tests/test_core/test_roi.py | <filename>tests/test_core/test_roi.py
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from scanpointgenerator import ROI
from pkg_resources import require
require("mock")
from mock import Mock
class ROITest(unittest.TestCase):
def test_to_dict(self):
r... |
dls-controls/scanpointgenerator | scanpointgenerator/rois/elliptical_roi.py | ###
# Copyright (c) 2016 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
#
###
from annotypes import Anno, Union, Array, Sequence
from math import cos, sin
from scanpointgenerator.core import ROI
with Anno("The centre of ellipse"):
ACentre = ... |
dls-controls/scanpointgenerator | scanpointgenerator/excluders/roiexcluder.py | ###
# Copyright (c) 2017 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
#
###
from annotypes import Anno, Union, Array, Sequence, deserialize_object
from scanpointgenerator.core import Excluder, UExcluderAxes, ROI
from scanpointgenerator.compat im... |
dls-controls/scanpointgenerator | scanpointgenerator/rois/polygonal_roi.py | ###
# Copyright (c) 2016 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
#
###
from annotypes import Anno, Union, Array, Sequence
from scanpointgenerator.core import ROI
from scanpointgenerator.compat import np
with Anno("x positions for polygon v... |
dls-controls/scanpointgenerator | scanpointgenerator/rois/sector_roi.py | ###
# Copyright (c) 2016 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
#
###
from annotypes import Anno, Union, Array, Sequence
from math import hypot, atan2, pi
from scanpointgenerator.core import ROI
from scanpointgenerator.compat import np
w... |
dls-controls/scanpointgenerator | scanpointgenerator/generators/staticpointgenerator.py | ###
# Copyright (c) 2017 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
#
###
import numpy as np
from scanpointgenerator.core import Generator, ASize, UAxes, AAxes
@Generator.register_subclass(
"scanpointgenerator:generator/StaticPointGenerat... |
dls-controls/scanpointgenerator | scanpointgenerator/generators/spiralgenerator.py | ###
# Copyright (c) 2016, 2017 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or initial documentation
#
###
import math as m
from annotypes import Anno, Union, Array, Sequence
from scanpointgenera... |
dls-controls/scanpointgenerator | scanpointgenerator/core/generator.py | ###
# Copyright (c) 2016, 2017 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or initial documentation
#
###
from annotypes i... |
dls-controls/scanpointgenerator | scanpointgenerator/generators/concatgenerator.py | <reponame>dls-controls/scanpointgenerator<filename>scanpointgenerator/generators/concatgenerator.py<gh_stars>1-10
from annotypes import Anno, deserialize_object, Array
from scanpointgenerator.compat import np
from scanpointgenerator.core import Generator, AAlternate
with Anno("The array containing points"):
AGener... |
dls-controls/scanpointgenerator | tests/test_rois/test_polygonal_roi.py | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from test_util import ScanPointGeneratorTest
from scanpointgenerator.rois.polygonal_roi import PolygonalROI
from scanpointgenerator.compat import np
class PolygonalROITests(unittest.TestCase):
def test_init(self)... |
dls-controls/scanpointgenerator | scanpointgenerator/rois/point_roi.py | ###
# Copyright (c) 2016 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
#
###
from annotypes import Anno, Union, Array, Sequence
from scanpointgenerator.core import ROI
with Anno("The point"):
APoint = Array[float]
UPoint = Union[APoint, Sequ... |
dls-controls/scanpointgenerator | scanpointgenerator/generators/linegenerator.py | ###
# Copyright (c) 2016, 2017 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or initial documentation
# <NAME> - initial API and implementation and/or initial documentation
#
###
from annotypes i... |
dls-controls/scanpointgenerator | scanpointgenerator/excluders/squashingexcluder.py | <reponame>dls-controls/scanpointgenerator
###
# Copyright (c) 2019 Diamond Light Source Ltd.
#
# Contributors:
# <NAME> - Initial implementation
#
###
from scanpointgenerator.core import Excluder, UExcluderAxes
from scanpointgenerator.compat import np
@Excluder.register_subclass("scanpointgenerator:excluder/Squas... |
dls-controls/scanpointgenerator | tests/test_generators/test_staticpointgenerator.py | <filename>tests/test_generators/test_staticpointgenerator.py
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
from test_util import ScanPointGeneratorTest
from scanpointgenerator import StaticPointGenerator
class StaticPointGeneratorTest(ScanPointGeneratorTest):
... |
dls-controls/scanpointgenerator | tests/test_core/test_compoundgenerator_performance.py | import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import unittest
import time
from test_util import ScanPointGeneratorTest
from scanpointgenerator import CompoundGenerator
from scanpointgenerator import LineGenerator
from scanpointgenerator import SpiralGenerator
from scanpointgenerat... |
surajmane/Movie_reviews | reviews_import.py | #Keep adding the required imports below
from bs4 import BeautifulSoup
import urllib
import urllib.request
import re
import sys
from nltk.tokenize import word_tokenize
from nltk.corpus import stopwords
import string
import numpy as np
import pandas as pd
import cufflinks as cf
import chart_studio.plotly as p... |
surajmane/Movie_reviews | reviews.py | <reponame>surajmane/Movie_reviews
from reviews_import import *
"""Get the movie about info and the average movie ratings from Rottentomatoes given the movie name
Args:
url(str) = The name of the movie you'd like the review of
returns: A small about info of the movie and the average rating from Rottentomat... |
fruser/video_analysis | video_analysis.py | import argparse
import boto3
def extractTextRekognition(source, destination, object_name):
client = boto3.client('rekognition')
response = client.detect_text(Image={'S3Object': {'Bucket': source, 'Name': object_name}})
text_detection = response['TextDetections']
print(response)
print('Detected te... |
fruser/video_analysis | video_split.py | import argparse
import cv2
import boto3
import os
def extract_image(source, destination, step):
count = 0
vidcap = cv2.VideoCapture(source)
success, image = vidcap.read()
while success:
vidcap.set(cv2.CAP_PROP_POS_MSEC, (count * step * 1000))
cv2.imwrite(destination + "/frame%d.jpg" %... |
dpttw/model_calibration | mc.py | <reponame>dpttw/model_calibration
# -*- coding: utf-8 -*-
import os
import time
import numpy as np
import ctypes
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colorbar as clb
import matplotlib.patches as mpatches
import matplotlib.lines as mlines
# ++++ Fortran function for plastic deformation... |
lordent/hasoffers-api | hasoffers_api/api.py | import aiohttp
import ujson
import asyncio
from multidimensional_urlencode import urlencode
class ApiError(Exception):
pass
class InvalidAuthorization(ApiError):
pass
class MissingRequiredArgument(ApiError):
pass
class APIUsageExceededRateLimit(ApiError):
pass
class FailedToHydrateRows(ApiErro... |
lordent/hasoffers-api | hasoffers_api/tests/test.py | <filename>hasoffers_api/tests/test.py
import pytest
from aiohttp import web
from hasoffers_api.api import Api, ApiController, ApiMethod, \
ApiRequest, APIUsageExceededRateLimit
pytest_plugins = 'aiohttp.pytest_plugin'
async def test_api_builder():
network = 'test_network'
apikey = 'test_apikey'
cont... |
lordent/hasoffers-api | setup.py | <reponame>lordent/hasoffers-api
from setuptools import setup
setup(
name='hasoffers_api',
version='1.0.3',
description='Async HasOffers Network API driver',
long_description='',
author='<NAME>',
author_email='<EMAIL>',
packages=['hasoffers_api'],
url='https://github.com/lordent/hasoffe... |
groupserver/gs.group.messages.add.base | gs/group/messages/add/base/addapost.py | # -*- coding: utf-8 -*-
############################################################################
#
# Copyright © 2014 OnlineGroups.net and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this dis... |
groupserver/gs.group.messages.add.base | gs/group/messages/add/base/base.py | # -*- coding: utf-8 -*-
############################################################################
#
# Copyright © 2014 OnlineGroups.net and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this dis... |
groupserver/gs.group.messages.add.base | gs/group/messages/add/base/adder.py | # -*- coding: utf-8 -*-
############################################################################
#
# Copyright © 2014 OnlineGroups.net and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this dis... |
groupserver/gs.group.messages.add.base | gs/group/messages/add/base/groupexists.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright © 2014 OnlineGroups.net and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this d... |
groupserver/gs.group.messages.add.base | gs/group/messages/add/base/interfaces.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright © 2014 OnlineGroups.net and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this d... |
groupserver/gs.group.messages.add.base | gs/group/messages/add/base/addemail.py | # -*- coding: utf-8 -*-
############################################################################
#
# Copyright © 2014, 2015 OnlineGroups.net and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany th... |
groupserver/gs.group.messages.add.base | gs/group/messages/add/base/audit.py | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright © 2014 OnlineGroups.net and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this d... |
groupserver/gs.group.messages.add.base | gs/group/messages/add/base/__init__.py | <reponame>groupserver/gs.group.messages.add.base<gh_stars>0
# -*- coding: utf-8 -*-
from __future__ import absolute_import
#lint:disable
from .addapost import add_a_post
from .base import ListInfoForm
#lint:enable
|
veggiespam/ZocSec.SecurityAsCode.GitHub | GitHub_Inventory_Tool/kyro.py | <gh_stars>1-10
# kyro.py || part of ZocSec.SecurityAsCode.GitHub
#
# A tool for extracting important informaiton about all repos in an organization.
#
# Owner: Copyright © 2018-2019 Zocdoc Inc. www.zocdoc.com
# Authors: <NAME> @garymalaysia
# <NAME> @veggiespam
#
#
from github import Github
from gith... |
veggiespam/ZocSec.SecurityAsCode.GitHub | GitHub_Enable_Vuln_Scan/enable_vuln.py | # enable_vuln.py || part of ZocSec.SecurityAsCode.GitHub
#
# A tool for extracting important informaiton about all repos in an organization.
#
# Owner: Copyright © 2018-2019 Zocdoc Inc. www.zocdoc.com
# Authors: <NAME> @garymalaysia
# <NAME> @veggiespam
#
from github import Github
from github import ena... |
AugRM/stereo-to-mono | Stereo-to-mono.py | import os
def st2mono(arquivo):
from pydub import AudioSegment
if arquivo.endswith('.wav'):
sound=AudioSegment.from_wav(arquivo)
sound=sound.set_channels(1)
output="[MONO] %s"%(arquivo)
print("%s criado."%output)
sound.export(output, format="wav")
if arquivo.endswith('.mp3'):... |
rezam747/DSCI_522_Spotify_Track_Popularity_Predictor | src/.ipynb_checkpoints/eda_profile-checkpoint.py | <gh_stars>0
# author: UBC MDS Block 3 Group 27
# date: 2021-11-18
"""This script output the EDA report of the data.
Usage: eda_profile.py <data> <output>
Options:
<data> Takes any data, remember the path ;)
<output> output data, should be *.html
"""
import pandas as pd
from docopt import docopt
... |
rezam747/DSCI_522_Spotify_Track_Popularity_Predictor | src/preprocess_n_model.py | <reponame>rezam747/DSCI_522_Spotify_Track_Popularity_Predictor
# author : Group 27
# date : 2021-11-25
"""Performs some statistical or machine learning analysis and summarizes the results as a figure(s) and a table(s)
Usage: preprocess_n_model.py --file_path=<file_path> --out_file=<out_file>
Options:
--file_path=<fi... |
rezam747/DSCI_522_Spotify_Track_Popularity_Predictor | src/clean_n_split.py | # author : Group 27
# date : 2021-11-25
""""Cleans data csv data from a data file audio_features.csv and save it to a local filepath as csv format"
Usage: clean_n_split.py --file_path=<file_path> --out_file=<out_file>
Options:
--file_path=<file_path> Path to data file for which to perform preprocessing on
--out_f... |
DboraSilva/c-spiffe | integration_test/features/steps/fetch_x509_step.py | <reponame>DboraSilva/c-spiffe
import os
import sys
import json
import base64
import subprocess
import time
PARENT_PATH = os.path.abspath("..")
if PARENT_PATH not in sys.path:
sys.path.insert(0, PARENT_PATH)
from hamcrest import assert_that, is_, is_not
from OpenSSL import crypto
@when(u'I fetch SVID')
def step_... |
DboraSilva/c-spiffe | integration_test/features/utils.py | import os
import sys
import string
from os import chdir
from common.constants import Paths
PARENT_PATH = os.path.abspath("..")
if PARENT_PATH not in sys.path:
sys.path.insert(0, PARENT_PATH)
def handle_response(response, function_name, expected_status_code):
if response.status_code != expected_status_code:... |
DboraSilva/c-spiffe | integration_test/get-entries.py | #!/usr/bin/env python
import os
import logging
import sys
logging.basicConfig(stream=sys.stderr, level=logging.DEBUG)
def check_entries():
logging.info("Getting Entries from SPIRE server...")
bashCommand = "./get-entries.sh";
output = os.system(bashCommand)
logging.info("entries:" + ... |
DboraSilva/c-spiffe | integration_test/features/environment.py | import os
import sys
import json
import argparse
from urllib.parse import unquote
def before_all(context):
context.spiffe_id = context.config.userdata['spiffe_id']
|
DboraSilva/c-spiffe | integration_test/common/constants.py | <gh_stars>0
class Paths:
ASSETS_PATH = '..\\common\\assets\\' |
rushkii/maid_manga_id | maid_manga_id/http.py | from .utils import to_async
from bs4 import BeautifulSoup as bsoup
import requests, lxml, re
BASE = "https://maid.my.id"
@to_async
def scrape(path:str):
if bool(re.match(r'((http|https):\/\/)?(www.)?maid.my.id/(.*)', path)):
url = path
elif not path.startswith('/'):
url = f'{BASE}/{path}'
... |
rushkii/maid_manga_id | maid_manga_id/methods/manga/info.py | from bs4 import BeautifulSoup as bsoup
from dateutil import parser
import re
from maid_manga_id.scaffold import Maid
from maid_manga_id import types
from maid_manga_id import http
from maid_manga_id import utils
from maid_manga_id.object import Listing
class MangaInfo(Maid):
async def info(self, title):
... |
rushkii/maid_manga_id | maid_manga_id/maid_client.py | from maid_manga_id.scaffold import Maid
from maid_manga_id.methods import Methods
class MaidManga(Methods, Maid):
pass |
rushkii/maid_manga_id | maid_manga_id/methods/manga/search.py | from bs4 import BeautifulSoup as bsoup
from urllib.parse import quote
from urllib.parse import urlparse
import re
from maid_manga_id.scaffold import Maid
from maid_manga_id import types
from maid_manga_id import http
from maid_manga_id.object import Listing
class MangaSearch(Maid):
async def search(self, title):
... |
rushkii/maid_manga_id | maid_manga_id/types/__init__.py | <reponame>rushkii/maid_manga_id
from .manga import Manga
from .chapter import Chapters |
rushkii/maid_manga_id | example.py | from maid_manga_id import MaidManga
import asyncio
if __name__ == '__main__':
maid = MaidManga()
async def main():
manga = await maid.info('kanojo mo kanojo')
print(manga)
asyncio.get_event_loop().run_until_complete(main()) |
rushkii/maid_manga_id | maid_manga_id/types/manga.py | from typing import List, Dict
from dataclasses import dataclass
from maid_manga_id.object import Object
@dataclass
class Manga(Object):
cover: str = None
title: Dict[str, str] = None
genre: List[str] = None
synopsis: str = None
published: int = None
author: str = None
rating: float = None
... |
rushkii/maid_manga_id | old_version/maid_manga/__init__.py | from .api import MaidMangaID
__copyright__ = 'Copyright 2020 by https://maid.my.id/'
__version__ = '1.0'
__author__ = 'Kee'
__author_email__ = '<EMAIL>'
__url__ = 'https://github.com/rushkii/maid_manga_id'
__all__ = ['MaidMangaID']
|
rushkii/maid_manga_id | maid_manga_id/methods/manga/__init__.py | <reponame>rushkii/maid_manga_id<gh_stars>1-10
from .info import MangaInfo
from .search import MangaSearch
class Manga(
MangaInfo,
MangaSearch
):
pass
|
rushkii/maid_manga_id | maid_manga_id/object.py | from typing import cast, List, Any, Union, Dict, Match
from datetime import datetime
import json, inspect
import maid_manga_id
class PrettyObject:
__slots__: List[str] = []
QUALNAME = "Types"
@staticmethod
def default(obj: "PrettyObject") -> Union[str, Dict[str, str]]:
if isinstance(obj, byte... |
rushkii/maid_manga_id | maid_manga_id/methods/__init__.py | from maid_manga_id.methods.manga import Manga
class Methods(
Manga
):
pass |
rushkii/maid_manga_id | maid_manga_id/utils.py | from typing import Any, Callable
from functools import wraps, partial
from motor.frameworks.asyncio import _EXECUTOR
import asyncio
def to_async(func: Callable[[Any], Any]) -> Callable[[Any], Any]:
@wraps(func)
async def wrapper(*args: Any, **kwargs: Any) -> Any:
loop = asyncio.get_running_loop()
... |
rushkii/maid_manga_id | setup.py | from setuptools import setup, find_packages
def readme():
with open('README.md') as f:
return f.read()
setup(
name='maid_manga_id',
version='1.1',
description='Maid Manga Indonesia wrapper using Python BeautifulSoup.',
long_description=readme(),
long_description_content_type='text/mark... |
rushkii/maid_manga_id | old_version/example.py | <reponame>rushkii/maid_manga_id<filename>old_version/example.py
from maid_manga.api import MaidMangaID
import json, re
if __name__ == '__main__':
manga = MaidMangaID()
print(json.dumps(manga.top_manga('romance'), indent=4)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.