Skip to content

Instantly share code, notes, and snippets.

View Alexei-Kornienko's full-sized avatar

Alexei Kornienko Alexei-Kornienko

View GitHub Profile
class StateGuard(type):
def __new__(cls, name, bases, dct):
base_states = [base for base in bases if type(base) == cls]
if len(base_states) > 1:
raise TypeError("Multiple inheritance of States is not allowed")
elif len(base_states) == 1:
state = base_states.pop()
state_methods = {method for method in dir(state) if not method.startswith('__')}
for b in bases:
if b == state:
openapi: 3.0.1
tags:
- name: Health check
- name: info
- name: history
- name: bid
info:
title: Prozorro Sale Auction API
description: Swagger API definition
version: v3.0.10-1-gf2e97ad
FROM python:3-slim as prod_base
WORKDIR /app
ENV PYTHONUNBUFFERED True
COPY requirements.txt .
RUN pip install -r requirements.txt
FROM prod_base as test_base
COPY test-requirements.txt .
RUN pip install -r test-requirements.txt
FROM ubuntu:16.04 as build_base
WORKDIR /edx/app/edxapp/edx-platform
COPY requirements requirements
RUN mkdir -p /edx/app/edxapp/themes
RUN mkdir -p /edx/var/edxapp/static_collector
ENV CFLAGS="-O2 -g0 -Wl,--strip-all"
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
*TL;DR
Provides recombination business logic by chaining together using boolean logic.
"""
from abc import abstractmethod
class GameObject():
def __init__(self,name,level,race):
self.name = name
self.level = level
self.race = race
self.health = 0
def __repr__(self):
return "<%s Level: %s, Country: %s, Health: %s>" % (self.name, self.level, self.race, self.health)
@Alexei-Kornienko
Alexei-Kornienko / log
Created October 17, 2018 18:15
milchat
2018-10-17 20:59:31 [http-thread-1] WARN c.b.g.internal.GoogleAnalyticsImpl - Exception while sending the Google Analytics tracker request Request [parms={SESSION_CONTROL=start, PROTOCOL_VERSION=1, HIT_TYPE=screenview, USER_ID=3b6ce28a, USER_LANGUAGE=en-US, SCREEN_COLORS=-1, CLIENT_ID=MIL_CHAT, DOCUMENT_ENCODING=UTF-8, USER_IP=192.168.0.101, TRACKING_ID=UA-126028317-1, JAVA_ENABLED=true, SCREEN_RESOLUTION=1920x1080, 96 dpi}, customDimensions={}, customMetrics={}]
java.lang.NullPointerException: null
at com.brsanthu.googleanalytics.httpclient.ApacheHttpClientImpl.post(ApacheHttpClientImpl.java:113)
at com.brsanthu.googleanalytics.internal.GoogleAnalyticsImpl.postSingle(GoogleAnalyticsImpl.java:165)
at com.brsanthu.googleanalytics.internal.GoogleAnalyticsImpl.post(GoogleAnalyticsImpl.java:105)
at com.brsanthu.googleanalytics.request.GoogleAnalyticsRequest.lambda$send$0(GoogleAnalyticsRequest.java:1864)
at com.brsanthu.googleanalytics.request.GoogleAnalyticsRequest.execute(GoogleAnalyticsRequest.java:1876)
class Event(object):
def __init__(self):
self._callbacks = set()
def fire(self, *args, **kwargs):
for callback in self._callbacks:
try:
callback(*args, **kwargs)
except Exception: