content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#-----------------------------------
# AutoNaptPython
#
# Copyright (c) 2018 RainForest
#
# This software is released under the MIT License.
# http://opensource.org/licenses/mit-license.php
#-----------------------------------
class Event2(object):
def __init__(self,... | class Event2(object):
def __init__(self, doc=None):
self.handlers = []
self.__doc__ = doc
def __str__(self):
return 'Event<%s>' % str(self.__doc__)
def add(self, handler):
self.handlers.append(handler)
return self
def remove(self, handler):
self.handle... |
class Parser:
def __init__(self, directory, rel_path):
pass
def parse(self):
return {}, []
def get_parser(): return 5
| class Parser:
def __init__(self, directory, rel_path):
pass
def parse(self):
return ({}, [])
def get_parser():
return 5 |
load("@bazel_tools//tools/jdk:toolchain_utils.bzl", "find_java_runtime_toolchain", "find_java_toolchain")
def _proto_path(proto):
"""
The proto path is not really a file path
It's the path to the proto that was seen when the descriptor file was generated.
"""
path = proto.path
root = proto.root... | load('@bazel_tools//tools/jdk:toolchain_utils.bzl', 'find_java_runtime_toolchain', 'find_java_toolchain')
def _proto_path(proto):
"""
The proto path is not really a file path
It's the path to the proto that was seen when the descriptor file was generated.
"""
path = proto.path
root = proto.root... |
# Set up constants
WIDTH = 25
HEIGHT = 6
LAYER_SIZE = WIDTH * HEIGHT
# Read in the input file and convert to a list
pixel_string = ""
with open("./input.txt") as f:
pixel_string = f.readline()
unlayered_pixel_values = list(pixel_string.strip())
# Make into a list of layers
idx = 0
layers = []
while idx < len(unla... | width = 25
height = 6
layer_size = WIDTH * HEIGHT
pixel_string = ''
with open('./input.txt') as f:
pixel_string = f.readline()
unlayered_pixel_values = list(pixel_string.strip())
idx = 0
layers = []
while idx < len(unlayered_pixel_values):
layers.append(unlayered_pixel_values[idx:idx + LAYER_SIZE])
idx += L... |
def pg_version(conn):
"""
Returns the PostgreSQL server version as numeric and full version.
"""
num_version = conn.get_pg_version()
conn.execute("SELECT version()")
full_version = list(conn.get_rows())[0]['version']
return dict(numeric=num_version, full=full_version)
| def pg_version(conn):
"""
Returns the PostgreSQL server version as numeric and full version.
"""
num_version = conn.get_pg_version()
conn.execute('SELECT version()')
full_version = list(conn.get_rows())[0]['version']
return dict(numeric=num_version, full=full_version) |
class BaseExceptions(Exception):
pass
class DeleteException(BaseException):
"""Raised when delete failed"""
def __init__(self, resp_data):
if isinstance(resp_data, dict):
self.err = ''.join('Failed with reason {}'.format(val) for key, val in resp_data.items())
else:
... | class Baseexceptions(Exception):
pass
class Deleteexception(BaseException):
"""Raised when delete failed"""
def __init__(self, resp_data):
if isinstance(resp_data, dict):
self.err = ''.join(('Failed with reason {}'.format(val) for (key, val) in resp_data.items()))
else:
... |
class CommandBuilder():
def __init__(self, cindex):
self.cindex = cindex
class CodeBuilder(CommandBuilder):
def __init__(self, cindex, cmd):
super().__init__(cindex)
self.cmd = cmd
def __str__(self):
return self.cmd
class SlugBuilder(CommandBuilder):
def __init__(self,... | class Commandbuilder:
def __init__(self, cindex):
self.cindex = cindex
class Codebuilder(CommandBuilder):
def __init__(self, cindex, cmd):
super().__init__(cindex)
self.cmd = cmd
def __str__(self):
return self.cmd
class Slugbuilder(CommandBuilder):
def __init__(self... |
def data_provider(fn_data_provider):
"""Data provider decorator, allows another callable to provide the data for the test"""
def test_decorator(fn):
def repl(self, *args):
for i in fn_data_provider():
try:
fn(self, *i)
except AssertionError... | def data_provider(fn_data_provider):
"""Data provider decorator, allows another callable to provide the data for the test"""
def test_decorator(fn):
def repl(self, *args):
for i in fn_data_provider():
try:
fn(self, *i)
except AssertionErr... |
model_filename = "cifar10.model"
data_filename = "cifar10.npz"
model_url = "#"
data_url = "https://github.com/danielwilczak101/EasyNN/raw/datasets/cifar/cifar10.npz"
labels = {
0: "airplane",
1: "automobile",
2: "bird",
3: "cat",
4: "deer",
5: "d... | model_filename = 'cifar10.model'
data_filename = 'cifar10.npz'
model_url = '#'
data_url = 'https://github.com/danielwilczak101/EasyNN/raw/datasets/cifar/cifar10.npz'
labels = {0: 'airplane', 1: 'automobile', 2: 'bird', 3: 'cat', 4: 'deer', 5: 'dog', 6: 'frog', 7: 'horse', 8: 'ship', 9: 'truck'} |
#Normalmenet se declara asi
#numero = 9
#La variable que se relaciona con la instancia de una clase
class Persona:
edad=18#Clase Persona con variable de clase que es edad
def __init__(self,nombre,nacionalidad):
self.nombre=nombre#variables de instancia
self.nacionalidad=nacionalidad
persona1= Persona("Jose","Me... | class Persona:
edad = 18
def __init__(self, nombre, nacionalidad):
self.nombre = nombre
self.nacionalidad = nacionalidad
persona1 = persona('Jose', 'Mexicano')
print(Persona.edad)
persona2 = persona('Franklin', 'Colombo-Argentino')
print(persona2.nombre) |
#
# PySNMP MIB module SIAE-IFEXT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file://./sm_ifext.mib
# Produced by pysmi-0.3.2 at Fri Jul 19 08:18:02 2019
# On host 0e190c6811ee platform Linux version 4.9.125-linuxkit by user root
# Using Python version 3.7.3 (default, Apr 3 2019, 05:39:12)
#
Integer, OctetString, O... | (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, constraints_intersection, constraints_union, single_value_constraint, value_range_constraint) ... |
"""Custom dataloaders for testing"""
class CustomInfDataloader:
def __init__(self, dataloader):
self.dataloader = dataloader
self.iter = iter(dataloader)
self.count = 0
def __iter__(self):
self.count = 0
return self
def __next__(self):
if self.count >= 50... | """Custom dataloaders for testing"""
class Custominfdataloader:
def __init__(self, dataloader):
self.dataloader = dataloader
self.iter = iter(dataloader)
self.count = 0
def __iter__(self):
self.count = 0
return self
def __next__(self):
if self.count >= 50:... |
a = float(input("a = "))
b = float(input("b = "))
c = float(input("c = "))
if a==b==c:
print('nothing')
elif a==c:
print(2)
elif b==a:
print(3)
elif b==c:
print(1)
else:
print('nothing')
| a = float(input('a = '))
b = float(input('b = '))
c = float(input('c = '))
if a == b == c:
print('nothing')
elif a == c:
print(2)
elif b == a:
print(3)
elif b == c:
print(1)
else:
print('nothing') |
"""
Example Backup Plugin
"""
__import__("pkg_resources").declare_namespace(__name__)
| """
Example Backup Plugin
"""
__import__('pkg_resources').declare_namespace(__name__) |
"""
Management of OpenStack Neutron Security Group Rules
====================================================
.. versionadded:: 2018.3.0
:depends: shade
:configuration: see :py:mod:`salt.modules.neutronng` for setup instructions
Example States
.. code-block:: yaml
create security group rule:
neutron_secg... | """
Management of OpenStack Neutron Security Group Rules
====================================================
.. versionadded:: 2018.3.0
:depends: shade
:configuration: see :py:mod:`salt.modules.neutronng` for setup instructions
Example States
.. code-block:: yaml
create security group rule:
neutron_secg... |
#!/usr/bin/env python3
""" This is the exceptions file foi the CalculationsWithDots project """
class InvalidName(Exception):
""" Description of InvalidName
This Exception class is raised, if the given name is invalid.
"""
pass
class InvalidCoordinate(Exception):
""" Description of InvalidCoordi... | """ This is the exceptions file foi the CalculationsWithDots project """
class Invalidname(Exception):
""" Description of InvalidName
This Exception class is raised, if the given name is invalid.
"""
pass
class Invalidcoordinate(Exception):
""" Description of InvalidCoordinate
This Exception c... |
# -*- coding: utf-8 -*-
"""@package Methods.Geometry.Segment.get_end
Return the end point of an Segment method
@date Created on Thu Jul 27 13:51:43 2018
@copyright (C) 2015-2016 EOMYS ENGINEERING.
@author pierre_b
@todo unittest it
"""
def get_end(self):
"""Return the end point of the segment
Parameters
... | """@package Methods.Geometry.Segment.get_end
Return the end point of an Segment method
@date Created on Thu Jul 27 13:51:43 2018
@copyright (C) 2015-2016 EOMYS ENGINEERING.
@author pierre_b
@todo unittest it
"""
def get_end(self):
"""Return the end point of the segment
Parameters
----------
self : Seg... |
# 456. 132 Pattern
"""
Given an array of n integers nums, a 132 pattern is a subsequence of three integers nums[i], nums[j] and nums[k]
such that i < j < k and nums[i] < nums[k] < nums[j].
Return true if there is a 132 pattern in nums, otherwise, return false.
Follow up: The O(n^2) is trivial, could ... | """
Given an array of n integers nums, a 132 pattern is a subsequence of three integers nums[i], nums[j] and nums[k]
such that i < j < k and nums[i] < nums[k] < nums[j].
Return true if there is a 132 pattern in nums, otherwise, return false.
Follow up: The O(n^2) is trivial, could you come up with th... |
#!/usr/bin/python
"""
This is a collections of functions common to the other, individual pieces of this project
"""
__author__ = "AJ Wilson"
__copyright__ = " "
__license__ = " "
__version__ = "0.0.0.0"
__maintainer__ = "AJ Wilson"
__email__ = "aj.wilson08[at]gmail.com"
__status__ = "WIP"
def function1():
return... | """
This is a collections of functions common to the other, individual pieces of this project
"""
__author__ = 'AJ Wilson'
__copyright__ = ' '
__license__ = ' '
__version__ = '0.0.0.0'
__maintainer__ = 'AJ Wilson'
__email__ = 'aj.wilson08[at]gmail.com'
__status__ = 'WIP'
def function1():
return None |
def fib(n):
'''
uses generater to return fibonacci sequence
up to given # n dynamically
'''
a,b = 1,1
for _ in range(0,n):
yield a
a,b = b,a+b
return a
| def fib(n):
"""
uses generater to return fibonacci sequence
up to given # n dynamically
"""
(a, b) = (1, 1)
for _ in range(0, n):
yield a
(a, b) = (b, a + b)
return a |
config = {
"qqGroup": "",
"pro_ids": ['11111', '22222'],
"daily": {
"pro_ids": ['11111']
},
# "pk": {
# "me": "22222",
# "vs": ['33333']
# }
"dailyInterval": 25,
"pkInterval": 30
}
| config = {'qqGroup': '', 'pro_ids': ['11111', '22222'], 'daily': {'pro_ids': ['11111']}, 'dailyInterval': 25, 'pkInterval': 30} |
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def swapPairs(self, head):
if not head:
return None
if not head.next:
return head
curr = head
after = head.next
pre = None
head = after
while after:
curr.next = after.next
after.next = cur... | class Listnode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def swap_pairs(self, head):
if not head:
return None
if not head.next:
return head
curr = head
after = head.next
pre = None
head = after... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
# CODE NAME HERE
# CODE DESCRIPTION HERE
Created on 2019-01-17 at 14:31
@author: cook
"""
__all__ = []
# =============================================================================
# Define functions
# =============================================================... | """
# CODE NAME HERE
# CODE DESCRIPTION HERE
Created on 2019-01-17 at 14:31
@author: cook
"""
__all__ = [] |
{
'targets': [
{
'target_name': 'brotli',
'type': 'static_library',
'include_dirs': ['c/include'],
'conditions': [
['OS=="linux"', {
'defines': [
'OS_LINUX'
]
}],
['OS=="freebsd"', {
'defines': [
'OS_FREEBSD'
... | {'targets': [{'target_name': 'brotli', 'type': 'static_library', 'include_dirs': ['c/include'], 'conditions': [['OS=="linux"', {'defines': ['OS_LINUX']}], ['OS=="freebsd"', {'defines': ['OS_FREEBSD']}], ['OS=="mac"', {'defines': ['OS_MACOSX']}]], 'direct_dependent_settings': {'include_dirs': ['c/include']}, 'libraries'... |
{
'variables': {
'base_cflags': [
'-Wall',
'-Wextra',
'-Wno-unused-parameter',
'-std=c++11',
],
'debug_cflags': ['-g', '-O0'],
'release_cflags': ['-O3'],
},
'targets': [
{
'target_name': 'tonclient',
'sources': ['binding.cc'],
'conditions': [
[... | {'variables': {'base_cflags': ['-Wall', '-Wextra', '-Wno-unused-parameter', '-std=c++11'], 'debug_cflags': ['-g', '-O0'], 'release_cflags': ['-O3']}, 'targets': [{'target_name': 'tonclient', 'sources': ['binding.cc'], 'conditions': [['OS == "win"', {'libraries': ['../tonclient.lib', 'advapi32.lib', 'ws2_32.lib', 'usere... |
int1 = input("Enter first integer: ")
int2 = input("Enter second integer: ")
sum = int(int1) + int(int2)
if sum in range(105, 201):
print(200)
| int1 = input('Enter first integer: ')
int2 = input('Enter second integer: ')
sum = int(int1) + int(int2)
if sum in range(105, 201):
print(200) |
class Documents:
def __init__(self, session):
self.session = session
def index_documents(self, content_source_key, documents, **kwargs):
"""Index a batch of documents in a content source.
Raises :class:`~elastic_workplace_search.NonExistentRecord` if the
content_source_key is m... | class Documents:
def __init__(self, session):
self.session = session
def index_documents(self, content_source_key, documents, **kwargs):
"""Index a batch of documents in a content source.
Raises :class:`~elastic_workplace_search.NonExistentRecord` if the
content_source_key is m... |
# Create Plotter
acc_plotter = skdiscovery.data_structure.series.accumulators.Plotter('Plotter')
# Create stage containter for Plotter
sc_plotter = StageContainer(acc_plotter)
| acc_plotter = skdiscovery.data_structure.series.accumulators.Plotter('Plotter')
sc_plotter = stage_container(acc_plotter) |
# https://leetcode.com/problems/binary-watch/
#
# algorithms
# Easy (45.81%)
# Total Accepted: 69,493
# Total Submissions: 151,697
class Solution(object):
def readBinaryWatch(self, num):
"""
:type num: int
:rtype: List[str]
"""
hour = [1, 2, 4, 8]
minute = [1, 2... | class Solution(object):
def read_binary_watch(self, num):
"""
:type num: int
:rtype: List[str]
"""
hour = [1, 2, 4, 8]
minute = [1, 2, 4, 8, 16, 32]
res = []
(h_arr, m_arr) = ([], [])
def recursive(arr, idx, length, tmp, res_arr):
... |
"""
An *example* .bzl file.
You will find here a rule, a macro and the implementation function for the rule.
"""
def custom_macro(name, format, srcs=[]):
'''Custom macro documentation example.
Args:
:param format: The format to write check report in.
:param srcs: Source files to run the checks again... | """
An *example* .bzl file.
You will find here a rule, a macro and the implementation function for the rule.
"""
def custom_macro(name, format, srcs=[]):
"""Custom macro documentation example.
Args:
:param format: The format to write check report in.
:param srcs: Source files to run the checks agains... |
# ----------------------------------------------------------------------
# ctokens.py
#
# Token specifications for symbols in ANSI C and C++. This file is
# meant to be used as a library in other tokenizers.
# ----------------------------------------------------------------------
# Reserved words
tokens = [... | tokens = ['ID', 'TYPEID', 'INTEGER', 'FLOAT', 'STRING', 'CHARACTER', 'PLUS', 'MINUS', 'TIMES', 'DIVIDE', 'MODULO', 'OR', 'AND', 'NOT', 'XOR', 'LSHIFT', 'RSHIFT', 'LOR', 'LAND', 'LNOT', 'LT', 'LE', 'GT', 'GE', 'EQ', 'NE', 'EQUALS', 'TIMESEQUAL', 'DIVEQUAL', 'MODEQUAL', 'PLUSEQUAL', 'MINUSEQUAL', 'LSHIFTEQUAL', 'RSHIFTEQ... |
twitch_icon = "<:twitch:404633403603025921> "
cmd_fail = "<:tickNo:342738745092734976> "
cmd_success = "<:tickYes:342738345673228290> "
loading = "<a:loading:515632705262583819> "
bullet = "<:bullet:516382013779869726> "
right_arrow_alt = "<:arrow:343407434746036224>"
left_arrow = "<a:a_left_arrow:527634992415899650>"
... | twitch_icon = '<:twitch:404633403603025921> '
cmd_fail = '<:tickNo:342738745092734976> '
cmd_success = '<:tickYes:342738345673228290> '
loading = '<a:loading:515632705262583819> '
bullet = '<:bullet:516382013779869726> '
right_arrow_alt = '<:arrow:343407434746036224>'
left_arrow = '<a:a_left_arrow:527634992415899650>'
... |
list_a = [10, 20, 30]
list_b = ["Jan", "Peter", "Max"]
list_c = [True, False, True]
for val_a, val_b, val_c in zip(list_a, list_b, list_c):
print(val_a, val_b, val_c)
print("\n")
for i in range(len(list_a)):
print(i, list_a[i])
print("\n")
for i, val in enumerate(list_a):
print(i, val)
| list_a = [10, 20, 30]
list_b = ['Jan', 'Peter', 'Max']
list_c = [True, False, True]
for (val_a, val_b, val_c) in zip(list_a, list_b, list_c):
print(val_a, val_b, val_c)
print('\n')
for i in range(len(list_a)):
print(i, list_a[i])
print('\n')
for (i, val) in enumerate(list_a):
print(i, val) |
class ViewDisplaySketchyLines(object,IDisposable):
""" Represents the settings for sketchy lines. """
def Dispose(self):
""" Dispose(self: ViewDisplaySketchyLines) """
pass
def ReleaseUnmanagedResources(self,*args):
""" ReleaseUnmanagedResources(self: ViewDisplaySketchyLines,disposing: bool) """
pass
... | class Viewdisplaysketchylines(object, IDisposable):
""" Represents the settings for sketchy lines. """
def dispose(self):
""" Dispose(self: ViewDisplaySketchyLines) """
pass
def release_unmanaged_resources(self, *args):
""" ReleaseUnmanagedResources(self: ViewDisplaySketchyLines,di... |
PATH_DATA = "../train_data/pan20-author-profiling-training-2020-02-23"
PATH_DATA_EN = "../train_data/pan20-author-profiling-training-2020-02-23/en"
PATH_DATA_ES = "../train_data/pan20-author-profiling-training-2020-02-23/es"
PATH_DATA_EN_TRUTH = "../train_data/pan20-author-profiling-training-2020-02-23/en/truth.txt"
PA... | path_data = '../train_data/pan20-author-profiling-training-2020-02-23'
path_data_en = '../train_data/pan20-author-profiling-training-2020-02-23/en'
path_data_es = '../train_data/pan20-author-profiling-training-2020-02-23/es'
path_data_en_truth = '../train_data/pan20-author-profiling-training-2020-02-23/en/truth.txt'
pa... |
__all__ = ['Meta']
class Meta:
pass
| __all__ = ['Meta']
class Meta:
pass |
# Copyright (c) 2019 zfit
# TODO: improve errors of models. Generate more general error, inherit and use more specific?
class PDFCompatibilityError(Exception):
pass
class LogicalUndefinedOperationError(Exception):
pass
class ExtendedPDFError(Exception):
pass
class AlreadyExtendedPDFError(ExtendedP... | class Pdfcompatibilityerror(Exception):
pass
class Logicalundefinedoperationerror(Exception):
pass
class Extendedpdferror(Exception):
pass
class Alreadyextendedpdferror(ExtendedPDFError):
pass
class Notextendedpdferror(ExtendedPDFError):
pass
class Conversionerror(Exception):
pass
class Su... |
def good():
return ['Harry', 'Ron', 'Hermione']
# expected output:
'''
['Harry', 'Ron', 'Hermione']
'''
print( good() ) | def good():
return ['Harry', 'Ron', 'Hermione']
"\n['Harry', 'Ron', 'Hermione'] \n"
print(good()) |
glosario = {'listas' : "Se pueden identificar con []", 'tuplas' : "Se identifican con *()",
'glosario' : "Se identifican con {}", 'if' : "Condicional", 'for' : "Ciclo", '#' : "Para crear un comentario",
'str' : "Abreviacion de String", '==' : "usado para comparar elementos", "=!" : "Usado para verificar que dos eleme... | glosario = {'listas': 'Se pueden identificar con []', 'tuplas': 'Se identifican con *()', 'glosario': 'Se identifican con {}', 'if': 'Condicional', 'for': 'Ciclo', '#': 'Para crear un comentario', 'str': 'Abreviacion de String', '==': 'usado para comparar elementos', '=!': 'Usado para verificar que dos elementos son di... |
n = 8
fib0 = 0
fib1 = 1
if n > 0:
temp = fib0
fib0 = fib1
fib1 = fib1 + temp
n = n - 1
else:
print(f'Resultado {fib0}') | n = 8
fib0 = 0
fib1 = 1
if n > 0:
temp = fib0
fib0 = fib1
fib1 = fib1 + temp
n = n - 1
else:
print(f'Resultado {fib0}') |
class Solution(object):
def maxSlidingWindow(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: List[int]
"""
que, len1, len2 = [], 0, len(nums)
ans = []
for i in range(k):
while len1 > 0 and nums[i] >= que[-1][0]:
... | class Solution(object):
def max_sliding_window(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: List[int]
"""
(que, len1, len2) = ([], 0, len(nums))
ans = []
for i in range(k):
while len1 > 0 and nums[i] >= que[-1][0]:
... |
class ShellGame(object):
def __init__(self, start, swaps):
self.start = start
self.swaps = swaps
def find_the_ball(self):
if len(self.swaps) == 0:
return self.start
else:
for pos in self.swaps:
for x in pos:
self.start ... | class Shellgame(object):
def __init__(self, start, swaps):
self.start = start
self.swaps = swaps
def find_the_ball(self):
if len(self.swaps) == 0:
return self.start
else:
for pos in self.swaps:
for x in pos:
self.start... |
"""
from: http://adventofcode.com/2017/day/5
--- Part Two ---
Now, the jumps are even stranger: after each jump, if the offset was three or more, instead decrease
it by 1. Otherwise, increase it by 1 as before.
Using this rule with the above example, the process now takes 10 steps, and the offset values after
finding ... | """
from: http://adventofcode.com/2017/day/5
--- Part Two ---
Now, the jumps are even stranger: after each jump, if the offset was three or more, instead decrease
it by 1. Otherwise, increase it by 1 as before.
Using this rule with the above example, the process now takes 10 steps, and the offset values after
finding ... |
ROP_POPJUMPLR_STACK12 = 0x0101CD24;
ROP_POPJUMPLR_STACK20 = 0x01024D88;
ROP_CALLFUNC = 0x01080274;
ROP_CALLR28_POP_R28_TO_R31 = 0x0107DD70;
ROP_POP_R28R29R30R31 = 0x0101D8D4;
ROP_POP_R27 = 0x0101CB00;
ROP_POP_R24_TO_R31 = 0x010204C8;
ROP_CALLFUNCPTR_WITHARGS_FROM_R3MEM = 0x010253C0;
ROP_SETR3TOR31_POP_R31 = 0x0101CC10;... | rop_popjumplr_stack12 = 16895268
rop_popjumplr_stack20 = 16928136
rop_callfunc = 17302132
rop_callr28_pop_r28_to_r31 = 17292656
rop_pop_r28_r29_r30_r31 = 16898260
rop_pop_r27 = 16894720
rop_pop_r24_to_r31 = 16909512
rop_callfuncptr_withargs_from_r3_mem = 16929728
rop_setr3_tor31_pop_r31 = 16894992
rop__register = 16938... |
class NoPrivateKey(Exception):
"""
No private key was provided so unable to perform any operations requiring message signing.
"""
pass
class DigitalTwinMapError(Exception):
"""
No Digital Twin was created with this index or there is no such topic in Digital Twin map.
"""
pass
| class Noprivatekey(Exception):
"""
No private key was provided so unable to perform any operations requiring message signing.
"""
pass
class Digitaltwinmaperror(Exception):
"""
No Digital Twin was created with this index or there is no such topic in Digital Twin map.
"""
pass |
#
# PySNMP MIB module CISCO-VPN-LIC-USAGE-MONITOR-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-VPN-LIC-USAGE-MONITOR-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 18:03:26 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_size_constraint, constraints_intersection, single_value_constraint, value_range_constraint, constraints_union) ... |
# Copyright(c) 2017, Intel Corporation
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the followin... | metadata_guid = b'XeonFPGA\xb7GBSv001'
sizeof_len_field = 4
guid_len = len(METADATA_GUID) |
{
"targets": [
{
"target_name": "lmdb-queue",
"include_dirs" : [
"<!(node -e \"require('nan')\")",
"<!(node -e \"require('nnu')\")",
"deps"
],
"dependencies": [
"<(module_root_dir)/deps/lmdb.gyp:lmdb"
],
"sources": [
"src/module.cc",
... | {'targets': [{'target_name': 'lmdb-queue', 'include_dirs': ['<!(node -e "require(\'nan\')")', '<!(node -e "require(\'nnu\')")', 'deps'], 'dependencies': ['<(module_root_dir)/deps/lmdb.gyp:lmdb'], 'sources': ['src/module.cc', 'src/env.h', 'src/env.cc', 'src/topic.h', 'src/topic.cc', 'src/consumer.h', 'src/consumer.cc', ... |
# coding: utf-8
"""
railgun-cli
````````````
railgun command line tool
:License: MIT
:Copyright: @neo1218 @oaoouo
"""
__version__ = '0.1.3'
| """
railgun-cli
````````````
railgun command line tool
:License: MIT
:Copyright: @neo1218 @oaoouo
"""
__version__ = '0.1.3' |
# the key is the name of the class of the workload and the value is the program argument string
def get_workloads(checkpoint, analytics_data_paths: list, lda_data_paths: list, gbt_data_path: str,
pagerank_data_path: str, k: int, iterations: int, checkpoint_interval: int,
sampling_fra... | def get_workloads(checkpoint, analytics_data_paths: list, lda_data_paths: list, gbt_data_path: str, pagerank_data_path: str, k: int, iterations: int, checkpoint_interval: int, sampling_fraction: float=0.01, analytics_only: bool=False) -> dict:
if analytics_only:
workloads = {'Analytics': f'--sampling-fracti... |
__author__ = 'Cib'
class interface():
pass
| __author__ = 'Cib'
class Interface:
pass |
def foo(a):
"""
:param a:
"""
pass
foo("a")
| def foo(a):
"""
:param a:
"""
pass
foo('a') |
class MyStack:
def __init__(self):
self.q = deque()
def push(self, x: int) -> None:
self.q.append(x)
def pop(self) -> int:
for i in range(len(self.q)-1):
self.q.append(self.q.popleft())
return self.q.popleft()
def top(self) -> int:
temp = self.pop()
... | class Mystack:
def __init__(self):
self.q = deque()
def push(self, x: int) -> None:
self.q.append(x)
def pop(self) -> int:
for i in range(len(self.q) - 1):
self.q.append(self.q.popleft())
return self.q.popleft()
def top(self) -> int:
temp = self.po... |
N = int(input())
A = list(map(int, input().split()))
ans = 0
max_tall = 0
for i in range(0, N):
if max_tall > A[i]:
ans += max_tall - A[i]
if A[i] > max_tall:
max_tall = A[i]
print(ans) | n = int(input())
a = list(map(int, input().split()))
ans = 0
max_tall = 0
for i in range(0, N):
if max_tall > A[i]:
ans += max_tall - A[i]
if A[i] > max_tall:
max_tall = A[i]
print(ans) |
#
# PySNMP MIB module A3COM0027-RMON-EXTENSIONS (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/A3COM0027-RMON-EXTENSIONS
# Produced by pysmi-0.3.4 at Wed May 1 11:08:40 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.... | (rmon_extensions,) = mibBuilder.importSymbols('A3COM0004-GENERIC', 'rmonExtensions')
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_union, value_range_c... |
class ps_data:
@property
def train_data(self):
return self._train_data
@property
def indexs(self):
return self._indexs
@train_data.setter
def train_data(self, val):
self._train_data=val
@indexs.setter
def indexs(self, val):
self._indexs=val
| class Ps_Data:
@property
def train_data(self):
return self._train_data
@property
def indexs(self):
return self._indexs
@train_data.setter
def train_data(self, val):
self._train_data = val
@indexs.setter
def indexs(self, val):
self._indexs = val |
class Advice:
def __init__(self):
self.clothes = []
self.weather = None
def add_cloth(self, cloth):
self.clothes.append(cloth)
def add_message(self, message):
self.clothes.append(message)
def add_weather(self, weather):
self.weather = weather
| class Advice:
def __init__(self):
self.clothes = []
self.weather = None
def add_cloth(self, cloth):
self.clothes.append(cloth)
def add_message(self, message):
self.clothes.append(message)
def add_weather(self, weather):
self.weather = weather |
def _cantidad_caracter(cadena, caracter, indice, cantidad):
if indice == len(cadena):
return cantidad
if caracter == cadena[indice]:
cantidad += 1
return _cantidad_caracter(cadena, caracter, indice + 1, cantidad)
def cantidad_caracter(cadena, caracter):
"""Cuenta la cantidad de aparicio... | def _cantidad_caracter(cadena, caracter, indice, cantidad):
if indice == len(cadena):
return cantidad
if caracter == cadena[indice]:
cantidad += 1
return _cantidad_caracter(cadena, caracter, indice + 1, cantidad)
def cantidad_caracter(cadena, caracter):
"""Cuenta la cantidad de aparicio... |
script_part1 =r"""
<!DOCTYPE html>
<html lang="en">
<head>
<title>Cog Graph</title>
<style type="text/css">
body {
padding: 0;
margin: 0;
width: 100%;!important;
height: 100%;!important;
}
#cog-graph-view {
width: 700px;
height: 700px;
... | script_part1 = '\n<!DOCTYPE html>\n<html lang="en">\n <head>\n <title>Cog Graph</title>\n <style type="text/css">\n body {\n padding: 0;\n margin: 0;\n width: 100%;!important; \n height: 100%;!important; \n }\n\n #cog-graph-view {\n width: 700px;\n height... |
__all__= [
'table',
'projects',
'annotations',
'converters',
'metrics'
]
__version__ = '0.0.3'
| __all__ = ['table', 'projects', 'annotations', 'converters', 'metrics']
__version__ = '0.0.3' |
"""
Faster R-CNN with Normalized Wasserstein Assigner
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=1500 ] = 0.053
Average Precision (AP) @[ IoU=0.25 | area= all | maxDets=1500 ] = -1.000
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=1500 ] = 0.130
Average Precision (AP) ... | """
Faster R-CNN with Normalized Wasserstein Assigner
Average Precision (AP) @[ IoU=0.50:0.95 | area= all | maxDets=1500 ] = 0.053
Average Precision (AP) @[ IoU=0.25 | area= all | maxDets=1500 ] = -1.000
Average Precision (AP) @[ IoU=0.50 | area= all | maxDets=1500 ] = 0.130
Average Precision (AP) ... |
'''
lab2
'''
#3.1
my_name = "Tom"
print(my_name.upper())
#3.2
my_id = 123
print(my_id)
#3.3
# 123=my_id
my_id=your_id=123
print(my_id)
print(your_id)
#3.4
my_id_str= "123"
print(my_id_str)
#3.5
#print(my_name+my_id)
#3.6
print(my_name+my_id_str)
#3.7
print(my_name*3)
#3.8
print('hello, world. This is my fi... | """
lab2
"""
my_name = 'Tom'
print(my_name.upper())
my_id = 123
print(my_id)
my_id = your_id = 123
print(my_id)
print(your_id)
my_id_str = '123'
print(my_id_str)
print(my_name + my_id_str)
print(my_name * 3)
print('hello, world. This is my first python string'.split('.'))
message = "Tom's id is 123"
print(message) |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Jun 14 14:14:47 2017
@author: bmjl
"""
class Point:
"""This is Point class"""
def __init__(self):
"""This is the Point constructur"""
print("Point created")
def hello(self):
"""Hello method"""
p... | """
Created on Wed Jun 14 14:14:47 2017
@author: bmjl
"""
class Point:
"""This is Point class"""
def __init__(self):
"""This is the Point constructur"""
print('Point created')
def hello(self):
"""Hello method"""
print('Hello')
def hello_module():
"""Hello function"""... |
#/usr/bin/env python
def my_func1(callback):
def func_wrapper(x):
print("my_func1: {0} ".format(callback(x)))
return func_wrapper
@my_func1
def my_func2(x):
return x
# Actuall call sequence is similar to:
# deco = my_func1(my_func2)
# deco("test") => func_wrapper("test")
my_func2("test")
#-------... | def my_func1(callback):
def func_wrapper(x):
print('my_func1: {0} '.format(callback(x)))
return func_wrapper
@my_func1
def my_func2(x):
return x
my_func2('test')
def dec_param(param):
def my_func3(callback):
def func_wrapper(x):
print('my_func3: {0} {1} '.format(param, c... |
# HARD
# Rolling Hash Method
# abc ==> a *26^2, b * 26^1, c * 26^0.
# ex: 123 ==> 1*10^2, 2 * 10^1, 3 * 10^0
# we find every possible substring to find if exist a duplicated one
# start with mid, if possible ==> find longer one else find shorter one
# Time O(NlogN) Space: O(N)
class Solution:
def longestD... | class Solution:
def longest_dup_substring(self, S: str) -> str:
n = len(S)
nums = [ord(S[i]) - ord('a') for i in range(n)]
a = 26
mod = 2 ** 32
(left, right) = (1, n)
while left <= right:
mid = left + (right - left >> 1)
if self.match(mid, a, ... |
def squareme(x):
return(x**2)
myvar = input("Give me a number to square: ")
myvar = float(myvar)
print("The square of %f is %f." % (myvar, squareme(myvar)) )
| def squareme(x):
return x ** 2
myvar = input('Give me a number to square: ')
myvar = float(myvar)
print('The square of %f is %f.' % (myvar, squareme(myvar))) |
class Solution:
def rotate(self, N, D):
D = D%16
val1 = ((N << D) % (2 ** 16)) ^ int(N // (2 ** (16 - D)))
#val1 = (N << D) | (N >> (16 - D))
val2 = (N >> D) ^ int((2 ** (16 - D)) * (N % (2 ** D)))
return [val1, val2]
if __name__ == '__main__':
t = int(input... | class Solution:
def rotate(self, N, D):
d = D % 16
val1 = (N << D) % 2 ** 16 ^ int(N // 2 ** (16 - D))
val2 = N >> D ^ int(2 ** (16 - D) * (N % 2 ** D))
return [val1, val2]
if __name__ == '__main__':
t = int(input())
for _ in range(t):
(n, d) = input().strip().split(... |
def test_expect_error(testdir):
string = """
Lorem ipsum
<!--pytest-codeblocks:expect-exception-->
```python
raise RuntimeError()
```
"""
testdir.makefile(".md", string)
result = testdir.runpytest("--codeblocks")
result.assert_outcomes(passed=1)
def test_expect_error_fail(testd... | def test_expect_error(testdir):
string = '\n Lorem ipsum\n <!--pytest-codeblocks:expect-exception-->\n ```python\n raise RuntimeError()\n ```\n '
testdir.makefile('.md', string)
result = testdir.runpytest('--codeblocks')
result.assert_outcomes(passed=1)
def test_expect_error_fail(test... |
# These are words that will appear in most intros, and should be ignored when calculating
# the similarity score.
# TODO: improve the set of words that we should ignore.
IGNORED_WORDS = set(["I", "I'm", "and", "a", "to"])
class Student:
name = ""
email = ""
year = 1
gender = "Female"
should_match_w... | ignored_words = set(['I', "I'm", 'and', 'a', 'to'])
class Student:
name = ''
email = ''
year = 1
gender = 'Female'
should_match_with_same_gender = False
intro = ''
def __init__(self, name, email, year, gender, should_match_with_same_gender, intro):
self.name = name
self.ema... |
#
# PySNMP MIB module HUAWEI-PPP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HUAWEI-PPP-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:36:10 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2... | (object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(constraints_union, constraints_intersection, value_range_constraint, single_value_constraint, value_size_constraint) ... |
class ColorLanguageTranslator:
START = "CRYCYMCRW"
END = "CMW"
@staticmethod
def base7(num):
if num == 0:
return '0'
new_num_string = ''
current = num
while current != 0:
remainder = current % 7
remainder_string = str(remainder)
... | class Colorlanguagetranslator:
start = 'CRYCYMCRW'
end = 'CMW'
@staticmethod
def base7(num):
if num == 0:
return '0'
new_num_string = ''
current = num
while current != 0:
remainder = current % 7
remainder_string = str(remainder)
... |
class RhinoObjectSelectionEventArgs(EventArgs):
# no doc
Document=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Get: Document(self: RhinoObjectSelectionEventArgs) -> RhinoDoc
"""
RhinoObjects=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Get: Rhin... | class Rhinoobjectselectioneventargs(EventArgs):
document = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Get: Document(self: RhinoObjectSelectionEventArgs) -> RhinoDoc\n\n\n\n'
rhino_objects = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Get: Rhin... |
#https://codeforces.com/problemset/problem/734/A
input()
string = input()
a = string.count('A')
d = string.count('D')
if(a>d):
print('Anton')
elif d>a:
print('Danik')
else:
print('Friendship') | input()
string = input()
a = string.count('A')
d = string.count('D')
if a > d:
print('Anton')
elif d > a:
print('Danik')
else:
print('Friendship') |
class ConnectionValidationInfo(object,IDisposable):
"""
This object contains information about fabrication connection validations.
ConnectionValidationInfo()
"""
def Dispose(self):
""" Dispose(self: ConnectionValidationInfo) """
pass
def GetWarning(self,index):
"""
GetWarning(self: Connec... | class Connectionvalidationinfo(object, IDisposable):
"""
This object contains information about fabrication connection validations.
ConnectionValidationInfo()
"""
def dispose(self):
""" Dispose(self: ConnectionValidationInfo) """
pass
def get_warning(self, index):
"""
GetW... |
# Round the number from input to the required number of
# decimals.
# The input format:
# Two lines: the first with a floating-point number, the second
# with an integer representing the decimal count.
# The output format:
# A formatted string containing the rounded number.
# Do NOT forget to convert the input num... | decimal = float(input())
nth_place = int(input())
print(f'%.{nth_place}f' % decimal)
print(f'{decimal:.{nth_place}f}')
print(f'{float(input()):.{int(input())}f}') |
#
# Copyright (c) 2022 Samuel J. McKelvie
#
# MIT License - See LICENSE file accompanying this package.
#
"""Exception classes for cloud_init_gen package"""
class CloudInitGenError(Exception):
"""Generic exception raised by package cloud_init_gen"""
pass
| """Exception classes for cloud_init_gen package"""
class Cloudinitgenerror(Exception):
"""Generic exception raised by package cloud_init_gen"""
pass |
'''
This is the position of all the pieces, in a dictionary. This data is essential for the gameplay to work
'''
position_dic = { 'a1': "Left White Rook", 'b1': "Left White Knight", 'c1': "Left White Bishop", 'd1': "White Queen", 'e1': "White King", 'f1': "Right White Bishop", 'g1': "Right White Knight", 'h1': "Righ... | """
This is the position of all the pieces, in a dictionary. This data is essential for the gameplay to work
"""
position_dic = {'a1': 'Left White Rook', 'b1': 'Left White Knight', 'c1': 'Left White Bishop', 'd1': 'White Queen', 'e1': 'White King', 'f1': 'Right White Bishop', 'g1': 'Right White Knight', 'h1': 'Right Wh... |
count = 0
def max_ind_set(nodes, edges):
global count
if len(nodes) <= 1: return len(nodes)
node = nodes[0] # pick a node
# case 1: node lies in independent set => remove neighbours as well
nodes1 = [ n for n in nodes if n != node and (node, n) not in edges ]
size1 = 1 + max_ind_set(nodes1, ed... | count = 0
def max_ind_set(nodes, edges):
global count
if len(nodes) <= 1:
return len(nodes)
node = nodes[0]
nodes1 = [n for n in nodes if n != node and (node, n) not in edges]
size1 = 1 + max_ind_set(nodes1, edges)
count += 1
nodes2 = [n for n in nodes if n != node]
size2 = max_... |
# encoding: utf-8
# module Grasshopper.Kernel.Undo calls itself Undo
# from Grasshopper,Version=1.0.0.20,Culture=neutral,PublicKeyToken=dda4f5ec2cd80803
# by generator 1.145
""" NamespaceTracker represent a CLS namespace. """
# no imports
# no functions
# classes
class GH_UndoAction(object, IGH_UndoAction... | """ NamespaceTracker represent a CLS namespace. """
class Gh_Undoaction(object, IGH_UndoAction, GH_ISerializable):
def internal__redo(self, *args):
""" Internal_Redo(self: GH_UndoAction,doc: GH_Document) """
pass
def internal__undo(self, *args):
""" Internal_Undo(self: GH_UndoAction,d... |
"""j2cl_test build macro
Works similarly to junit_test; see j2cl_test_common.bzl for details
"""
load(":j2cl_test_common.bzl", "j2cl_test_common")
# buildifier: disable=function-docstring-args
def j2cl_test(
name,
tags = [],
**kwargs):
"""Macro for running a JUnit test cross compiled as a ... | """j2cl_test build macro
Works similarly to junit_test; see j2cl_test_common.bzl for details
"""
load(':j2cl_test_common.bzl', 'j2cl_test_common')
def j2cl_test(name, tags=[], **kwargs):
"""Macro for running a JUnit test cross compiled as a web test
This macro uses the j2cl_test_tranpile macro to transpile... |
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
load("//antlir/bzl:shape.bzl", "shape")
load("//antlir/bzl:target_tagger.bzl", "new_target_tagger", "target_tagger_to_feature")
load(":requi... | load('//antlir/bzl:shape.bzl', 'shape')
load('//antlir/bzl:target_tagger.bzl', 'new_target_tagger', 'target_tagger_to_feature')
load(':requires.shape.bzl', 'requires_t')
def feature_requires(users=None, groups=None, files=None):
"""
`feature.requires(...)` adds macro-level requirements on image layers.
Currently ... |
ENCRYPTED_MESSAGE = 'IQ PQTVJ CV PQQP'
DECRYPTED_MESSAGE = 'GO NORTH AT NOON'
CIPHER_OPTIONS = ['null','caesar','atbash']
cipher_used_in_this_example = CIPHER_OPTIONS[1] # replace with the index of the cipher used in this encryption
| encrypted_message = 'IQ PQTVJ CV PQQP'
decrypted_message = 'GO NORTH AT NOON'
cipher_options = ['null', 'caesar', 'atbash']
cipher_used_in_this_example = CIPHER_OPTIONS[1] |
# AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"img_resize": "00_clipmodel.ipynb",
"imgs_resize": "00_clipmodel.ipynb",
"dict_to_device": "00_clipmodel.ipynb",
"norm": "00_clipmodel.ipynb",
"detach_norm": "00_clipmodel.... | __all__ = ['index', 'modules', 'custom_doc_links', 'git_url']
index = {'img_resize': '00_clipmodel.ipynb', 'imgs_resize': '00_clipmodel.ipynb', 'dict_to_device': '00_clipmodel.ipynb', 'norm': '00_clipmodel.ipynb', 'detach_norm': '00_clipmodel.ipynb', 'text2clip_en': '00_clipmodel.ipynb', 'images2clip_en': '00_clipmodel... |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
def calculate(n, d):
s = str(n)
m = -1
for i in range(0, len(s) - d + 1):
p = 1
for j in range(0, d):
p *= int(s[i+j])
if p > m:
m = p
return m
# https://stackoverflow.com/questions/12385040/python-defining-a... | def calculate(n, d):
s = str(n)
m = -1
for i in range(0, len(s) - d + 1):
p = 1
for j in range(0, d):
p *= int(s[i + j])
if p > m:
m = p
return m
num = int('\n73167176531330624919225119674426574742355349194934\n969835203127745063262395783180169848018694788... |
# -*- coding: utf-8 -*-
__author__ = 'Russell Davies'
__copyright__ = 'Copyright (c) 2019-present - Russell Davies'
__description__ = 'The blakemere package provides a collection of python libraries created by Russell Davies.'
__email__ = 'russell@blakemere.ca'
__license__ = 'MIT'
__title__ = 'blakemere'
__version__ =... | __author__ = 'Russell Davies'
__copyright__ = 'Copyright (c) 2019-present - Russell Davies'
__description__ = 'The blakemere package provides a collection of python libraries created by Russell Davies.'
__email__ = 'russell@blakemere.ca'
__license__ = 'MIT'
__title__ = 'blakemere'
__version__ = '0.1.0' |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""ICM-20948: Low power 9-axis MotionTracking device that is ideally suited for Smartphones, Tablets, Wearable Sensors, and IoT applications."""
__author__ = "ChISL"
__copyright__ = "TBD"
__credits__ = ["TDK Invensense"]
__license__ = "TBD"
__version__ = "Ve... | """ICM-20948: Low power 9-axis MotionTracking device that is ideally suited for Smartphones, Tablets, Wearable Sensors, and IoT applications."""
__author__ = 'ChISL'
__copyright__ = 'TBD'
__credits__ = ['TDK Invensense']
__license__ = 'TBD'
__version__ = 'Version 0.1'
__maintainer__ = 'https://chisl.io'
__email__ = 'in... |
def mergeList(lis1, list2):
print("list1 =", list1)
print("list2 =", list2)
list3 = []
for i in list1:
if(i % 2 == 1):
list3.append(i)
for i in list2:
if(i % 2 == 0):
list3.append(i)
return list3
list1 = [10, 20, 23, 11, 17]
list2 = [13, 43, 24, 36, 12]
print("Result List ... | def merge_list(lis1, list2):
print('list1 =', list1)
print('list2 =', list2)
list3 = []
for i in list1:
if i % 2 == 1:
list3.append(i)
for i in list2:
if i % 2 == 0:
list3.append(i)
return list3
list1 = [10, 20, 23, 11, 17]
list2 = [13, 43, 24, 36, 12]
pri... |
# -*- coding: utf-8 -*-
# by Juan Carlos Montoya <odooerpcloud@gmail.com>
{
'name': "Library Management",
'summary': """
Library Management Module for Odoo 11
""",
'description': """
Library Management Module for Odoo 11
""",
'author': "Odoo ERP Cloud",
'website': "http... | {'name': 'Library Management', 'summary': '\n Library Management Module for Odoo 11\n ', 'description': '\n Library Management Module for Odoo 11\n\n ', 'author': 'Odoo ERP Cloud', 'website': 'http://odooerpcloud.com', 'category': 'Tools', 'version': '0.1', 'depends': ['base'], 'data': ['security/g... |
#daemon = True
# 1 core should equal 2*1+1=3 workers
workers = 3
# we want to use threads for concurrency. we estimate that a maximum of 3*7=21 users will use the application simultaneously
worker_class = "gthread"
threads = 7
#accesslog = "logs/access.log"
#errorlog = "logs/error.log"
| workers = 3
worker_class = 'gthread'
threads = 7 |
# 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, software
# distributed under the ... | class Osfexception(Exception):
"""Base Exception class"""
class Osferror(OSFException):
"""Base Error class"""
class Powermanagementerror(OSFError):
"""Base Error class for Power Management API"""
class Cloudmanagementerror(OSFError):
"""Base Error class for Cloud Management API"""
class Serviceerro... |
#! /usr/bin/env python
# Copyright Lajos Katona
#
# 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... | def search_linear(mylist, t):
for (i, l) in enumerate(mylist):
if l == t:
return i
return -1
def search_logarithm(mylist, t):
lower_b = 0
upper_b = len(mylist)
while True:
if lower_b == upper_b:
return -1
mid = (lower_b + upper_b) // 2
mid_ite... |
#!/usr/bin/env python
"""
Container class for parameters that are used to create a movie tile
"""
__author__ = 'Michal Frystacky'
class Movie:
"""
Container for extracted movie information data
"""
def __init__(self, title, poster_image_url, youtube_url, summary, director, *stars):
"""
... | """
Container class for parameters that are used to create a movie tile
"""
__author__ = 'Michal Frystacky'
class Movie:
"""
Container for extracted movie information data
"""
def __init__(self, title, poster_image_url, youtube_url, summary, director, *stars):
"""
Constructor ... |
"""A rule for building projects using the [GNU Make](https://www.gnu.org/software/make/) build tool"""
load(
"//foreign_cc/private:cc_toolchain_util.bzl",
"get_flags_info",
"get_tools_info",
)
load(
"//foreign_cc/private:detect_root.bzl",
"detect_root",
)
load(
"//foreign_cc/private:framework.b... | """A rule for building projects using the [GNU Make](https://www.gnu.org/software/make/) build tool"""
load('//foreign_cc/private:cc_toolchain_util.bzl', 'get_flags_info', 'get_tools_info')
load('//foreign_cc/private:detect_root.bzl', 'detect_root')
load('//foreign_cc/private:framework.bzl', 'CC_EXTERNAL_RULE_ATTRIBUTE... |
# Customer class
class Customer:
def __init__(self, name, address, phone):
self.__name = name
self.__address = address
self.__phone = phone
def set_name(self, name):
self.__name = name
def set_address(self, address):
self.__address = address
def set_phone(self,... | class Customer:
def __init__(self, name, address, phone):
self.__name = name
self.__address = address
self.__phone = phone
def set_name(self, name):
self.__name = name
def set_address(self, address):
self.__address = address
def set_phone(self, phone):
... |
# %% [695. Max Area of Island](https://leetcode.com/problems/max-area-of-island/)
class Solution:
def maxAreaOfIsland(self, grid: List[List[int]]) -> int:
n, m = len(grid), len(grid[0])
u = unionfind(n, m)
for i in range(n):
for j in range(m):
if j + 1 < m and gri... | class Solution:
def max_area_of_island(self, grid: List[List[int]]) -> int:
(n, m) = (len(grid), len(grid[0]))
u = unionfind(n, m)
for i in range(n):
for j in range(m):
if j + 1 < m and grid[i][j] == grid[i][j + 1] == 1:
u.unite((i, j), (i, j ... |
# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
#
# Use of this source code is governed by a BSD-style license
# that can be found in the LICENSE file in the root of the source
# tree. An additional intellectual property rights grant can be found
# in the file PATENTS. All contributing project au... | {'includes': ['../build/common.gypi'], 'targets': [{'target_name': 'webrtc_test_common', 'type': 'static_library', 'sources': ['configurable_frame_size_encoder.cc', 'configurable_frame_size_encoder.h', 'direct_transport.cc', 'direct_transport.h', 'encoder_settings.cc', 'encoder_settings.h', 'fake_audio_device.cc', 'fak... |
#!/usr/bin/python3
'''This module contains the add_integer function
'''
def add_integer(a, b=98):
'''add_integer adds two integers and/or floats together
and returns an integer of their sum
'''
if not isinstance(a, (int, float)):
raise TypeError("a must be an integer")
if not isinstance(b,... | """This module contains the add_integer function
"""
def add_integer(a, b=98):
"""add_integer adds two integers and/or floats together
and returns an integer of their sum
"""
if not isinstance(a, (int, float)):
raise type_error('a must be an integer')
if not isinstance(b, (int, float)):
... |
class Config(object):
def __init__(self, stellar_sed, laser_sed,
filt, nsamples, sample_rate, pulse_duration):
self.stellar_sed = stellar_sed
self.laser_sed = laser_sed
self.filt = filt
self.nsamples = nsamples # in ns
self.sample_rate = sample_rate # in ... | class Config(object):
def __init__(self, stellar_sed, laser_sed, filt, nsamples, sample_rate, pulse_duration):
self.stellar_sed = stellar_sed
self.laser_sed = laser_sed
self.filt = filt
self.nsamples = nsamples
self.sample_rate = sample_rate
self.pulse_duration = pul... |
# This is a util to create the advancement files
# Advancement list from https://github.com/jan00bl/mcfunction-novum/blob/master/lib/1.16/id/advancement.json
advancements = [
"minecraft:adventure/adventuring_time",
"minecraft:adventure/arbalistic",
"minecraft:adventure/bullseye",
"minecraft:adventure/h... | advancements = ['minecraft:adventure/adventuring_time', 'minecraft:adventure/arbalistic', 'minecraft:adventure/bullseye', 'minecraft:adventure/hero_of_the_village', 'minecraft:adventure/honey_block_slide', 'minecraft:adventure/kill_all_mobs', 'minecraft:adventure/kill_a_mob', 'minecraft:adventure/ol_betsy', 'minecraft:... |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Membership Management',
'version': '1.0',
'category': 'Sales',
'description': """
This module allows you to manage all operations for managing memberships.
====================================... | {'name': 'Membership Management', 'version': '1.0', 'category': 'Sales', 'description': '\nThis module allows you to manage all operations for managing memberships.\n=========================================================================\n\nIt supports different kind of members:\n-------------------------------------... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.