Skip to content

Instantly share code, notes, and snippets.

View yottatsa's full-sized avatar
🏳️‍⚧️
microsoft is transphobic

Atsuko Ito yottatsa

🏳️‍⚧️
microsoft is transphobic
View GitHub Profile
class Solution:
# @param A : list of list of integers
# @return an integer
def edge(self, A, x, first=None):
left = first or 0
right = len(A)-1
found = False
if x < A[0]:
import requests
import logging
import os.path
class Graphite(object):
def __init__(self, url):
self.url = url
self.session = requests.Session()
package main
import (
"fmt"
"flag"
"strings"
"os"
"strconv"
"log"
"math/rand"
__author__ = 'yottatsa'
import uuid
import random
MEASUREMENTS = 'Memory_used;Memory_free;Memory_cached;Net_tx;Net_rx;Net_recv;Net_send;Disk_read;Disk_write;CPU_user;CPU_system;CPU_iowait'.lower().split(
';')
def host(i):
class ConfigOpts(collections.Mapping):
"""Config options which may be set on the command line or in config files.
ConfigOpts is a configuration option manager with APIs for registering
option schemas, grouping options, parsing option values and retrieving
the values of options.
"""
def __init__(self):
--- router_info.py 2015-10-12 15:56:54.571650341 +0000
+++ /usr/lib/python2.7/dist-packages/neutron/agent/l3/router_info.py 2015-10-12 15:28:24.090577334 +0000
@@ -361,7 +361,9 @@
LOG.debug('Spawning radvd daemon in router device: %s', self.router_id)
if not internal_ports:
internal_ports = self.internal_ports
- self.radvd.enable(internal_ports)
+ ex_gw_port = self.get_ex_gw_port()
+ ext_interface = self.get_external_device_interface_name(ex_gw_port)
+ self.radvd.enable(internal_ports, ext_interface)
def validate_token(self, token):
"""Validates a Fernet token and returns the payload attributes."""
# Convert v2 unicode token to a string
if not isinstance(token, six.binary_type):
token = token.encode('ascii')
#to
def validate_token(self, token):
"""Validates a Fernet token and returns the payload attributes."""