content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
class Solution(object):
def convertToTitle(self, n):
"""
:type n: int
:rtype: str
"""
res = []
while(n>0):
res.append(chr(ord('A')+(n-1)%26))
n-=1
n /= 26
return ''.join(res[::-1])
| class Solution(object):
def convert_to_title(self, n):
"""
:type n: int
:rtype: str
"""
res = []
while n > 0:
res.append(chr(ord('A') + (n - 1) % 26))
n -= 1
n /= 26
return ''.join(res[::-1]) |
def display(p):
L=[]
s=""
for i in range (0,9):
if(i>=(9-p)):
L.append("|---------|")
#print" ".join(map(str,L[i]))
else:
L.append('| |')
#s+=" ".join(map(str,L[i]))
L.append("-----------")
#s+=" ".join(map(... | def display(p):
l = []
s = ''
for i in range(0, 9):
if i >= 9 - p:
L.append('|---------|')
else:
L.append('| |')
L.append('-----------')
return L
def bucket(n):
print('>>>>Enter 1 to fill the bucket A \nEnter 2 to fill the bucket B \nEnter 3 to fi... |
#!/usr/bin/env python
# coding: utf-8
# This notebook was prepared by [Donne Martin](https://github.com/donnemartin). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges).
# # Solution Notebook
# ## Problem: Given a magazine, see if a ransom note could have been writte... | class Solution(object):
def match_note_to_magazine(self, ransom_note, magazine):
if ransom_note is None or magazine is None:
raise type_error('ransom_note or magazine cannot be None')
seen_chars = {}
for char in magazine:
if char in seen_chars:
seen_c... |
# Modify the code inside this loop to stop when i is greater than zero and exactly divisible by 11
for i in range(0, 100, 7):
print(i)
if i > 0 and i % 11 == 0:
break
| for i in range(0, 100, 7):
print(i)
if i > 0 and i % 11 == 0:
break |
# We are given an array A of size n that is sorted in ascending order, containing different
# natural numbers in pairs. Find algorithm that checks if there is such an index i that A[i] == i.
# What will change if the numbers are integers, not necessarily natural numbers?
# Natural numbers
def is_index_equal_to_numb... | def is_index_equal_to_number_natural(T):
if T[0] == 0:
return True
else:
return False
def is_index_equal_to_number_integer(T):
start = 0
end = len(T) - 1
while start <= end:
mid = (start + end) // 2
if T[mid] == mid:
return True
elif T[mid] > mid:... |
class Solution:
def jump(self, nums: List[int]) -> int:
n, start, end, ans, amax = len(nums)-1, 0, 0, 0, 0
while True:
for i in range(end, start-1, -1):
if i >= n:
return ans
amax = max(amax, i+nums[i])
... | class Solution:
def jump(self, nums: List[int]) -> int:
(n, start, end, ans, amax) = (len(nums) - 1, 0, 0, 0, 0)
while True:
for i in range(end, start - 1, -1):
if i >= n:
return ans
amax = max(amax, i + nums[i])
start = en... |
with open('input/day6.txt', 'r', encoding='utf8') as file:
fish_list = [int(value) for value in file.read().split(',')]
population = [0,0,0,0,0,0,0,0,0]
for fish in fish_list:
population[fish] += 1
for day in range(1, 257):
population = population[1:] + population[:1]
population[6] += population[8]
... | with open('input/day6.txt', 'r', encoding='utf8') as file:
fish_list = [int(value) for value in file.read().split(',')]
population = [0, 0, 0, 0, 0, 0, 0, 0, 0]
for fish in fish_list:
population[fish] += 1
for day in range(1, 257):
population = population[1:] + population[:1]
population[6] += population... |
name0_0_1_1_0_2_0 = None
name0_0_1_1_0_2_1 = None
name0_0_1_1_0_2_2 = None
name0_0_1_1_0_2_3 = None
name0_0_1_1_0_2_4 = None | name0_0_1_1_0_2_0 = None
name0_0_1_1_0_2_1 = None
name0_0_1_1_0_2_2 = None
name0_0_1_1_0_2_3 = None
name0_0_1_1_0_2_4 = None |
names = ['Christopher', 'Susan']
scores = []
scores.append(98)
scores.append(99)
print(names)
print(scores)
| names = ['Christopher', 'Susan']
scores = []
scores.append(98)
scores.append(99)
print(names)
print(scores) |
# Copyright 2017 BBVA
#
# 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, softwar... | class Apitesterror(Exception):
pass
class Apitestmissingdataerror(Exception):
pass
class Apitestinvalidformaterror(Exception):
pass
class Apitestvalueerror(ValueError):
pass
class Apitesttypeerror(TypeError):
pass
class Apitestunknowntypeerror(TypeError):
pass
class Apitestconnectionerror(... |
'''
pattern
Enter number of rows: 5
54321
4321
321
21
1
'''
print('pattern: ')
number_row=int(input('Enter number of rows: '))
for row in range(number_row,0,-1):
for column in range(row,number_row):
print(' ',end=' ')
for column in range(row,0,-1):
if column < 10:
print(f'0{column}'... | """
pattern
Enter number of rows: 5
54321
4321
321
21
1
"""
print('pattern: ')
number_row = int(input('Enter number of rows: '))
for row in range(number_row, 0, -1):
for column in range(row, number_row):
print(' ', end=' ')
for column in range(row, 0, -1):
if column < 10:
... |
"""
806. Number of Lines To Write String
We are to write the letters of a given string S, from left to right into lines.
Each line has maximum width 100 units, and if writing a letter would cause the width of the line to exceed 100 units,
it is written on the next line. We are given an array widths, an array wh... | """
806. Number of Lines To Write String
We are to write the letters of a given string S, from left to right into lines.
Each line has maximum width 100 units, and if writing a letter would cause the width of the line to exceed 100 units,
it is written on the next line. We are given an array widths, an array where w... |
num1 = 00
num2 = 200
for n in range(num1, num2 + 1):
if n > 1:
for i in range(2, n):
if (n % i) == 0:
break
else:
print(n) | num1 = 0
num2 = 200
for n in range(num1, num2 + 1):
if n > 1:
for i in range(2, n):
if n % i == 0:
break
else:
print(n) |
# This program displays property taxes.
TAX_FACTOR = 0.0065
print('Enter the property lot number')
print('or enter 0 to end.')
lot = int(input('Lot number: '))
while lot != 0:
value = float(input('Enter the property value: '))
tax = value * TAX_FACTOR
print('Property tax: $', format(tax, ',.2f'), sep='... | tax_factor = 0.0065
print('Enter the property lot number')
print('or enter 0 to end.')
lot = int(input('Lot number: '))
while lot != 0:
value = float(input('Enter the property value: '))
tax = value * TAX_FACTOR
print('Property tax: $', format(tax, ',.2f'), sep='')
print('Enter the next lot number or')
... |
CHROOTPW = """
dn: olcDatabase={0}config,cn=config
changetype: modify
add: olcRootPW
olcRootPW: SSHA_KEY
"""
CHDOMAIN="""
dn: olcDatabase={1}monitor,cn=config
changetype: modify
replace: olcAccess
olcAccess: {0}to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth"
read by dn.base="cn=admin,dc=mlo... | chrootpw = '\ndn: olcDatabase={0}config,cn=config\nchangetype: modify\nadd: olcRootPW\nolcRootPW: SSHA_KEY\n'
chdomain = '\ndn: olcDatabase={1}monitor,cn=config\nchangetype: modify\nreplace: olcAccess\nolcAccess: {0}to * by dn.base="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth"\n read by dn.base="cn=admin,d... |
"""
This module implements some interesting algorithmic challenges on strings
"""
def remove_duplicates(s):
"""
Given a string, remove duplicate characters, retaining only the first time for each unique character.
Example: helloh -> helo
"""
unique_chars = set()
new_string = ""
for char in s:
if char not in ... | """
This module implements some interesting algorithmic challenges on strings
"""
def remove_duplicates(s):
"""
Given a string, remove duplicate characters, retaining only the first time for each unique character.
Example: helloh -> helo
"""
unique_chars = set()
new_string = ''
for char in s:
... |
"""
The :mod:`pure_sklearn.metrics` module includes pairwise
metrics and distance computations.
"""
__all__ = ["pairwise"]
| """
The :mod:`pure_sklearn.metrics` module includes pairwise
metrics and distance computations.
"""
__all__ = ['pairwise'] |
def bingo_sort(L):
minValue = min(L)
maxValue = max(L)
bingo = minValue
next_bingo = maxValue
nextIndex = 0
while bingo < maxValue:
startPosition = nextIndex
for i in range(startPosition, len(L)):
if L[i] == bingo: L[i], L[nextIndex] = L[nextIndex], L[i] ; nextIndex +... | def bingo_sort(L):
min_value = min(L)
max_value = max(L)
bingo = minValue
next_bingo = maxValue
next_index = 0
while bingo < maxValue:
start_position = nextIndex
for i in range(startPosition, len(L)):
if L[i] == bingo:
(L[i], L[nextIndex]) = (L[nextInd... |
"""
categories: Types,Exception
description: User-defined attributes for builtin exceptions are not supported
cause: MicroPython is highly optimized for memory usage.
workaround: Use user-defined exception subclasses.
"""
e = Exception()
e.x = 0
print(e.x)
| """
categories: Types,Exception
description: User-defined attributes for builtin exceptions are not supported
cause: MicroPython is highly optimized for memory usage.
workaround: Use user-defined exception subclasses.
"""
e = exception()
e.x = 0
print(e.x) |
# You are given two integer arrays nums1 and nums2 both of unique elements,
# where nums1 is a subset of nums2.
# Find all the next greater numbers for nums1's elements in the corresponding
# places of nums2.
# The Next Greater Number of a number x in nums1 is the first greater number to
# its right in nums2. If it d... | class Solution_1:
def next_greater_element(nums1, nums2):
if not nums1 or not nums2:
return []
map1 = {}
stack = [nums2[0]]
for ind in range(1, len(nums2)):
while stack and nums2[ind] > stack[-1]:
map1[stack.pop()] = nums2[ind]
sta... |
#encoding:utf-8
subreddit = 'arabfunny'
t_channel = '@r_Arabfunny'
def send_post(submission, r2t):
return r2t.send_simple(submission)
| subreddit = 'arabfunny'
t_channel = '@r_Arabfunny'
def send_post(submission, r2t):
return r2t.send_simple(submission) |
# Copyright (C) 2015-2019 by Vd.
# This file is part of RocketGram, the modern Telegram bot framework.
# RocketGram is released under the MIT License (see LICENSE).
class LocationMessageContent:
"""https://core.telegram.org/bots/api#inputlocationmessagecontent"""
def __init__(self, latitude, longitude):
... | class Locationmessagecontent:
"""https://core.telegram.org/bots/api#inputlocationmessagecontent"""
def __init__(self, latitude, longitude):
self._data = dict()
self._data['latitude'] = latitude
self._data['longitude'] = longitude
def render(self):
return self._data |
#!/usr/local/bin/python2
arquivo = open('pessoas.csv')
for registro in arquivo:
print('nome: {}, idade: {}'.format(*registro.split(',')))
arquivo.close()
print("ola mundo") | arquivo = open('pessoas.csv')
for registro in arquivo:
print('nome: {}, idade: {}'.format(*registro.split(',')))
arquivo.close()
print('ola mundo') |
class SignalAndTarget(object):
"""
Simple data container class.
Parameters
----------
X: 3darray or list of 2darrays
The input signal per trial.
y: 1darray or list
Labels for each trial.
"""
def __init__(self, X, y):
assert len(X) == len(y)
self.X = X
... | class Signalandtarget(object):
"""
Simple data container class.
Parameters
----------
X: 3darray or list of 2darrays
The input signal per trial.
y: 1darray or list
Labels for each trial.
"""
def __init__(self, X, y):
assert len(X) == len(y)
self.X = X
... |
"""1.6 String Compression: Implement a method to perform basic string compression using the counts
of repeated characters. For example, the string aabcccccaaa would become a2b1c5a3. If the
"compressed" string would not become smaller than the original string, your method should return
the original string. You can assum... | """1.6 String Compression: Implement a method to perform basic string compression using the counts
of repeated characters. For example, the string aabcccccaaa would become a2b1c5a3. If the
"compressed" string would not become smaller than the original string, your method should return
the original string. You can assum... |
"""
Create a Os and Xs program!
The program should do the following:
- Create three lists for the three rows of the grid (and put three spaces in each one)
- Repeatedly ask the O user and the X user (one after the other) for a row and column to place a symbol
- Place the correct symbol for the user at that... | """
Create a Os and Xs program!
The program should do the following:
- Create three lists for the three rows of the grid (and put three spaces in each one)
- Repeatedly ask the O user and the X user (one after the other) for a row and column to place a symbol
- Place the correct symbol for the user at that locat... |
"""
# Sample code to perform I/O:
name = input() # Reading input from STDIN
print('Hi, %s.' % name) # Writing output to STDOUT
# Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
"""
# Write your code here
t = int(input())
def calc(x):
x //= 6... | """
# Sample code to perform I/O:
name = input() # Reading input from STDIN
print('Hi, %s.' % name) # Writing output to STDOUT
# Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
"""
t = int(input())
def calc(x):
x //= 60
if 6 < x < 18:
... |
# Combination Sum III
'''
Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set of numbers.
Note:
All numbers will be positive integers.
The solution set must not contain duplicate combinations.
Example 1:
... | """
Find all possible combinations of k numbers that add up to a number n, given that only numbers from 1 to 9 can be used and each combination should be a unique set of numbers.
Note:
All numbers will be positive integers.
The solution set must not contain duplicate combinations.
Example 1:
Input: k = 3, n = 7
Out... |
class Solution:
def canConstruct(self, ransomNote: str, magazine: str) -> bool:
ransomNote = sorted(ransomNote)
magazine = sorted(magazine)
i = j = 0
while i < len(ransomNote) and j < len(magazine):
if ransomNote[i] == magazine[j]:
i += 1
elif ... | class Solution:
def can_construct(self, ransomNote: str, magazine: str) -> bool:
ransom_note = sorted(ransomNote)
magazine = sorted(magazine)
i = j = 0
while i < len(ransomNote) and j < len(magazine):
if ransomNote[i] == magazine[j]:
i += 1
el... |
# File: P (Python 2.4)
protectedStates = [
'Injured']
overrideStates = [
'ThrownInJail']
| protected_states = ['Injured']
override_states = ['ThrownInJail'] |
print("You will meet two people - one is the sweet shop owner who wants to steal the password so he can keep the sweets.")
print()
playername=input("What is your name? ")
print("Welcome "+ playername)
| print('You will meet two people - one is the sweet shop owner who wants to steal the password so he can keep the sweets.')
print()
playername = input('What is your name? ')
print('Welcome ' + playername) |
# https://leetcode.com/problems/next-greater-node-in-linked-list/discuss/265508/JavaC%2B%2BPython-Next-Greater-Element
class Solution:
def nextLargerNodes(self, head):
res, stack = [], []
while head:
while stack and stack[-1][1] < head.val:
res[stack.pop()[0]] = head.val
... | class Solution:
def next_larger_nodes(self, head):
(res, stack) = ([], [])
while head:
while stack and stack[-1][1] < head.val:
res[stack.pop()[0]] = head.val
stack.append([len(res), head.val])
res.append(0)
head = head.next
re... |
message = "Hello Python world!"
print(message)
message = "Hello Python Crash Course world!"
print(message)
mesage = "Hello Python Crash Course reader!"
print(mesage)
| message = 'Hello Python world!'
print(message)
message = 'Hello Python Crash Course world!'
print(message)
mesage = 'Hello Python Crash Course reader!'
print(mesage) |
class NHomogeneousBatchLoss:
def __init__(self, loss, *args, **kwargs):
"""
Apply loss on list of Non-Homogeneous tensors
"""
self.loss = loss(**kwargs)
def __call__(self, output, target):
"""
output: must be a list of torch tensors [1 x ? x spatial]
ta... | class Nhomogeneousbatchloss:
def __init__(self, loss, *args, **kwargs):
"""
Apply loss on list of Non-Homogeneous tensors
"""
self.loss = loss(**kwargs)
def __call__(self, output, target):
"""
output: must be a list of torch tensors [1 x ? x spatial]
tar... |
n = int(input())
l = list(map(int, input().split()))
flag = 0
for i in range(1,max(l)+1):
for j in range(n):
if i>l[j]:
l[j] = 0
for j in range(n-1):
if l[j] == l[j+1]==0 or l[n-1]==0 or l[0] == 0:
flag = 1
break
if flag == 1:
break
if n==1:
pr... | n = int(input())
l = list(map(int, input().split()))
flag = 0
for i in range(1, max(l) + 1):
for j in range(n):
if i > l[j]:
l[j] = 0
for j in range(n - 1):
if l[j] == l[j + 1] == 0 or l[n - 1] == 0 or l[0] == 0:
flag = 1
break
if flag == 1:
break
... |
# NPTEL WEEK 3 PROGRAMMING ASSIGNMENT
def ascending(l):
if len(l)==0:
return(True)
for i in range(len(l)-1,0,-1):
if l[i]<l[i-1]:
return(False)
return(True)
#print(ascending([2,3,4,5,1]))
#print(ascending([1,2,3,4,5,5]))
def valley(l):
if len(l)<3:
r... | def ascending(l):
if len(l) == 0:
return True
for i in range(len(l) - 1, 0, -1):
if l[i] < l[i - 1]:
return False
return True
def valley(l):
if len(l) < 3:
return False
for i in range(0, len(l), 1):
if i == len(l) - 1:
return False
if ... |
def single_number(arr):
arr.sort()
idx = 0
while idx < len(arr):
try:
if arr[idx] != arr[idx + 1]:
return arr[idx]
except IndexError:
return arr[idx]
idx += 2
| def single_number(arr):
arr.sort()
idx = 0
while idx < len(arr):
try:
if arr[idx] != arr[idx + 1]:
return arr[idx]
except IndexError:
return arr[idx]
idx += 2 |
"""Parse plate-reader and fit ClopHensor titrations."""
__version__ = "0.3.3" # importlib.metadata.version(__name__)
| """Parse plate-reader and fit ClopHensor titrations."""
__version__ = '0.3.3' |
# interp.py
'''
Interpreter Project
===================
This is an interpreter than can run wabbit programs directly from the
generated IR code.
To run a program use::
bash % python3 -m wabbit.interp someprogram.wb
'''
| """
Interpreter Project
===================
This is an interpreter than can run wabbit programs directly from the
generated IR code.
To run a program use::
bash % python3 -m wabbit.interp someprogram.wb
""" |
cityFile = open("Lecture5_NumpyMatplotScipy/ornek.txt")
cityArr = cityFile.read().split("\n")
cityDict = {}
for line in cityArr:
info = line.split(",")
cityName = info[0]
day = int(info[1])
rainfall = float(info[2])
if cityName in cityDict.keys():
days = cityDict[cityName]
days[... | city_file = open('Lecture5_NumpyMatplotScipy/ornek.txt')
city_arr = cityFile.read().split('\n')
city_dict = {}
for line in cityArr:
info = line.split(',')
city_name = info[0]
day = int(info[1])
rainfall = float(info[2])
if cityName in cityDict.keys():
days = cityDict[cityName]
days[d... |
def print_keyword_args(**kwargs):
print('\n')
for key, value in kwargs.items():
print(f'{key} = {value}')
third = kwargs.get('third', None)
if third != None:
print('third arg =', third)
print_keyword_args(first='a')
print_keyword_args(first='b', second='c')
print_keyword_args(first='d', second='e',... | def print_keyword_args(**kwargs):
print('\n')
for (key, value) in kwargs.items():
print(f'{key} = {value}')
third = kwargs.get('third', None)
if third != None:
print('third arg =', third)
print_keyword_args(first='a')
print_keyword_args(first='b', second='c')
print_keyword_args(first='d'... |
class ShylockAsyncBackend:
@staticmethod
def _check():
raise NotImplementedError()
async def acquire(self, name: str, block: bool = True):
raise NotImplementedError()
async def release(self, name: str):
raise NotImplementedError()
class ShylockSyncBackend:
@s... | class Shylockasyncbackend:
@staticmethod
def _check():
raise not_implemented_error()
async def acquire(self, name: str, block: bool=True):
raise not_implemented_error()
async def release(self, name: str):
raise not_implemented_error()
class Shylocksyncbackend:
@staticmet... |
class Solution:
# O(n) time | O(1) space
def minStartValue(self, nums: List[int]) -> int:
minSum, currentSum = nums[0], 0
for num in nums:
currentSum += num
minSum = min(minSum, currentSum)
if minSum < 0:
return abs(minSum) + 1
else:
... | class Solution:
def min_start_value(self, nums: List[int]) -> int:
(min_sum, current_sum) = (nums[0], 0)
for num in nums:
current_sum += num
min_sum = min(minSum, currentSum)
if minSum < 0:
return abs(minSum) + 1
else:
return 1 |
class TrieNode(object):
def __init__(self):
self.children = {}
self.is_word = False
class Trie(object):
def __init__(self):
self.root = TrieNode()
def insert(self, word):
curr = self.root
for letter in word:
if word in curr.children:
... | class Trienode(object):
def __init__(self):
self.children = {}
self.is_word = False
class Trie(object):
def __init__(self):
self.root = trie_node()
def insert(self, word):
curr = self.root
for letter in word:
if word in curr.children:
c... |
foo = [25, 68, 'bar', 89.45, 789, 'spam', 0, 'last item']
print(foo[:3])
# difference?
print(foo[0:3])
print(foo[2:])
print(foo[1:-1]) | foo = [25, 68, 'bar', 89.45, 789, 'spam', 0, 'last item']
print(foo[:3])
print(foo[0:3])
print(foo[2:])
print(foo[1:-1]) |
# -*- coding: utf-8 -*-
config_page_name = {
'zh': {
'wikipedia': '',
}
}
| config_page_name = {'zh': {'wikipedia': ''}} |
class Result:
def __init__(self, id = None, success = None, message = None, url = None, data = None) -> None:
self.id = id
self.success = success
self.message = message
self.url = url
self.data = data
def to_json(self):
json_data = None
if (self.data and... | class Result:
def __init__(self, id=None, success=None, message=None, url=None, data=None) -> None:
self.id = id
self.success = success
self.message = message
self.url = url
self.data = data
def to_json(self):
json_data = None
if self.data and hasattr(se... |
def solution(arr):
size = 0
value = 0
for i in range(len(arr)):
if size == 0:
value = arr[i]
size += 1
else:
if value != arr[i] and size != 0:
size -= 1
else:
size += 1
leader = value
if arr.count(leader)... | def solution(arr):
size = 0
value = 0
for i in range(len(arr)):
if size == 0:
value = arr[i]
size += 1
elif value != arr[i] and size != 0:
size -= 1
else:
size += 1
leader = value
if arr.count(leader) <= len(arr) // 2:
r... |
"""
The module provides utility methods for hash code calculation.
"""
HASH_SEED = 23
def calc_hashcode(seed_value: int, value: int) -> int:
"""
Calculates hash code of the value using seed value.
:param seed_value: Seed value (current hash code).
:param value: Value for which to calculate hash code.... | """
The module provides utility methods for hash code calculation.
"""
hash_seed = 23
def calc_hashcode(seed_value: int, value: int) -> int:
"""
Calculates hash code of the value using seed value.
:param seed_value: Seed value (current hash code).
:param value: Value for which to calculate hash code.
... |
class Solution(object):
def spiralOrder(self, matrix):
"""
:type matrix: List[List[int]]
:rtype: List[int]
"""
if not matrix or not matrix[0]:
return []
len_mat_row = len(matrix)
len_mat_col = len(matrix[0])
j, k, m, n = 0, 0, 0, 0
... | class Solution(object):
def spiral_order(self, matrix):
"""
:type matrix: List[List[int]]
:rtype: List[int]
"""
if not matrix or not matrix[0]:
return []
len_mat_row = len(matrix)
len_mat_col = len(matrix[0])
(j, k, m, n) = (0, 0, 0, 0)
... |
def memory(x):
x = [i for i in range(x)]
return -1
def time(x):
# recursive function to find xth fibonacci number
if x < 3:
return 1
return time(x-1) + time(x-2)
def error(x=None):
# error function
return "a" / 2
def return_check(*args, **kwagrs):
# args and kwargs function... | def memory(x):
x = [i for i in range(x)]
return -1
def time(x):
if x < 3:
return 1
return time(x - 1) + time(x - 2)
def error(x=None):
return 'a' / 2
def return_check(*args, **kwagrs):
return list(args) + list(kwagrs.values()) |
class User:
user_budget = ""
travel_budget, food_budget, stay_budget = 500, 100, 400
travel_preference = False
stay_preference = False
food_preference = False
origin_city = ""
start_date = ""
return_date = ""
def __init__(self, origin_city, start_date, return_date, user_budget):
... | class User:
user_budget = ''
(travel_budget, food_budget, stay_budget) = (500, 100, 400)
travel_preference = False
stay_preference = False
food_preference = False
origin_city = ''
start_date = ''
return_date = ''
def __init__(self, origin_city, start_date, return_date, user_budget):... |
#
# PySNMP MIB module HUAWEI-LswQos-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HUAWEI-LswQos-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:34:31 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Ma... | (object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_intersection, value_size_constraint, constraints_union, value_range_constraint, single_value_constraint) ... |
def test_check_userId1(client):
response = client.get('/check?userId=1')
assert "True" in response.json
def test_check_userId3(client):
response = client.get('/check?userId=3')
assert "False" in response.json
| def test_check_user_id1(client):
response = client.get('/check?userId=1')
assert 'True' in response.json
def test_check_user_id3(client):
response = client.get('/check?userId=3')
assert 'False' in response.json |
# Write your solution for 1.3 here!
mysum=0
i=0
while i <= 10000 :
i = i+1
mysum = mysum+ i
print (mysum) | mysum = 0
i = 0
while i <= 10000:
i = i + 1
mysum = mysum + i
print(mysum) |
config = {
"CLIENT_ID": "8",
"API_URL": "http://DOMAIN.COM",
"PERSONAL_ACCESS_TOKEN": "",
"BRIDGE_IP": "192.168.x.x",
}
| config = {'CLIENT_ID': '8', 'API_URL': 'http://DOMAIN.COM', 'PERSONAL_ACCESS_TOKEN': '', 'BRIDGE_IP': '192.168.x.x'} |
load("//bazel/rules/cpp:main.bzl", "cpp_main")
load("//bazel/rules/unilang:unilang_to_java.bzl", "unilang_to_java")
load("//bazel/rules/code:code_to_java.bzl", "code_to_java")
load("//bazel/rules/move_file:move_file.bzl", "move_file")
load("//bazel/rules/move_file:move_file_java.bzl", "move_java_file")
def transfer_un... | load('//bazel/rules/cpp:main.bzl', 'cpp_main')
load('//bazel/rules/unilang:unilang_to_java.bzl', 'unilang_to_java')
load('//bazel/rules/code:code_to_java.bzl', 'code_to_java')
load('//bazel/rules/move_file:move_file.bzl', 'move_file')
load('//bazel/rules/move_file:move_file_java.bzl', 'move_java_file')
def transfer_un... |
class Track:
count = 0
def __init__(self, track_id, centroid, bbox=None, class_id=None):
"""
Track
Parameters
----------
track_id : int
Track id.
centroid : tuple
Centroid of the track pixel coordinate (x, y).
bbox :... | class Track:
count = 0
def __init__(self, track_id, centroid, bbox=None, class_id=None):
"""
Track
Parameters
----------
track_id : int
Track id.
centroid : tuple
Centroid of the track pixel coordinate (x, y).
bbox :... |
"""
Example of property documentation
>>> f = Foo()
>>> f.bar = 77
>>> f.bar
77
>>> Foo.bar.__doc__
'The bar attribute'
"""
# BEGIN DOC_PROPERTY
class Foo:
@property
def bar(self):
'''The bar attribute'''
return self.__dict__['bar']
@bar.setter
def bar(self, v... | """
Example of property documentation
>>> f = Foo()
>>> f.bar = 77
>>> f.bar
77
>>> Foo.bar.__doc__
'The bar attribute'
"""
class Foo:
@property
def bar(self):
"""The bar attribute"""
return self.__dict__['bar']
@bar.setter
def bar(self, value):
self._... |
getinput = input()
def main():
# import pdb; pdb.set_trace()
res = []
split_input = list(str(getinput))
for i, _ in enumerate(split_input):
if i == len(split_input) - 1:
if split_input[i] == split_input[-1]:
res.append(int(split_input[i]))
else:
i... | getinput = input()
def main():
res = []
split_input = list(str(getinput))
for (i, _) in enumerate(split_input):
if i == len(split_input) - 1:
if split_input[i] == split_input[-1]:
res.append(int(split_input[i]))
elif split_input[i] == split_input[i + 1]:
... |
# Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0
"""Composer CLI."""
| """Composer CLI.""" |
#
# PySNMP MIB module H3C-SUBNET-VLAN-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/H3C-SUBNET-VLAN-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:23:59 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default... | (integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_intersection, value_size_constraint, constraints_union, value_range_constraint, single_value_constraint) ... |
class User:
# create the class attributes
n_active = 0
users = []
# create the __init__ method
def __init__(self, active, user_name):
self.active = active
self.user_name = user_name
| class User:
n_active = 0
users = []
def __init__(self, active, user_name):
self.active = active
self.user_name = user_name |
class DatabaseError(Exception):
pass
class GameError(Exception):
pass
| class Databaseerror(Exception):
pass
class Gameerror(Exception):
pass |
# -*- coding: utf-8 -*-
"""
compat.py
~~~~~~~~~
Defines cross-platform functions and classes needed to achieve proper
functionality.
"""
pass
| """
compat.py
~~~~~~~~~
Defines cross-platform functions and classes needed to achieve proper
functionality.
"""
pass |
lst = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
def sequential__search(lst_, num):
for i in lst_:
if i == num:
print()
print(i)
return print()
print()
print(f"{num} does not exist in the given list")
print()
return False
sequential__search(lst, 10)
| lst = (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
def sequential__search(lst_, num):
for i in lst_:
if i == num:
print()
print(i)
return print()
print()
print(f'{num} does not exist in the given list')
print()
return False
sequential__search(lst, 10) |
"""
Geological modelling classes and functions
"""
| """
Geological modelling classes and functions
""" |
# -*- coding: utf-8 -*-
dummy_log = """commit 6b635e74901e6e4c264534c0f05dc0498e0f5eb6
Author: Vinayak Mehta <vmehta94@gmail.com>
Date: Tue Apr 14 15:45:38 2020 +0530
Latest commit
commit 9a05e2014694f1633a17ed84eab00f577d0a51f2
Author: Vinayak Mehta <vmehta94@gmail.com>
Date: Tue Apr 14 15:45:32 2020 +0530... | dummy_log = 'commit 6b635e74901e6e4c264534c0f05dc0498e0f5eb6\nAuthor: Vinayak Mehta <vmehta94@gmail.com>\nDate: Tue Apr 14 15:45:38 2020 +0530\n\n Latest commit\n\ncommit 9a05e2014694f1633a17ed84eab00f577d0a51f2\nAuthor: Vinayak Mehta <vmehta94@gmail.com>\nDate: Tue Apr 14 15:45:32 2020 +0530\n\n Ok last I pr... |
def is_credit_card_valid(number):
length = len(number)
if length % 2 == 0:
return False
new_number = ''
rev = number[::-1]
for index in range(0,length):
if index % 2 == 0:
new_number += rev[index]
else:
new_number += (str)((int)(rev[index]) + (int)(rev[index]))
return sum(map(int, list(new_number... | def is_credit_card_valid(number):
length = len(number)
if length % 2 == 0:
return False
new_number = ''
rev = number[::-1]
for index in range(0, length):
if index % 2 == 0:
new_number += rev[index]
else:
new_number += str(int(rev[index]) + int(rev[inde... |
"""
Copyright (c) 2013-2015, Fionn Kelleher
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the fol... | """
Copyright (c) 2013-2015, Fionn Kelleher
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the foll... |
"""
Templie exceptions
"""
class TemplieException(Exception):
def __init__(self, message):
super().__init__('ERROR: {}'.format(message))
class DslSyntaxError(TemplieException):
@classmethod
def get_error(cls, line):
return cls('invalid line: {}'.format(line.strip('\n')))
class Missing... | """
Templie exceptions
"""
class Templieexception(Exception):
def __init__(self, message):
super().__init__('ERROR: {}'.format(message))
class Dslsyntaxerror(TemplieException):
@classmethod
def get_error(cls, line):
return cls('invalid line: {}'.format(line.strip('\n')))
class Missingse... |
"""Const for Velbus."""
DOMAIN = "velbus"
CONF_INTERFACE = "interface"
CONF_MEMO_TEXT = "memo_text"
SERVICE_SCAN = "scan"
SERVICE_SYNC = "sync_clock"
SERVICE_SET_MEMO_TEXT = "set_memo_text"
| """Const for Velbus."""
domain = 'velbus'
conf_interface = 'interface'
conf_memo_text = 'memo_text'
service_scan = 'scan'
service_sync = 'sync_clock'
service_set_memo_text = 'set_memo_text' |
"""A test that verifies documenting a namespace of functions."""
def _min(integers):
"""Returns the minimum of given elements.
Args:
integers: A list of integers. Must not be empty.
Returns:
The minimum integer in the given list.
"""
_ignore = [integers]
return 42
def _assert_non... | """A test that verifies documenting a namespace of functions."""
def _min(integers):
"""Returns the minimum of given elements.
Args:
integers: A list of integers. Must not be empty.
Returns:
The minimum integer in the given list.
"""
_ignore = [integers]
return 42
def _assert_non... |
BNB_BASE_URL = "https://www.bnb.bg/Statistics/StExternalSector/StExchangeRates/StERForeignCurrencies/index.htm?"
BNB_DATE_FORMAT = "%d.%m.%Y"
BNB_SPLIT_BY_MONTHS = 3
BNB_CSV_HEADER_ROWS = 2
NAP_DIGIT_PRECISION = "0.01"
NAP_DATE_FORMAT = "%Y-%m-%d"
NAP_DIVIDEND_TAX = "0.05"
RECEIVED_DIVIDEND_ACTIVITY_TYPES = ["DIV", ... | bnb_base_url = 'https://www.bnb.bg/Statistics/StExternalSector/StExchangeRates/StERForeignCurrencies/index.htm?'
bnb_date_format = '%d.%m.%Y'
bnb_split_by_months = 3
bnb_csv_header_rows = 2
nap_digit_precision = '0.01'
nap_date_format = '%Y-%m-%d'
nap_dividend_tax = '0.05'
received_dividend_activity_types = ['DIV', 'DI... |
class Matcher:
def matches(self, arg):
pass
class Any(Matcher):
def __init__(self, wanted_type=None):
self.wanted_type = wanted_type
def matches(self, arg):
if self.wanted_type:
return isinstance(arg, self.wanted_type)
else:
return True
def __repr__(self):
re... | class Matcher:
def matches(self, arg):
pass
class Any(Matcher):
def __init__(self, wanted_type=None):
self.wanted_type = wanted_type
def matches(self, arg):
if self.wanted_type:
return isinstance(arg, self.wanted_type)
else:
return True
def __... |
print("The elementary reactions are:")
print(" Reaction 1: the birth of susceptible individuals with propensity b")
print(" Reaction 2: their death with propensity mu_S*S(t)")
print(" Reaction 3: their infection with propensity beta * S(t)*I(t)")
print(" Reaction 4: the death of infected individuals with propensity mu_... | print('The elementary reactions are:')
print(' Reaction 1: the birth of susceptible individuals with propensity b')
print(' Reaction 2: their death with propensity mu_S*S(t)')
print(' Reaction 3: their infection with propensity beta * S(t)*I(t)')
print(' Reaction 4: the death of infected individuals with propensity mu_... |
def baz(x):
if x < 0:
baz(x)
else:
baz(x)
| def baz(x):
if x < 0:
baz(x)
else:
baz(x) |
TABLES = {'Network': [['f_name', 'TEXT'],
['scenariodate', 'TEXT'],
['stopthresholdspeed', 'TEXT'],
['growth', 'TEXT'],
['defwidth', 'TEXT'],
['pedspeed', 'TEXT'],
['phf', 'TEXT'],
... | tables = {'Network': [['f_name', 'TEXT'], ['scenariodate', 'TEXT'], ['stopthresholdspeed', 'TEXT'], ['growth', 'TEXT'], ['defwidth', 'TEXT'], ['pedspeed', 'TEXT'], ['phf', 'TEXT'], ['vehlength', 'TEXT'], ['criticalmergegap', 'TEXT'], ['hv', 'TEXT'], ['followuptime', 'TEXT'], ['utdfversion', 'TEXT'], ['dontwalk', 'TEXT'... |
class TxInfo:
def __init__(self, txid, timestamp, fee, fee_currency, wallet_address, exchange, url):
self.txid = txid
self.timestamp = timestamp
self.fee = fee
self.fee_currency = fee_currency
self.wallet_address = wallet_address
self.exchange = exchange
sel... | class Txinfo:
def __init__(self, txid, timestamp, fee, fee_currency, wallet_address, exchange, url):
self.txid = txid
self.timestamp = timestamp
self.fee = fee
self.fee_currency = fee_currency
self.wallet_address = wallet_address
self.exchange = exchange
self... |
'''https://practice.geeksforgeeks.org/problems/multiply-two-linked-lists/1
Multiply two linked lists
Easy Accuracy: 38.67% Submissions: 24824 Points: 2
Given elements as nodes of the two linked lists. The task is to multiply these two linked lists, say L1 and L2.
Note: The output could be large take modulo 109+7.
I... | """https://practice.geeksforgeeks.org/problems/multiply-two-linked-lists/1
Multiply two linked lists
Easy Accuracy: 38.67% Submissions: 24824 Points: 2
Given elements as nodes of the two linked lists. The task is to multiply these two linked lists, say L1 and L2.
Note: The output could be large take modulo 109+7.
I... |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def numComponents(self, head: ListNode, G: List[int]) -> int:
ans = 0
G_set = set(G)
cur = head
while cur:
... | class Solution:
def num_components(self, head: ListNode, G: List[int]) -> int:
ans = 0
g_set = set(G)
cur = head
while cur:
if cur.val in G_set and (not cur.next or cur.next.val not in G_set):
ans += 1
cur = cur.next
return ans |
#Kunal Gautam
#Codewars : @Kunalpod
#Problem name: Rock Paper Scissors!
#Problem level: 8 kyu
def rps(p1, p2):
if p1[0]=='r' and p2[0]=='s': return "Player 1 won!"
if p1[0]=='s' and p2[0]=='p': return "Player 1 won!"
if p1[0]=='p' and p2[0]=='r': return "Player 1 won!"
if p2[0]=='r' and p1[0]=... | def rps(p1, p2):
if p1[0] == 'r' and p2[0] == 's':
return 'Player 1 won!'
if p1[0] == 's' and p2[0] == 'p':
return 'Player 1 won!'
if p1[0] == 'p' and p2[0] == 'r':
return 'Player 1 won!'
if p2[0] == 'r' and p1[0] == 's':
return 'Player 2 won!'
if p2[0] == 's' and p1[... |
class ArgsTest:
def __init__(self, key:str=None, value:str=None,
max_age=None, expires=None, path:str=None, domain:str=None,
secure:bool=False, httponly:bool=False, sync_expires:bool=True,
comment:str=None, version:int=None): pass
class Sub(ArgsTest):
pass
| class Argstest:
def __init__(self, key: str=None, value: str=None, max_age=None, expires=None, path: str=None, domain: str=None, secure: bool=False, httponly: bool=False, sync_expires: bool=True, comment: str=None, version: int=None):
pass
class Sub(ArgsTest):
pass |
def roll_new(name, gender):
pass
def describe(character):
pass | def roll_new(name, gender):
pass
def describe(character):
pass |
# receive a integer than count the number of "1"s in it's binary form
#my :
def countBits(n):
i = 0
while n > 2:
if n % 2 == 1:
i = i + 1
n = (n-1)/2
else:
n = n/2
return (i + 1) if n != 0 else 0
| def count_bits(n):
i = 0
while n > 2:
if n % 2 == 1:
i = i + 1
n = (n - 1) / 2
else:
n = n / 2
return i + 1 if n != 0 else 0 |
# -*- coding: utf-8 -*-
class ImageSerializerMixin:
def build_absolute_image_url(self, url):
if not url.startswith('http'):
request = self.context.get('request')
return request.build_absolute_uri(url)
return url
| class Imageserializermixin:
def build_absolute_image_url(self, url):
if not url.startswith('http'):
request = self.context.get('request')
return request.build_absolute_uri(url)
return url |
__version__ = "0.1.9"
__license__ = "Apache 2.0 license"
__website__ = "https://oss.navio.online/navio-gitlab/"
__download_url__ = ('https://github.com/navio-online/navio-gitlab/archive'
'/{}.tar.gz'.format(__version__)),
| __version__ = '0.1.9'
__license__ = 'Apache 2.0 license'
__website__ = 'https://oss.navio.online/navio-gitlab/'
__download_url__ = ('https://github.com/navio-online/navio-gitlab/archive/{}.tar.gz'.format(__version__),) |
SPACE_TOKEN = "\u241F"
def replace_space(text: str) -> str:
return text.replace(" ", SPACE_TOKEN)
def revert_space(text: list) -> str:
clean = (
" ".join("".join(text).replace(SPACE_TOKEN, " ").split())
.strip()
)
return clean
| space_token = '␟'
def replace_space(text: str) -> str:
return text.replace(' ', SPACE_TOKEN)
def revert_space(text: list) -> str:
clean = ' '.join(''.join(text).replace(SPACE_TOKEN, ' ').split()).strip()
return clean |
# -*- coding utf-8 -*-
"""
Created on Tue Nov 12 07:51:01 2019
Copyright 2019 Douglas Bowman dbowmans46@gmail.com
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 wi... | """
Created on Tue Nov 12 07:51:01 2019
Copyright 2019 Douglas Bowman dbowmans46@gmail.com
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 ri... |
def check(s):
(rule, password) = s.split(':')
(amount, letter) = rule.split(' ')
(lower, upper) = amount.split('-')
count = password.count(letter)
return count >= int(lower) and count <= int(upper)
def solve(in_file):
with open(in_file) as f:
passwords = f.readlines()
return sum(1 ... | def check(s):
(rule, password) = s.split(':')
(amount, letter) = rule.split(' ')
(lower, upper) = amount.split('-')
count = password.count(letter)
return count >= int(lower) and count <= int(upper)
def solve(in_file):
with open(in_file) as f:
passwords = f.readlines()
return sum((1 ... |
class DictionaryManipulator:
def __init__(self):
self.__dict = {}
with open("./en_US.dic", 'r') as content_file:
count = 0
for line in content_file.readlines():
words = line.split("/")
if len(words) > 1:
self.__dict[words[0... | class Dictionarymanipulator:
def __init__(self):
self.__dict = {}
with open('./en_US.dic', 'r') as content_file:
count = 0
for line in content_file.readlines():
words = line.split('/')
if len(words) > 1:
self.__dict[words[0... |
"""
logging
~~~~~~~
This module contains a class that wraps the log4j object instantiated
by the active SparkContext, enabling Log4j logging for PySpark using.
"""
class Log4j(object):
"""Wrapper class for Log4j JVM object.
:param spark: SparkSession object.
"""
def __init__(self,spark,key=None):
... | """
logging
~~~~~~~
This module contains a class that wraps the log4j object instantiated
by the active SparkContext, enabling Log4j logging for PySpark using.
"""
class Log4J(object):
"""Wrapper class for Log4j JVM object.
:param spark: SparkSession object.
"""
def __init__(self, spark, key=None):
... |
# AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"load_dcm": "00_io.ipynb",
"load_h5": "00_io.ipynb",
"crop": "01_manipulate.ipynb",
"pad": "01_manipulate.ipynb",
"resample": "01_manipulate.ipynb",
"resample_by":... | __all__ = ['index', 'modules', 'custom_doc_links', 'git_url']
index = {'load_dcm': '00_io.ipynb', 'load_h5': '00_io.ipynb', 'crop': '01_manipulate.ipynb', 'pad': '01_manipulate.ipynb', 'resample': '01_manipulate.ipynb', 'resample_by': '01_manipulate.ipynb'}
modules = ['io.py', 'manipulate.py']
doc_url = 'https://pfdama... |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@bazel_tools//tools/build_defs/repo:java.bzl", "java_import_external")
load(
"@nl_tulipsolutions_tecl//third_party/protoc-gen-validate:version.bzl",
com_envoyproxy_protoc_gen_validate_version = "version",
)
def repositories(
omi... | load('@bazel_tools//tools/build_defs/repo:http.bzl', 'http_archive')
load('@bazel_tools//tools/build_defs/repo:java.bzl', 'java_import_external')
load('@nl_tulipsolutions_tecl//third_party/protoc-gen-validate:version.bzl', com_envoyproxy_protoc_gen_validate_version='version')
def repositories(omit_com_salesforce_servi... |
#
# PySNMP MIB module SNR-ERD-4 (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SNR-ERD-4
# Produced by pysmi-0.3.4 at Mon Apr 29 21:00:57 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... | (object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_range_constraint, value_size_constraint, constraints_union, constraints_intersection, single_value_constraint) ... |
class Subtract:
def subtract(initial, remove):
if not(remove in initial):
return initial
index = initial.index(remove)
tracker = 0
removed = ''
while tracker < len(initial):
if not(tracker >= index and tracker < index + len(remove)):
removed += initial[tracker:tracker + 1]
tracker += 1
return ... | class Subtract:
def subtract(initial, remove):
if not remove in initial:
return initial
index = initial.index(remove)
tracker = 0
removed = ''
while tracker < len(initial):
if not (tracker >= index and tracker < index + len(remove)):
r... |
fr=open('migrating.txt', 'r')
caseDict = {}
oldList = [
"Ball_LightningSphere1.bmp",
"Ball_LightningSphere2.bmp",
"Ball_LightningSphere3.bmp",
"Ball_Paper.bmp",
"Ball_Stone.bmp",
"Ball_Wood.bmp",
"Brick.bmp",
"Button01_deselect.tga",
"Button01_select.tga",
"Button01_special.tga"... | fr = open('migrating.txt', 'r')
case_dict = {}
old_list = ['Ball_LightningSphere1.bmp', 'Ball_LightningSphere2.bmp', 'Ball_LightningSphere3.bmp', 'Ball_Paper.bmp', 'Ball_Stone.bmp', 'Ball_Wood.bmp', 'Brick.bmp', 'Button01_deselect.tga', 'Button01_select.tga', 'Button01_special.tga', 'Column_beige.bmp', 'Column_beige_fa... |
class Net3(nn.Module):
def __init__(self, kernel=None, padding=0, stride=2):
super(Net3, self).__init__()
self.conv1 = nn.Conv2d(in_channels=1, out_channels=3, kernel_size=3,
padding=padding)
# first kernel - leading diagonal
kernel_1 = torch.Tensor([[[1, -1, -1],
... | class Net3(nn.Module):
def __init__(self, kernel=None, padding=0, stride=2):
super(Net3, self).__init__()
self.conv1 = nn.Conv2d(in_channels=1, out_channels=3, kernel_size=3, padding=padding)
kernel_1 = torch.Tensor([[[1, -1, -1], [-1, 1, -1], [-1, -1, 1]]])
kernel_2 = torch.Tensor(... |
# Fonte https://www.thehuxley.com/problem/2253?locale=pt_BR
# TODO: Ordenar saidas de forma alfabetica, seguindo especificacoes do problema
tamanho_a, tamanho_b = input().split()
tamanho_a = int(tamanho_a)
tamanho_b = int(tamanho_b)
selecionados_a, selecionados_b = input().split()
selecionados_a = int(selecionados_a)
... | (tamanho_a, tamanho_b) = input().split()
tamanho_a = int(tamanho_a)
tamanho_b = int(tamanho_b)
(selecionados_a, selecionados_b) = input().split()
selecionados_a = int(selecionados_a)
selecionados_b = int(selecionados_b)
a = input().split()
a = list(map(int, a))
b = input().split()
b = list(map(int, b))
a.sort()
b.sort(... |
#
# PySNMP MIB module ASCEND-CALL-LOGGING-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ASCEND-CALL-LOGGING-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:26:02 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 ... | (call_logging_group,) = mibBuilder.importSymbols('ASCEND-MIB', 'callLoggingGroup')
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, value_ran... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.