max_stars_repo_path
stringlengths
4
286
max_stars_repo_name
stringlengths
5
119
max_stars_count
int64
0
191k
id
stringlengths
1
7
content
stringlengths
6
1.03M
content_cleaned
stringlengths
6
1.03M
language
stringclasses
111 values
language_score
float64
0.03
1
comments
stringlengths
0
556k
edu_score
float64
0.32
5.03
edu_int_score
int64
0
5
inference/online_inference/src/entities/dataclasses.py
made-ml-in-prod-2021/marina-zav
0
6628351
<filename>inference/online_inference/src/entities/dataclasses.py from pydantic import BaseModel, conlist, validator from typing import List, Union from src.entities import read_features_params DEFAULT_FEATURES_CONFIG_PATH = "configs/features_config.yaml" MODEL_FEATURES = read_features_params(DEFAULT_FEATURES_CONFIG_P...
<filename>inference/online_inference/src/entities/dataclasses.py from pydantic import BaseModel, conlist, validator from typing import List, Union from src.entities import read_features_params DEFAULT_FEATURES_CONFIG_PATH = "configs/features_config.yaml" MODEL_FEATURES = read_features_params(DEFAULT_FEATURES_CONFIG_P...
none
1
2.549798
3
2019_3_Cooper_Type/RoboFont/simple_interp.py
benkiel/python_workshops
6
6628352
font = CurrentFont() ss = """ feature ss%s{ sub %s by %s; } ss%s; """ one = font['a'] two = font['a.2'] print(one.isCompatible(two)) features = "" for f in range(10): f = f+1 name = "test."+str(f) result = font.newGlyph(name) r = .1*f print(r) result.interpolate(f/5,one,two) ...
font = CurrentFont() ss = """ feature ss%s{ sub %s by %s; } ss%s; """ one = font['a'] two = font['a.2'] print(one.isCompatible(two)) features = "" for f in range(10): f = f+1 name = "test."+str(f) result = font.newGlyph(name) r = .1*f print(r) result.interpolate(f/5,one,two) ...
en
0.780662
feature ss%s{ sub %s by %s; } ss%s;
3.483123
3
tests/test_checker.py
TestowanieAutomatyczneUG/laboratorium-9-wgulan
0
6628353
<reponame>TestowanieAutomatyczneUG/laboratorium-9-wgulan from src.sample.Checker import Checker from unittest.mock import * from unittest import TestCase, main class TestCar(TestCase): def setUp(self): self.test_checker = Checker() def test_checker_play_file_after_17(self): wav_file = 'file....
from src.sample.Checker import Checker from unittest.mock import * from unittest import TestCase, main class TestCar(TestCase): def setUp(self): self.test_checker = Checker() def test_checker_play_file_after_17(self): wav_file = 'file.wav' # prepare mock self.test_checker.env...
en
0.742083
# prepare mock # testing # prepare mock # testing
2.891853
3
examples/loading-img.py
m0rphed/comp-vis-notes
0
6628354
import cv2 import matplotlib.pyplot as plt image = cv2.imread('./images/watch.jpg', cv2.IMREAD_GRAYSCALE) cv2.imshow('picture', image) cv2.waitKey(0) cv2.destroyAllWindows() plt.imshow(image, cmap='gray', interpolation='bicubic') plt.plot([50, 100], [80, 100], 'c', linewidth=5) plt.show() cv2.imwrite('./images/watch...
import cv2 import matplotlib.pyplot as plt image = cv2.imread('./images/watch.jpg', cv2.IMREAD_GRAYSCALE) cv2.imshow('picture', image) cv2.waitKey(0) cv2.destroyAllWindows() plt.imshow(image, cmap='gray', interpolation='bicubic') plt.plot([50, 100], [80, 100], 'c', linewidth=5) plt.show() cv2.imwrite('./images/watch...
none
1
3.059597
3
oops_fhir/r4/code_system/v3_substitution_condition.py
Mikuana/oops_fhir
0
6628355
from pathlib import Path from fhir.resources.codesystem import CodeSystem from oops_fhir.utils import CodeSystemConcept __all__ = ["v3SubstitutionCondition"] _resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json")) class v3SubstitutionCondition: """ v3 Code System SubstitutionCondition ...
from pathlib import Path from fhir.resources.codesystem import CodeSystem from oops_fhir.utils import CodeSystemConcept __all__ = ["v3SubstitutionCondition"] _resource = CodeSystem.parse_file(Path(__file__).with_suffix(".json")) class v3SubstitutionCondition: """ v3 Code System SubstitutionCondition ...
en
0.868351
v3 Code System SubstitutionCondition Identifies what sort of change is permitted or has occurred between the item that was ordered/requested and the one that was/will be provided. Status: active - Version: 2018-08-12 Copyright None http://terminology.hl7.org/CodeSystem/v3-SubstitutionCondition Cond...
2.265389
2
silabel/sample.py
wahyubram82/indonesian_syllabelizer
0
6628356
<filename>silabel/sample.py test_sample = [ 'BSD', 'SMP', 'main', 'april', 'swasta', 'instan', 'dengan', 'pandai', 'makhluk', 'saudara', 'menyapu', 'etiopia', 'masyhur', 'biografi', 'instrumen', 'pengarang', 'reboisasi', 'musyawarah', 'dramatisasi', 'memproklamasikan', 'berkesinambungan', 'mempertanggungjaw...
<filename>silabel/sample.py test_sample = [ 'BSD', 'SMP', 'main', 'april', 'swasta', 'instan', 'dengan', 'pandai', 'makhluk', 'saudara', 'menyapu', 'etiopia', 'masyhur', 'biografi', 'instrumen', 'pengarang', 'reboisasi', 'musyawarah', 'dramatisasi', 'memproklamasikan', 'berkesinambungan', 'mempertanggungjaw...
none
1
1.331142
1
run_route_scripts/results/diff_route_stats.py
eric-erki/valhalla
0
6628357
<reponame>eric-erki/valhalla #!/usr/bin/env python3 import csv import argparse STATS_TO_DIFF = ['#Passes', 'runtime', 'trip time', 'length', '#Manuevers'] def main(old_stats_file, new_stats_file, output_file): with open(old_stats_file, 'r') as old_file, \ open(new_stats_file, 'r') as new_file, \ ...
#!/usr/bin/env python3 import csv import argparse STATS_TO_DIFF = ['#Passes', 'runtime', 'trip time', 'length', '#Manuevers'] def main(old_stats_file, new_stats_file, output_file): with open(old_stats_file, 'r') as old_file, \ open(new_stats_file, 'r') as new_file, \ open(output_file, 'w', n...
en
0.865417
#!/usr/bin/env python3 # Store header, stripping any whitespace that might be present # Skip header row in the second csv # Collect indexes of cols we're going to generate diff stats of and # generate fieldnames for stats diff # each field generates the following field names in the diff: # - <field name>_old # - <field...
3.36944
3
py/moma/models/end_effectors/wrist_sensors/robotiq_fts300.py
wx-b/dm_robotics
128
6628358
# Copyright 2020 DeepMind Technologies Limited. # # 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 ag...
# Copyright 2020 DeepMind Technologies Limited. # # 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 ag...
en
0.848661
# Copyright 2020 DeepMind Technologies Limited. # # 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 ag...
1.934058
2
pipeline/contrib/external_plugins/tests/utils/importer/test_base.py
ZhuoZhuoCrayon/bk-nodeman
31
6628359
<gh_stars>10-100 # -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this ...
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
en
0.861578
# -*- coding: utf-8 -*- Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2019 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compli...
1.908101
2
scp/plugins/user/paste.py
ALiwoto/SCP-5170
2
6628360
from scp import user import aiofiles import os __PLUGIN__ = 'paste' __DOC__ = str( user.md.KanTeXDocument( user.md.Section( 'Paste Utility', user.md.SubSection( 'paste', user.md.Code('(*prefix)paste {content}'), ), ), ), ) @...
from scp import user import aiofiles import os __PLUGIN__ = 'paste' __DOC__ = str( user.md.KanTeXDocument( user.md.Section( 'Paste Utility', user.md.SubSection( 'paste', user.md.Code('(*prefix)paste {content}'), ), ), ), ) @...
none
1
2.455572
2
lista3/Q42.py
AlexandrePeBrito/Python
0
6628361
<reponame>AlexandrePeBrito/Python #Faça um programa que leia uma quantidade indeterminada de números positivos e conte #quantos deles estão nos seguintes intervalos: [0-25], [26-50], [51-75] e [76-100]. A entrada de #dados deverá terminar quando for lido um número negativo. num=int(input("Informe um numero: ")) numero...
#Faça um programa que leia uma quantidade indeterminada de números positivos e conte #quantos deles estão nos seguintes intervalos: [0-25], [26-50], [51-75] e [76-100]. A entrada de #dados deverá terminar quando for lido um número negativo. num=int(input("Informe um numero: ")) numeros=[] cl1=0 cl2=0 cl3=0 cl4=0 #clas...
pt
0.869158
#Faça um programa que leia uma quantidade indeterminada de números positivos e conte #quantos deles estão nos seguintes intervalos: [0-25], [26-50], [51-75] e [76-100]. A entrada de #dados deverá terminar quando for lido um número negativo. #clas[0]=[0-25] #clas[1]=[26-50] #clas[2]=[51-75] #clas[3]=[76-100]
3.819633
4
tests/utils/test_concurrent.py
fpacifici/snuba
0
6628362
import threading import time import pytest from concurrent.futures import TimeoutError from snuba.utils.concurrent import Synchronized, execute def test_execute() -> None: assert execute(threading.current_thread).result() != threading.current_thread() with pytest.raises(ZeroDivisionError): assert e...
import threading import time import pytest from concurrent.futures import TimeoutError from snuba.utils.concurrent import Synchronized, execute def test_execute() -> None: assert execute(threading.current_thread).result() != threading.current_thread() with pytest.raises(ZeroDivisionError): assert e...
none
1
2.321411
2
ambari-common/src/main/python/resource_management/core/providers/system.py
nexr/ambari
1
6628363
#!/usr/bin/env python """ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License");...
#!/usr/bin/env python """ Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License");...
en
0.853581
#!/usr/bin/env python Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you...
1.801901
2
twisted/names/test/test_dns.py
linxuping/twisted
3
6628364
<reponame>linxuping/twisted # test-case-name: twisted.names.test.test_dns # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for twisted.names.dns. """ from __future__ import division, absolute_import from io import BytesIO import struct from zope.interface.verify import verifyClass ...
# test-case-name: twisted.names.test.test_dns # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for twisted.names.dns. """ from __future__ import division, absolute_import from io import BytesIO import struct from zope.interface.verify import verifyClass from twisted.python.failure...
en
0.701337
# test-case-name: twisted.names.test.test_dns # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. Tests for twisted.names.dns. Tests for L{dns._ord2bytes}. L{dns._ord2byte} accepts an integer and returns a byte string of length one with an ordinal value equal to the given integer. Tests for ...
2.593453
3
launcher.py
MrForg3t/sourcecodetrm
0
6628365
from platform import system from os import system as cmd from os import path from time import sleep def launcherMain(): try: if system() == "Windows": if path.exists("checkfileint.exe"): cmd("checkfileint.exe") if path.exists("uuid_g...
from platform import system from os import system as cmd from os import path from time import sleep def launcherMain(): try: if system() == "Windows": if path.exists("checkfileint.exe"): cmd("checkfileint.exe") if path.exists("uuid_g...
none
1
3.046436
3
county_avg_sat.py
Statistica/pennsylvania-education
0
6628366
# Written by <NAME>, released April 11th, 2016 for Statisti.ca # Released under the MIT License (https://opensource.org/licenses/MIT) from __future__ import division import csv, requests, re, collections, plotly.plotly as plotly, plotly.graph_objs as go from plotly.graph_objs import Scatter, Layout schools=[] with o...
# Written by <NAME>, released April 11th, 2016 for Statisti.ca # Released under the MIT License (https://opensource.org/licenses/MIT) from __future__ import division import csv, requests, re, collections, plotly.plotly as plotly, plotly.graph_objs as go from plotly.graph_objs import Scatter, Layout schools=[] with o...
en
0.850772
# Written by <NAME>, released April 11th, 2016 for Statisti.ca # Released under the MIT License (https://opensource.org/licenses/MIT) #add all of the schools to the 'schools' list #pa_schools.csv from: http://www.edna.ed.state.pa.us/Screens/Extracts/wfExtractPublicSchools.aspx #skip header row #row[0] is the aun, row[5...
2.860035
3
pypika/tests/test_formats.py
YiuRULE/pypika
1,616
6628367
<reponame>YiuRULE/pypika import unittest from pypika import Query, Tables, functions as fn class QuoteTests(unittest.TestCase): maxDiff = None table_abc, table_efg = Tables("abc", "efg") def setUp(self): subquery1 = ( Query.from_(self.table_abc) .select( ...
import unittest from pypika import Query, Tables, functions as fn class QuoteTests(unittest.TestCase): maxDiff = None table_abc, table_efg = Tables("abc", "efg") def setUp(self): subquery1 = ( Query.from_(self.table_abc) .select( self.table_abc.foo, ...
none
1
2.758606
3
djangobb_forum/tests/test_templatetags.py
dwminer/s2forums
2
6628368
# -*- coding: utf-8 -*- from django.test import TestCase from django.contrib.auth.models import User from djangobb_forum.models import Post from djangobb_forum.templatetags.forum_extras import profile_link, link, mobile_link class TestLinkTags(TestCase): fixtures = ['test_forum.json'] def setUp(self): ...
# -*- coding: utf-8 -*- from django.test import TestCase from django.contrib.auth.models import User from djangobb_forum.models import Post from djangobb_forum.templatetags.forum_extras import profile_link, link, mobile_link class TestLinkTags(TestCase): fixtures = ['test_forum.json'] def setUp(self): ...
en
0.769321
# -*- coding: utf-8 -*-
2.444294
2
task_5/scripts/spawning_test.py
Shobuj-Paul/Strawberry-Stacker
0
6628369
#!/usr/bin/env python3 import rospy import rospkg from gazebo_msgs.msg import ModelState from gazebo_msgs.srv import SetModelState from std_msgs.msg import UInt8 import pandas as pd box_count_in_row = [0]*15 max_box_per_row = 10 rand = [-0.15, 0.44, 0.04, -0.84, -0.66, -0.1, 0.04, 0.46, -0.54, 0.19, 0.64, 0.32, -0.1...
#!/usr/bin/env python3 import rospy import rospkg from gazebo_msgs.msg import ModelState from gazebo_msgs.srv import SetModelState from std_msgs.msg import UInt8 import pandas as pd box_count_in_row = [0]*15 max_box_per_row = 10 rand = [-0.15, 0.44, 0.04, -0.84, -0.66, -0.1, 0.04, 0.46, -0.54, 0.19, 0.64, 0.32, -0.1...
fr
0.221828
#!/usr/bin/env python3
2.202159
2
mammoth_snowplow/launch/include/realsense/rs_launch.py
iscumd/Yeti2020
1
6628370
<reponame>iscumd/Yeti2020<filename>mammoth_snowplow/launch/include/realsense/rs_launch.py # Copyright (c) 2018 Intel Corporation # # 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:/...
# Copyright (c) 2018 Intel Corporation # # 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...
en
0.833147
# Copyright (c) 2018 Intel Corporation # # 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...
1.713069
2
lldb/test/API/tools/lldb-vscode/runInTerminal/TestVSCode_runInTerminal.py
hanzhan1/llvm
305
6628371
<gh_stars>100-1000 """ Test lldb-vscode runInTerminal reverse request """ import unittest2 import vscode from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil import lldbvscode_testcase import time import os class TestVSCode_runInTerminal(lldbvscode_testca...
""" Test lldb-vscode runInTerminal reverse request """ import unittest2 import vscode from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil import lldbvscode_testcase import time import os class TestVSCode_runInTerminal(lldbvscode_testcase.VSCodeTestCaseBa...
en
0.928397
Test lldb-vscode runInTerminal reverse request Tests the "runInTerminal" reverse request. It makes sure that the IDE can launch the inferior with the correct environment variables and arguments. # We verify we actually stopped inside the loop # We verify we were able to set the launch arguments # We verify ...
2.695549
3
ambari-server/src/test/python/TestCheckHost.py
vsosrc/ambari
0
6628372
# !/usr/bin/env python ''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"...
# !/usr/bin/env python ''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"...
en
0.89078
# !/usr/bin/env python Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); yo...
1.9034
2
Sudoku_py/Sudoku.py
yuryybk/opencv-basic-samples
0
6628373
<filename>Sudoku_py/Sudoku.py import cv2, numpy as np import sys def get_new(old): new = np.ones(old.shape, np.uint8) cv2.bitwise_not(new,new) return new if __name__ == '__main__': img = cv2.imread(sys.argv[1]) img = cv2.GaussianBlur(img,(5,5),0) gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) ...
<filename>Sudoku_py/Sudoku.py import cv2, numpy as np import sys def get_new(old): new = np.ones(old.shape, np.uint8) cv2.bitwise_not(new,new) return new if __name__ == '__main__': img = cv2.imread(sys.argv[1]) img = cv2.GaussianBlur(img,(5,5),0) gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) ...
none
1
2.797687
3
src/models/mobilenetv2.py
JoseLuisRojasAranda/tfmodels
1
6628374
<filename>src/models/mobilenetv2.py<gh_stars>1-10 import tensorflow as tf from tensorflow.keras import Model, Sequential from tensorflow.keras import layers from models.ops.conv_ops import normal_conv, ReLU6, pointwise_conv from models.ops.conv_blocks import BottleneckResidualBlock, basic_conv_block from models.ops.con...
<filename>src/models/mobilenetv2.py<gh_stars>1-10 import tensorflow as tf from tensorflow.keras import Model, Sequential from tensorflow.keras import layers from models.ops.conv_ops import normal_conv, ReLU6, pointwise_conv from models.ops.conv_blocks import BottleneckResidualBlock, basic_conv_block from models.ops.con...
es
0.692676
# # Implementacion de MobilenetV2, suponiendo un input size de 224x224x3 # # Solo el primer bloque tiene stride 2 # a partir del segundo bottleneck el numero de input_channels es igual al output_channels # los bloques de bottleneck intermedios # ultima convolucion # Average Pooling y Fully Connected # # Args: # class...
2.608841
3
test/augmenters/test_blur.py
HubukiNinten/imgaug
0
6628375
from __future__ import print_function, division, absolute_import import warnings import sys import itertools # unittest only added in 3.4 self.subTest() if sys.version_info[0] < 3 or sys.version_info[1] < 4: import unittest2 as unittest else: import unittest # unittest.mock is not available in 2.7 (though unit...
from __future__ import print_function, division, absolute_import import warnings import sys import itertools # unittest only added in 3.4 self.subTest() if sys.version_info[0] < 3 or sys.version_info[1] < 4: import unittest2 as unittest else: import unittest # unittest.mock is not available in 2.7 (though unit...
en
0.70988
# unittest only added in 3.4 self.subTest() # unittest.mock is not available in 2.7 (though unittest2 might contain it?) # fix execution of tests involving matplotlib on travis # note that self.assertWarningRegex does not exist in python 2.7 # bool # uint, int # float # prototype kernel, generated via: # mask = np.zero...
2.261842
2
5.SequentialDataProcessing/AdvancedRNN/model.py
sdhnshu/HandsOnDeepLearningWithPytorch
87
6628376
<filename>5.SequentialDataProcessing/AdvancedRNN/model.py import torch import torch.nn as nn class Encoder(nn.Module): def __init__(self, config): super(Encoder, self).__init__() self.config = config if config.type == 'LSTM': self.rnn = nn.LSTM(input_size=config.embed_dim, hid...
<filename>5.SequentialDataProcessing/AdvancedRNN/model.py import torch import torch.nn as nn class Encoder(nn.Module): def __init__(self, config): super(Encoder, self).__init__() self.config = config if config.type == 'LSTM': self.rnn = nn.LSTM(input_size=config.embed_dim, hid...
none
1
2.689804
3
arkane/outputTest.py
pm15ma/RMG-Py
4
6628377
<reponame>pm15ma/RMG-Py #!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################### # # # RMG - Reaction Mechanism Generator # # ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################### # # # RMG - Reaction Mechanism Generator # # ...
en
0.545296
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################### # # # RMG - Reaction Mechanism Generator # # ...
1.492736
1
tests/integrations/conftest.py
vincenthcui/sentry-python
0
6628378
import pytest import sentry_sdk @pytest.fixture def capture_exceptions(monkeypatch): def inner(): errors = set() old_capture_event = sentry_sdk.Hub.current.capture_event def capture_event(event, hint=None): if hint: if "exc_info" in hint: er...
import pytest import sentry_sdk @pytest.fixture def capture_exceptions(monkeypatch): def inner(): errors = set() old_capture_event = sentry_sdk.Hub.current.capture_event def capture_event(event, hint=None): if hint: if "exc_info" in hint: er...
none
1
2.064346
2
attributes_and_methods/project_hotel/test.py
ivan-yosifov88/python_oop
1
6628379
from project_hotel.hotel import Hotel from project_hotel.room import Room hotel = Hotel.from_stars(5) first_room = Room(1, 3) second_room = Room(2, 2) third_room = Room(3, 1) hotel.add_room(first_room) hotel.add_room(second_room) hotel.add_room(third_room) hotel.take_room(1, 4) hotel.take_room(1, 2) hotel.take_roo...
from project_hotel.hotel import Hotel from project_hotel.room import Room hotel = Hotel.from_stars(5) first_room = Room(1, 3) second_room = Room(2, 2) third_room = Room(3, 1) hotel.add_room(first_room) hotel.add_room(second_room) hotel.add_room(third_room) hotel.take_room(1, 4) hotel.take_room(1, 2) hotel.take_roo...
none
1
2.356933
2
PyHEADTAIL/gpu/gpu_utils.py
fsoubelet/PyHEADTAIL
0
6628380
''' GPU Utils Memory pool, ... This could also be the place to store the context, device, streams, etc... The module is automatically a singleton @author <NAME> ''' use_streams = False import atexit from itertools import cycle try: import pycuda.tools import pycuda.driver as drv import pycuda.elementwise...
''' GPU Utils Memory pool, ... This could also be the place to store the context, device, streams, etc... The module is automatically a singleton @author <NAME> ''' use_streams = False import atexit from itertools import cycle try: import pycuda.tools import pycuda.driver as drv import pycuda.elementwise...
en
0.349854
GPU Utils Memory pool, ... This could also be the place to store the context, device, streams, etc... The module is automatically a singleton @author <NAME> #the error pycuda throws if no context initialized # print ('No context initialized. Please import pycuda.autoinit at the ' # 'beginning of your script if y...
2.619119
3
esxi_cert_tool/vsanapiutils.py
cleeistaken/esxi_certtool
0
6628381
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2016-2019 VMware, Inc. All rights reserved. This module defines basic helper functions used in the sample codes """ __author__ = 'VMware, Inc' import sys import ssl if (sys.version_info[0] == 3): from urllib.request import urlopen else: from urll...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2016-2019 VMware, Inc. All rights reserved. This module defines basic helper functions used in the sample codes """ __author__ = 'VMware, Inc' import sys import ssl if (sys.version_info[0] == 3): from urllib.request import urlopen else: from urll...
en
0.804106
#!/usr/bin/env python # -*- coding: utf-8 -*- Copyright 2016-2019 VMware, Inc. All rights reserved. This module defines basic helper functions used in the sample codes # Import the vSAN API python bindings # Construct a stub for vSAN API access using vCenter or ESXi sessions from # existing stubs. Corresponding vCent...
2.150734
2
setup.py
yashu-seth/dummyPy
21
6628382
from distutils.core import setup setup( name = 'dummyPy', packages = ['dummyPy'], version = 'v0.3', description = 'A python module to transform categorical variables to one hot encoded vectors.\ It can handle categorical variables of a dataset that cannot be fit into memory.\ I...
from distutils.core import setup setup( name = 'dummyPy', packages = ['dummyPy'], version = 'v0.3', description = 'A python module to transform categorical variables to one hot encoded vectors.\ It can handle categorical variables of a dataset that cannot be fit into memory.\ I...
none
1
2.00196
2
lti/__init__.py
claudevervoort/ltiautotest
7
6628383
<reponame>claudevervoort/ltiautotest<gh_stars>1-10 from .ltiregistration import ToolRegistration, registration, get_platform_config, register_tool, base_tool_oidc_conf, get_tool_configuration, verify_11_oauth, add_coursenav_message from .jwks import get_public_keyset, get_publickey_pem from .gen_model import * from .c...
from .ltiregistration import ToolRegistration, registration, get_platform_config, register_tool, base_tool_oidc_conf, get_tool_configuration, verify_11_oauth, add_coursenav_message from .jwks import get_public_keyset, get_publickey_pem from .gen_model import * from .const import const from .services import *
none
1
1.073163
1
main.py
LuisMayo/meme-ocr
37
6628384
#!/usr/bin/env python3 import sys from memeocr import MemeOCR def main(argv): if len(argv) != 2: print('usage:') print(' ./main.py meme-file-name') return meme_fname = argv[1] ocr = MemeOCR() txt = ocr.recognize(meme_fname) print(txt) if __name__ == '__main__': mai...
#!/usr/bin/env python3 import sys from memeocr import MemeOCR def main(argv): if len(argv) != 2: print('usage:') print(' ./main.py meme-file-name') return meme_fname = argv[1] ocr = MemeOCR() txt = ocr.recognize(meme_fname) print(txt) if __name__ == '__main__': mai...
fr
0.221828
#!/usr/bin/env python3
2.178931
2
assignments/11-tictactoe/test.py
mattmiller899/biosys-analytics
4
6628385
#!/usr/bin/env python3 """tests for outcome.py""" from subprocess import getstatusoutput, getoutput from random import shuffle, sample import os.path import re outcome = './outcome.py' def usage(prg): """usage""" (retval, out) = getstatusoutput(prg) assert retval > 0 assert re.match("usage", out, r...
#!/usr/bin/env python3 """tests for outcome.py""" from subprocess import getstatusoutput, getoutput from random import shuffle, sample import os.path import re outcome = './outcome.py' def usage(prg): """usage""" (retval, out) = getstatusoutput(prg) assert retval > 0 assert re.match("usage", out, r...
en
0.367496
#!/usr/bin/env python3 tests for outcome.py usage outcome usage fails on bad input bad input outcome bad input
2.627655
3
isin.py
nbeguier/financial-tools
1
6628386
<reponame>nbeguier/financial-tools #!/usr/bin/env python3 """ ISIN Copyright (c) 2020-2021 <NAME> Licensed under the MIT License Written by <NAME> (<EMAIL>) """ # Standard library imports from argparse import ArgumentParser import sys # Own library import lib.common as common import lib.display as display import lib...
#!/usr/bin/env python3 """ ISIN Copyright (c) 2020-2021 <NAME> Licensed under the MIT License Written by <NAME> (<EMAIL>) """ # Standard library imports from argparse import ArgumentParser import sys # Own library import lib.common as common import lib.display as display import lib.reporting as reporting # Debug # ...
en
0.709749
#!/usr/bin/env python3 ISIN Copyright (c) 2020-2021 <NAME> Licensed under the MIT License Written by <NAME> (<EMAIL>) # Standard library imports # Own library # Debug # from pdb import set_trace as st Main function
2.547672
3
pyjob/task.py
fsimkovic/pyjob
8
6628387
import abc import logging import os import time from pyjob import cexec, config from pyjob.exception import ( PyJobError, PyJobExecutableNotFoundError, PyJobTaskLockedError, ) from pyjob.script import ScriptCollector logger = logging.getLogger(__name__) class Task(abc.ABC): """Abstract base class fo...
import abc import logging import os import time from pyjob import cexec, config from pyjob.exception import ( PyJobError, PyJobExecutableNotFoundError, PyJobTaskLockedError, ) from pyjob.script import ScriptCollector logger = logging.getLogger(__name__) class Task(abc.ABC): """Abstract base class fo...
en
0.637583
Abstract base class for executable tasks Instantiate a new :obj:`~pyjob.task.Task` Parameters ---------- script : :obj:`~pyjob.script.ScriptCollector`, :obj:`~pyjob.script.Script`, str, list, tuple A :obj:`str`, :obj:`list` or :obj:`tuple` of one or more script paths Exit function at...
2.271107
2
skimpy/core/modifiers.py
EPFL-LCSB/skimpy
13
6628388
<reponame>EPFL-LCSB/skimpy<filename>skimpy/core/modifiers.py # -*- coding: utf-8 -*- """ .. module:: skimpy :platform: Unix, Windows :synopsis: Simple Kinetic Models in Python .. moduleauthor:: SKiMPy team [---------] Copyright 2017 Laboratory of Computational Systems Biotechnology (LCSB), Ecole Pol...
# -*- coding: utf-8 -*- """ .. module:: skimpy :platform: Unix, Windows :synopsis: Simple Kinetic Models in Python .. moduleauthor:: SKiMPy team [---------] Copyright 2017 Laboratory of Computational Systems Biotechnology (LCSB), Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland Licens...
en
0.750933
# -*- coding: utf-8 -*- .. module:: skimpy :platform: Unix, Windows :synopsis: Simple Kinetic Models in Python .. moduleauthor:: SKiMPy team [---------] Copyright 2017 Laboratory of Computational Systems Biotechnology (LCSB), Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland Licensed und...
2.821651
3
release/scripts/addons/amaranth/render/samples_scene.py
simileV/blenderStereo29
1
6628389
<reponame>simileV/blenderStereo29 # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed i...
# This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful,...
en
0.839831
# This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful,...
1.984185
2
Nested_Lists.py
richapatil/Hackerrank-python
1
6628390
<reponame>richapatil/Hackerrank-python if __name__ == '__main__': students=[] #Creating a list for storing Students with their marks for _ in range(int(input())): name = input() #taking names of student score = float(input()) #take score of each student students.append...
if __name__ == '__main__': students=[] #Creating a list for storing Students with their marks for _ in range(int(input())): name = input() #taking names of student score = float(input()) #take score of each student students.append((name,score)) #appending the name...
en
0.881504
#Creating a list for storing Students with their marks #taking names of student #take score of each student #appending the name and score of students one by one #A #B #For printing the second student #Step by step explaination of A and # B # A : second_lowest=sorted(list(set([x[1] for x in students])))[1] # [x[1] for...
4.292332
4
thingsboard_gateway/connectors/mqtt/json_mqtt_uplink_converter.py
DavideBorsatti/thingsboard-gateway
0
6628391
<reponame>DavideBorsatti/thingsboard-gateway # Copyright 2022. ThingsBoard # # 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...
# Copyright 2022. ThingsBoard # # 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 ...
en
0.842097
# Copyright 2022. ThingsBoard # # 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 ...
1.903666
2
export_histogram.py
greplova/MachineLearning
1
6628392
<filename>export_histogram.py import tensorflow as tf import numpy as np import glob, os # This is the path where the model is saved # it can be a relative path, if script is in the same folder that contain the model data inpath = 'sparse_model_batches_noisy/' ##################################### #First we export ...
<filename>export_histogram.py import tensorflow as tf import numpy as np import glob, os # This is the path where the model is saved # it can be a relative path, if script is in the same folder that contain the model data inpath = 'sparse_model_batches_noisy/' ##################################### #First we export ...
en
0.708237
# This is the path where the model is saved # it can be a relative path, if script is in the same folder that contain the model data ##################################### #First we export the evaluation data# ##################################### # First we create a list to save the steps with data # First loop is over...
2.530294
3
Lib/site-packages/wx-2.8-msw-unicode/wx/lib/agw/labelbook.py
ekkipermana/robotframework-test
11
6628393
# --------------------------------------------------------------------------- # # LABELBOOK And FLATIMAGEBOOK Widgets wxPython IMPLEMENTATION # # Original C++ Code From Eran, embedded in the FlatMenu source code # # # License: wxWidgets license # # # Python Code By: # # <NAME>, @ 03 Nov 2006 # Latest Revision: 17 Jan 2...
# --------------------------------------------------------------------------- # # LABELBOOK And FLATIMAGEBOOK Widgets wxPython IMPLEMENTATION # # Original C++ Code From Eran, embedded in the FlatMenu source code # # # License: wxWidgets license # # # Python Code By: # # <NAME>, @ 03 Nov 2006 # Latest Revision: 17 Jan 2...
en
0.61068
# --------------------------------------------------------------------------- # # LABELBOOK And FLATIMAGEBOOK Widgets wxPython IMPLEMENTATION # # Original C++ Code From Eran, embedded in the FlatMenu source code # # # License: wxWidgets license # # # Python Code By: # # <NAME>, @ 03 Nov 2006 # Latest Revision: 17 Jan 2...
1.937288
2
newnnfw/externals/nnapi_test_generator/tests/P_full/addfloat.mod.py
kosslab-kr/Tizen-NN-Framework
8
6628394
<reponame>kosslab-kr/Tizen-NN-Framework # model model = Model() i1 = Input("op1", "TENSOR_FLOAT32", "{2}") # a vector of 2 float32s i2 = Input("op2", "TENSOR_FLOAT32", "{2}") # another vector of 2 float32s b0 = Int32Scalar("b0", 0) # an int32_t scalar bias i3 = Output("op3", "TENSOR_FLOAT32", "{2}") model = model.Opera...
# model model = Model() i1 = Input("op1", "TENSOR_FLOAT32", "{2}") # a vector of 2 float32s i2 = Input("op2", "TENSOR_FLOAT32", "{2}") # another vector of 2 float32s b0 = Int32Scalar("b0", 0) # an int32_t scalar bias i3 = Output("op3", "TENSOR_FLOAT32", "{2}") model = model.Operation("ADD", i1, i2, b0).To(i3) # Exampl...
en
0.606322
# model # a vector of 2 float32s # another vector of 2 float32s # an int32_t scalar bias # Example 1. Input in operand 0, # input 0 # input 1 # output 0 # Instantiate an example
3.215554
3
{{cookiecutter.project_slug}}/_/frameworks/Django/application/settings.py
ruxi/cookiecutter-ruxi-ds
0
6628395
<filename>{{cookiecutter.project_slug}}/_/frameworks/Django/application/settings.py """ Django settings for application project. """ from os.path import abspath, dirname, join from environ import Env env = Env() # pylint: disable=invalid-name ENVIRONMENT = env('ENVIRONMENT', default='local') REVISION = env('REVISION...
<filename>{{cookiecutter.project_slug}}/_/frameworks/Django/application/settings.py """ Django settings for application project. """ from os.path import abspath, dirname, join from environ import Env env = Env() # pylint: disable=invalid-name ENVIRONMENT = env('ENVIRONMENT', default='local') REVISION = env('REVISION...
en
0.574124
Django settings for application project. # pylint: disable=invalid-name # Application definition # Database # Password validation # Internationalization # Static files (CSS, JavaScript, Images)
1.793303
2
care/facility/migrations/0092_recompute_facility_types.py
gigincg/care
189
6628396
<reponame>gigincg/care # Generated by Django 2.2.11 on 2020-04-15 07:53 from django.db import migrations, transaction OLD_TO_NEW_FACILITY_TYPE_MAP_LABS = { 850: 950, } OLD_TO_NEW_FACILITY_TYPE_MAP_GOVT_HOSPITALS = { 200: 800, 201: 801, 202: 802, 203: 803, 220: 820, 230: 830, 231: 831,...
# Generated by Django 2.2.11 on 2020-04-15 07:53 from django.db import migrations, transaction OLD_TO_NEW_FACILITY_TYPE_MAP_LABS = { 850: 950, } OLD_TO_NEW_FACILITY_TYPE_MAP_GOVT_HOSPITALS = { 200: 800, 201: 801, 202: 802, 203: 803, 220: 820, 230: 830, 231: 831, 240: 840, 250:...
en
0.698888
# Generated by Django 2.2.11 on 2020-04-15 07:53
1.988702
2
mmdet3d/datasets/sunrgbd_dataset.py
maskjp/mmdetection3d
1
6628397
# Copyright (c) OpenMMLab. All rights reserved. from collections import OrderedDict from os import path as osp import numpy as np from mmdet3d.core import show_multi_modality_result, show_result from mmdet3d.core.bbox import DepthInstance3DBoxes from mmdet.core import eval_map from mmdet.datasets import DATASETS from...
# Copyright (c) OpenMMLab. All rights reserved. from collections import OrderedDict from os import path as osp import numpy as np from mmdet3d.core import show_multi_modality_result, show_result from mmdet3d.core.bbox import DepthInstance3DBoxes from mmdet.core import eval_map from mmdet.datasets import DATASETS from...
en
0.64992
# Copyright (c) OpenMMLab. All rights reserved. SUNRGBD Dataset. This class serves as the API for experiments on the SUNRGBD Dataset. See the `download page <http://rgbd.cs.princeton.edu/challenge.html>`_ for data downloading. Args: data_root (str): Path of dataset root. ann_file (str...
2.251451
2
tests/kyu_8_tests/test_remove_exclamation_marks.py
the-zebulan/CodeWars
40
6628398
<reponame>the-zebulan/CodeWars<filename>tests/kyu_8_tests/test_remove_exclamation_marks.py import unittest from katas.kyu_8.remove_exclamation_marks import remove_exclamation_marks class RemoveExclamationMarksTestCase(unittest.TestCase): def test_equal_1(self): self.assertEqual(remove_exclamation_marks('...
import unittest from katas.kyu_8.remove_exclamation_marks import remove_exclamation_marks class RemoveExclamationMarksTestCase(unittest.TestCase): def test_equal_1(self): self.assertEqual(remove_exclamation_marks('Hello World!'), 'Hello World') def test_equal_2(self): ...
none
1
3.707176
4
Server/SendKeys.py
And0r-/RaspBox3000
0
6628399
#socket_echo_client.py import socket import sys import kb_map import keyboard import time NULL_CHAR = chr(0) release_key = (NULL_CHAR*8).encode() # Create a TCP/IP socket sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Connect the socket to the p...
#socket_echo_client.py import socket import sys import kb_map import keyboard import time NULL_CHAR = chr(0) release_key = (NULL_CHAR*8).encode() # Create a TCP/IP socket sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock2 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Connect the socket to the p...
en
0.688585
#socket_echo_client.py # Create a TCP/IP socket # Connect the socket to the port where the server is listening # Send data # Look for the response
3.038043
3
tests/test_sugar.py
DeJona/busypie
13
6628400
from busypie import given, wait, ONE_SECOND, wait_at_most, MILLISECOND def test_start_with_given(): assert given() == wait() assert given().wait().at_most(ONE_SECOND) == wait().at_most(ONE_SECOND) def test_combine_wait_and_at_most(): assert wait().at_most(ONE_SECOND) == wait_at_most(ONE_SECOND) asse...
from busypie import given, wait, ONE_SECOND, wait_at_most, MILLISECOND def test_start_with_given(): assert given() == wait() assert given().wait().at_most(ONE_SECOND) == wait().at_most(ONE_SECOND) def test_combine_wait_and_at_most(): assert wait().at_most(ONE_SECOND) == wait_at_most(ONE_SECOND) asse...
none
1
2.89507
3
tests/test_function_call_assignment.py
PseuToPy/PseuToPy
6
6628401
<gh_stars>1-10 from tests.utils import check_ast class TestFunctionCallAssignment: def test_function_call_assignment_input(self, pseutopy): pseudo_str = "set a to the result of input (\"Hello\", myVar)" python_str = "a = input(\"Hello\", myVar)" assert check_ast(pseutopy, python_str, pseud...
from tests.utils import check_ast class TestFunctionCallAssignment: def test_function_call_assignment_input(self, pseutopy): pseudo_str = "set a to the result of input (\"Hello\", myVar)" python_str = "a = input(\"Hello\", myVar)" assert check_ast(pseutopy, python_str, pseudo_str) def...
en
0.279852
set a to the result of call function foo with parameter 10 set b to the result of call function bar with parameters 0, 10 set c to the result of call function foobar with parameter myVar set d to the result of call function fizzbuzz with parameters var1, var2 set e to the result of call ...
3.296861
3
projects/tests.py
Waithera-m/project_rater
0
6628402
<gh_stars>0 from django.test import TestCase from .models import Profile, Tags, Project, Votes from django.contrib.auth.models import User import factory from django.db.models import signals # Create your tests here. class ProfileModelTests(TestCase): """ class supports the creation of tests to test model beha...
from django.test import TestCase from .models import Profile, Tags, Project, Votes from django.contrib.auth.models import User import factory from django.db.models import signals # Create your tests here. class ProfileModelTests(TestCase): """ class supports the creation of tests to test model behavior """...
en
0.821812
# Create your tests here. class supports the creation of tests to test model behavior method defines the object to be created and instructions to be executed before each test # def tearDown(self): # """ # method returns database to pristine condition after all tests run # """ # Profile.objects.all().del...
2.684822
3
chapter_3.py
jeremyn/python-machine-learning-book
7
6628403
<reponame>jeremyn/python-machine-learning-book # Copyright <NAME>. # Released under the MIT license. See included LICENSE.txt. # # Almost entirely copied from code created by <NAME> released under # the MIT license. See included LICENSE.raschka.txt. import matplotlib.pyplot as plt import numpy as np from sklearn.cross_...
# Copyright <NAME>. # Released under the MIT license. See included LICENSE.txt. # # Almost entirely copied from code created by <NAME> released under # the MIT license. See included LICENSE.raschka.txt. import matplotlib.pyplot as plt import numpy as np from sklearn.cross_validation import train_test_split from sklearn...
en
0.388531
# Copyright <NAME>. # Released under the MIT license. See included LICENSE.txt. # # Almost entirely copied from code created by <NAME> released under # the MIT license. See included LICENSE.raschka.txt. # clf = Perceptron(n_iter=40, eta0=0.1, random_state=0) # clf = LogisticRegression(C=1000.0, random_state=0) # clf = ...
2.564527
3
src/third_party/skia/infra/bots/assets/android_ndk_linux/create.py
rhencke/engine
54
6628404
<filename>src/third_party/skia/infra/bots/assets/android_ndk_linux/create.py #!/usr/bin/env python # # Copyright 2016 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Create the asset.""" import argparse import glob import os.path import shutil i...
<filename>src/third_party/skia/infra/bots/assets/android_ndk_linux/create.py #!/usr/bin/env python # # Copyright 2016 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Create the asset.""" import argparse import glob import os.path import shutil i...
en
0.809237
#!/usr/bin/env python # # Copyright 2016 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. Create the asset. Create the asset.
2.185386
2
tflite_tools.py
oxmlsys/tflite-tools
18
6628405
<gh_stars>10-100 import argparse import os from tflite_tools import TFLiteModel def main(): parser = argparse.ArgumentParser(description='TFLite model analyser & memory optimizer') parser.add_argument("-i", type=str, dest="input_path", help="input model file (.tflite)") parser.add_argument("-o", type=st...
import argparse import os from tflite_tools import TFLiteModel def main(): parser = argparse.ArgumentParser(description='TFLite model analyser & memory optimizer') parser.add_argument("-i", type=str, dest="input_path", help="input model file (.tflite)") parser.add_argument("-o", type=str, dest="output_p...
none
1
2.931737
3
cycy/__init__.py
Magnetic/cycy
26
6628406
<reponame>Magnetic/cycy from cycy._version import __version__
from cycy._version import __version__
none
1
1.011109
1
src/logger.py
hazimavdal/gpurge
1
6628407
<reponame>hazimavdal/gpurge import time DEBUG_LEVEL = 0 INFO_LEVEL = 1 WARNING_LEVEL = 2 ERROR_LEVEL = 3 FATAL_LEVEL = 4 def level_str(level): if level == 0: return "DEBUG" if level == 1: return "INFO" if level == 2: return "WARN" if level == 3: return "ERROR" if l...
import time DEBUG_LEVEL = 0 INFO_LEVEL = 1 WARNING_LEVEL = 2 ERROR_LEVEL = 3 FATAL_LEVEL = 4 def level_str(level): if level == 0: return "DEBUG" if level == 1: return "INFO" if level == 2: return "WARN" if level == 3: return "ERROR" if level == 4: return "F...
none
1
3.099941
3
VirtualBox-5.0.0/src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/UPT/Library/String.py
egraba/vbox_openbsd
1
6628408
<reponame>egraba/vbox_openbsd ## @file # This file is used to define common string related functions used in parsing # process # # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials are licensed and made available # under the terms and conditions of the BSD...
## @file # This file is used to define common string related functions used in parsing # process # # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials are licensed and made available # under the terms and conditions of the BSD License which accompanies thi...
en
0.573198
## @file # This file is used to define common string related functions used in parsing # process # # Copyright (c) 2011, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials are licensed and made available # under the terms and conditions of the BSD License which accompanies this ...
2.597574
3
apps/secure_url/api/tests/tests_secured_entity_access.py
fryta/sercure-url
0
6628409
from datetime import timedelta from django.conf import settings from rest_framework import status from rest_framework.reverse import reverse from .tests_base import BaseApiTestCase from ...models import SecuredEntity class SecuredEntityAccessApiTest(BaseApiTestCase): def __finish_create_secured_entity(self): ...
from datetime import timedelta from django.conf import settings from rest_framework import status from rest_framework.reverse import reverse from .tests_base import BaseApiTestCase from ...models import SecuredEntity class SecuredEntityAccessApiTest(BaseApiTestCase): def __finish_create_secured_entity(self): ...
none
1
2.149061
2
submissions/abc130/d.py
m-star18/atcoder
1
6628410
<reponame>m-star18/atcoder import bisect import sys input = sys.stdin.readline n, k = map(int, input().split()) a = list(map(int, input().split())) A = [0]*(n+1) ans = 0 for i in range(n): A[i+1] = a[i]+A[i] for i in range(n): s = bisect.bisect_left(A, k+A[i]) ans += n+1-s print(ans)
import bisect import sys input = sys.stdin.readline n, k = map(int, input().split()) a = list(map(int, input().split())) A = [0]*(n+1) ans = 0 for i in range(n): A[i+1] = a[i]+A[i] for i in range(n): s = bisect.bisect_left(A, k+A[i]) ans += n+1-s print(ans)
none
1
2.770462
3
mbuild/lib/moieties/peg.py
daico007/mbuild
101
6628411
"""mBuild polyethylene glycol (PEG) monomer moiety.""" __author__ = "jonestj1" import mbuild as mb class PegMonomer(mb.Compound): """A monomer of polyethylene glycol (PEG).""" def __init__(self): super(PegMonomer, self).__init__() mb.load( "peg_monomer.pdb", compound...
"""mBuild polyethylene glycol (PEG) monomer moiety.""" __author__ = "jonestj1" import mbuild as mb class PegMonomer(mb.Compound): """A monomer of polyethylene glycol (PEG).""" def __init__(self): super(PegMonomer, self).__init__() mb.load( "peg_monomer.pdb", compound...
en
0.38053
mBuild polyethylene glycol (PEG) monomer moiety. A monomer of polyethylene glycol (PEG).
2.748107
3
OpenCV/video_cut.py
Tripleler/Tistory_blog
0
6628412
import sys import cv2 cap = cv2.VideoCapture('md.mp4') if not cap.isOpened(): print("Video open failed!") sys.exit() fps = cap.get(cv2.CAP_PROP_FPS) print('FPS:', fps) w = round(cap.get(cv2.CAP_PROP_FRAME_WIDTH)) print('Frame width:', w) h = round(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)) print('Frame height:', h)...
import sys import cv2 cap = cv2.VideoCapture('md.mp4') if not cap.isOpened(): print("Video open failed!") sys.exit() fps = cap.get(cv2.CAP_PROP_FPS) print('FPS:', fps) w = round(cap.get(cv2.CAP_PROP_FRAME_WIDTH)) print('Frame width:', w) h = round(cap.get(cv2.CAP_PROP_FRAME_HEIGHT)) print('Frame height:', h)...
en
0.319214
# cap = cv2.VideoCapture('Raw.mp4') # out = cv2.VideoWriter('Cut.mp4', cv2.VideoWriter_fourcc(*'mp4v'), fps, (w, h)) # cap.set(cv2.CAP_PROP_POS_FRAMES, 116) # while True: # ret, frame = cap.read() # if not ret: # break # out.write(frame) # # cap.release() # out.release() # cv2.destroyAllWindows() # ...
2.686834
3
SAC/models.py
pnnayyeri/Reinforcement-learning
0
6628413
import torch import torch.nn as nn import torch.nn.functional as F from torch.distributions import Normal, Uniform class ValueNetwork(nn.Module): def __init__(self, input_dim, output_dim, init_w=3e-3): super(ValueNetwork, self).__init__() self.fc1 = nn.Linear(input_dim, 256) self.fc2 = nn...
import torch import torch.nn as nn import torch.nn.functional as F from torch.distributions import Normal, Uniform class ValueNetwork(nn.Module): def __init__(self, input_dim, output_dim, init_w=3e-3): super(ValueNetwork, self).__init__() self.fc1 = nn.Linear(input_dim, 256) self.fc2 = nn...
none
1
2.69978
3
learning/codesearcher.py
linzeqipku/drm_codesearch
0
6628414
from __future__ import absolute_import import os import numpy as np import re import torch import torch.optim as optim from torch.utils.data import DataLoader from tqdm import tqdm from learning.model.rnn import RnnModel from preprocess.dataset import CodeSearchDataset from preprocess.lex.token import Tokenizer from ...
from __future__ import absolute_import import os import numpy as np import re import torch import torch.optim as optim from torch.utils.data import DataLoader from tqdm import tqdm from learning.model.rnn import RnnModel from preprocess.dataset import CodeSearchDataset from preprocess.lex.token import Tokenizer from ...
none
1
2.142048
2
qpath/utils.py
vladpopovici/QPath
0
6628415
# -*- coding: utf-8 -*- ############################################################################# # Copyright <NAME> <<EMAIL>> # # Licensed under the MIT License. See LICENSE file in root folder. ############################################################################# __author__ = "<NAME> <<EMAIL>>" __versio...
# -*- coding: utf-8 -*- ############################################################################# # Copyright <NAME> <<EMAIL>> # # Licensed under the MIT License. See LICENSE file in root folder. ############################################################################# __author__ = "<NAME> <<EMAIL>>" __versio...
en
0.33186
# -*- coding: utf-8 -*- ############################################################################# # Copyright <NAME> <<EMAIL>> # # Licensed under the MIT License. See LICENSE file in root folder. ############################################################################# # # QPATH.UTILS: handy functions # Return ...
2.492383
2
coordination/migrations/0011_add_ml_quest_type.py
PhobosXIII/qc
0
6628416
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-03-20 13:28 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('coordination', '0010_increase_hint_max_delay'), ] operations = [ migrations....
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-03-20 13:28 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('coordination', '0010_increase_hint_max_delay'), ] operations = [ migrations....
en
0.7973
# -*- coding: utf-8 -*- # Generated by Django 1.9.2 on 2016-03-20 13:28
1.514562
2
curso_em_video/0064.py
marinaoliveira96/python-exercises
0
6628417
<filename>curso_em_video/0064.py n = 0 cont = 0 soma = 0 while n != 999: n = int(input('Digite um numero. [Digite 999 para parar]: ')) cont += 1 soma += n print(f'foram digitados {cont} numeros e a soma deles é igual a {soma-999}')
<filename>curso_em_video/0064.py n = 0 cont = 0 soma = 0 while n != 999: n = int(input('Digite um numero. [Digite 999 para parar]: ')) cont += 1 soma += n print(f'foram digitados {cont} numeros e a soma deles é igual a {soma-999}')
none
1
3.445309
3
app/services/models/pool_member.py
tirinox/thorchainmonitorbot
3
6628418
<reponame>tirinox/thorchainmonitorbot from dataclasses import dataclass @dataclass class PoolMemberDetails: asset_added: int = 0 asset_withdrawn: int = 0 asset_address: str = '' rune_added: int = 0 rune_withdrawn: int = 0 run_address: str = '' date_first_added: int = 0 date_last_adde...
from dataclasses import dataclass @dataclass class PoolMemberDetails: asset_added: int = 0 asset_withdrawn: int = 0 asset_address: str = '' rune_added: int = 0 rune_withdrawn: int = 0 run_address: str = '' date_first_added: int = 0 date_last_added: int = 0 liquidity_units: int = ...
none
1
2.130255
2
machine-learning/utils/figures.py
tusharsingh62/nasaapps-rgb-awl
0
6628419
<filename>machine-learning/utils/figures.py import colorlover as cl import plotly.graph_objs as go import numpy as np from sklearn import metrics def serve_prediction_plot( model, X_train, X_test, y_train, y_test, Z, xx, yy, mesh_step, threshold, image ): # Get train and test score from model y_pred_train...
<filename>machine-learning/utils/figures.py import colorlover as cl import plotly.graph_objs as go import numpy as np from sklearn import metrics def serve_prediction_plot( model, X_train, X_test, y_train, y_test, Z, xx, yy, mesh_step, threshold, image ): # Get train and test score from model y_pred_train...
en
0.741326
# Get train and test score from model # Compute threshold # Colorscale # Create the plot # Plot the prediction contour of the SVM # Plot the threshold # Plot Training Data # Plot Test Data # symbol="triangle-up", # color=y_train, # Compute threshold
2.773356
3
c.calculation.py
anmol1455/python
0
6628420
#class creation class calculation: num1=0 num2=0 def inputdata(self): self.num1=int(input("enter first number")) self.num2=int(input("enter second number")) def addition(self): add=self.num1+self.num2 print("sum=",add) def subtraction(self): sub=self.num1-sel...
#class creation class calculation: num1=0 num2=0 def inputdata(self): self.num1=int(input("enter first number")) self.num2=int(input("enter second number")) def addition(self): add=self.num1+self.num2 print("sum=",add) def subtraction(self): sub=self.num1-sel...
en
0.653471
#class creation # object creation
3.954929
4
ool/oppositions/migrations/0016_opposition_inform_jury_member.py
HeLsEroC/bbr
0
6628421
<gh_stars>0 # Generated by Django 3.1.12 on 2021-07-27 06:34 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('oppositions', '0015_auto_20210713_1303'), ] operations = [ migrations.AddField( model_name='opposition', ...
# Generated by Django 3.1.12 on 2021-07-27 06:34 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('oppositions', '0015_auto_20210713_1303'), ] operations = [ migrations.AddField( model_name='opposition', name='info...
en
0.796867
# Generated by Django 3.1.12 on 2021-07-27 06:34
1.504373
2
test/unit/test_decoder.py
blchu/sockeye
0
6628422
# Copyright 2017--2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You may not # use this file except in compliance with the License. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fi...
# Copyright 2017--2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You may not # use this file except in compliance with the License. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fi...
en
0.870358
# Copyright 2017--2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). You may not # use this file except in compliance with the License. A copy of the License # is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" fi...
1.958842
2
lemur/common/validators.py
dck25/lemur
1,656
6628423
import re from cryptography import x509 from cryptography.exceptions import UnsupportedAlgorithm, InvalidSignature from cryptography.hazmat.backends import default_backend from cryptography.x509 import NameOID from flask import current_app from marshmallow.exceptions import ValidationError from lemur.auth.permissions...
import re from cryptography import x509 from cryptography.exceptions import UnsupportedAlgorithm, InvalidSignature from cryptography.hazmat.backends import default_backend from cryptography.x509 import NameOID from flask import current_app from marshmallow.exceptions import ValidationError from lemur.auth.permissions...
en
0.836972
If the common name could be a domain name, apply domain validation rules. # Common name could be a domain name, or a human-readable name of the subject (often used in CA names or client # certificates). As a simple heuristic, we assume that human-readable names always include a space. # However, to avoid confusion for ...
2.394251
2
methods/segmentation/utils.py
ciampluca/counting_perineuronal_nets
6
6628424
import pandas as pd from skimage import measure def segmentation_map_to_points(y_pred, thr=None): """ Find connected components of a segmentation map and returns a pandas DataFrame with the centroids' coordinates and the score (computes as maximum value of the centroid in the map). Args: ...
import pandas as pd from skimage import measure def segmentation_map_to_points(y_pred, thr=None): """ Find connected components of a segmentation map and returns a pandas DataFrame with the centroids' coordinates and the score (computes as maximum value of the centroid in the map). Args: ...
en
0.747188
Find connected components of a segmentation map and returns a pandas DataFrame with the centroids' coordinates and the score (computes as maximum value of the centroid in the map). Args: y_pred (ndarray): (H,W)-shaped array with values in [0, 1] thr (float, optional): Optional thres...
2.916562
3
smiles2actions/name_filters/state_filter.py
rxn4chemistry/smiles2actions
8
6628425
<reponame>rxn4chemistry/smiles2actions import re from typing import List from .filter import Filter from ..regex_utils import RegexMatch, match_all, alternation, optional from ..utils import dash_characters _optional_of = optional(' of') _descriptors = [ r'\b[Ss]olid\b' + _optional_of, r'\b[Ll]iquid\b' + _op...
import re from typing import List from .filter import Filter from ..regex_utils import RegexMatch, match_all, alternation, optional from ..utils import dash_characters _optional_of = optional(' of') _descriptors = [ r'\b[Ss]olid\b' + _optional_of, r'\b[Ll]iquid\b' + _optional_of, r'\bgas\b', r'\(s\)'...
en
0.853543
Looks for substrings related to the state (solid, liquid, gaseous). The regex matching in 'find_matches' is a bit too generous. This function checks whether the match should be kept. # if "(s)" is followed by a dash, it probably refers to the chirality -> ignore it
2.703151
3
disk2.py
berrnd/linuxfabrik-lib
0
6628426
<gh_stars>0 #! /usr/bin/env python2 # -*- coding: utf-8; py-indent-offset: 4 -*- # # Author: Linuxfabrik GmbH, Zurich, Switzerland # Contact: info (at) linuxfabrik (dot) ch # https://www.linuxfabrik.ch/ # License: The Unlicense, see LICENSE file. # https://github.com/Linuxfabrik/monitoring-plugins/blob/main/...
#! /usr/bin/env python2 # -*- coding: utf-8; py-indent-offset: 4 -*- # # Author: Linuxfabrik GmbH, Zurich, Switzerland # Contact: info (at) linuxfabrik (dot) ch # https://www.linuxfabrik.ch/ # License: The Unlicense, see LICENSE file. # https://github.com/Linuxfabrik/monitoring-plugins/blob/main/CONTRIBUTING...
en
0.683255
#! /usr/bin/env python2 # -*- coding: utf-8; py-indent-offset: 4 -*- # # Author: Linuxfabrik GmbH, Zurich, Switzerland # Contact: info (at) linuxfabrik (dot) ch # https://www.linuxfabrik.ch/ # License: The Unlicense, see LICENSE file. # https://github.com/Linuxfabrik/monitoring-plugins/blob/main/CONTRIBUTING....
2.52869
3
lib/testcode2/validation.py
giovannipizzi/testcode
17
6628427
''' testcode2.validation -------------------- Classes and functions for comparing data. :copyright: (c) 2012 <NAME>. :license: modified BSD; see LICENSE for more details. ''' import re import sys import warnings import testcode2.ansi as ansi import testcode2.compatibility as compat import testcode2.exceptions as ex...
''' testcode2.validation -------------------- Classes and functions for comparing data. :copyright: (c) 2012 <NAME>. :license: modified BSD; see LICENSE for more details. ''' import re import sys import warnings import testcode2.ansi as ansi import testcode2.compatibility as compat import testcode2.exceptions as ex...
en
0.819025
testcode2.validation -------------------- Classes and functions for comparing data. :copyright: (c) 2012 <NAME>. :license: modified BSD; see LICENSE for more details. Enum-esque object for storing whether an object passed a comparison. bools: iterable of boolean objects. If all booleans are True (False) then the ...
3.247451
3
sudoku_solver/board.py
Blondberg/py-sudoku-solver-mk2
0
6628428
<filename>sudoku_solver/board.py from pygame.constants import K_LEFT, K_RIGHT from input_box import InputBox import pygame class Board: def __init__(self) -> None: self.ROW_COUNT = 9 self.COL_COUNT = 9 self.BOX_WIDTH = 50 self.BOX_HEIGHT = 50 self.active_row = 0 sel...
<filename>sudoku_solver/board.py from pygame.constants import K_LEFT, K_RIGHT from input_box import InputBox import pygame class Board: def __init__(self) -> None: self.ROW_COUNT = 9 self.COL_COUNT = 9 self.BOX_WIDTH = 50 self.BOX_HEIGHT = 50 self.active_row = 0 sel...
en
0.714461
###") ###") # Could do foreach, but need the number of row and col
3.625557
4
PR/production/personal_rank.py
Cathy-t/basic_recommendation_algorithm
6
6628429
# -*- coding: utf-8 -*- # @Time : 2019/3/18 17:40 # @Author : Cathy # @FileName: personal_rank.py # @Software: PyCharm from __future__ import division import sys sys.path.append("../util") import util.read as read import operator import util.mat_util as mat_util # 解稀疏矩阵的方程所需使用的模块 gmres from scipy.sparse.linalg ...
# -*- coding: utf-8 -*- # @Time : 2019/3/18 17:40 # @Author : Cathy # @FileName: personal_rank.py # @Software: PyCharm from __future__ import division import sys sys.path.append("../util") import util.read as read import operator import util.mat_util as mat_util # 解稀疏矩阵的方程所需使用的模块 gmres from scipy.sparse.linalg ...
zh
0.798295
# -*- coding: utf-8 -*- # @Time : 2019/3/18 17:40 # @Author : Cathy # @FileName: personal_rank.py # @Software: PyCharm # 解稀疏矩阵的方程所需使用的模块 gmres :param graph: user item graph 之前得到的user和item的图结构 :param root: the fixed user for which to recom 将要给哪个user推荐 :param alpha: the prob to go to random walk 以alpha的概率选择向下...
2.62358
3
mfem/_par/densemat.py
kennyweiss/PyMFEM
0
6628430
# This file was automatically generated by SWIG (http://www.swig.org). # Version 4.0.2 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info as _swig_python_version_info if _swig_python_version_info < (2, 7, 0): raise Runtime...
# This file was automatically generated by SWIG (http://www.swig.org). # Version 4.0.2 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info as _swig_python_version_info if _swig_python_version_info < (2, 7, 0): raise Runtime...
en
0.38803
# This file was automatically generated by SWIG (http://www.swig.org). # Version 4.0.2 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. # Import the low-level C/C++ module Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down ve...
1.991092
2
ABC143/ABC143d.py
VolgaKurvar/AtCoder
0
6628431
<filename>ABC143/ABC143d.py # ABC143d import bisect import sys input = sys.stdin.readline sys.setrecursionlimit(10**6) n = int(input()) l = list(map(int, input().split())) ans = 0 l.sort() # print(l) for x in range(n): for y in range(x+1, n): t = bisect.bisect_left(l, max(l[x] - l[y], l[y] - l[x])+1, y+1...
<filename>ABC143/ABC143d.py # ABC143d import bisect import sys input = sys.stdin.readline sys.setrecursionlimit(10**6) n = int(input()) l = list(map(int, input().split())) ans = 0 l.sort() # print(l) for x in range(n): for y in range(x+1, n): t = bisect.bisect_left(l, max(l[x] - l[y], l[y] - l[x])+1, y+1...
en
0.259213
# ABC143d # print(l) #print(l[x], l[y], max(l[x] - l[y], l[y] - l[x]), t, l[t]) #print(t2, l[t2] if t2 < n else None) #print(t2 - t)
2.614245
3
CIS41B/class_examples/Args.py
jackh423/python
1
6628432
<reponame>jackh423/python<filename>CIS41B/class_examples/Args.py def Pack(*args, **kwargs): print(type(args)) print(type(kwargs)) def Add(*num): sum = 0 for n in num: sum = sum + n return sum def Multiply(*args): product = 1 for x in args: product = product...
def Pack(*args, **kwargs): print(type(args)) print(type(kwargs)) def Add(*num): sum = 0 for n in num: sum = sum + n return sum def Multiply(*args): product = 1 for x in args: product = product * x return product def Average(*args): total = 0 ...
none
1
3.634439
4
frcnn.py
xwshi/faster-rcnn-keras
0
6628433
import colorsys import copy import os import time import numpy as np from keras import backend as K from keras.applications.imagenet_utils import preprocess_input from PIL import Image, ImageDraw, ImageFont import nets.frcnn as frcnn from nets.frcnn_training import get_new_img_size from utils.anchors impo...
import colorsys import copy import os import time import numpy as np from keras import backend as K from keras.applications.imagenet_utils import preprocess_input from PIL import Image, ImageDraw, ImageFont import nets.frcnn as frcnn from nets.frcnn_training import get_new_img_size from utils.anchors impo...
zh
0.21379
#--------------------------------------------# # 使用自己训练好的模型预测需要修改2个参数 # model_path和classes_path都需要修改! # 如果出现shape不匹配 # 一定要注意训练时的NUM_CLASSES、 # model_path和classes_path参数的修改 #--------------------------------------------# #---------------------------------------------------# # 初始化faster RCNN #-----------------...
2.068793
2
Desafios/desafio13.py
ArthurBrito1/MY-SCRIPTS-PYTHON
1
6628434
<gh_stars>1-10 temperatura = int(input('informe a temperatura em graus celcius:')) converssão = (temperatura*9/5)+32 print('A temperatura em graus celcius é de {}C \nApós de ser convertida para fharenheit fica {}F'.format(temperatura, converssão))
temperatura = int(input('informe a temperatura em graus celcius:')) converssão = (temperatura*9/5)+32 print('A temperatura em graus celcius é de {}C \nApós de ser convertida para fharenheit fica {}F'.format(temperatura, converssão))
none
1
3.682393
4
integration/idea/root0/apputils_setup.py
hapylestat/appcore
0
6628435
<filename>integration/idea/root0/apputils_setup.py # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache L...
<filename>integration/idea/root0/apputils_setup.py # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache L...
en
0.859601
# Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not...
1.822595
2
main.py
nalbarr/halamka_nlp_tf_keras
0
6628436
import pandas as pd import numpy as np import random import tensorflow as tf from tensorflow.keras.preprocessing.text import Tokenizer from tensorflow.keras.preprocessing.sequence import pad_sequences def dump_tf_info(): print("Version: ", tf.__version__) print("Eager mode: ", tf.executing_eagerly()) pri...
import pandas as pd import numpy as np import random import tensorflow as tf from tensorflow.keras.preprocessing.text import Tokenizer from tensorflow.keras.preprocessing.sequence import pad_sequences def dump_tf_info(): print("Version: ", tf.__version__) print("Eager mode: ", tf.executing_eagerly()) pri...
none
1
2.730041
3
book/_build/jupyter_execute/descriptive/m3-demo-04-SummaryStatisticsAndVisualizations.py
hossainlab/statswithpy
0
6628437
<gh_stars>0 #!/usr/bin/env python # coding: utf-8 # ## Univariate and Bivariate Analysis # <b>Dataset</b>: https://www.kaggle.com/mustafaali96/weight-height # The variables used are: # * Height # * Weight # * Gender # ### Import libraries # In[1]: import pandas as pd import matplotlib.pyplot as plt ...
#!/usr/bin/env python # coding: utf-8 # ## Univariate and Bivariate Analysis # <b>Dataset</b>: https://www.kaggle.com/mustafaali96/weight-height # The variables used are: # * Height # * Weight # * Gender # ### Import libraries # In[1]: import pandas as pd import matplotlib.pyplot as plt import numpy...
en
0.457787
#!/usr/bin/env python # coding: utf-8 # ## Univariate and Bivariate Analysis # <b>Dataset</b>: https://www.kaggle.com/mustafaali96/weight-height # The variables used are: # * Height # * Weight # * Gender # ### Import libraries # In[1]: # ### Load and read dataset # In[2]: # In[3]: # ### Mean, median, mode, ...
3.903969
4
conf.py
orishamir/OriScapy
0
6628438
iface = 'eth0'
iface = 'eth0'
none
1
1.05878
1
Auto-differentiation/auto_class.py
Robertboy18/Numerical-Algorithms-Implementation
0
6628439
<reponame>Robertboy18/Numerical-Algorithms-Implementation<gh_stars>0 # original author : Professor <NAME> class Autodiff_Node(object): ## A class is a recipe for creating objects (with methods and atributes). ## This is called a 'base class', which is like a boiler plate recipe that ## many other classes ...
# original author : Professor <NAME> class Autodiff_Node(object): ## A class is a recipe for creating objects (with methods and atributes). ## This is called a 'base class', which is like a boiler plate recipe that ## many other classes will use a starting point, each making specific ## changes. ...
en
0.812549
# original author : Professor <NAME> ## A class is a recipe for creating objects (with methods and atributes). ## This is called a 'base class', which is like a boiler plate recipe that ## many other classes will use a starting point, each making specific ## changes. ## All methods (unless otherwise specified) must hav...
3.608301
4
tests/e2e/rnn_rollout/test_deal_or_not.py
haojiepan1/CrossWOZ
1
6628440
import argparse from convlab2.e2e.rnn_rollout.deal_or_not import DealornotAgent from convlab2.e2e.rnn_rollout.deal_or_not.model import get_context_generator from convlab2 import DealornotSession import convlab2.e2e.rnn_rollout.utils as utils import numpy as np session_num = 20 def rnn_model_args(): parser = argp...
import argparse from convlab2.e2e.rnn_rollout.deal_or_not import DealornotAgent from convlab2.e2e.rnn_rollout.deal_or_not.model import get_context_generator from convlab2 import DealornotSession import convlab2.e2e.rnn_rollout.utils as utils import numpy as np session_num = 20 def rnn_model_args(): parser = argp...
en
0.658939
# agent # session # print(np.mean(rewards, axis=1))
2.211698
2
src/estimagic/visualization/convergence_plot.py
janosg/estimagic
7
6628441
import numpy as np import plotly.express as px import plotly.graph_objects as go from estimagic.benchmarking.process_benchmark_results import ( create_convergence_histories, ) from estimagic.config import PLOTLY_TEMPLATE from estimagic.utilities import propose_alternatives from estimagic.visualization.plotting_util...
import numpy as np import plotly.express as px import plotly.graph_objects as go from estimagic.benchmarking.process_benchmark_results import ( create_convergence_histories, ) from estimagic.config import PLOTLY_TEMPLATE from estimagic.utilities import propose_alternatives from estimagic.visualization.plotting_util...
en
0.826932
Plot convergence of optimizers for a set of problems. This creates a grid of plots, showing the convergence of the different algorithms on each problem. The faster a line falls, the faster the algorithm improved on the problem. The algorithm converged where its line reaches 0 (if normalize_distance is ...
2.92027
3
alipay/aop/api/response/ZhimaCustomerCertificationCertifyResponse.py
snowxmas/alipay-sdk-python-all
213
6628442
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class ZhimaCustomerCertificationCertifyResponse(AlipayResponse): def __init__(self): super(ZhimaCustomerCertificationCertifyResponse, self).__init__() self._biz_no = None ...
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class ZhimaCustomerCertificationCertifyResponse(AlipayResponse): def __init__(self): super(ZhimaCustomerCertificationCertifyResponse, self).__init__() self._biz_no = None ...
en
0.352855
#!/usr/bin/env python # -*- coding: utf-8 -*-
2.130936
2
handlers/base.py
binux/webrtc_video
32
6628443
<reponame>binux/webrtc_video #!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<<EMAIL>> # http://binux.me # Created on 2012-12-15 16:16:38 import logging import tornado.web import tornado.websocket from tornado.web import HTTPError from tornado.opt...
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<<EMAIL>> # http://binux.me # Created on 2012-12-15 16:16:38 import logging import tornado.web import tornado.websocket from tornado.web import HTTPError from tornado.options import options __ALL__ ...
en
0.225609
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<<EMAIL>> # http://binux.me # Created on 2012-12-15 16:16:38
1.805149
2
button.py
mn1del/rpigpio
0
6628444
#!/usr/bin/env python3 """ Class to handle momentary switches """ import RPi.GPIO as GPIO import time if __name__ == "__main__": from base import BaseIO else: from rpigpio.base import BaseIO class Button(BaseIO): def __init__(self, button_pin=12, pull_up=True, ...
#!/usr/bin/env python3 """ Class to handle momentary switches """ import RPi.GPIO as GPIO import time if __name__ == "__main__": from base import BaseIO else: from rpigpio.base import BaseIO class Button(BaseIO): def __init__(self, button_pin=12, pull_up=True, ...
en
0.772461
#!/usr/bin/env python3 Class to handle momentary switches Class to handle momentary switch input. Note that STATE behaviour will depend on whether a pullup or pull-down resistor is used, and whether the circuit is wired normally open or normally closed. args: button_pin: (in...
3.437627
3
villes_en_france.py
mbrewer/dictionary_magic
0
6628445
<gh_stars>0 #!/usr/bin/env python # -*- coding: latin-1 -*- combien_de_departements = { 'Auvergne-Rhônes-Alpes': 12, 'Île-de-France': 8, 'Normandie': 5, 'Provence-Alpes-Côte d\'Azur': 8, 'Nouvelle-Aquitaine': 12, ...
#!/usr/bin/env python # -*- coding: latin-1 -*- combien_de_departements = { 'Auvergne-Rhônes-Alpes': 12, 'Île-de-France': 8, 'Normandie': 5, 'Provence-Alpes-Côte d\'Azur': 8, 'Nouvelle-Aquitaine': 12, ...
en
0.184027
#!/usr/bin/env python # -*- coding: latin-1 -*-
2.090516
2
src/npx/__init__.py
rohankumardubey/npx
0
6628446
<gh_stars>0 from ._isin import isin_rows from ._main import add_at, dot, outer, solve, subtract_at, sum_at from ._mean import mean from ._unique import unique, unique_rows __all__ = [ "dot", "outer", "solve", "sum_at", "add_at", "subtract_at", "unique_rows", "isin_rows", "mean", ...
from ._isin import isin_rows from ._main import add_at, dot, outer, solve, subtract_at, sum_at from ._mean import mean from ._unique import unique, unique_rows __all__ = [ "dot", "outer", "solve", "sum_at", "add_at", "subtract_at", "unique_rows", "isin_rows", "mean", "unique", ...
none
1
1.936957
2
docker/app.py
icedwater/dole
0
6628447
<filename>docker/app.py #! /usr/bin/env python from flask import Flask from redis import Redis, RedisError import os import socket # Connect to Redis redis = Redis(host="redis", db=0, socket_connect_timeout=2, socket_timeout=2) app = Flask(__name__) @app.route("/") def hello(): try: visits = redis.incr(...
<filename>docker/app.py #! /usr/bin/env python from flask import Flask from redis import Redis, RedisError import os import socket # Connect to Redis redis = Redis(host="redis", db=0, socket_connect_timeout=2, socket_timeout=2) app = Flask(__name__) @app.route("/") def hello(): try: visits = redis.incr(...
en
0.342116
#! /usr/bin/env python # Connect to Redis
2.640903
3
functions/RedditDownloader.py
RafaelRCamargo/reddit-downloader-plus
0
6628448
<filename>functions/RedditDownloader.py<gh_stars>0 # FRTS # ? Reddit Api + Downloader # * Imports # Sys os import os # Sys Path from pathlib import Path # Date from datetime import datetime # Reddit Downloader from redvid import Downloader # Cool Terminal Colors from rich import print duration = 0 def reddit_downl...
<filename>functions/RedditDownloader.py<gh_stars>0 # FRTS # ? Reddit Api + Downloader # * Imports # Sys os import os # Sys Path from pathlib import Path # Date from datetime import datetime # Reddit Downloader from redvid import Downloader # Cool Terminal Colors from rich import print duration = 0 def reddit_downl...
en
0.605856
# FRTS # ? Reddit Api + Downloader # * Imports # Sys os # Sys Path # Date # Reddit Downloader # Cool Terminal Colors # * Basics # Redvid setup # Video path # Video url # * Defs # Max size of the file in MB # * Props # Auto max video quality based on the file size # Video overwrite method # * Get Videos Stats # * Genera...
3.186541
3
io_scene_webaverse/blender/exp/gltf2_blender_gather_animation_sampler_keyframes.py
chrislatorres/blender-plugin
3
6628449
<reponame>chrislatorres/blender-plugin<gh_stars>1-10 # Copyright 2018-2019 The glTF-Blender-IO authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/...
# Copyright 2018-2019 The glTF-Blender-IO authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
en
0.882033
# Copyright 2018-2019 The glTF-Blender-IO authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
1.626919
2
src/StockSight/EsMap/StockPrice.py
oreoluwa/stocksight
3
6628450
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Stock Price Mapping Copyright (C) <NAME> 2018-2019 Copyright (C) Allen (<NAME>) Xie 2019 stocksight is released under the Apache 2.0 license. See LICENSE for the full license text. """ # set up elasticsearch mappings and create index mapping = { "mappings": { ...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Stock Price Mapping Copyright (C) <NAME> 2018-2019 Copyright (C) Allen (<NAME>) Xie 2019 stocksight is released under the Apache 2.0 license. See LICENSE for the full license text. """ # set up elasticsearch mappings and create index mapping = { "mappings": { ...
en
0.67356
#!/usr/bin/env python # -*- coding: utf-8 -*- Stock Price Mapping Copyright (C) <NAME> 2018-2019 Copyright (C) Allen (<NAME>) Xie 2019 stocksight is released under the Apache 2.0 license. See LICENSE for the full license text. # set up elasticsearch mappings and create index
1.597385
2