text stringlengths 2 999k |
|---|
__author__ = "Israel Fruchter <israel.fruchter@gmail.com>"
from cffi import FFI
ffi = FFI()
ffi.cdef('''
typedef void * HANDLE;
typedef HANDLE HWND;
typedef int BOOL;
typedef unsigned int UINT;
typedef int SIZE_T;
typedef char * LPTSTR;
typedef HANDLE HGLOBAL;
typedef HANDLE LPVOID;
... |
from numpy import cross, eye, dot, array, pi
from numpy.linalg import norm
from math import atan2, sqrt
def ssc(v):
'''
Calculate the skew-symmetric cross-product matrix of v
See: See: http://math.stackexchange.com/a/897677/6965
'''
return array([[0, -v[2], v[1]],
[v[2], 0, -v[0... |
# MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptio... |
# Generated by Django 3.2.9 on 2021-12-20 04:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('mysite', '0013_auto_20211219_2320'),
]
operations = [
migrations.RemoveField(
model_name='formation',
name='courses'... |
from sklearn.base import BaseEstimator, TransformerMixin
import numpy as np
class RandomFeature(BaseEstimator, TransformerMixin):
def __init__(self, n_cols=1):
self.n_cols = n_cols
def fit(self, X, y=None):
return self
def transform(self, X, y=None):
n_rows = len(X)
retur... |
import os
import torch
import numpy as np
from PIL import Image
import voc12.dataloader
import torch.nn.functional as F
from torch.backends import cudnn
from alisuretool.Tools import Tools
from misc import torchutils, indexing
from torch import multiprocessing, cuda
from torch.utils.data import DataLoader
from net.resn... |
#! /usr/bin/env python
# filename: dmrg.py
import numpy
from mps_tensor import local_state
from mpo import MPO
# Attention to the identifiers "pos" and "idx":
# pos: the position index of REAL sites
# idx: the index of all the sites, including two dummies
# pos == 0 is the first REAL site, whose idx is 1
# idx = pos ... |
import os
import torch
import torch.nn as nn
from ...ops.iou3d_nms import iou3d_nms_utils
from .. import backbones_2d, backbones_3d, dense_heads, roi_heads
from ..backbones_2d import map_to_bev
from ..backbones_3d import pfe, vfe
from ..model_utils import model_nms_utils
class Detector3DTemplate(nn.Module):
def... |
# Copyright (c) 2016 Claudiu Popa <pcmanticore@gmail.com>
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
# For details: https://github.com/PyCQA/astroid/blob/master/COPYING.LESSER
import sys
import textwrap
import six
import astroid
PY34 = sys.version_info >= (3, 4)
PY36 = s... |
import os
import zipfile
from datetime import datetime
from io import BytesIO
from typing import List
from fastapi import APIRouter, Depends, HTTPException, status, UploadFile, File
from fastapi.encoders import jsonable_encoder
from fastapi.responses import FileResponse
from sqlalchemy.orm import Session
from ensysmo... |
# Copyright 2020 MONAI Consortium
# 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 required by applicable law or agreed to in writing, s... |
from typing import List
class InvalidCommand(Exception):
def __init__(self, command: List[str], cli: str) -> None:
super().__init__(f"Invalid command: {command}\n\n{cli}")
class InvalidSourcePath(Exception):
def __init__(self, path: str) -> None:
super().__init__(f"Non-existent source path: ... |
# -*- coding: utf-8 -*-
description = 'system setup'
group = 'lowlevel'
sysconfig = dict(
cache = 'stressictrl.stressi.frm2',
instrument = 'Stressi',
experiment = 'Exp',
datasinks = [
'conssink', 'daemonsink', 'livesink', 'LiveImgSink', 'LiveImgSinkLog'
],
notifiers = ['email', 'smser... |
from typing import Tuple
from .types import FSharpRef
def get_range(unsigned: bool, bitsize: int) -> Tuple[int, int]:
if bitsize == 8:
return (0, 255) if unsigned else (-128, 127)
if bitsize == 16:
return (0, 65535) if unsigned else (-32768, 32767)
if bitsize == 32:
return (0, 4294... |
from __future__ import absolute_import, division, print_function
from cctbx.omz import dev
from cctbx.development import random_structure
from cctbx.development import debug_utils
from cctbx.array_family import flex
import random
import sys
if (1):
random.seed(0)
flex.set_random_seed(0)
def run_call_back(flags, s... |
"""IBM URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vie... |
from flask import Flask, redirect, send_file, request, jsonify
from models import InstallID
import requests
import boto3
import random
import string
import botocore
# Imports go here.
app = Flask(__name__)
# Defines the app.
@app.route("/")
def go_to_website():
"""Returns to magiccap.me"""
return redirect("h... |
#!/usr/bin/env python
#
# Public Domain 2014-2017 MongoDB, Inc.
# Public Domain 2008-2014 WiredTiger, Inc.
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compil... |
from .graph_features import (
num_edges,
triangle_ratio,
avg_shortest_path_length,
avg_clustering_coefficient,
global_clustering_coefficient,
diameter,
square_clustering,
degree_assortativity,
density,
node_connectivity,
)
|
# https://github.com/google/go-attestation/blob/master/attest/eventlog.go#L588
# https://lists.ofono.org/hyperkitty/list/tpm2@lists.01.org/thread/PVR5UPADM6VYITAADIZUHWCMBD3MIEPL/
# https://trustedcomputinggroup.org/wp-content/uploads/EFI-Protocol-Specification-rev13-160330final.pdf
# https://trustedcomputinggroup.org/... |
tempC = float(input("Unesite temperaturu u *C: "))
tempF = 1.8 * tempC + 32
print("Temperatura u *F je " + str(tempF))
|
#!/usr/bin/env python3
# Copyright 2019 Shift Cryptosecurity AG
#
# 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 required by appl... |
#!/usr/bin/env python3
# Copyright (c) 2014-2016 The Ruxcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test pruning code
# ********
# WARNING:
# This test uses 4GB of disk space.
# This test takes 30 mins... |
import aiohttp
import requests
from typing import Union, TypeVar, List, Dict, Optional, Literal
from .objects import *
from .models import *
from .errors import ImgflipError
__all__ = (
"Imgflip",
"ImgflipError",
"Meme",
"Box",
"Template"
)
__version__ = "1.0"
ImgflipModel = Type... |
import os
import re
import shutil
import sys
from pathlib import Path
import regex
class File(object):
@staticmethod
def get_yaml_files(path):
files = os.listdir(path)
return filter(lambda file: re.match(r".*\.yml$", file), files)
@staticmethod
def real_path(base_path, path):
... |
#!/usr/bin/env python3
# Copyright (c) 2014-2018 The Baricoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test coinbase transactions return the correct categories.
Tests listtransactions, listsinceblock, and... |
# -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-06-03 13:49
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('smartshark', '0003_auto_20160603_1523'),
]
operations = [
migrations.RemoveF... |
import re
HEADER_LINE_RE = re.compile("^#[*]+ (\w+): (.*)$")
def parse_header(header_line):
"""
Return (header-name, header-value), or None if the line can't be
parsed.
"""
match = HEADER_LINE_RE.match(header_line)
if not match:
return None
return (match.group(1), match.group(2))
|
#Using classname.method
'''class Parent:
def show(self):
print("Inside Parent")
class Child(Parent):
def show(self):
Parent.show(self)
print("Inside Child")
O = Child()
O.show()'''
#Using super()
class Parent:
def show(self):
print("Inside Parent")
class Child(Parent):
... |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-11-25 12:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('awwards', '0009_auto_20191125_1433'),
]
operations = [
migrations.AlterField(... |
import numpy as np
from sklearn.metrics import roc_auc_score, accuracy_score, log_loss
from utils.encoder import target_encode
def kfold_stack_binary(kfold, classifier, x_train, y_train, x_test):
"""k fold stacking x_train and y_train for binary classification task
given estimator `classifier` from sklearn ap... |
# Copyright (c) 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import webapp2
from perf_insights import cloud_config
def _is_devserver():
return os.environ.get('SERVER_SOFTWARE', '').startswith('Develop... |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import pickle
import argparse
import builtins
import math
import os
import random
import shutil
import time
import warnings
import sys
from datetime import date
import torch
import torch.nn as nn
import torch.nn.parallel
import torch.backends.cudn... |
import os
from codecs import open
from setuptools import setup, find_packages
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
VERSION = __import__('tapeforms').__version__
with open(os.path.join(BASE_DIR, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='django-tapefor... |
from timeseries import TimeSeries
from .tsdb_error import TSDBStatus
class TSDBOp(dict):
'''
Interface class for TSDB network operations. Used to document the database
operations supported, including their "string name" in the typemap, and
conversion to and from a json-like dictionary structure.
N... |
# coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-255
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class ConnectorFetchStreamMessage(object):
"""
NOTE... |
from urllib.parse import urlparse
from toolkit.lib.http_tools import request_page
from bs4 import BeautifulSoup, Doctype
import requests
import pandas as pd
import hashlib
from .lib import generate_audit_json, generate_result_bool, generate_result_int
class AuditWebsite():
def __init__(self, url):
parsed_u... |
"""
Loads data
"""
import os
import PIL
import torch
import pandas
import numpy as np
from PIL import Image
from torch.utils.data import Dataset
from torch.utils.data import DataLoader
from torchvision import transforms
class NonTemporalDataset(Dataset):
def __init__(self, dataset_file_path, opt):
self.opt = opt
... |
""" Entry point for our twitoff flask app"""
from .app import create_app
APP = create_app()
|
# Copyright 2013, Couchbase, 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 required by applicable law... |
"""The code to test training process for pnet"""
# MIT License
#
# Copyright (c) 2017 Baoming Wang
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without li... |
# -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
# pylint: ... |
"""
This module defines a BaseDecorator to wrap a user view function and a RequestResponseDecorator
which manages the lifecycle of a request internally in Especifico.
"""
import asyncio
import functools
import logging
from ..utils import has_coroutine
logger = logging.getLogger("especifico.decorators.decorator")
c... |
#!/usr/bin/env python
"""
Download the given htmx version and the extensions we're using.
"""
import argparse
import subprocess
from typing import List, Optional
def main(argv: Optional[List[str]] = None) -> int:
parser = argparse.ArgumentParser()
parser.add_argument("version", help="e.g. 1.0.1")
args = p... |
import serial
import time
import random
import sys
# Give port name of your UART as first argument. No error checking
# here, sorry.
#
ser = serial.Serial(sys.argv[1], 9600, timeout = 1)
serwrite = lambda x: ser.write(bytearray(map(ord, x)))
move_to = lambda x, y: serwrite("\x1B[{0};{1}H".format(y, x))
serwrite("xx... |
# coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... |
from PIL import Image
from torchvision.transforms.functional import five_crop as torch_five_crop, resize as torch_resize
from fingerprints_dataset import get_fingerprint_images_list
def save_resized_image(path, HR_image_size, LR_image_size):
img = Image.open(path)
resized = torch_resize(img, HR_image_size)
... |
"""
.. module:: parser_mp
:synopsis: Definition of the command line options
.. moduleauthor:: Benjamin Audren <benjamin.audren@epfl.ch>
.. moduleauthor:: Francesco Montesano <franz.bergesund@gmail.com>
Defines the command line options and their help messages in
:func:`create_parser` and read the input command line... |
import numpy
n = int(input())
a = numpy.array([input().split() for _ in range(n)], int)
b = numpy.array([input().split() for _ in range(n)], int)
print(numpy.dot(a, b)) |
# coding: utf-8
import pprint
import re
import six
class ConfigByOption:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value is ... |
# Copyright 2015 The TensorFlow Authors. 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 required by applica... |
#import adafruit_dht
#import board
import Adafruit_DHT as dht
from Observer.Observer import Observer
from prometheus_client import Gauge
class ObserverDH22(Observer):
# dhtDevice = adafruit_dht.DHT22(board.D18)
# dhtDevice = adafruit_dht.DHT22(18)
def __init__(self, name, session = None, *args, **kwargs):
... |
"""
Mar 3 - all labels
757 | 0.639035 | 0.681034 | 0.938330 | 79.90% | 67.6s
Early stopping.
Best valid loss was 0.660526 at epoch 656.
Finished training. Took 51241 seconds
Accuracy test score is 0.7903
Multiclass log loss test score is 0.6823
Model saved to models/net-net_mar3_specialist_1-0.... |
from utils import *
from anndata import AnnData
from sklearn.metrics import roc_auc_score
import scanpy as sc
from scipy.sparse import csc_matrix, csr_matrix
def auroc(y1, y2):
labels = np.zeros(len(y1) + len(y2))
labels[:len(y1)] = 1.
values = np.concatenate([ y1, y2 ])
return roc_auc_score(labels, v... |
from django.contrib import admin
from management.models import Activity, Assistance
@admin.register(Assistance)
class AssistanceAdmin(admin.ModelAdmin):
search_fields = ('activity__title',)
list_display = ('activity', 'number_of_assistance', 'date',)
list_filter = ('date',)
fieldsets = (
('As... |
import typing
T = typing.TypeVar("T")
class TrieNode(typing.Generic[T]):
def __init__(self):
self.values: typing.List[T] = []
self.children: typing.Dict[str, TrieNode] = {}
class Trie(typing.Generic[T]):
"""A simple in-memory trie"""
def __init__(self):
self._root: TrieNode[T]... |
import cocotb
from cocotb.clock import Clock
from cocotb.triggers import ClockCycles
@cocotb.test()
async def test_icebreaker_top(dut):
# start a 12 MHz clock
clock = Clock(dut.clock, round(1e3/100), units="ns")
cocotb.start_soon(clock.start())
# reset
dut.reset.value = 1
await ClockCycles(dut... |
# -*- coding: utf-8 -*-
#
# TSE 上市證券
# OTC 上櫃證券
# Future 期貨
import os
import redis
import csv,json
from json import JSONEncoder
from collections import namedtuple
from shioajicaller.caller import Caller
StockROW = namedtuple('Stock', [
'exchange',
'code',
... |
""" This module provides the functions used to build the platform information
that is available for actions """
import platform
from pprint import pprint
import warnings
def get_platform_info():
""" Returns the base information from the running platform """
platform_info = {}
for key in dir(platform):
... |
"""
ASGI config for whisper project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTI... |
# coding: utf-8
# /*##########################################################################
#
# Copyright (C) 2016-2018 European Synchrotron Radiation Facility
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to d... |
import math
from collections import defaultdict
import numpy as np
import pandas as pd
from tqdm import tqdm
import sketch.compress_freq as cf
import sketch.sketch_frequent as f
import sketch.compress_dyadic as dyadic
class LinearBenchRunner:
def __init__(
self,
size,
segment... |
# Copyright 2017 The TensorFlow Authors. 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 required by... |
#!/usr/bin/env python
import os, re, sys, tarfile, zipfile
try:
from urllib.request import urlretrieve # this option only true with Python3
except:
from urllib import urlretrieve
options = sys.argv[1:]
# Auxiliary data downloads
# Format: [URL, file 1, file 2, ..., file to run when done]
_bpass_v1_links =... |
# Copyright 2021 The DaisyKit Authors.
#
# 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 required by applicable law or agreed to i... |
import os.path
import pytest
import socket
import ssl
def pytest_addoption(parser):
parser.addoption('--server', action='store', default='localhost',
help='memcached server')
parser.addoption('--port', action='store', default='11211',
help='memcached server port')
... |
from opentelemetry.instrumentation.botocore import (
BotocoreInstrumentor,
_determine_call_context,
)
class FilteredBotocoreInstrumentor(BotocoreInstrumentor):
def _instrument(self, **kwargs):
self.excluded = set(kwargs.get("excluded", []))
super(FilteredBotocoreInstrumentor, self)._instru... |
txt = "Welcome to my 2nd world"
x = txt.title()
print(x)
|
#!/usr/bin/env python
# dymerge.py
"""
Copyright (C) 2016 Nikolaos Kamarinakis (nikolaskam@gmail.com)
See License at nikolaskama.me (https://nikolaskama.me/dymergeproject)
____
/\ _`\ /'\_/`\
\ \ \/\ \ __ __/\ \ __ _ __ __ __
\ \ \ \ \/\ \/\ \ \ \__\ \ /'__`\/\` __\/'_ `\ /'__`\
... |
# coding: utf8
__author__ = 'Lev'
|
# Copyright (c) 2021, NVIDIA CORPORATION.
# 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 required by applicable law or agreed to i... |
from django.apps import AppConfig
from django.utils.translation import gettext_lazy as _
class CalendarConfig(AppConfig):
name = 'terrafirma.calendar'
label = 'terrafirma_calendar'
verbose_name = _('Terrafirma Calendar')
|
"""A simple HTML visualizer.
It is based on the Cycle-GAN codebase:
https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix
"""
import os
import numpy as np
from pathlib import Path
from . import util, html
class Visualizer:
"""This class includes several functions that can display/save images.
It uses a Py... |
from jumpscale import j
JSBASE = j.application.jsbase_get_class()
class WIC_Factory(JSBASE):
def __init__(self):
self.__jslocation__ = "j.tools.wic"
self.defPassword = "rooter"
JSBASE.__init__(self)
def get(self, ipaddr, passwd=""):
return WIC()
def install(self, wics="... |
__author__ = 'benjamindeleener'
import numpy as np
from datetime import datetime, timedelta
import multiprocessing
def find_closest(A, target):
# A must be sorted and must be a numpy array
idx = A.searchsorted(target)
idx = np.clip(idx, 1, len(A)-1)
left = A[idx-1]
right = A[idx]
idx -= target... |
#!/usr/bin/env python3
# Diff or copy protoxform artifacts from Bazel cache back to the source tree.
import argparse
import os
import pathlib
import re
import shutil
import string
import subprocess
import sys
import tempfile
from api_proto_plugin import utils
from importlib.util import spec_from_loader, module_from... |
import requests
import urllib.request
import time
import urllib
import re
import csv
import sys
from bs4 import BeautifulSoup
def leiden_uni():
url = "https://www.universiteitleiden.nl/en/science/computer-science/staff?_ga=2.53055201.852038052.1618384824-1207103337.1618384824#tab-2"
headers = {'User... |
"""
Copyright 2020 Google LLC
Copyright 2020 PerfectVIPs Inc.
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 required by applicable law or agreed t... |
#!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""The frontend for the Mojo bindings system."""
from __future__ import print_function
import argparse
try:
import cPickle as pick... |
import pytest
import numpy as np
from numpy.testing import assert_array_equal
from scipy.stats import multiscale_graphcorr
from causalscm.cgm import CausalGraph
from causalscm.scm import StructuralCausalModel
seed = 12345
rng = np.random.RandomState(seed=seed)
def test_scm_errors():
"""Test SCM class and error... |
# Copyright (c) 2016 PaddlePaddle Authors. 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 required by applic... |
"""Game Unittest"""
import unittest
from unittest.mock import patch
from diceGame import Game
from diceGame.Bcolors import Bcolors
from diceGame.Player import Player
class TestGame(unittest.TestCase):
"""Game Testing class."""
DIVIDER = "===================================================================\
==... |
"""Handles the rendering of libtcod's tilesets.
Using this module you can render a console to an SDL :any:`Texture` directly, letting you have full control over how
conoles are displayed.
This includes rendering multiple tilesets in a single frame and rendering consoles on top of each other.
Example::
tileset = ... |
#!/usr/bin/python
"""
Edit a Wikipedia article with your favourite editor.
TODO:
- non existing pages
- edit conflicts
- minor edits
- watch/unwatch
- ...
The following parameters are supported:
-r Edit redirect pages without following them
--edit_redirect automatically.
--edit-redirect
-p P ... |
#!/usr/bin/env python2
"""
Copyright (c) 2014-2019 Maltrail developers (https://github.com/stamparm/maltrail/)
See the file 'LICENSE' for copying permission
"""
from craw.modules.trail.plugins.util import wget_content
__url__ = "https://raw.githubusercontent.com/futpib/policeman-rulesets/master/examples/simple_domai... |
# -*- coding: utf-8 -*-
from .austria import Austria
from .belgium import Belgium
from .bulgaria import Bulgaria
from .cayman_islands import CaymanIslands
from .croatia import Croatia
from .cyprus import Cyprus
from .czech_republic import CzechRepublic
from .estonia import Estonia
from .european_central_bank import Eur... |
"""Diablo 2 Holy Grail 502 challenge tracker.
HG502 is an application with a graphical user interface that allows you
to track your progress in the Holy Grail 502 Diablo 2 challenge.
Features:
- statistics for each item type such as set's and unique items and overall;
- ability to view lists of found and rema... |
# Copyright 2018 The TensorFlow Authors. 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 required by applica... |
import itertools
import time
try:
import json
except ImportError:
import simplejson as json
import requests
import requests.exceptions
from requests_toolbelt.adapters import socket_options
import marathon
from .models import MarathonApp, MarathonDeployment, MarathonGroup, MarathonInfo, MarathonTask, Marathon... |
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import imp
import itertools
import os
import posixpath
from devil.android import device_errors
from devil.android import device_temp_file
from devil.android... |
from django.shortcuts import render
def contact(request):
return render(request,'about/contact.html')
# Create your views here.
|
import argparse
import datetime
import json
import googleapiclient.discovery
import sys
class GCPTransfer():
__doc__ = """
Command-line sample that creates a one-time transfer from Amazon S3 to
Google Cloud Storage.
This sample is used on this page:
https://cloud.google.com/storage/transfer/create-transfer
"""
... |
#!/usr/bin/python
################################################################################
# Author: Cody C Lewis <srlm@srlmproductions.com>
# Date: November 6, 2012
# Notes:
#
import glob
import os
import subprocess
dpi = "600"
#TODO: Add test (and creation) of output folder
# inkscape --file=s... |
from pytest import mark
from tests.constants import bad_table_names, good_table_names
from sqlitemap import table_name_re
@mark.parametrize('name', good_table_names)
def test_valid_table_name(name: str):
assert table_name_re.match(name)
@mark.parametrize('name', bad_table_names)
def test_invalid_table_name(nam... |
'''
# Amazon Route53 Construct Library
<!--BEGIN STABILITY BANNER-->---


---
<!--END STABILITY B... |
import hmac
import hashlib
from struct import Struct
from operator import xor
from itertools import starmap
from os import urandom
from base64 import b64encode
from galaxy.util import safe_str_cmp
SALT_LENGTH = 12
KEY_LENGTH = 24
HASH_FUNCTION = 'sha256'
COST_FACTOR = 10000
def hash_password( password ):
"""
... |
import base64
import datetime
import json
import re
from time import sleep
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support import expec... |
import sys
import os
from time import sleep
version = os.environ['GITHUB_REF'].split('/')[-1]
print(f'version: {version}')
_, token = sys.argv
cwd = os.path.realpath('.')
# Login to GH
with open('token.txt', 'w') as tok:
tok.write(token)
print('Finished writing token file')
cmd = 'gh auth login --with-tok... |
#!/usr/bin/env python
# coding: utf-8
# In[2]:
# Python3 code to demonstrate
# to check if list is subset of other
# initializing list
num = input(range(0,10))
sub_list = [1, 1, 5]
# printing original lists
print ("Original list : " + str(num))
print ("Original sub list : " + str(sub_list))
... |
from freezegun import freeze_time
from sage_utils.amqp.clients import RpcAmqpClient
from sage_utils.constants import VALIDATION_ERROR, TOKEN_ERROR
from sage_utils.wrappers import Response
from app.token.api.workers.generate_token import GenerateTokenWorker
from app.token.api.workers.verify_token import VerifyTokenWork... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.