content
stringlengths
7
1.05M
class MatrixOperations: #Function which returns the transpose of given matrix A def transpose(self, A) : #T is used to store the transpose of A T = [[0, 0, 0], [0, 0, 0], [0, 0, 0]] # iterate through rows for i in range(len(A)): # iterate thr...
# Soma de vários números, média, maior e menor. Uso de fstring. numero = i = soma = media = menor = maior = 0 cont = 0 teste = 'S' while teste == 'S': numero = int(input('Digite um número inteiro: ')) cont += 1 soma += numero if cont == 1: menor = numero maior = numero els...
@app.route('/add', methods=['POST']) #The “?” is a safe why for sqlite3 to accept text# #Add a category with the posts# def addentry(): g.db.execute ('insert into entries [word, helptext] values (?, ?)' [request.form['word'], request.form['helptext']]) g.db.commit() flash('The new entry was successfully posted!...
# Given an array with n objects colored red, white or blue, sort them in-place so # that objects of the same color are adjacent, with the colors in the order red, # white and blue. # # Here, we will use the integers 0, 1, and 2 to represent the color red, white, # and blue respectively. # # Note: You are not suppose to...
# Definition for a binary tree node # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: # @param p, a tree node # @param q, a tree node # @return a boolean def isSameTree(self, p, q): if p is None or q i...
# -*- coding: utf-8 -*- """ execution_report.py @author: Darwinex Labs (www.darwinex.com), 2021-* execution_report - A data structure to hold execution reports """ class execution_report(): # Side: 1=buy, 2=sell def __init__(self, ClOrdID, Symbol, Side, Price, OrdType, O...
#!/usr/bin/env python actions = {} asts = [] # hgawk asts.append('''class DollarNumber(ast.expr): _fields = ("n",) def __init__(self, n, **kwds): self.n = n self.__dict__.update(kwds) ''') actions['''atom : DOLLARNUMBER'''] = ''' p[0] = DollarNumber(int(p[1][0][1:]), **p[1][1])''' # Python...
s = 0 older_man = 0 older_name = 0 minor_women = 0 for c in range (1, 5): name = str(input('The name of the {}° person: '.format(c))).strip().title() age = int(input('The age of the {}° person: '.format(c))) gender = str(input('Insert (W) if the {}° person is women, and (M) if is man: ')).strip().upper() ...
def printHi(): print('hi') def print2(): print('2')
# # PySNMP MIB module ONEACCESS-MISC-CONFIG-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ONEACCESS-MISC-CONFIG-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 20:25:14 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3....
""" Initial Migration """ name = "20201002172400_init" dependencies = [] def upgrade(db): db.teams.insert_many([ {"name": "cx"}, {"name": "voyager"}, {"name": "dar"}, {"name": "platform"}, {"name": "infra"}, {"name": "embedded"}, {"name": "helios"} ]) ...
def read_seats(file_location): """Read file the code """ seats = [] seat_map = open(file_location, 'r').read().split('\n') for line in seat_map: if line == '': continue seats.append(list(line)) return seats def count_occupied(locations): """Count occupied loca...
class Assembly: def __init__(self): self.name = 'UnnamedAssembly' self.methods = [] self.extern = False self.version = '1.0.0.0' self.hashAlgorithm = None self.customAttributes = [] self.classes = []
# -*- coding: utf-8 -*- class NotNullFieldError(Exception): pass class TooLargeContent(Exception): pass class NoDateTimeGiven(Exception): pass class NoBooleanGiven(Exception): pass class NoListOrTupleGiven(Exception): pass
""" Class to parse precipitation file line """ class PrecipLine: """ Line parser for precipitation data """ def __init__(self, line): """ Init precip_line. :param line: Raw input line """ self.station = line[3:9] self.state_code = line[3:5] self...
# title # defines the title of the whole set of queries # OPTIONAL, if not set, timestamp will be used title = "General overview queries" # description # defines the textual and human-intended description of the purpose of these queries # OPTIONAL, if not set, nothing will be used or displayed description = "Queri...
#!/usr/bin/env python3 for _ in range(int(input())): n = int(input()) # https://www.wolframalpha.com/input/?i=sum_k%3D(n(n-1)%2B1)%5E(n(n-1)%2B2n)+k print(n * (n * n * 2 + 1))
class A(object): def __init__(self, b): self.b = b def a(self): print(self.b) A(2).a()
# 63. Unique Paths II # ttungl@gmail.com # Follow up for "Unique Paths": # Now consider if some obstacles are added to the grids. How many unique paths would there be? # An obstacle and empty space is marked as 1 and 0 respectively in the grid. # For example, # There is one obstacle in the middle of a 3x3 grid as il...
# AUTOGENERATED BY NBDEV! DO NOT EDIT! __all__ = ["index", "modules", "custom_doc_links", "git_url"] index = {"unhex": "defaults.ipynb", "unimplemented": "defaults.ipynb", "list_to_indexdir": "factory.ipynb", "create_model": "factory.ipynb", "assemble_sunspec_model": "factory.ipynb...
myString="UHHHHHH HMMMMMM HMM" myStringLength=len(myString) print(myStringLength)
listagem = ('Lapís', 1.50, 'Borracha', 3.75, 'Estojo', 5.99, 'Caderno', 15, 'Mochila', 123.89) print('-'*40) print(f'\033[34m{"lISTAGEM DE PREÇOS":^40}\033[m') print('-'*40) for itens in listagem[::2]: preco = listagem[listagem.index(itens)+1] print(f'{itens:.<30}\033[32mR$ \033[m{preco:>6.2f}') print('-'*40)
# encoding: utf-8 # module Autodesk.Gis.Map.Platform.Interop calls itself Interop # from Autodesk.Map.Platform, Version=24.0.30.14, Culture=neutral, PublicKeyToken=null # by generator 1.145 # no doc # no imports # no functions # classes class AcMapDisplayManagementService(MgService): """ AcMapDisplayMa...
# default configuration values questions = { "number_of_options": 4, "number_show_lines": 4 } printing = { "line_width": 20 }
async def example(): await channel.put(json.dumps({ 'text': data.text, 'image': image, 'username': data.user.screen_name, }))
print('Welcome to your Fitness Guide!') arm_ne = ['arms circle', 'tricep dips', 'push-ups', 'body saw'] back_ne = ['superman','plank', 'reverse snow angels', 'aquaman' ] shoulder_ne = ['plank tap', 'side plank with lateral raise', 'crab walk', 'incline push-up' ] abs_ne = ['mountain climber twist', 'plank up',...
def main(): n = int(input()) for i in range(n): a = int(input()) b = set([int(x) for x in input().split()]) if (max(b) - min(b)) < len(b): print("YES") else: print("NO") if __name__ == '__main__': main()
''' n Python, we can pass a variable number of arguments to a function using special symbols. There are two special symbols: *args (Non Keyword Arguments) **kwargs (Keyword Arguments) We use *args and **kwargs as an argument when we are unsure about the number of arguments to pass in the functions. ''' def func(a,b,c,...
args_count = {'documentclass':(1, 1), 'usepackage':(1, 1), 'title':(1, 0), 'author':(1, 0), 'date':(1, 0), 'color':(1, 0), 'input':(1, 0), 'part':(1, 0), 'chapter':(1, 1), 'section':(1, 1), ...
""" This problem was asked by LinkedIn. Given a list of points, a central point, and an integer k, find the nearest k points from the central point. For example, given the list of points [(0, 0), (5, 4), (3, 1)], the central point (1, 2), and k = 2, return [(0, 0), (3, 1)]. """ def k_nearest(points, central, k): ...
""" Source: https://pe.usps.com/text/pub28/welcome.htm """ STREET_NAME_POST_ABBREVIATIONS = { "ALLEE": "ALY", "ALLEY": "ALY", "ALLY": "ALY", "ALY": "ALY", "ANEX": "ANX", "ANNEX": "ANX", "ANNX": "ANX", "ANX": "ANX", "ARC": "ARC", "ARC ": "ARC", "ARCADE": "ARC",...
# -*- coding: utf-8 -*- """ Created on Wed Jun 20 17:06:02 2018 The Selection sort algorithm is based on the idea of finding the minimum or maximum element in an unsorted array and then putting it in its correct position in a sorted array. @author: Akash """ def swap(num1,num2): temp = num1 num1=nu...
#!/usr/bin/env python3 s = input() n = 0 base = 2 i = 0 while i < len(s): n = (base * n) + int(s[i]) i = i + 1 print(n)
class Node: def __init__(self, value): self.value = value self.next = None class LinkedList: def __init__(self): self.head = None def add(self, value): node = Node(value) if not self.head: self.head = node else: current = self.hea...
#!/usr/bin/env python """ interaction.py -------------- """ class Interaction(object): """ Class that rappresents an interaction between instances of mape elements. Args: name (str): Name of the interaction. data_class: ROS message type associated with the interaction. """ def __i...
""" Run Command Line Interface ========================== Define a set of functions that perform runtime task over specific set of scenarios. """
size(800, 800) background(255) smooth() fill(86, 135, 174, 175) noStroke() # Verschiebe Nullpunkt des Koordinatensystems von der Ecke links oben des # grafischen Ausgabefensters ins Zentrum. translate(width / 2, height / 2) radius = 350.0 for i in range(0, 8): arc(radius / 2, 0.0, radius, radius, 0, PI) rota...
class KStacks(): def __init__(self, k, capacity): self.nextAvailable = 0 self.data = [0] * capacity self.front = [-1] * k self.rear = [-1] * k self.nextIndex = [i+1 for i in range(capacity)] self.nextIndex[capacity-1] = -1 def isFull(self): return self.ne...
# Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 ResourceMap = { "k8s.config-map": "c7n_kube.resources.core.configmap.ConfigMap", "k8s.custom-cluster-resource": "c7n_kube.resources.crd.CustomResourceDefinition", "k8s.custom-namespaced-resource": "c7n_kube.resources.crd.CustomNa...
"""pydtk modules.""" __version__ = "0.0.0-0" __commit_id__ = "335be874b189127a42620a0475877155cdf0f870"
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #Студенты убирают урожай помидоров. При сборе до 50 кг в день работа оплачивается из расчёта 30 коп. за 1 кг; # при сборе от 50 до 75 кг в день - 50 коп. за 1 кг; при сборе от 75 до 90 кг в день - 65 коп. за 1 кг; # при сборе свыше 90 кг в день - 70 коп. за 1 кг плюс 20 р...
def capitalize_title(title): pass def check_sentence_ending(sentence): pass def remove_extra_spaces(sentence): pass def replace_word_choice(sentence, new_word, old_word): pass
TASK_NAME = 'NERTaggingTask' JS_ASSETS = [''] JS_ASSETS_OUTPUT = 'scripts/vulyk-ner.js' JS_ASSETS_FILTERS = 'yui_js' CSS_ASSETS = [''] CSS_ASSETS_OUTPUT = 'styles/vulyk-ner.css' CSS_ASSETS_FILTERS = 'yui_css'
# # Example file for working with conditional statements # def main(): x, y = 10, 100 # conditional flow uses if, elif, else if x<y: print("x is less than y") elif x>y: print("x is more than y") else: print("x is equal to y") # conditional statements let you use "a if C else b" print("x...
test = [1, "dog", (("tost", "tost1"), ("test", "test1")), 'c', 4, 'cat'] def mysort(eleme): if type(eleme) == int: return str(eleme) else: return eleme print(test[2][0][1]) # print(c) # print(test.count(self))
patches = [ # backwards compatibility { "op": "move", "from": "/PropertyTypes/AWS::CodeCommit::Repository.RepositoryTrigger", "path": "/PropertyTypes/AWS::CodeCommit::Repository.Trigger", }, { "op": "replace", "path": "/ResourceTypes/AWS::CodeCommit::Repository/Pr...
#!/usr/bin/env python3 _min, c = 7856, 0 for i in range(4855, 7856): if i % 8 == 0 and i % 19 == 0 and i % 7 != 0 and i % 16 != 0 and i % 24 != 0 and i % 26 != 0: _min = min(_min, i) c += 1 print(c, _min)
def replace_links(course_id,links,title): new_links = [] for link in links: split_href = link['href'].split('dev.brightspace.com') if course_id in split_href[1]: my_href = 'data/rubrics%s.json'%split_href[1].replace(course_id,title) else: my_href = 'data/rubrics%s...
pattern = r'</?p>' for p in re.split(pattern, TEXT): if p.startswith('We choose to go to the moon'): result = p
# Copyright 2021 san kim # # 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...
# GMOS geometry_conf.py module containing information # for Transform-based tileArrays/mosaicDetectors # for tileArrays(): key=detector_name(), value=gap (unbinned pixels) tile_gaps = { # GMOS-N 'EEV9273-16-03EEV9273-20-04EEV9273-20-03': 37, 'e2v 10031-23-05,10031-01-03,10031-18-04': 37, 'BI13-20-4k-1,...
n, c = list(map(int, input().split())) p = list(map(int, input().split())) t = list(map(int, input().split())) limak = 0 Radewoosh = 0 sm, sm2 =0,0 for i in range(n): sm +=t[i] sm2 +=t[n-i-1] limak += max(0,p[i] - c*sm) Radewoosh += max(0,p[n-i-1] - c*sm2) if limak > Radewoosh: print("...
#! /usr/bin/env python3 ############################################################################### # File Name : l3e3.py # Created By : Félix Chiasson (7138723) # Creation Date : [2015-09-29 12:12] # Last Modified : [2015-09-29 12:18] # Description...
''' @Date: 2019-08-20 09:16:33 @Author: ywyz @LastModifiedBy: ywyz @Github: https://github.com/ywyz @LastEditors: ywyz @LastEditTime: 2019-08-20 09:16:33 ''' print("\u03b1\u03b2\u03b3\u03b4\u03b5\u03b6\u03b7\u03b8")
class BlazingException(Exception): def __init__(self, http_status_code: int, message: str): super(BlazingException, self).__init__(message) self.message: str = message self.status_code: int = http_status_code def __str__(self): message = "Message: %s. Status Code: %s" % (self.m...
physconst = { "h" : 6.62606896E-34, # The Planck constant (Js) "c" : 2.99792458E8, # Speed of light (ms$^{-1}$) "kb" : 1.3806504E-23, # The Boltzmann constant (JK$^{-1}$) "R" ...
# DEBUG DEBUG = True # DJANGO SECRET KEY SECRET_KEY = 'xh=yw8#%ob65a@ijq=2r41(6#8*ghhk7an)bcupk6ifd42bid+' # ALLOWED HOSTS ALLOWED_HOSTS = [] # DBS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'db', 'USER': 'root', 'PASSWORD': 'secret', 'HOST': ...
""" File for representing argus-specific exceptions. """ class ArgusException(Exception): """ Exception class for the Argus application """ pass class ImageLoadException(ArgusException): """ Exception raised when an image file could not be loaded """ pass class InvalidQueryExceptio...
# b 0 # f 1 # l 0 # r 1 def part1(data): return max(get_seats(data)) def get_seats(data): seats = [] for line in data: row = line[:7].replace('B', '1').replace('F', '0') col = line[7:].replace('L', '0').replace('R', '1') seats.append(int(row, 2) * 8 + int(col, 2)) return s...
for val in "string": if val == "i": break print(val) print() for val in range(1,10): if val == 5: break print(val)
def base_logic(login_generator, password_generator, query): login = login_generator.generate() if login is None:return while True: password = password_generator.generate() if password is None:return if query(login, password): print('Success',login,password) ...
# Copyright (c) 2020 Kirill Snezhko # 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 limitation the rights # to use, copy, modify, merge, publish, distr...
class Solution: def shortestPalindrome(self, s: str) -> str: double = s + '*' + s[::-1] lps = self.longestPrefixString(double) index = lps[-1] return s[index: ][::-1] + s def longestPrefixString(self, s): lps = [0] * len(s) i, j = 0, 1 while ...
class SummonerModel: def __init__(self, dbRow): self.ID = dbRow["ID"] self.User = dbRow["User"] self.SummonerName = dbRow["SummonerName"] self.SummonerID = dbRow["SummonerID"] self.Shadow = dbRow["Shadow"] self.Region = dbRow["Region"] self.Timestamp = dbRow["Timestamp"]
#ml = [1, 2, 3, 4, 5, 6] for num in range(10): # generators print(num) for num in range(0, 10, 2): print(num) index_count = 0 for letter in 'abcde': print('At index {} the letter is {}'.format(index_count, letter)) index_count += 1 print(list(range(0, 11, 2))) index_count = 0 word = 'abcdefg' for ...
# # PySNMP MIB module NOKIA-UNITTYPES-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NOKIA-UNITTYPES-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 20:13:57 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default...
nome = str(input('Digite o seu nome: ')) if nome.isdigit(): print('Caracter invalido') exit('Seu nome não pode ter caracteres especias') print(nome)
names = [ 'Noah', 'Liam', 'Mason', 'Jacob', 'William', 'Ethan', 'Michael', 'Alexander' ] surnames = [ 'Smith', 'Johnson', 'Williams', 'Jones', 'Brown', 'Davis', 'Miller', 'Wilson' ] streets_num = [ '357', '173', '543', '731', '276', '851', '624', '932' ] streets = [ 'Fulton St', 'Park Avenue', 'Lafayette Avenue', 'D...
def is_number(s): try: float(s) return True except ValueError: return False def parse_instruction(instruction): return instruction.split(' ') class Program: def __init__(self, program): self.registers = {} self.line = 0 self.program = program self.commands = {'mo...
class Solution: def multiply(self, num1, num2): """ :type num1: str :type num2: str :rtype: str """ value = [0]*(len(num1)+len(num2)) for i in range(len(num1)-1, -1, -1): for j in range(len(num2)-1, -1, -1): value[i+j+1] += int(n...
f2 = lambda x: (lambda : lambda y: x + y)() inc = f2(1) plus10 = f2(10) ___assertEqual(inc(1), 2) ___assertEqual(plus10(5), 15)
def encode(value_to_encode): """ Bencodes python value to binary string :param value_to_encode: int, string, list or dict :return: Bencoded `value_to_encode` :raise: ValueError if the provided value cannot be encoded """ try: return _encode_value(value_to_encode) except Excepti...
""" File: anagram.py Name: ---------------------------------- This program recursively finds all the anagram(s) for the word input by user and terminates when the input string matches the EXIT constant defined at line 19 If you correctly implement this program, you should see the number of anagrams for each word liste...
def staircase(n): for index in range(1, n+1): print(" " * (n-index) + "#" * index)
#!/usr/bin/env python def check_connected(device): return(device.connected)
class Deactivated(Exception): pass class NotApplicable(Exception): pass class NotUniqueError(Exception): pass
""" 45 - Faça um programa para converter uma letra maiúscula em letra minúscula. Use a tabela ASCII/ para resolver o problema. """ # Receba a letra letra_minuscula = input("Informe uma letra minúscula: ") #Converte para decimal da tabela ASCII ascii = ord(letra_minuscula) # Transforma em maiúscula usando a tabela A...
# -*- coding: utf-8 -*- """ @author: salimt """ def getGuessedWord(secretWord, lettersGuessed): ''' secretWord: string, the word the user is guessing lettersGuessed: list, what letters have been guessed so far returns: string, comprised of letters and underscores that represents what le...
""" Binary search ------------- - Worst time complexity: O(log n); The half-ing of the list on each iteration follows a log n of the number of elements progression (log x is assumed to be log base 2). - a search strategy used to find elements within an ordered list of items - by consistently reducing the amount of data...
def findDecision(obj): #obj[0]: Passanger, obj[1]: Time, obj[2]: Coupon, obj[3]: Coupon_validity, obj[4]: Gender, obj[5]: Age, obj[6]: Children, obj[7]: Education, obj[8]: Occupation, obj[9]: Income, obj[10]: Bar, obj[11]: Coffeehouse, obj[12]: Restaurant20to50, obj[13]: Direction_same, obj[14]: Distance # {"feature":...
# Copyright (c) 2016-2017 Dustin Doloff # Licensed under Apache License v2.0 load( "@bazel_toolbox//labels:labels.bzl", "executable_label", ) load( "@io_bazel_rules_sass//sass:sass.bzl", "sass_binary", ) def _assert_descending_sizes_impl(ctx): ctx.actions.run( mnemonic = "AssertingFilesOfD...
MIN_BRANCH_ROTATION = 3 NUM_TRIES = 100 BRANCH_RATIO_FACTOR = 0.5 NEW_BRANCH_RATIO_FACTOR = 0.7 NUM_SIDES_FACTOR = 0.05 BRANCH_MIN_THICKNESS = 0.05
# class Solution: # def fibonacci(self, n): # a = 0 # b = 1 # for i in range(n - 1): # a, b = b, a + b # return a # if __name__ == "__main__": # so = Solution() # print(so.fibonacci(100)) class Solution: def fibonacci(self, n): a,b = 0,1 num ...
class Solution: def gameOfLife(self, board: List[List[int]]) -> None: """ Do not return anything, modify board in-place instead. """ # 0,2 - dead, dead->live # 1,3 - live, live->dead def neighbors(r,c): for nr, nc in ((r,c-1), (r,c+1),(r-1,c),(r+1...
trp_player = 0 trp_multiplayer_profile_troop_male = 1 trp_multiplayer_profile_troop_female = 2 trp_temp_troop = 3 trp_temp_array_a = 4 trp_multiplayer_data = 5 trp_british_infantry_ai = 6 trp_british_infantry2_ai = 7 trp_british_highlander_ai = 8 trp_british_foot_guard_ai = 9 trp_british_light_infantry_ai = 10 trp_brit...
class IdentifierSeparator(): identifier_name = None def __init__(self, identifier_name): self.identifier_name = identifier_name def get_separated_identifier(self): separated_word: str = self.identifier_name last_char = separated_word[0] index = 1 while index <...
# Basket settings OSCAR_BASKET_COOKIE_LIFETIME = 7*24*60*60 OSCAR_BASKET_COOKIE_OPEN = 'oscar_open_basket' OSCAR_BASKET_COOKIE_SAVED = 'oscar_saved_basket' # Currency OSCAR_DEFAULT_CURRENCY = 'GBP' # Max number of products to keep on the user's history OSCAR_RECENTLY_VIEWED_PRODUCTS = 4 # Image paths OSCAR_IMAGE_FOL...
# PROBLEM 1: Shortest Word # Given a string of words, return the length of the shortest word(s). def find_short(sentence): # your code here sentence = sentence.split() shortest = len(sentence[0]) for word in sentence: if len(word) < shortest: shortest = len(word) print('shortest'...
class Solution: def XXX(self, n): """ :type n: int :rtype: int """ if n <= 2: return n a = 1 b = 2 for i in range(2, n): c = a + b a = b b = c return c
""" > Task Ticket numbers usually consist of an even number of digits. A ticket number is considered lucky if the sum of the first half of the digits is equal to the sum of the second half. Given a ticket number n, determine if it's lucky or not. > Example For n = 1230, the output should be true For n = 239017, the ou...
def main(j, args, params, tags, tasklet): page = args.page page.addMessage(str(params.requestContext.params)) page.addMessage("this is a test macro tasklet") # use the page object to add content to the page # play with it you can debug in this tasklet # use #from pylabs.Shell import ipsh...
s = 0 co = 0 ss = 0 coo = 0 for c in range(6): num = int(input('Digite um número:')) if num % 2 ==0: s += num co += 1 elif num % 2 !=0: ss += num coo += 1 print("Você informou {} números pares .A soma dos números é {}.". format(co, s)) print("Você informou {} números impares...
# view definition view = { 'view_name' : 'cb_trans', 'module_id' : 'cb', 'short_descr' : 'Cb transactions', 'long_descr' : 'Cb transactions', 'base_tables' : ['cb_tran_rec', 'cb_tran_pmt', 'cb_tran_tfr_out', 'cb_tran_tfr_in'], 'path_to_row' : [ 'tran_type', { ...
"""Global constants for the AgavePy package """ __all__ = [ 'PLATFORM', 'BASE_URL', 'SESSION_CACHE_DIRS', 'CACHE_FILENAME', 'SESSIONS_FILENAME', 'AGPY_FILENAME', 'ENV_USERNAME', 'ENV_PASSWORD', 'ENV_TOKEN', 'ENV_REFRESH_TOKEN', 'ENV_BASE_URL', 'ENV_API_KEY', 'ENV_API_SECRET', 'ENV_TENANT_ID', 'TOKEN_SCO...
class parent: def __init__(self): self.y=40 self.x=50 def update(self): print(self.y) class child(parent): def __init__(self): parent.__init__(self) # def update(self): # print(self.x) c=child() c.update()
DEBUG = True CELERY_ALWAYS_EAGER = True DATABASES = { 'default': { 'ENGINE': 'giscube.db.backends.postgis', 'NAME': os.environ.get('TEST_DB_NAME', 'test'), 'USER': os.environ.get('TEST_DB_USER', 'admin'), 'PASSWORD': os.environ.get('TEST_DB_PASSWORD', 'admin'), 'HOST': os.e...
def generate_hex(content): begin = "unsigned char game["+str(len(content))+"] = {" middle = "" end = " };" for byte in content: middle = middle + str(hex(byte))+"," final = begin+middle+end print(final) def open_file(file_path): try: f = open(file_path,"rb") con...
def phone_home(): s = """ .;''-. .' | `._ /` ; `'. .' \\ \\ ,'\\| `| | | -'_ \ `'.__,J ;' `. `'.__.' | `"-.___ ,' '-, / |.-`-.______-| } __.--'L ; _,- _.-"`\ ___ `7-;" ' _,,--._ ,-'`__ `. ...
class Station(object): ''' classdocs ''' def __init__(self): self.platformNameSet = set() #note: this is for convenience only
class PyNFTException(Exception): def __init__(self, rc, obj, msg): self.rc = rc self.obj = obj self.msg = msg