repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
BeginToCodeSnaps/PythonSnaps
EG3-06 Ding.py
<reponame>BeginToCodeSnaps/PythonSnaps<gh_stars>1-10 # EG3-06 Ding import snaps snaps.play_sound('ding.wav')
BeginToCodeSnaps/PythonSnaps
EG3-04 hello world.py
# EG3-04 hello world import snaps snaps.display_message('hello world')
BeginToCodeSnaps/PythonSnaps
EG4-04 Pizza Order Calculator.py
# EG4-04 Pizza Order Calculator students_text = input('How many students: ') students_int = int(students_text) pizza_count = students_int/1.5 print('You will need', pizza_count, 'pizzas')
BeginToCodeSnaps/PythonSnaps
EG4-01 Self Timer.py
# EG4-01 Self Timer import time import random print('''Welcome to Self Timer Everybody stand up Stay standing until you think the time has ended. Then sit down. Anyone still standing when the time ends loses. The last person to sit down before the time ended will win.''') stand_time = random.randint(5, 20) print(...
jackchi/google-python-exercises
copyspecial/copyspecial.py
<reponame>jackchi/google-python-exercises #!/usr/bin/python # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ import sys import re import os import shutil import...
jackchi/google-python-exercises
repeat.py
#!/usr/bin/python -tt import sys # Defines a "repeat" function that takes 2 arguments. def repeat(s, exclaim): """Returns the string s repeated 3 times. If exclaim is true, add exclamation marks. """ result = s + s + s # can also use "s * 3" which is faster (Why?) if exclaim: result = res...
jackchi/google-python-exercises
crack/reverse.py
<gh_stars>0 #!/usr/bin/python # Simple Algorithm To Reverse A String import sys def main(): if len(sys.argv) != 2: print 'usage: ./reverse.py %s' % ('"string"') sys.exit(1) index = {} str = sys.argv[1] rev= "" for c in str: rev = c + rev print rev return rev i...
jackchi/google-python-exercises
babynames/babynames.py
#!/usr/bin/python # Copyright 2010 Google Inc. # Licensed under the Apache License, Version 2.0 # http://www.apache.org/licenses/LICENSE-2.0 # Google's Python Class # http://code.google.com/edu/languages/google-python-class/ import sys import re """Baby Names exercise Define the extract_names() function below and c...
jackchi/google-python-exercises
crack/unique.py
#!/usr/bin/python import sys def main(): if len(sys.argv) != 2: print 'usage: ./unique.py %s' % ('"string"') sys.exit(1) index = {} str = sys.argv[1] for c in str: if c in index: print "\"%s\" not unique: %c repeated" % (str, c) sys.exit(1) e...
FabianSaulRubilarAlvarez/mat281_portfolio_template
project/Project/preprocesamiento.py
hacer la mejor predicción de cada imagen. Para ellos es necesario realizar los pasos clásicos de un proyecto de _Machine Learning_, como estadística descriptiva, visualización y preprocesamiento.
LaRiffle/axa_challenge
Main.py
import pandas as pd from fonction_py.preprocess import * from fonction_py.train import * from fonction_py.tools import * from fonction_py.robin import * from fonction_py.tim import * from sklearn import linear_model import numpy as np import matplotlib.pyplot as plt import time #A FAIRE :) #preprocess : Preprocessing...
LaRiffle/axa_challenge
fonction_py/boosting.py
<reponame>LaRiffle/axa_challenge from fonction_py.tools import * from fonction_py.preprocess import * from scipy.optimize import minimize from sklearn import linear_model import matplotlib.pyplot as plt import pandas as pd import numpy as np from pandas.tools.plotting import scatter_matrix import matplotlib.pyplot as p...
LaRiffle/axa_challenge
fonction_py/tim.py
from fonction_py.tools import * from fonction_py.preprocess import * from scipy.optimize import minimize from sklearn import linear_model import matplotlib.pyplot as plt import pandas as pd import numpy as np from pandas.tools.plotting import scatter_matrix import matplotlib.pyplot as plt from sklearn import cross_vali...
LaRiffle/axa_challenge
fonction_py/train2.py
<reponame>LaRiffle/axa_challenge from fonction_py.tools import * from sklearn import linear_model import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn import cross_validation from sklearn.linear_model import LogisticRegression from sklearn import tree from sklearn import svm from sklearn ...
LaRiffle/axa_challenge
fonction_py/robin.py
from fonction_py.tools import * from sklearn import linear_model import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn import cross_validation from sklearn.linear_model import LogisticRegression from sklearn import tree from sklearn import svm from sklearn import decomposition from sklearn...
LaRiffle/axa_challenge
fonction_py/train.py
from fonction_py.tools import * from fonction_py.preprocess import * from sklearn import linear_model import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn import cross_validation from sklearn.linear_model import LogisticRegression from sklearn import tree from sklearn import svm from skle...
LaRiffle/axa_challenge
fonction_py/preprocess.py
from numpy import * import pandas as pd import datetime from datetime import timedelta def sum_duplicated(): fields = ['DATE', 'DAY_OFF', 'WEEK_END', 'DAY_WE_DS', 'ASS_ASSIGNMENT', 'CSPL_RECEIVED_CALLS' ] # selectionne les colonnes à lire x=pd.read_csv("data/train_2011_2012_2013.csv", sep=";", usecols=fields) ...
LaRiffle/axa_challenge
fonction_py/test arima.py
from fonction_py.tools import * from sklearn import linear_model import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn import cross_validation from sklearn.linear_model import LogisticRegression from sklearn import tree from sklearn import svm from sklearn import decomposition from sklearn...
LaRiffle/axa_challenge
fonction_py/tools.py
<filename>fonction_py/tools.py from numpy import * import math import pandas def poly_exp(X, degree): N,D = X.shape for d in range(2,degree+1): X = column_stack([X,X[:,0:D]**d]) return X def MSE(yt,yp): print("NE PAS UTILISER MSE !! utiliser LinExp !!!") def normalize(df): return (df - d...
pokepocky/smop
smop/version.py
<gh_stars>100-1000 __version__='0.41-beta'
bjacquin/deezer-python
tests/test_tornado_client.py
<reponame>bjacquin/deezer-python<filename>tests/test_tornado_client.py import pytest from tornado.httpclient import AsyncHTTPClient from deezer import Album from deezer.contrib.tornado import AsyncClient pytestmark = pytest.mark.vcr class TestAsyncClient: @pytest.fixture() def async_client(self): re...
bjacquin/deezer-python
deezer/contrib/tornado.py
""" Implements an async tornado client class to query the `Deezer API <http://developers.deezer.com/api>`_ """ import json from typing import Optional, Type from urllib.parse import urlencode from tornado.gen import Return, coroutine from tornado.httpclient import AsyncHTTPClient from deezer import Resource from deez...
bjacquin/deezer-python
conftest.py
<filename>conftest.py<gh_stars>100-1000 import pytest from environs import Env import deezer env = Env() env.read_env() @pytest.fixture() def client(): return deezer.Client( # nosec app_id="foo", app_secret="bar", # This is to get human readable response output in VCR cassettes ...
bjacquin/deezer-python
tests/test_exceptions.py
<reponame>bjacquin/deezer-python import pytest import requests from deezer.exceptions import ( DeezerForbiddenError, DeezerHTTPError, DeezerNotFoundError, DeezerRetryableHTTPError, ) @pytest.mark.parametrize( ("status_code", "expected_exception"), [ (403, DeezerForbiddenError), ...
bjacquin/deezer-python
deezer/dates.py
import datetime as dt from typing import Optional DATE_FORMAT = "%Y-%m-%d" DATETIME_FORMAT = "%Y-%m-%d %H:%M:%S" def parse_date(date_str: str) -> Optional[dt.date]: datetime = parse_datetime(date_str, DATE_FORMAT) return datetime.date() if datetime else None def parse_datetime( datetime_str: str, d...
marchcui/pythUDS
udsoncan/services/ReadDTCInformation.py
from . import * from udsoncan.Response import Response from udsoncan.exceptions import * import struct class ReadDTCInformation(BaseService): _sid = 0x19 supported_negative_response = [ Response.Code.SubFunctionNotSupported, Response.Code.Incorrect...
marchcui/pythUDS
udsoncan/services/RoutineControl.py
from . import * from udsoncan.Response import Response from udsoncan.exceptions import * import struct class RoutineControl(BaseService): _sid = 0x31 class ControlType(BaseSubfunction): """ RoutineControl defined subfunctions """ __pretty_name__ = 'control type' ...
marchcui/pythUDS
udsoncan/configs.py
<gh_stars>0 default_client_config = { 'exception_on_negative_response' : True, 'exception_on_invalid_response' : True, 'exception_on_unexpected_response' : True, 'security_algo' : None, 'security_algo_params' : None, 'tolerate_zero_padding' : True, 'ignore...
marchcui/pythUDS
test/client/test_diagnostic_session_control.py
<gh_stars>0 from udsoncan.client import Client from udsoncan import services from udsoncan.exceptions import * from test.ClientServerTest import ClientServerTest class TestDiagnosticSessionControl(ClientServerTest): def __init__(self, *args, **kwargs): ClientServerTest.__init__(self, *args, **kwargs) ...
marchcui/pythUDS
udsoncan/services/AccessTimingParameter.py
from . import * from udsoncan.Response import Response from udsoncan.exceptions import * class AccessTimingParameter(BaseService): _sid = 0x83 class AccessType(BaseSubfunction): """ AccessTimingParameter defined subfunctions """ __pretty_name__ = 'access type' ...
marchcui/pythUDS
udsoncan/services/RequestDownload.py
from . import * from udsoncan.Response import Response from udsoncan.exceptions import * import struct class RequestDownload(BaseService): _sid = 0x34 _use_subfunction = False supported_negative_response = [ Response.Code.IncorrectMessageLegthOrInvalidFormat, ...
marchcui/pythUDS
udsoncan/services/WriteMemoryByAddress.py
from . import * from udsoncan.Response import Response from udsoncan.exceptions import * class WriteMemoryByAddress(BaseService): _sid = 0x3D _use_subfunction = False supported_negative_response = [ Response.Code.IncorrectMessageLegthOrInvalidFormat, ...
matthew-bahloul/browser-utils
src/po_utils/common_actions/element_interactions.py
""" by_locator : tuple --> (<selenium By object>, <selector string>) x_offset : int --> integer value of x offset in pixels y_offset : int --> integer value of y offset in pixels x_destination : int --> integer value of x location on page y_desitination : int ...
matthew-bahloul/browser-utils
src/po_utils/common_actions/gets.py
""" by_locator : tuple --> (<selenium By object>, <selector string>) attribute : str --> 'attribute of an html element' """ from po_utils.common_actions.waits import wait_for_page_to_load, wait_until_displayed, wait_until_not_displayed @wait_until_displayed @wait_for_page_to_load def get_elements(self, by...
matthew-bahloul/browser-utils
src/po_utils/common_actions/booleans.py
""" by_locator : tuple --> (<selenium By object>, <selector string>) attribute : str --> 'attribute of an html element' text : str --> 'text of the element' is_case_sensitive : bool --> boolean to toggle case sensitivity """ from po_utils.common_actions.waits import wai...
matthew-bahloul/browser-utils
src/po_utils/common_actions/waits.py
from functools import wraps from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC def wait_for_page_to_load(function): @wraps(function) def wrapper(self, *args, **kwargs): try: WebDriverWait(self.driver, self.__driver_wait_...
matthew-bahloul/browser-utils
src/po_utils/base_objects.py
<filename>src/po_utils/base_objects.py from po_utils.common_actions import element_interactions, gets, booleans from re import compile, search # helpers ----------------------------------------------- def __get_locator_by_re(locators, pattern): pattern = compile(pattern) if type(pattern) is str else pattern r...
arcticlimer/flaskquotes
src/blueprints/user_routes.py
from flask import render_template from flask import Blueprint from flask import redirect from flask import flash from flask import abort from flask_login import current_user from flask_login import login_user from utils.decorators import redirect_auth from utils.decorators import templated from utils.session import us...
arcticlimer/flaskquotes
src/utils/session.py
<filename>src/utils/session.py from typing import Optional from random import sample, randint from utils.decorators import commit from database.tables import Quote from database.tables import User def find_user(usersearch: str) -> Optional[User]: """Search for a user either by name or tag and returns it Par...
arcticlimer/flaskquotes
src/blueprints/server_routes.py
from flask import Blueprint from flask import redirect from flask import jsonify from flask import request from flask import abort from flask_login import current_user from flask_login import logout_user from utils.session import create_quote from utils.session import find_user server_routes = Blueprint(name="serve...
arcticlimer/flaskquotes
src/database/tables.py
from __future__ import annotations from datetime import datetime from werkzeug.security import generate_password_hash from werkzeug.security import check_password_hash from flask_login import UserMixin from utils.decorators import commit from exts import login from exts import db @login.user_loader def load_user(id...
arcticlimer/flaskquotes
src/utils/decorators.py
<reponame>arcticlimer/flaskquotes import functools from flask_login import current_user from flask import render_template from flask import redirect from exts import db def redirect_auth(endpoint=None): """Redirects the user to the given endpoint if authenticated""" def decorator(f): @functools.wrap...
SpadeLiu/Lac-GwcNet
test_sceneflow.py
import argparse import torch import torch.nn as nn from torchvision import transforms from tqdm import tqdm, trange import os from PIL import Image import numpy as np import matplotlib.pyplot as plt import skimage.io import cv2 from dataloader import sceneflow_loader as sf from dataloader import readpfm as rp from net...
SpadeLiu/Lac-GwcNet
networks/stackhourglass.py
<reponame>SpadeLiu/Lac-GwcNet from __future__ import print_function import torch import torch.nn as nn import torch.utils.data from torch.autograd import Variable import torch.nn.functional as F import math from networks.submodule import convbn_3d, feature_extraction, DisparityRegression from networks.deformable_refine...
SpadeLiu/Lac-GwcNet
loss_functions.py
import torch import torch.nn as nn import torch.nn.functional as F import numpy as np import cv2 from PIL import Image import matplotlib.pyplot as plt def disp2distribute(disp_gt, max_disp, b=2): disp_gt = disp_gt.unsqueeze(1) disp_range = torch.arange(0, max_disp).view(1, -1, 1, 1).float().cuda() gt_dist...
SpadeLiu/Lac-GwcNet
KITTI_ft.py
<gh_stars>10-100 import argparse import torch import torch.utils.data as data import torch.optim as optim import torch.nn.functional as F import torch.nn as nn import numpy as np import os from tqdm import tqdm from collections import OrderedDict from dataloader import KITTIloader as kt from dataloader import KITTI2012...
SpadeLiu/Lac-GwcNet
networks/deformable_refine.py
import torch import torch.nn as nn import torch.nn.functional as F from networks.U_net import U_Net, U_Net_F, U_Net_F_v2 class OffsetConv(nn.Module): def __init__(self, inc, node_num, modulation): super(OffsetConv, self).__init__() self.modulation = modulation self.p_conv = nn.Conv2d(inc,...
SpadeLiu/Lac-GwcNet
dataloader/sceneflow_loader.py
import os from PIL import Image from dataloader import readpfm as rp import torch.utils.data as data import torchvision.transforms as transforms import numpy as np import random IMG_EXTENSIONS= [ '.jpg', '.JPG', '.jpeg', '.JPEG', '.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP' ] def is_image_file(filename): ...
SpadeLiu/Lac-GwcNet
networks/submodule.py
<gh_stars>10-100 from __future__ import print_function import torch import torch.nn as nn import torch.utils.data from torch.autograd import Variable import torch.nn.functional as F from torchvision import models import math import numpy as np import torchvision.transforms as transforms import PIL import os import matp...
SpadeLiu/Lac-GwcNet
networks/refinement.py
import torch import torch.nn as nn import torch.nn.functional as F def reconstruction(right, disp): b, _, h, w = right.size() x_base = torch.linspace(0, 1, w).repeat(b, h, 1).type_as(right) y_base = torch.linspace(0, 1, h).repeat(b, w, 1).transpose(1, 2).type_as(right) flow_field = torch.stack((x_ba...
SpadeLiu/Lac-GwcNet
networks/affinity_feature.py
import torch import torch.nn as nn import torch.nn.functional as F class AffinityFeature(nn.Module): def __init__(self, win_h, win_w, dilation, cut): super(AffinityFeature, self).__init__() self.win_w = win_w self.win_h = win_h self.dilation = dilation self.cut = 0 def...
SpadeLiu/Lac-GwcNet
test_kitti.py
<reponame>SpadeLiu/Lac-GwcNet import argparse import torch import torch.nn as nn from torchvision import transforms import os from tqdm import tqdm, trange from PIL import Image import numpy as np import matplotlib.pyplot as plt from dataloader import KITTIloader as kt from networks.stackhourglass import PSMNet import...
SpadeLiu/Lac-GwcNet
networks/U_net.py
<filename>networks/U_net.py import torch import torch.nn as nn import torch.nn.functional as F import math class conv_block(nn.Module): def __init__(self, ch_in, ch_out): super(conv_block, self).__init__() self.conv = nn.Sequential( nn.Conv2d(ch_in, ch_out, kernel_size=3, stride=1, pad...
saramsv/decaying_human_body_part_classifier
predict_labels.py
<reponame>saramsv/decaying_human_body_part_classifier #!/usr/bin/env python ## run : python3 predict_labels.py file_name #(each line in file_name is a path_to_img) import cv2 import numpy as np from keras.models import load_model import keras import csv import sys import os from keras.preprocessing import image impor...
saramsv/decaying_human_body_part_classifier
path2clustering.py
#RUN: python path2clustering file_with_paths import tensorflow.keras from tensorflow.keras.applications import ResNet50 from tensorflow.keras.applications.resnet50 import preprocess_input from tensorflow.keras.models import Sequential from tensorflow.keras.models import Model from tensorflow.keras.layers import Dense, ...
saramsv/decaying_human_body_part_classifier
sequence.py
<filename>sequence.py import sys import numpy as np import csv import ast import datetime import math def key_func(x): # For some year like 2011 the year is 2 digits so the date format should ne %m%d%y but for others like 2015 it should be %m%d%Y try: #date = "" if '(' in x: da...
saramsv/decaying_human_body_part_classifier
kmeans_embeddings_clustering.py
#python3 clustering.py --embeding_file data/pcaUT29-15 --cluster_number 7 > daily_merge_7ClusAll # the file for this script should be image_name va1l val2.... valn. from sklearn.cluster import KMeans from sklearn.decomposition import PCA from sklearn.cluster import DBSCAN import matplotlib.pyplot as plt import sys imp...
saramsv/decaying_human_body_part_classifier
pred_one_million.py
#!/usr/bin/env python ## run : python3 predict_bodypart.py file_name #file name is each line a path and then : the grount truth label import cv2 import numpy as np from keras.models import load_model import csv import sys import os from keras.preprocessing import image import pandas as pd from sklearn.metrics import ...
saramsv/decaying_human_body_part_classifier
resnet2pca.py
#python3 resnet2pca.py --embeding_file 50000resnet.csv > 50000PCAed64 # the input file is image_name var1 var2.....varn. #NOTE: No '' round the image_name import csv from sklearn.decomposition import PCA import argparse import ast import numpy as np import sys csv.field_size_limit(sys.maxsize) parser = argparse.Ar...
saramsv/decaying_human_body_part_classifier
label_voting.py
<gh_stars>0 #!usr/bin/env python3 import pandas as pd import operator import sys pd.set_option('display.max_columns', None) pd.set_option('display.expand_frame_repr', False) pd.set_option('max_colwidth', -1) pd.set_option('display.max_rows', 1000) file_name = sys.argv[1] df = pd.read_csv(file_name, delimiter = ...
saramsv/decaying_human_body_part_classifier
classifier.py
<filename>classifier.py<gh_stars>0 #!/usr/bin/env python # run python3 classifier.py very_clean_label_data import cv2 import numpy as np import matplotlib.pyplot as plt from keras.preprocessing import image from keras.preprocessing.image import ImageDataGenerator from keras.applications.inception_v3 import InceptionV3 ...
saramsv/decaying_human_body_part_classifier
decom_sequence_generator.py
<reponame>saramsv/decaying_human_body_part_classifier<gh_stars>0 #run python3 decom_sequence_generator.py file_with_the_following_format # the file for this script should be image_name va1l val2.... valn. import sys import numpy as np import csv import ast import datetime import argparse from operator import itemgette...
saramsv/decaying_human_body_part_classifier
classify_all_1M_imgs.py
#!/usr/bin/env python ## run : python3 predict_bodypart.py file_name #each line in file_name is a path import cv2 import numpy as np from tensorflow.keras.models import load_model import csv import sys import os from tensorflow.keras.preprocessing import image import pandas as pd from sklearn.metrics import confusio...
saramsv/decaying_human_body_part_classifier
model_evaluation.py
<reponame>saramsv/decaying_human_body_part_classifier #!/usr/bin/env python ## run : python3 predict_bodypart.py gt_file_name #gt_file_name has a path to an image and the grount truth label seperated by ":" in each line import os import cv2 import csv import sys import numpy as np import pandas as pd from tqdm import...
saramsv/decaying_human_body_part_classifier
path2embeding.py
<reponame>saramsv/decaying_human_body_part_classifier<filename>path2embeding.py<gh_stars>0 # only use it to generate the resnet features then use the other script to convert to pca #python3 path2embeding.py --img_path data/some_paths --weight_type pt > resnet_feautres_filename #then clean the [] and , from the all_emb...
NuthanReddy/mp3-meta-cleanser
mp3clean.py
from __future__ import print_function import os, re, argparse from eyed3.id3 import Tag class CleanMyMusic: def __init__(self): self.regex = r"" self.t = Tag() self.parser = argparse.ArgumentParser(description='A Python Script to clean/format mp3 file metadata', ...
echel0nn/project-management-system
register/admin.py
from django.contrib import admin from .models import Team from .models import UserProfile from .models import Invite class TeamAdmin(admin.ModelAdmin): list_display = ['name','email','city','found_date'] search_fields = ['name', 'social_name','city'] class UserProfileAdmin(admin.ModelAdmin): list_display...
echel0nn/project-management-system
projects/views.py
from django.shortcuts import render from django.db.models import Avg from register.models import Project from projects.models import Task from projects.forms import TaskRegistrationForm from projects.forms import ProjectRegistrationForm from django.contrib.auth.decorators import login_required # Create your views here...
echel0nn/project-management-system
register/urls.py
from django.urls import path from . import views app_name = 'register' urlpatterns = [ path('new-user/', views.register, name='new-user'), path('new-team/', views.newTeam, name='new-team'), path('users/', views.usersView, name='users'), path('users/profile', views.profile, name='profile'), path('u...
dokla/moncash_python
moncash/configuration.py
<reponame>dokla/moncash_python<gh_stars>10-100 from moncash.http import Http from moncash.exceptions import ConfigurationError from moncash.environment import Environment class Configuration(object): def __init__(self, client_id=None, client_secret=None, environment=None): self.client_id = client_id ...
dokla/moncash_python
moncash/gateway.py
from moncash.configuration import Configuration from moncash.payement import Payment class Moncash(object): def __init__(self, config=None, **kwargs): if isinstance(config, Configuration): self.config = config else: self.config = Configuration( client_id=kw...
dokla/moncash_python
moncash/version.py
<gh_stars>10-100 version="1.0.2"
dokla/moncash_python
moncash/__init__.py
<filename>moncash/__init__.py """ _ /\/\ ___ _ __ ___ __ _ ___| |__ / \ / _ \| '_ \ / __/ _` / __| '_ \ / /\/\ \ (_) | | | | (_| (_| \__ \ | | | \/ \/\___/|_| |_|\___\__,_|___/_| |_| This is an unofficial wrapper providin...
ITTV-tools/oilfoxpy
setup.py
<filename>setup.py<gh_stars>1-10 import setuptools setuptools.setup( name="oilfoxpy", version="0.4", author="ittv-tools", description="API call to oilfox", url="https://github.com/ITTV-tools/olifoxpy", py_modules=["oilfox"], package_dir={'': 'src'}, install_requires=['jwt', 'json', 'req...
bincrafters/conan-http-parser
conanfile.py
from conans.errors import ConanInvalidConfiguration import os import shutil from conans import ConanFile, CMake, tools class HttpParserConan(ConanFile): name = "http-parser" version = "2.9.0" description = "http request/response parser for c" url = "https://github.com/bincrafters/conan-http-parser" ...
compositive/node-sketch-bridge
binding.gyp
<reponame>compositive/node-sketch-bridge { "targets": [ { "target_name": "node_sketch_bridge", "sources": [ "main.m" ], "conditions": [ [ "OS=='mac'", { "defines": [ "__MACOSX_CORE__" ], "link_settings": ...
pinklite34/passes-rest-samples
python/main.py
<reponame>pinklite34/passes-rest-samples """ Copyright 2019 Google Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless r...
Atry/hhvm
hphp/hack/test/fanout/tools/fanout_test_driver.py
<filename>hphp/hack/test/fanout/tools/fanout_test_driver.py # pyre-strict from __future__ import annotations import json import logging import os import re import shutil import subprocess import sys import tempfile from typing import Dict, List, Tuple, Optional, Any import attr from .fanout_information import Fanout...
rgreinho/yelper
tests/step_defs/test_features.py
<filename>tests/step_defs/test_features.py """ Define the scenarios for the feauture tests. This file should contain our scenarios, but if it does, it cannot find the steps. """ # from pytest_bdd import scenario # @scenario('../features/collect.feature', 'Collect information') # def test_collect_information(): # ...
rgreinho/yelper
tests/step_defs/test_steps.py
"""Define the feature test steps.""" import asyncio import json import os from faker import Faker import pytest from pytest_bdd import given from pytest_bdd import scenario from pytest_bdd import then from yelpapi import YelpAPI from yelper.core.yelper import async_deep_query from tests import mock_data # The scena...
rgreinho/yelper
tests/mock_data.py
"""Define the mock data for the tests.""" from textwrap import dedent # Search results for "Bike shops in Austin, TX". YELP_SEARCH_RESULTS = """ { "businesses": [ { "id": "WT_d47o-V5xlMNx8trI0-A", "alias": "monkey-wrench-bicycles-austin", "name": "<NAME>", "image_url": "https://s3-media3....
rgreinho/yelper
yelper/core/yelper.py
<reponame>rgreinho/yelper """Define the core functions.""" import asyncio import csv import dataclasses import os import re import urllib import urllib3 import aiohttp from lxml import html from yelpapi import YelpAPI urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) HEADERS = { 'User-Agent': ...
rgreinho/yelper
yelper/main.py
"""quick .""" from yelper.cli.cli import cli # pylint: disable=no-value-for-parameter if __name__ == '__main__': cli()
rgreinho/yelper
tests/test_yelper.py
"""Test the Yelper module.""" class TestYelpBusiness: """Test the YelpBusiness class."""
jianbo-sudo/detectron2_layout
upload_detectron.py
<gh_stars>0 # coding:utf-8 from flask import Flask, render_template, request, redirect, url_for, make_response,jsonify from werkzeug.utils import secure_filename import time from PIL import Image from datetime import timedelta import os, json, cv2, random, io import numpy as np import torch from detectron2.engine im...
alyshakt/mobile-appium-framework-py
setup_helpers/PlatformType.py
<filename>setup_helpers/PlatformType.py """To define the platform type""" import enum class PlatformType(enum.Enum): """To define a standardized platform type""" ios = 1 android = 2
alyshakt/mobile-appium-framework-py
ios_objects/ios_pages.py
"""Created December 15th, 2020 by <NAME> """ import datetime import pytest from appium.webdriver.common.touch_action import TouchAction from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.support import expected_conditions from selenium.webdriver.support.wait import WebDriverWait fr...
alyshakt/mobile-appium-framework-py
tests/gen_rand_num_id.py
<reponame>alyshakt/mobile-appium-framework-py<filename>tests/gen_rand_num_id.py import random import string def random_number(range=10): amount = random.randrange(range) if amount < 1: amount = amount + 1 return amount def random_string(stringLength=10): letters = string.ascii_letters re...
alyshakt/mobile-appium-framework-py
tests/conftest.py
import time import logging def pytest_addoption(parser): """Defines arguments that can be passed in""" parser.addoption("--environment", action="store", default="dev", help="Environment to run tests in") parser.addoption("--is_headless", ...
alyshakt/mobile-appium-framework-py
ios_objects/ios_page_locators.py
<reponame>alyshakt/mobile-appium-framework-py """Created December 29th, 2020 by <NAME> This Base Page object locator strategy was gleaned with much gratitude from http://elementalselenium.com/tips/9-use-a-base-page-object """ class BasePageLocators(object): """Initializes the driver for use on all other ...
alyshakt/mobile-appium-framework-py
setup_helpers/driver_setup.py
"""To set up the appium driver by Platform Type""" import logging """Created December 15th, 2020 by <NAME> """ import os from appium import webdriver from appium.webdriver.appium_service import AppiumService appium_service = AppiumService() def get_app_type(PlatformType): """To Define the platform type for you...
alyshakt/mobile-appium-framework-py
tests/ios_ui/test_filelist.py
"""Created December 15th, 2020 by <NAME> """ import logging from ios_objects import ios_pages from setup_helpers import driver_setup from setup_helpers.PlatformType import PlatformType def test_filelist(is_headless, record_xml_attribute): """A basic test to check for a file list""" record_xml_attribute( ...
nishadg246/pybullet-play
examples/pybullet/examples/nishad.py
import pybullet as p import time import math import numpy as np import random p.connect(p.GUI) p.loadURDF("plane.urdf",[0,0,-.2],globalScaling=6.0,useFixedBase=True) cylId = p.loadURDF("simple_cylinder.urdf",[0,0,0.2],globalScaling=6.0,useFixedBase=False) cubeId = p.loadURDF("cube.urdf",[2,2,0],globalScaling=0.6,useFi...
mikiec84/wagtail-filepreviews
wagtaildocs_previews/apps.py
<reponame>mikiec84/wagtail-filepreviews<filename>wagtaildocs_previews/apps.py<gh_stars>10-100 from __future__ import unicode_literals from django.apps import AppConfig class WagtailDocsPreviewsConfig(AppConfig): name = 'wagtaildocs_previews' label = 'wagtaildocs_previews' verbose_name = 'Wagtail document...
mikiec84/wagtail-filepreviews
wagtaildocs_previews/views.py
import json from django.http import JsonResponse from django.views.decorators.csrf import csrf_exempt from .models import PreviewableDocument @csrf_exempt def filepreviews_webhook(request): if request.method == 'POST': body = json.loads(request.body.decode('utf8')) user_data = body.get('user_dat...
mikiec84/wagtail-filepreviews
wagtaildocs_previews/urls.py
from __future__ import absolute_import, unicode_literals from django.conf.urls import include, url from wagtail.documents import urls as wagtaildocs_urls from .views import filepreviews_webhook urlpatterns = [ url(r'', include(wagtaildocs_urls)), url(r'webhooks/filepreviews$', filepreviews_webhook, ...
mikiec84/wagtail-filepreviews
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re import shutil import sys from setuptools import setup def read(*paths): """ Build a file path from paths and return the contents. """ with open(os.path.join(*paths), 'r') as f: return f.read() def get_version(package): ""...
mikiec84/wagtail-filepreviews
wagtaildocs_previews/settings.py
from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils import six from django.utils.module_loading import import_string def get_callback_function(setting_name, default=None): func = getattr(settings, setting_name, None) if not func: return default ...
mikiec84/wagtail-filepreviews
wagtaildocs_previews/migrations/0001_initial.py
<filename>wagtaildocs_previews/migrations/0001_initial.py # -*- coding: utf-8 -*- # Generated by Django 1.10.7 on 2017-04-16 16:02 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import jsonfield.fields import taggit.man...
mikiec84/wagtail-filepreviews
wagtaildocs_previews/tests/test_models.py
import json from django.core.files.base import ContentFile from django.test import TestCase from django.utils.six import b import responses from wagtail.core.models import Site from wagtaildocs_previews.models import ( FilePreviewsSettings, PreviewableDocument ) def setup_mock(): def request_callback(reque...