content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
print_('Voltages') for a in ['CH1','CH2','CH3','AN8','CAP','SEN']: button('Voltage : %s'%a,"get_voltage('%s')"%a,"display_number") print('') #Just to get a newline print('') print_('Passive Elements') button('Capacitance_:',"get_capacitance()","display_number") print('') button('Resistance__:',"get_resistance()","d...
print_('Voltages') for a in ['CH1', 'CH2', 'CH3', 'AN8', 'CAP', 'SEN']: button('Voltage : %s' % a, "get_voltage('%s')" % a, 'display_number') print('') print('') print_('Passive Elements') button('Capacitance_:', 'get_capacitance()', 'display_number') print('') button('Resistance__:', 'get_resistance()', 'displ...
ASCII_BYTE = ' !"#\\$%&\'\\(\\)\\*\\+,-\\./0123456789:;<=>\\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\\[\\]\\^_`abcdefghijklmnopqrstuvwxyz\\{\\|\\}\\\\~\t' # Directory structure MAIN_TRACE = 'cor1_1' SECOND_TRACE = 'cor1_2' DIFF_TRACE = 'cor2_1' INPUT1 = 'input1' INPUT2 = 'input2' FUNCTYPE = 'functype' HEADER...
ascii_byte = ' !"#\\$%&\'\\(\\)\\*\\+,-\\./0123456789:;<=>\\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ\\[\\]\\^_`abcdefghijklmnopqrstuvwxyz\\{\\|\\}\\\\~\t' main_trace = 'cor1_1' second_trace = 'cor1_2' diff_trace = 'cor2_1' input1 = 'input1' input2 = 'input2' functype = 'functype' header = '\n#include <stdio.h>\n#include <string.h>...
def main(): total = None serie = input("What's your favorite serie?: ") seasons = int(input("How much seasons have?: ")) number_chap = int(input("How much chapter have?: ")) duration_chap = int(input("How much minuts chapters have?: ")) total = seasons * number_chap * duration_chap / 60 p...
def main(): total = None serie = input("What's your favorite serie?: ") seasons = int(input('How much seasons have?: ')) number_chap = int(input('How much chapter have?: ')) duration_chap = int(input('How much minuts chapters have?: ')) total = seasons * number_chap * duration_chap / 60 prin...
BASE_LOGGING = { "version": 1, "disable_existing_loggers": False, "formatters": { "console": { "format": "{module}: {message}", "datefmt": "%d/%b/%Y %H:%M:%S", "style": "{", }, }, "handlers": { "console": { "level": "DEBUG", ...
base_logging = {'version': 1, 'disable_existing_loggers': False, 'formatters': {'console': {'format': '{module}: {message}', 'datefmt': '%d/%b/%Y %H:%M:%S', 'style': '{'}}, 'handlers': {'console': {'level': 'DEBUG', 'class': 'logging.StreamHandler', 'formatter': 'console'}}, 'loggers': {'': {'handlers': ['console'], 'l...
newdata = [] with open("requirements.txt") as f: data = f.read() data = data.split("\n") for i in data: if "@" not in i: newdata.append(i) # print(newdata) file = open("requirements.txt", "w") # print("".join(newdata) + "\n") for i in newdata: print(i) file.write(i + "\n"...
newdata = [] with open('requirements.txt') as f: data = f.read() data = data.split('\n') for i in data: if '@' not in i: newdata.append(i) file = open('requirements.txt', 'w') for i in newdata: print(i) file.write(i + '\n')
source = r'''#include <cstdio> #include "mylib.h" void do_something_else() { printf("something else\n"); }''' print(source)
source = '#include <cstdio>\n#include "mylib.h"\n\nvoid do_something_else()\n{\n printf("something else\\n");\n}' print(source)
print(' ') print('-------Menghitung laba seorang pengusaha-------') a=100000000 sum=0 b=0 laba=[int(0),int(0),int(a)*.1,int(a)*.1,int(a)*.5,int(a)*.5,int(a)*.5,int(a)*.2] print('') print('Modal seorang pengusaha :',a) print(' ') for i in laba: sum=sum+i b+=1 print('Laba Bulan ke -',b,'...
print(' ') print('-------Menghitung laba seorang pengusaha-------') a = 100000000 sum = 0 b = 0 laba = [int(0), int(0), int(a) * 0.1, int(a) * 0.1, int(a) * 0.5, int(a) * 0.5, int(a) * 0.5, int(a) * 0.2] print('') print('Modal seorang pengusaha :', a) print(' ') for i in laba: sum = sum + i b += 1 pri...
#!python3 msn = 0 for x in range(3,1000000) : n = x csn = 0 while n != 1 : if n % 2 == 0 : n = int(n / 2) else : n = n * 3 +1 csn += 1 if csn > msn : msn = csn sn = x print(sn)
msn = 0 for x in range(3, 1000000): n = x csn = 0 while n != 1: if n % 2 == 0: n = int(n / 2) else: n = n * 3 + 1 csn += 1 if csn > msn: msn = csn sn = x print(sn)
def day01_1(input_data): result = 0 for i in range(len(input_data)): if int(input_data[i]) == int(input_data[(i + 1) % len(input_data)]): result += int(input_data[i]) return result def day01_2(input_data): result = 0 for i in range(len(input_data)): if int(input_data[i...
def day01_1(input_data): result = 0 for i in range(len(input_data)): if int(input_data[i]) == int(input_data[(i + 1) % len(input_data)]): result += int(input_data[i]) return result def day01_2(input_data): result = 0 for i in range(len(input_data)): if int(input_data[i])...
class Solution: def minimumDeleteSum(self, s1, s2): """ :type s1: str :type s2: str :rtype: int """ w1 = len(s1) w2 = len(s2) dp = [[0 for j in range(w2 + 1)] for i in range(w1 + 1)] dp[0][0] = 0 for i in range(1, w2 + 1): d...
class Solution: def minimum_delete_sum(self, s1, s2): """ :type s1: str :type s2: str :rtype: int """ w1 = len(s1) w2 = len(s2) dp = [[0 for j in range(w2 + 1)] for i in range(w1 + 1)] dp[0][0] = 0 for i in range(1, w2 + 1): ...
class Fuzzy_logical_relationship(object): def __init__(self, lhs, rhs): self.lhs = lhs self.rhs = rhs def __str__(self): return str(self.lhs) + " -> " + str(self.rhs)
class Fuzzy_Logical_Relationship(object): def __init__(self, lhs, rhs): self.lhs = lhs self.rhs = rhs def __str__(self): return str(self.lhs) + ' -> ' + str(self.rhs)
random_list = tuple(range(0, 1000)) def just_mean(x): total = 0 for xi in x: total += xi return total / len(x) mean_output = just_mean(random_list)
random_list = tuple(range(0, 1000)) def just_mean(x): total = 0 for xi in x: total += xi return total / len(x) mean_output = just_mean(random_list)
INVALID_INPUT = 1 DOCKER_ERROR = 2 UNKNOWN_ERROR = 3 class DkrException(Exception): def __init__(self, message, exit_code): self.message = message self.exit_code = exit_code
invalid_input = 1 docker_error = 2 unknown_error = 3 class Dkrexception(Exception): def __init__(self, message, exit_code): self.message = message self.exit_code = exit_code
class Action: def __init__(self, unit, target): self.unit = unit self.target = target def complete(self): self.unit.walked = [] self.unit.action = None self.unit._flee_or_fight_if_enemy() def update(self): pass class MoveAction(Action): def u...
class Action: def __init__(self, unit, target): self.unit = unit self.target = target def complete(self): self.unit.walked = [] self.unit.action = None self.unit._flee_or_fight_if_enemy() def update(self): pass class Moveaction(Action): def update(sel...
""" Part 1 Solution: 580 Part 2 Solution: 81972 """ # Basically a Sum function def solve_day1_part1(): fname = "data_day1.txt" frequency = 0 with open(fname) as fp: line = fp.readline().rstrip("\n") while line: i = int(line) frequency += i # print("{} => {} = {}".format(line, i, total)) # print("{...
""" Part 1 Solution: 580 Part 2 Solution: 81972 """ def solve_day1_part1(): fname = 'data_day1.txt' frequency = 0 with open(fname) as fp: line = fp.readline().rstrip('\n') while line: i = int(line) frequency += i line = fp.readline().rstrip('\n') retu...
a=int(input("enter first number:")) b=int(input("enter second number:")) sum=0 for i in range (a,b+1): sum=sum+i print(sum)
a = int(input('enter first number:')) b = int(input('enter second number:')) sum = 0 for i in range(a, b + 1): sum = sum + i print(sum)
# contains bunch of buggy examples # taken from https://hackernoon.com/10-common-security-gotchas-in-python # -and-how-to-avoid-them-e19fbe265e03 def transcode_file(filename): """Input injection""" command = 'ffmpeg -i "{source}" output_file.mpg'.format(source=filename) return command # a bad i...
def transcode_file(filename): """Input injection""" command = 'ffmpeg -i "{source}" output_file.mpg'.format(source=filename) return command def access_function(user): """Assert statements""" assert user.is_admin, 'user does not have access' class Runbinsh: """Pickles""" def __reduce__(sel...
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: # @param {integer[]} preorder # @param {integer[]} inorder # @return {TreeNode} def buildTree(self, preorder, inorder): ...
class Solution: def build_tree(self, preorder, inorder): if not preorder or not inorder: return None (n1, n2) = (len(preorder), len(inorder)) if n1 != n2 or n1 == 0: return None root = tree_node(0) st = [root] i = 0 j = 0 last_...
while 1: a = 1 break print(a) # pass
while 1: a = 1 break print(a)
class Solution: def searchRange(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ start = self.binarySearch(nums, target) if start == -1: return [-1, -1] end = self.binarySearch(nums, targe...
class Solution: def search_range(self, nums, target): """ :type nums: List[int] :type target: int :rtype: List[int] """ start = self.binarySearch(nums, target) if start == -1: return [-1, -1] end = self.binarySearch(nums, target, True) ...
# Migration removed because it depends on models which have been removed def run(): return False
def run(): return False
""" Program to determine whether a given number is a Harshad number Harshad number A number is said to be the Harshad number if it is divisible by the sum of its digit. For example, if number is 156, then sum of its digit will be 1 + 5 + 6 = 12. Since 156 is divisible by 12. So, 156 is a Harshad number. Some of ...
""" Program to determine whether a given number is a Harshad number Harshad number A number is said to be the Harshad number if it is divisible by the sum of its digit. For example, if number is 156, then sum of its digit will be 1 + 5 + 6 = 12. Since 156 is divisible by 12. So, 156 is a Harshad number. Some of the ot...
#-----------------------------------------------------------------# #! Python3 # Author : NK # Month, Year : March, 2019 # Info : Program to get Squares of numbers upto 25, using return # Desc : An example program to show usage of return #--------------------------------------...
def next_square(x): return x * x def main(): for x in range(25): print(next_square(x)) if __name__ == '__main__': main()
def get_planet_name(id): tmp = { 1: "Mercury", 2: "Venus", 3: "Earth", 4: "Mars", 5: "Jupiter", 6: "Saturn", 7: "Uranus", 8: "Neptune" } return tmp[id]
def get_planet_name(id): tmp = {1: 'Mercury', 2: 'Venus', 3: 'Earth', 4: 'Mars', 5: 'Jupiter', 6: 'Saturn', 7: 'Uranus', 8: 'Neptune'} return tmp[id]
class Solution: def successfulPairs(self, spells: List[int], potions: List[int], success: int) -> List[int]: potions = [(val, idx) for idx, val in enumerate(potions)] potions.sort() spells = [(val, idx) for idx, val in enumerate(spells)] spells.sort() left = 0 right =...
class Solution: def successful_pairs(self, spells: List[int], potions: List[int], success: int) -> List[int]: potions = [(val, idx) for (idx, val) in enumerate(potions)] potions.sort() spells = [(val, idx) for (idx, val) in enumerate(spells)] spells.sort() left = 0 r...
# # PySNMP MIB module SONOMASYSTEMS-SONOMA-IPAPPS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SONOMASYSTEMS-SONOMA-IPAPPS-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:09:25 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Pytho...
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, constraints_union, single_value_constraint, constraints_intersection, value_size_constraint) ...
#!/usr/bin/env python3 '''Iterate over multiple sequences in parallel using zip() function NOET: zip() stops when the shortest sequence is done ''' # Init days = ['Monday', 'Tuesday', 'Wednesday'] fruits = ['banana', 'orange', 'peach'] drinks = ['coffee', 'tea', 'beer'] desserts = ['tiramisu', 'ice cream', 'pie', '...
"""Iterate over multiple sequences in parallel using zip() function NOET: zip() stops when the shortest sequence is done """ days = ['Monday', 'Tuesday', 'Wednesday'] fruits = ['banana', 'orange', 'peach'] drinks = ['coffee', 'tea', 'beer'] desserts = ['tiramisu', 'ice cream', 'pie', 'pudding'] for (day, fruit, dri...
"""One To Many. ...is used to mark that an instance of a class can be associated with many instances of another class. For example, on a blog engine, an instance of the Article class could be associated with many instances of the Comment class. In this case, we would map the mentioned classes and its relation as follo...
"""One To Many. ...is used to mark that an instance of a class can be associated with many instances of another class. For example, on a blog engine, an instance of the Article class could be associated with many instances of the Comment class. In this case, we would map the mentioned classes and its relation as follo...
name=input("Please input my daughter's name:") while name!="Nina" and name!="Anime": print("I'm sorry, but the name is not valid.") name=input("Please input my daughter's name:") print("Yes."+name+"is my daughter.")
name = input("Please input my daughter's name:") while name != 'Nina' and name != 'Anime': print("I'm sorry, but the name is not valid.") name = input("Please input my daughter's name:") print('Yes.' + name + 'is my daughter.')
cases = [ ('pmt -s 1 -n 20 populations, use seed so same run each time', 'pmt -s 1 -n 20 populations'), ('pmt -s 2 -n 6 populations, use seed so same run each time', 'pmt -s 2 -n 6 -r 3 populations') ]
cases = [('pmt -s 1 -n 20 populations, use seed so same run each time', 'pmt -s 1 -n 20 populations'), ('pmt -s 2 -n 6 populations, use seed so same run each time', 'pmt -s 2 -n 6 -r 3 populations')]
{ "hawq": { "master": "localhost", "standby": "", "port": 5432, "user": "johnsaxon", "password": "test", "database": "postgres" }, "data_config": { "schema": "public", "table": "elec_tiny", "features": [ { "n...
{'hawq': {'master': 'localhost', 'standby': '', 'port': 5432, 'user': 'johnsaxon', 'password': 'test', 'database': 'postgres'}, 'data_config': {'schema': 'public', 'table': 'elec_tiny', 'features': [{'name': 'id', 'type': 'categorical', 'cates': ['2019-01-20', '2019-03-01', '2019-04-20', '2018-09-10', '2018-12-01', '20...
"""New retry v2 handlers. This package obsoletes the ibm_botocore/retryhandler.py module and contains new retry logic. """
"""New retry v2 handlers. This package obsoletes the ibm_botocore/retryhandler.py module and contains new retry logic. """
""" 38. User-registered management commands The ``manage.py`` utility provides a number of useful commands for managing a Django project. If you want to add a utility command of your own, you can. The user-defined command ``dance`` is defined in the management/commands subdirectory of this test application. It is a s...
""" 38. User-registered management commands The ``manage.py`` utility provides a number of useful commands for managing a Django project. If you want to add a utility command of your own, you can. The user-defined command ``dance`` is defined in the management/commands subdirectory of this test application. It is a s...
{ "targets": [{ "target_name": "findGitRepos", "dependencies": [ "vendor/openpa/openpa.gyp:openpa" ], "sources": [ "cpp/src/FindGitRepos.cpp", "cpp/src/Queue.cpp" ], "include_dirs": [ "<!@(node -p \"require('node-addon...
{'targets': [{'target_name': 'findGitRepos', 'dependencies': ['vendor/openpa/openpa.gyp:openpa'], 'sources': ['cpp/src/FindGitRepos.cpp', 'cpp/src/Queue.cpp'], 'include_dirs': ['<!@(node -p "require(\'node-addon-api\').include")', 'cpp/includes'], 'defines': ['NAPI_DISABLE_CPP_EXCEPTIONS'], 'conditions': [["OS=='win'",...
def define_actions( action ): """ Define the list of actions we are using. Args action: String with the passed action. Could be "all" Returns actions: List of strings of actions Raises ValueError if the action is not included in H3.6M """ actions = ["walking", "eating", "smoking", "discussio...
def define_actions(action): """ Define the list of actions we are using. Args action: String with the passed action. Could be "all" Returns actions: List of strings of actions Raises ValueError if the action is not included in H3.6M """ actions = ['walking', 'eating', 'smoking', 'discussi...
# Withdrawal Request amount must be non-negative non_negative_amount = \ """ ALTER TABLE ledger_withdrawalrequest DROP CONSTRAINT IF EXISTS non_negative_amount; ALTER TABLE ledger_withdrawalrequest ADD CONSTRAINT non_negative_amount CHECK ("amount" >= 0); ALTER TABLE ledger_withdrawalrequest VALIDATE CONSTRAINT non...
non_negative_amount = '\nALTER TABLE ledger_withdrawalrequest DROP CONSTRAINT IF EXISTS non_negative_amount;\nALTER TABLE ledger_withdrawalrequest ADD CONSTRAINT non_negative_amount CHECK ("amount" >= 0);\nALTER TABLE ledger_withdrawalrequest VALIDATE CONSTRAINT non_negative_amount;\n'
# Using hash table # Time Complexity: O(n) class Solution: def intersect(self, nums1: List[int], nums2: List[int]) -> List[int]: checkDict =dict() final = list() for i in nums1: if i not in checkDict: checkDict[i] = 1 else: checkDict[...
class Solution: def intersect(self, nums1: List[int], nums2: List[int]) -> List[int]: check_dict = dict() final = list() for i in nums1: if i not in checkDict: checkDict[i] = 1 else: checkDict[i] += 1 for i in nums2: ...
# using factorial, reduced the time complexity # of program from O(2^N) to O(N) def factorial(n): if n < 2: return 1 else: return n * factorial(n - 1) def computeCoefficient(col, row): return factorial(row) // (factorial(col) * factorial(row - col)) # Recusrive method to create the ser...
def factorial(n): if n < 2: return 1 else: return n * factorial(n - 1) def compute_coefficient(col, row): return factorial(row) // (factorial(col) * factorial(row - col)) def compute_pascal(col, row): if col == row or col == 0: return 1 else: return compute_coeffici...
#!/usr/bin/env python # -*- coding: utf-8 -*- class Names(): Chemical_Elemnts = ["Yb", "Pb", "Ca", "Ti", "Mo", "Sn", "Cd", "Ag", "La", "Cs", "W", "Sb", "Ta", "V", "Fe", "Bi", "Ce", "Nb", "Cu", "I", "B", "Te", "Al", "Zr", "Gd", "Na", "Ga", "Cl"...
class Names: chemical__elemnts = ['Yb', 'Pb', 'Ca', 'Ti', 'Mo', 'Sn', 'Cd', 'Ag', 'La', 'Cs', 'W', 'Sb', 'Ta', 'V', 'Fe', 'Bi', 'Ce', 'Nb', 'Cu', 'I', 'B', 'Te', 'Al', 'Zr', 'Gd', 'Na', 'Ga', 'Cl', 'S', 'Si', 'O', 'F', 'Mn', 'Ba', 'K', 'Zn', 'N', 'Li', 'Ge', 'Y', 'Sr', 'P', 'Mg', 'Er', 'As'] "\n Chemical_Com...
# Build a Boolean mask to filter out all the 'LAX' departure flights: mask mask = df['Destination Airport'] == 'LAX' # Use the mask to subset the data: la la = df[mask] # Combine two columns of data to create a datetime series: times_tz_none times_tz_none = pd.to_datetime( la['Date (MM/DD/YYYY)'] + ' ' + la['Wheels-...
mask = df['Destination Airport'] == 'LAX' la = df[mask] times_tz_none = pd.to_datetime(la['Date (MM/DD/YYYY)'] + ' ' + la['Wheels-off Time']) times_tz_central = times_tz_none.dt.tz_localize('US/Central') times_tz_pacific = times_tz_central.dt.tz_convert('US/Pacific')
""" Write a Python program to find the second most repeated word in a given string. """ def word_count(str): counts = dict() words = str.split() for word in words: if word in counts: counts[word] += 1 else: counts[word] = 1 counts_x = sorted(counts.items(), key=l...
""" Write a Python program to find the second most repeated word in a given string. """ def word_count(str): counts = dict() words = str.split() for word in words: if word in counts: counts[word] += 1 else: counts[word] = 1 counts_x = sorted(counts.items(), key=l...
# -*- coding: utf-8 -*- """ Created on Sat Jan 19 10:52:04 2019 @author: Nihar """ marks=int(input("Enter Marks: ")) if marks >=70: print("Congrats!Distinction for you") elif 70 > marks >= 60: print("Well done! First Class !!") elif 60 > marks >= 40: print("You got Second Class") else: ...
""" Created on Sat Jan 19 10:52:04 2019 @author: Nihar """ marks = int(input('Enter Marks: ')) if marks >= 70: print('Congrats!Distinction for you') elif 70 > marks >= 60: print('Well done! First Class !!') elif 60 > marks >= 40: print('You got Second Class') else: print('Sorry! You failed!')
''' Given an unsorted array of integers, find the number of longest increasing subsequence. Example 1: Input: [1,3,5,4,7] Output: 2 Explanation: The two longest increasing subsequence are [1, 3, 4, 7] and [1, 3, 5, 7]. Example 2: Input: [2,2,2,2,2] Output: 5 Explanation: The length of longest continuous increasing subs...
""" Given an unsorted array of integers, find the number of longest increasing subsequence. Example 1: Input: [1,3,5,4,7] Output: 2 Explanation: The two longest increasing subsequence are [1, 3, 4, 7] and [1, 3, 5, 7]. Example 2: Input: [2,2,2,2,2] Output: 5 Explanation: The length of longest continuous increasing subs...
# python3 def solve(n, v): #if sum(v) % 3 != 0: # return False res = [] values = [] s = sum(v)//3 for i in range(2**n): bit = [0 for i in range(n)] k = i p = n-1 while k!=0: bit[p] = (k%2) k = k//2 p -= 1 ...
def solve(n, v): res = [] values = [] s = sum(v) // 3 for i in range(2 ** n): bit = [0 for i in range(n)] k = i p = n - 1 while k != 0: bit[p] = k % 2 k = k // 2 p -= 1 val = [a * b for (a, b) in zip(v, bit)] if sum(val)...
# create string and dictionary lines = "" occurrences = {} # prompt for lines line = input("Enter line: ") while line: lines += line + " " line = input("Enter line: ") # iterate through each color and store count for word in set(lines.split()): occurrences[word] = lines.split().count(word) # print result...
lines = '' occurrences = {} line = input('Enter line: ') while line: lines += line + ' ' line = input('Enter line: ') for word in set(lines.split()): occurrences[word] = lines.split().count(word) for word in sorted(occurrences): print(word, occurrences[word])
""" Demonstrates swapping the values of two variables """ number1 = 65 #Declares a variable named number1 and assigns it the value 65 number2 = 27 #Declares a variable named number2 and assigns it the value 27 temp_number = number1 #Copies the reference of n...
""" Demonstrates swapping the values of two variables """ number1 = 65 number2 = 27 temp_number = number1 number1 = number2 number2 = temp_number print(number1) print(number2)
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str ...
class Codec: def serialize(self, root): """Encodes a tree to a single string. :type root: TreeNode :rtype: str """ if root is None: return '[]' queue = [root] index = 0 while index < len(queue): node = queue[index] ...
# python3 n, m = map(int, input().split()) clauses = [ list(map(int, input().split())) for i in range(m) ] # This solution tries all possible 2^n variable assignments. # It is too slow to pass the problem. # Implement a more efficient algorithm here. def isSatisfiable(): for mask in range(1<<n): result = [...
(n, m) = map(int, input().split()) clauses = [list(map(int, input().split())) for i in range(m)] def is_satisfiable(): for mask in range(1 << n): result = [mask >> i & 1 for i in range(n)] formula_is_satisfied = True for clause in clauses: clause_is_satisfied = False ...
""" sentence span mapping to special concepts in amr like name,date-entity,etc. """ class Span(object): def __init__(self,start,end,words,entity_tag): self.start = start self.end = end self.entity_tag = entity_tag self.words = words def set_entity_tag(self,entity_tag): ...
""" sentence span mapping to special concepts in amr like name,date-entity,etc. """ class Span(object): def __init__(self, start, end, words, entity_tag): self.start = start self.end = end self.entity_tag = entity_tag self.words = words def set_entity_tag(self, entity_tag): ...
class FlPosition: def __init__(self, position_data, column_labels, timestamps, conversion): self.position_data = position_data self.column_labels = column_labels self.timestamps = timestamps self.conversion = conversion
class Flposition: def __init__(self, position_data, column_labels, timestamps, conversion): self.position_data = position_data self.column_labels = column_labels self.timestamps = timestamps self.conversion = conversion
class Recipe: def __init__(self, name, ingredients, yt_link): self.name = name self.ingredients = ingredients self.yt_link = yt_link self.similarity = 0 self.leftChild = None self.rightChild = None class BinarySearchTree: def __init__(self): self.root...
class Recipe: def __init__(self, name, ingredients, yt_link): self.name = name self.ingredients = ingredients self.yt_link = yt_link self.similarity = 0 self.leftChild = None self.rightChild = None class Binarysearchtree: def __init__(self): self.root =...
######################################################################## # Useful classes for implementing quantum heterostructures behavior # # author: Thiago Melo # # creation: 2018-11-09 # # update: 2018-11-09 ...
class Device(object): def __init__(self): pass
def deco(func): def temp(): print("-"*60) func() print("-"*60) return temp @deco def print_h1(): print("body") def main(): print_h1() if __name__ == "__main__": main()
def deco(func): def temp(): print('-' * 60) func() print('-' * 60) return temp @deco def print_h1(): print('body') def main(): print_h1() if __name__ == '__main__': main()
# linear search on sorted list def search(L, e): for i in range(len(L)): if L[i] == e: return True if L[i] > e: # sorted return False return False # O(n) for the loop and O(1) for the lookup to test if e == L[i] # overall complexity is O(n) where n is len(L)
def search(L, e): for i in range(len(L)): if L[i] == e: return True if L[i] > e: return False return False
def CheckPypi(auth, project): projectInfo = auth.GetJson("https://pypi.org/pypi/" + project + "/json") return projectInfo["info"]["version"]
def check_pypi(auth, project): project_info = auth.GetJson('https://pypi.org/pypi/' + project + '/json') return projectInfo['info']['version']
# Exercise 3: # # In this exercise we will create a program that identifies whether someone can # enter a super secret club. # Below are the people that are allowed in the club. # If your name is Bill Gates, Steve Jobs or Jesus, you should be allowed in the # club. # If your name is not one of the above, but your name ...
print("What's your name?") name = raw_input() print("What's your age?") age = input() if name == 'Bill Gates' or name == 'Steve Jobs' or name == 'Jesus': print('You are welcomed in our fancy club!') elif name == 'Maria' and age < 30: print('You are welcomed in our fancy club!') elif age > 100: print('You ar...
N, K = [int(a) for a in input().split()] h = [] for _ in range(N): h.append(int(input())) sortedh = sorted(h) min_ = 1e9 for i in range(N-K+1): diff = sortedh[i+K-1] - sortedh[i] min_ = min(min_, diff) print(min_)
(n, k) = [int(a) for a in input().split()] h = [] for _ in range(N): h.append(int(input())) sortedh = sorted(h) min_ = 1000000000.0 for i in range(N - K + 1): diff = sortedh[i + K - 1] - sortedh[i] min_ = min(min_, diff) print(min_)
# slow version dp class Solution(object): def isMatch(self, s, p): """ :type s: str :type p: str :rtype: bool """ sLength, pLength = len(s), len(p) matrix = [[False] * (pLength+1) for i in range(sLength+1)] matrix[0][0] = True ...
class Solution(object): def is_match(self, s, p): """ :type s: str :type p: str :rtype: bool """ (s_length, p_length) = (len(s), len(p)) matrix = [[False] * (pLength + 1) for i in range(sLength + 1)] matrix[0][0] = True for i in range(sLength ...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Created by AKM_FAN@163.com on 2017/11/6 if __name__ == '__main__': pass
if __name__ == '__main__': pass
# -*- coding: utf-8 -*- """ Created on Tue May 19 08:27:42 2020 @author: Shivadhar SIngh """ def histogram(seq): count = dict() for elem in seq: if elem not in count: count[elem] = 1 else: count[elem] += 1 return count
""" Created on Tue May 19 08:27:42 2020 @author: Shivadhar SIngh """ def histogram(seq): count = dict() for elem in seq: if elem not in count: count[elem] = 1 else: count[elem] += 1 return count
"""Errors raised by mailmerge.""" class MailmergeError(Exception): """Top level exception raised by mailmerge functions.""" class MailmergeRateLimitError(MailmergeError): """Reuse to send message because rate limit exceeded."""
"""Errors raised by mailmerge.""" class Mailmergeerror(Exception): """Top level exception raised by mailmerge functions.""" class Mailmergeratelimiterror(MailmergeError): """Reuse to send message because rate limit exceeded."""
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 ...
"""Constants for fever data.""" verifiable = 'VERIFIABLE' not_verifiable = 'NOT VERIFIABLE' not_enough_info = 'NOT ENOUGH INFO' refutes = 'REFUTES' supports = 'SUPPORTS' fever_classes = [REFUTES, SUPPORTS, NOT_ENOUGH_INFO] matching = 'MATCHING' not_matching = 'NOT_MATCHING' evidence_matching_classes = [NOT_MATCHING, MA...
# !/usr/bin/python # -*- coding: utf-8 -*- class Friends(object): def __init__(self, connections): super(Friends, self).__init__() self._data = {} self._add_connections(connections) def add(self, connection): is_exists = self.is_exists(connection) self._add_c...
class Friends(object): def __init__(self, connections): super(Friends, self).__init__() self._data = {} self._add_connections(connections) def add(self, connection): is_exists = self.is_exists(connection) self._add_connection(connection) return not is_exists ...
def table_service(*args): text, client, current_channel = args if text.lower().startswith("tables"): number = int(text.split()[-1]) result = "" for i in range(1, 11): result += f"{number} X {i} = {number*i}\n" client.chat_postMessage(channel=current_channel, text=resu...
def table_service(*args): (text, client, current_channel) = args if text.lower().startswith('tables'): number = int(text.split()[-1]) result = '' for i in range(1, 11): result += f'{number} X {i} = {number * i}\n' client.chat_postMessage(channel=current_channel, text=...
class Parameters: def __init__(self, **kwargs): self.__dict__.update(kwargs) def info(self): print("The parameters, and data-type are: ") for key,values in self.__dict__.items(): print("{} = {}, {}\n".format(key, values, type(values)))
class Parameters: def __init__(self, **kwargs): self.__dict__.update(kwargs) def info(self): print('The parameters, and data-type are: ') for (key, values) in self.__dict__.items(): print('{} = {}, {}\n'.format(key, values, type(values)))
if __name__ == '__main__': n = int(input()) arr = list(map(int, input().split())) max_val = max(arr) while(max_val in arr): arr.remove(max_val) print(max(arr))
if __name__ == '__main__': n = int(input()) arr = list(map(int, input().split())) max_val = max(arr) while max_val in arr: arr.remove(max_val) print(max(arr))
CHECKSUM_TAG = 'CHECKSUM_TAG' AVSCAN_TAG = 'AVSCAN_TAG' MAILER_TAG = 'MAILER_TAG' UNPACK_TAG = 'UNPACK_TAG' ARKADE5_TAG = 'ARKADE5_TAG' ARTIFACT_WRITER_TAG = 'ARTIFACT_WRITER_TAG' class ContainerTagParams: """ Parameter class containing dictionaries of {parameter names: image tags} for containers used during ...
checksum_tag = 'CHECKSUM_TAG' avscan_tag = 'AVSCAN_TAG' mailer_tag = 'MAILER_TAG' unpack_tag = 'UNPACK_TAG' arkade5_tag = 'ARKADE5_TAG' artifact_writer_tag = 'ARTIFACT_WRITER_TAG' class Containertagparams: """ Parameter class containing dictionaries of {parameter names: image tags} for containers used during a...
def solution(A): curSlice = float('-inf') maxSlice = float('-inf') for num in A: curSlice = max(num, curSlice+num) maxSlice = max(curSlice, maxSlice) return maxSlice if __name__ == '__main__': print(solution([3,2,-6,4,0])) print(solution([-10]))
def solution(A): cur_slice = float('-inf') max_slice = float('-inf') for num in A: cur_slice = max(num, curSlice + num) max_slice = max(curSlice, maxSlice) return maxSlice if __name__ == '__main__': print(solution([3, 2, -6, 4, 0])) print(solution([-10]))
class Solution: def XXX(self, head: ListNode) -> ListNode: o = head p = None while head is not None: if p is not None and head.val == p.val: p.next = head.next else: p = head head = head.next return o
class Solution: def xxx(self, head: ListNode) -> ListNode: o = head p = None while head is not None: if p is not None and head.val == p.val: p.next = head.next else: p = head head = head.next return o
def taxicab_distance(a, b): """ Returns the Manhattan distance of the given points """ n = len(a) d = 0 for i in range(n): d += abs(a[i] - b[i]) return d PERIOD = 2 # the period of the sequence def sequ(): """ Generates the sequence corresponding to the number of steps to...
def taxicab_distance(a, b): """ Returns the Manhattan distance of the given points """ n = len(a) d = 0 for i in range(n): d += abs(a[i] - b[i]) return d period = 2 def sequ(): """ Generates the sequence corresponding to the number of steps to take at each turn when trav...
#!/usr/bin/env python3 ######################################################################################################################## ##### INFORMATION ###################################################################################################### ### @PROJECT_NAME: SPLAT: Speech Processing and Lingu...
""" This package contains the following files: [01] POSTagger.py Provides the functionality to tokenize the given input with punctuation as separate tokens, and then does a dictionary lookup to determine the part-of-speech for each token. """
def start(): return def stop(): return def apply_command(self, c, e, command, arguments): pass def on_welcome(self, c, e): pass def on_invite(self, c, e): pass def on_join(self, c, e): pass def on_namreply(self, c, e): pass def on_pubmsg(self, c, e): pass def on_privmsg(s...
def start(): return def stop(): return def apply_command(self, c, e, command, arguments): pass def on_welcome(self, c, e): pass def on_invite(self, c, e): pass def on_join(self, c, e): pass def on_namreply(self, c, e): pass def on_pubmsg(self, c, e): pass def on_privmsg(self, c, ...
# Code Challenge 13 open_list = ["[", "{", "("] close_list = ["]", "}", ")"] def validate_brackets(str): stack=[] for i in str: if i in open_list: stack.append(i) elif i in close_list: x = close_list.index(i) if ((len(stack) > 0) ...
open_list = ['[', '{', '('] close_list = [']', '}', ')'] def validate_brackets(str): stack = [] for i in str: if i in open_list: stack.append(i) elif i in close_list: x = close_list.index(i) if len(stack) > 0 and open_list[x] == stack[len(stack) - 1]: ...
tail = input() body = input() head = input() meerkat = [tail, body, head] meerkat.reverse() print(meerkat)
tail = input() body = input() head = input() meerkat = [tail, body, head] meerkat.reverse() print(meerkat)
""" A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a2 + b2 = c2 For example, 32 + 42 = 9 + 16 = 25 = 52. There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product abc. a<995 b<996 c<997 They tell us there is only one, so we only need to test for existe...
""" A Pythagorean triplet is a set of three natural numbers, a < b < c, for which, a2 + b2 = c2 For example, 32 + 42 = 9 + 16 = 25 = 52. There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product abc. a<995 b<996 c<997 They tell us there is only one, so we only need to test for existe...
num = int(input()) for i in range(num): s = input() t = input() p = input()
num = int(input()) for i in range(num): s = input() t = input() p = input()
def peopleneeded(Smax, S): needed = 0 for s in range(Smax+1): if sum(S[:s+1])<s+1: needed += s+1-sum(S[:s+1]) S[s] += s+1-sum(S[:s+1]) return needed def get_output(instance): inputdata = open(instance + ".in", 'r') output = open(instance+ ".out", 'w') T = int(inp...
def peopleneeded(Smax, S): needed = 0 for s in range(Smax + 1): if sum(S[:s + 1]) < s + 1: needed += s + 1 - sum(S[:s + 1]) S[s] += s + 1 - sum(S[:s + 1]) return needed def get_output(instance): inputdata = open(instance + '.in', 'r') output = open(instance + '.out',...
class Solution: def isValidSerialization(self, preorder: str) -> bool: degree = 1 # outDegree (children) - inDegree (parent) for node in preorder.split(','): degree -= 1 if degree < 0: return False if node != '#': degree += 2 return degree == 0
class Solution: def is_valid_serialization(self, preorder: str) -> bool: degree = 1 for node in preorder.split(','): degree -= 1 if degree < 0: return False if node != '#': degree += 2 return degree == 0
""" Tests as were previously formatted. Leaving here in case I want to revert to more disparate testing. """ def test_vehicle_info(client): mock_file = 'mock_vehicleinfo.json' output_file = 'output_vehicleinfo.json' mock_response, correct_output = mocktest_setup(mock_file, output_file) with patch('server.request...
""" Tests as were previously formatted. Leaving here in case I want to revert to more disparate testing. """ def test_vehicle_info(client): mock_file = 'mock_vehicleinfo.json' output_file = 'output_vehicleinfo.json' (mock_response, correct_output) = mocktest_setup(mock_file, output_file) with patch('se...
""" Space : O(n) Time : O(n) """ class Solution: def rob(self, nums: List[int]) -> int: if len(nums) == 1: return nums[0] if len(nums) == 0: return 0 ans = 0 leng = len(nums)-1 one, two = [0] * leng, [0] * leng # 1st ite...
""" Space : O(n) Time : O(n) """ class Solution: def rob(self, nums: List[int]) -> int: if len(nums) == 1: return nums[0] if len(nums) == 0: return 0 ans = 0 leng = len(nums) - 1 (one, two) = ([0] * leng, [0] * leng) for idx in range(len...
class ZoneFilter: def __init__(self, rules): self.rules = rules def filter(self, record): # TODO Dummy implementation return [record]
class Zonefilter: def __init__(self, rules): self.rules = rules def filter(self, record): return [record]
class HyperparameterGrid(): def __init__(self): DEFAULT_HYPERPARAMETER_GRID = { 'lr': { 'C': [0.001, 0.01, 0.1, 1], 'penalty': ['l1', 'l2'], 'solver': ['liblinear'], 'intercept_scaling': [1, 1000], 'max_iter': [1000...
class Hyperparametergrid: def __init__(self): default_hyperparameter_grid = {'lr': {'C': [0.001, 0.01, 0.1, 1], 'penalty': ['l1', 'l2'], 'solver': ['liblinear'], 'intercept_scaling': [1, 1000], 'max_iter': [1000]}, 'dt': {'criterion': ['gini', 'entropy'], 'max_depth': [3, 5, 10, None], 'min_samples_leaf': ...
def uniqueElements(myList): uniqList = [] for _var in myList: if _var not in uniqList: uniqList.append(_var) else: return "Not Unique" return "Unique" print(uniqueElements([2,99,99,12,3,11,223]))
def unique_elements(myList): uniq_list = [] for _var in myList: if _var not in uniqList: uniqList.append(_var) else: return 'Not Unique' return 'Unique' print(unique_elements([2, 99, 99, 12, 3, 11, 223]))
def magic_square(square): size_square = len(square) is_magic = True wanted_sum = 0 for index in range(0, size_square): wanted_sum += square[0][index] for row in range(0, size_square): current_sum = 0 for col in range(0, size_square): current_sum += square[row][col] if current_sum != wanted_sum: ...
def magic_square(square): size_square = len(square) is_magic = True wanted_sum = 0 for index in range(0, size_square): wanted_sum += square[0][index] for row in range(0, size_square): current_sum = 0 for col in range(0, size_square): current_sum += square[row][col...
def f(x): y=1 x=x+y return x x=3 y=2 z=f(x) print("x="+str(x)) print("y="+str(y)) print("z="+str(z))
def f(x): y = 1 x = x + y return x x = 3 y = 2 z = f(x) print('x=' + str(x)) print('y=' + str(y)) print('z=' + str(z))
__all__ = [ "mock_generation_data_frame", "test_get_monthly_net_generation", "test_rate_limit", "test_retry", ]
__all__ = ['mock_generation_data_frame', 'test_get_monthly_net_generation', 'test_rate_limit', 'test_retry']
test = { 'name': 'q1_2', 'points': 1, 'suites': [ { 'cases': [ {'code': ">>> assert trending_vids.shape[0] == '40379'\n", 'hidden': False, 'locked': False}, {'code': ">>> assert trending_vids.iloc[0, 0] == '25231'\n", 'hidden': False, 'locked': False}, ...
test = {'name': 'q1_2', 'points': 1, 'suites': [{'cases': [{'code': ">>> assert trending_vids.shape[0] == '40379'\n", 'hidden': False, 'locked': False}, {'code': ">>> assert trending_vids.iloc[0, 0] == '25231'\n", 'hidden': False, 'locked': False}, {'code': ">>> assert trending_vids.iloc[0, 4] == 'Inside Edition'\n", '...
# -*- coding: utf-8 -*- """ Created on Tue Apr 6 10:35:39 2021 @author: ELCOT """ """ Given an integer numRows, return the first numRows of Pascal's triangle. In Pascal's triangle, each number is the sum of the two numbers directly above it as shown: Input: numRows = 5 Output: [[1],[1,1],[1,2,1],[...
""" Created on Tue Apr 6 10:35:39 2021 @author: ELCOT """ "\nGiven an integer numRows, return the first numRows of Pascal's triangle.\n\nIn Pascal's triangle, each number is the sum of the two numbers directly above it as shown:\n \nInput: numRows = 5\nOutput: [[1],[1,1],[1,2,1],[1,3,3,1],[1,4,6,4,1]] \n" clas...
class Income: def __init__(self): self.tranId = "" self.tradeId = "" self.symbol = "" self.incomeType = "" self.income = 0.0 self.asset = "" self.time = 0 @staticmethod def json_parse(json_data): result = Income() re...
class Income: def __init__(self): self.tranId = '' self.tradeId = '' self.symbol = '' self.incomeType = '' self.income = 0.0 self.asset = '' self.time = 0 @staticmethod def json_parse(json_data): result = income() result.tranId = json...
def game(input,max_turns): memory = {} turncounter = 1 most_recent_number = int(input[-1]) for i in range(len(input)): memory[int(input[i])] = [turncounter,-1] turncounter += 1 while turncounter <= max_turns: if memory[most_recent_number][1] == -1: most_r...
def game(input, max_turns): memory = {} turncounter = 1 most_recent_number = int(input[-1]) for i in range(len(input)): memory[int(input[i])] = [turncounter, -1] turncounter += 1 while turncounter <= max_turns: if memory[most_recent_number][1] == -1: most_recent_n...
# Copyright 2020 Uber Technologies, 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 to ...
valid_meta_keys = ['cpu', 'memory', 'gpu'] def post_process(metadata): if 'memory' in metadata: memory = metadata.pop('memory') metadata['mem'] = memory return metadata def meta(**kwargs): """ fiber.meta API allows you to decorate your function and provide some hints to Fiber. Curr...
def is_krampus(n): p = str(n**2) l_p = len(p) for i in range(1, l_p - 1): p_1 = int(p[:i]) p_2 = int(p[i:]) if p_1 and p_2 and p_1 + p_2 == n: return True return False def test_is_krampus(): assert is_krampus(45) assert not is_krampus(100) if __name__ ==...
def is_krampus(n): p = str(n ** 2) l_p = len(p) for i in range(1, l_p - 1): p_1 = int(p[:i]) p_2 = int(p[i:]) if p_1 and p_2 and (p_1 + p_2 == n): return True return False def test_is_krampus(): assert is_krampus(45) assert not is_krampus(100) if __name__ == ...
def adjacentElementsProduct(inputArray): first, second = 0, 1 lp = inputArray[first]*inputArray[second] for index in range(2, len(inputArray)): first = second second = index new_lp = inputArray[first]*inputArray[second] if new_lp > lp: lp = new_lp ...
def adjacent_elements_product(inputArray): (first, second) = (0, 1) lp = inputArray[first] * inputArray[second] for index in range(2, len(inputArray)): first = second second = index new_lp = inputArray[first] * inputArray[second] if new_lp > lp: lp = new_lp re...
def y(): pass def x(): y() for i in range(10): x()
def y(): pass def x(): y() for i in range(10): x()
INSTALLED_APPS = ( 'vkontakte_api', 'vkontakte_places', 'vkontakte_users', 'vkontakte_groups', 'vkontakte_comments', 'm2m_history', ) SOCIAL_API_TOKENS_STORAGES = []
installed_apps = ('vkontakte_api', 'vkontakte_places', 'vkontakte_users', 'vkontakte_groups', 'vkontakte_comments', 'm2m_history') social_api_tokens_storages = []
# # PySNMP MIB module AcAlarm (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/AcAlarm # Produced by pysmi-0.3.4 at Wed May 1 11:33:03 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)...
(ac_alarm_event_type, ac_alarm_probable_cause, ac_alarm_severity) = mibBuilder.importSymbols('AC-FAULT-TC', 'AcAlarmEventType', 'AcAlarmProbableCause', 'AcAlarmSeverity') (octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuil...
"""Set up dependency to tensorflow pip package.""" def _find_tf_include_path(repo_ctx): exec_result = repo_ctx.execute( [ "python3", "-c", "import tensorflow as tf; import sys; " + "sys.stdout.write(tf.sysconfig.get_include())", ], quiet = Tru...
"""Set up dependency to tensorflow pip package.""" def _find_tf_include_path(repo_ctx): exec_result = repo_ctx.execute(['python3', '-c', 'import tensorflow as tf; import sys; ' + 'sys.stdout.write(tf.sysconfig.get_include())'], quiet=True) if exec_result.return_code != 0: fail('Could not locate tensorf...
''' Processing of data via :py:mod:`.json_io`. Utilities for Excel conversion in :py:mod:`.convert` and :py:mod:`.service_sheet`. Example code in :py:mod:`.cli_examples` and :py:mod:`.plots`. '''
""" Processing of data via :py:mod:`.json_io`. Utilities for Excel conversion in :py:mod:`.convert` and :py:mod:`.service_sheet`. Example code in :py:mod:`.cli_examples` and :py:mod:`.plots`. """
# Create by Packetsss # Personal use is allowed # Commercial use is prohibited name = input("Enter your baphoon:") age = input("Enter your chikka:") print("WTF " + name + "! You are " + age + "??") num1 = input("Number 1:") num2 = input("Number 2:") result = num1 + num2
name = input('Enter your baphoon:') age = input('Enter your chikka:') print('WTF ' + name + '! You are ' + age + '??') num1 = input('Number 1:') num2 = input('Number 2:') result = num1 + num2
####!/usr/bin/env python3 """ Parse data files with json output for estack bulk load """ def elk_index(elk_index_name): """ Index setup for ELK Stack bulk install """ index_tag_full = {} index_tag_inner = {} index_tag_inner['_index'] = elk_index_name index_tag_inner['_type'] = elk_index_name ...
""" Parse data files with json output for estack bulk load """ def elk_index(elk_index_name): """ Index setup for ELK Stack bulk install """ index_tag_full = {} index_tag_inner = {} index_tag_inner['_index'] = elk_index_name index_tag_inner['_type'] = elk_index_name index_tag_full['index'] = in...