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
exp/DFRdatasets/simulate.py
zzzace2000/dropout-feature-rankin
6
2700
<filename>exp/DFRdatasets/simulate.py import argparse import argparse import os import numpy as np import torch from dataloaders.LoaderBase import LoaderBase import exp.feature.feature_utils as feature_utils def run_with_identifier(unit, corr_val, datasize, rank_names, loader, show_ols=True): loader.clear_cache...
<filename>exp/DFRdatasets/simulate.py import argparse import argparse import os import numpy as np import torch from dataloaders.LoaderBase import LoaderBase import exp.feature.feature_utils as feature_utils def run_with_identifier(unit, corr_val, datasize, rank_names, loader, show_ols=True): loader.clear_cache...
en
0.054235
# Ex: 'nn_rank:0.01'. Then extract nn_rank and 0.01 seperately # Run different datasizes / correlations. # Ex: datasizes => [100_0, 200_0, 1000] # Ex: correlations => [1000_0.1, 1000_0.2] # return a dictionary but not a rank!!! # Get the loader # corr_vals = [0., 0.1] # Save containers and rank # Training settings # pa...
2.160632
2
gym_pcgrl/envs/reps/wide_3D_rep.py
JiangZehua/gym-pcgrl
0
2701
from gym_pcgrl.envs.reps.representation3D import Representation3D from PIL import Image from gym import spaces import numpy as np from gym_pcgrl.envs.probs.minecraft.mc_render import reps_3D_render """ The wide representation where the agent can pick the tile position and tile value at each update. """ class Wide3DRep...
from gym_pcgrl.envs.reps.representation3D import Representation3D from PIL import Image from gym import spaces import numpy as np from gym_pcgrl.envs.probs.minecraft.mc_render import reps_3D_render """ The wide representation where the agent can pick the tile position and tile value at each update. """ class Wide3DRep...
en
0.749703
The wide representation where the agent can pick the tile position and tile value at each update. Initialize all the parameters used by that representation Gets the action space used by the wide representation Parameters: length: the current map length width: the current map width height: t...
2.829359
3
ucsmsdk/mometa/adaptor/AdaptorMenloQStats.py
thinkitdata/ucsmsdk
0
2702
<filename>ucsmsdk/mometa/adaptor/AdaptorMenloQStats.py """This module contains the general information for AdaptorMenloQStats ManagedObject.""" from ...ucsmo import ManagedObject from ...ucscoremeta import MoPropertyMeta, MoMeta from ...ucsmeta import VersionMeta class AdaptorMenloQStatsConsts: MENLO_QUEUE_COMPO...
<filename>ucsmsdk/mometa/adaptor/AdaptorMenloQStats.py """This module contains the general information for AdaptorMenloQStats ManagedObject.""" from ...ucsmo import ManagedObject from ...ucscoremeta import MoPropertyMeta, MoMeta from ...ucsmeta import VersionMeta class AdaptorMenloQStatsConsts: MENLO_QUEUE_COMPO...
en
0.432812
This module contains the general information for AdaptorMenloQStats ManagedObject. This is AdaptorMenloQStats class. ((deleteAll|ignore|deleteNonPresent),){0,2}(deleteAll|ignore|deleteNonPresent){0,1} ((none|del|mod|addchild|cascade),){0,4}(none|del|mod|addchild|cascade){0,1} ((removed|created|modified|deleted),){0,3}(...
2.086719
2
python/old_password_test.py
XelaRellum/old_password
0
2703
<filename>python/old_password_test.py<gh_stars>0 import unittest import pytest from old_password import old_password import csv import re @pytest.mark.parametrize("password,expected_hash", [ (None, None), ("", ""), ("a", "<PASSWORD>"), ("abc", "<PASSWORD>"), ("ä", "<PASSWORD>"), ]) def test_old_p...
<filename>python/old_password_test.py<gh_stars>0 import unittest import pytest from old_password import old_password import csv import re @pytest.mark.parametrize("password,expected_hash", [ (None, None), ("", ""), ("a", "<PASSWORD>"), ("abc", "<PASSWORD>"), ("ä", "<PASSWORD>"), ]) def test_old_p...
en
0.96897
spaces in password are skipped tabs in password are skipped
3.174823
3
src/RS_model/train_mlp.py
CindyChen1995/MKR
0
2704
# -*- coding: utf-8 -*- """ ------------------------------------------------- Description : Author : cmy date: 2020/1/2 ------------------------------------------------- """ import datetime import heapq import numpy as np import tensorflow as tf import time from metrics import ndcg_at_k from tr...
# -*- coding: utf-8 -*- """ ------------------------------------------------- Description : Author : cmy date: 2020/1/2 ------------------------------------------------- """ import datetime import heapq import numpy as np import tensorflow as tf import time from metrics import ndcg_at_k from tr...
en
0.38074
# -*- coding: utf-8 -*- ------------------------------------------------- Description : Author : cmy date: 2020/1/2 ------------------------------------------------- # maximun alloc gpu50% of MEM #allocate dynamically # RS training # print(loss) # CTR evaluation # train_auc, train_acc = model.ev...
1.934264
2
pylipid.py
glass-w/PyLipID
0
2705
<filename>pylipid.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Aug 28 19:28:17 2019 @author: <NAME> """ import mdtraj as md import numpy as np import pandas as pd import argparse import sys from collections import defaultdict import pickle import os import matplotlib matplotlib.use('Agg') impo...
<filename>pylipid.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Aug 28 19:28:17 2019 @author: <NAME> """ import mdtraj as md import numpy as np import pandas as pd import argparse import sys from collections import defaultdict import pickle import os import matplotlib matplotlib.use('Agg') impo...
de
0.314234
#!/usr/bin/env python3 # -*- coding: utf-8 -*- Created on Wed Aug 28 19:28:17 2019 @author: <NAME> ################################### ###### Parameter settings ####### ################################### #L56. For coarse-grained \ ########################################## ########## assisting functions ###########...
1.72246
2
main.py
yaakiyu/rt-bot
0
2706
<reponame>yaakiyu/rt-bot # RT by Rext from asyncio import run from discord import Intents, Status, Game, AllowedMentions from core.bot import RT from data import SECRET try: from uvloop import install except ModuleNotFoundError: ... else: install() intents = Intents.default() intents.message_content = True intent...
# RT by Rext from asyncio import run from discord import Intents, Status, Game, AllowedMentions from core.bot import RT from data import SECRET try: from uvloop import install except ModuleNotFoundError: ... else: install() intents = Intents.default() intents.message_content = True intents.members = True bot = RT...
en
0.984642
# RT by Rext
2.119714
2
hiplot/fetchers_demo.py
dmitryvinn/hiplot
1
2707
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import uuid import random import math import time import typing as t from . import experiment as hip # Demos from the README. If one of those ...
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import uuid import random import math import time import typing as t from . import experiment as hip # Demos from the README. If one of those ...
en
0.744307
# Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # Demos from the README. If one of those is modified, please modify the readme as well # This column won't appear in the parallel plot # Column `...
2.110923
2
app/endpoints/common/dtos/ingredient.py
brauls/ingredients-service
0
2708
<reponame>brauls/ingredients-service """Ingredient dto. """ class Ingredient(): """Class to represent an ingredient. """ def __init__(self, name, availability_per_month): self.name = name self.availability_per_month = availability_per_month def __repr__(self): return """{} is t...
"""Ingredient dto. """ class Ingredient(): """Class to represent an ingredient. """ def __init__(self, name, availability_per_month): self.name = name self.availability_per_month = availability_per_month def __repr__(self): return """{} is the name.""".format(self.name)
en
0.806297
Ingredient dto. Class to represent an ingredient. {} is the name.
3.433556
3
barcode.py
kallangerard/grocery-barcode-scanner
0
2709
import logging import groceries.api as groceries import barcodescanner.scan as barcode def main(): grocy = groceries.GrocyAPIClient() while True: scanner = barcode.Scan() line = scanner.PollScanner() if line != None: response = grocy.consume_barcode(line) loggin...
import logging import groceries.api as groceries import barcodescanner.scan as barcode def main(): grocy = groceries.GrocyAPIClient() while True: scanner = barcode.Scan() line = scanner.PollScanner() if line != None: response = grocy.consume_barcode(line) loggin...
none
1
2.432771
2
setup.py
mr-sk/easy-icm-runner
0
2710
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="easy-icm-runner", version="1.0.6", author="<NAME>", author_email="<EMAIL>", description="A wrapper for IBM ICMs Scheduler API Calls", long_description=long_description, long_descri...
import setuptools with open("README.md", "r") as fh: long_description = fh.read() setuptools.setup( name="easy-icm-runner", version="1.0.6", author="<NAME>", author_email="<EMAIL>", description="A wrapper for IBM ICMs Scheduler API Calls", long_description=long_description, long_descri...
en
0.468964
#packages=setuptools.find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]),
1.212759
1
test_molecule.py
zee93/molecule_parser
0
2711
<reponame>zee93/molecule_parser import unittest from molecule import onize_formula, update_equation_with_multiplier, flaten_formula, parse_molecule class MoleculeParserTestCases(unittest.TestCase): def test_onizing_formulas(self): self.assertEqual(onize_formula('H'), 'H1') self.assertEqual(onize_...
import unittest from molecule import onize_formula, update_equation_with_multiplier, flaten_formula, parse_molecule class MoleculeParserTestCases(unittest.TestCase): def test_onizing_formulas(self): self.assertEqual(onize_formula('H'), 'H1') self.assertEqual(onize_formula('H2O'), 'H2O1') ...
none
1
2.856204
3
config.py
lyth031/ptb_lm
0
2712
<reponame>lyth031/ptb_lm<gh_stars>0 # -*- coding: utf-8 -*- class Config(object): def __init__(self): self.init_scale = 0.1 self.learning_rate = 1.0 self.max_grad_norm = 5 self.num_layers = 2 self.slice_size = 30 self.hidden_size = 200 self.max_epoch = 13 ...
# -*- coding: utf-8 -*- class Config(object): def __init__(self): self.init_scale = 0.1 self.learning_rate = 1.0 self.max_grad_norm = 5 self.num_layers = 2 self.slice_size = 30 self.hidden_size = 200 self.max_epoch = 13 self.keep_prob = 0.8 se...
en
0.769321
# -*- coding: utf-8 -*-
1.987269
2
binding.gyp
HupuInc/node-mysql-listener
2
2713
<gh_stars>1-10 { 'targets': [ { # have to specify 'liblib' here since gyp will remove the first one :\ 'target_name': 'mysql_bindings', 'sources': [ 'src/mysql_bindings.cc', 'src/mysql_bindings_connection.cc', 'src/mysql_bindings_result.cc', 'src/mysql_bindings_st...
{ 'targets': [ { # have to specify 'liblib' here since gyp will remove the first one :\ 'target_name': 'mysql_bindings', 'sources': [ 'src/mysql_bindings.cc', 'src/mysql_bindings_connection.cc', 'src/mysql_bindings_result.cc', 'src/mysql_bindings_statement.cc', ...
en
0.877751
# have to specify 'liblib' here since gyp will remove the first one :\ # no Windows support yet... # cflags on OS X are stupid and have to be defined like this
0.994878
1
pymel/__init__.py
GlenWalker/pymel
0
2714
# copyright <NAME> <EMAIL> # created at luma pictures www.luma-pictures.com """ ******************************* PyMEL ******************************* PyMEL makes python scripting in Maya work the way it should. Maya's command module is a direct translation of MEL commands into python functions. The re...
# copyright <NAME> <EMAIL> # created at luma pictures www.luma-pictures.com """ ******************************* PyMEL ******************************* PyMEL makes python scripting in Maya work the way it should. Maya's command module is a direct translation of MEL commands into python functions. The re...
en
0.848182
# copyright <NAME> <EMAIL> # created at luma pictures www.luma-pictures.com ******************************* PyMEL ******************************* PyMEL makes python scripting in Maya work the way it should. Maya's command module is a direct translation of MEL commands into python functions. The result i...
2.102957
2
setup.py
rlbellaire/ActT
2
2715
from setuptools import find_packages, setup setup(name='ActT', version='0.6', description='Active Testing', url='', author='', author_email='none', license='BSD', packages=find_packages(), install_requires=[ 'numpy', 'pandas', 'matplotlib','scipy','scikit-learn',...
from setuptools import find_packages, setup setup(name='ActT', version='0.6', description='Active Testing', url='', author='', author_email='none', license='BSD', packages=find_packages(), install_requires=[ 'numpy', 'pandas', 'matplotlib','scipy','scikit-learn',...
none
1
1.051385
1
Fusion/deltat.py
coylen/pySG
264
2716
# deltat.py time difference calculation for sensor fusion # Released under the MIT License (MIT) # Copyright (c) 2018 <NAME> # Provides TimeDiff function and DeltaT class. # The following notes cover special cases. Where the device performing fusion # is linked to the IMU and is running MicroPython no special treatmen...
# deltat.py time difference calculation for sensor fusion # Released under the MIT License (MIT) # Copyright (c) 2018 <NAME> # Provides TimeDiff function and DeltaT class. # The following notes cover special cases. Where the device performing fusion # is linked to the IMU and is running MicroPython no special treatmen...
en
0.892833
# deltat.py time difference calculation for sensor fusion # Released under the MIT License (MIT) # Copyright (c) 2018 <NAME> # Provides TimeDiff function and DeltaT class. # The following notes cover special cases. Where the device performing fusion # is linked to the IMU and is running MicroPython no special treatment...
3.005762
3
colour/models/rgb/datasets/sony.py
wenh06/colour
1
2717
# -*- coding: utf-8 -*- """ Sony Colourspaces ================= Defines the *Sony* colourspaces: - :attr:`colour.models.RGB_COLOURSPACE_S_GAMUT`. - :attr:`colour.models.RGB_COLOURSPACE_S_GAMUT3`. - :attr:`colour.models.RGB_COLOURSPACE_S_GAMUT3_CINE`. - :attr:`colour.models.RGB_COLOURSPACE_VENICE_S_GAMUT3`. - ...
# -*- coding: utf-8 -*- """ Sony Colourspaces ================= Defines the *Sony* colourspaces: - :attr:`colour.models.RGB_COLOURSPACE_S_GAMUT`. - :attr:`colour.models.RGB_COLOURSPACE_S_GAMUT3`. - :attr:`colour.models.RGB_COLOURSPACE_S_GAMUT3_CINE`. - :attr:`colour.models.RGB_COLOURSPACE_VENICE_S_GAMUT3`. - ...
en
0.305922
# -*- coding: utf-8 -*- Sony Colourspaces ================= Defines the *Sony* colourspaces: - :attr:`colour.models.RGB_COLOURSPACE_S_GAMUT`. - :attr:`colour.models.RGB_COLOURSPACE_S_GAMUT3`. - :attr:`colour.models.RGB_COLOURSPACE_S_GAMUT3_CINE`. - :attr:`colour.models.RGB_COLOURSPACE_VENICE_S_GAMUT3`. - :a...
1.456939
1
network.py
QiaoZhongzheng/EWC-sample-PMNIST
0
2718
# -*- coding: UTF-8 -*- '''================================================= @Project -> File :EWC -> network @IDE :PyCharm @Author :<NAME> @Date :2021/6/23 20:28 @Desc : ==================================================''' from tensorflow.keras import Model from tensorflow.keras.layers import Dense, Conv2D,L...
# -*- coding: UTF-8 -*- '''================================================= @Project -> File :EWC -> network @IDE :PyCharm @Author :<NAME> @Date :2021/6/23 20:28 @Desc : ==================================================''' from tensorflow.keras import Model from tensorflow.keras.layers import Dense, Conv2D,L...
fr
0.310614
# -*- coding: UTF-8 -*- ================================================= @Project -> File :EWC -> network @IDE :PyCharm @Author :<NAME> @Date :2021/6/23 20:28 @Desc : ================================================== # x = Dense(128,activation='relu')(input) # x = Dense(64,activation='relu')(x) # x = Dense(3...
3.138446
3
src/quanguru/classes/exceptions.py
Qfabiolous/QuanGuru
0
2719
<reponame>Qfabiolous/QuanGuru<gh_stars>0 # TODO turn prints into actual error raise, they are print for testing def qSystemInitErrors(init): def newFunction(obj, **kwargs): init(obj, **kwargs) if obj._genericQSys__dimension is None: className = obj.__class__.__name__ print(c...
# TODO turn prints into actual error raise, they are print for testing def qSystemInitErrors(init): def newFunction(obj, **kwargs): init(obj, **kwargs) if obj._genericQSys__dimension is None: className = obj.__class__.__name__ print(className + ' requires a dimension') ...
en
0.527598
# TODO turn prints into actual error raise, they are print for testing # pylint: disable=protected-access # pylint: disable=protected-access #for ind in range(len(obj._qCoupling__qSys)): # if len(obj._qCoupling__cFncs) != len(obj._qCoupling__qSys): # className = obj.__class__.__name__ # print(className...
2.590055
3
reagent/gym/tests/test_gym.py
alexnikulkov/ReAgent
0
2720
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import logging import os import pprint import unittest import numpy as np # pyre-fixme[21]: Could not find module `pytest`. import pytest import torch from parameterized import parameterized from reagent.core.types import R...
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. import logging import os import pprint import unittest import numpy as np # pyre-fixme[21]: Could not find module `pytest`. import pytest import torch from parameterized import parameterized from reagent.core.types import R...
en
0.749771
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. # pyre-fixme[21]: Could not find module `pytest`. # Use internal runner or OSS otherwise # for seeding the environment Put on-policy gym tests here in the format (test name, path to yaml config). Format path to be: "configs/<...
1.706114
2
src/deep_dialog/usersims/usersim.py
CommissarSilver/TC-Bot
1
2721
<reponame>CommissarSilver/TC-Bot<gh_stars>1-10 """ Created on June 7, 2016 a rule-based user simulator @author: xiul, t-zalipt """ import random class UserSimulator: """ Parent class for all user sims to inherit from """ def __init__(self, movie_dict=None, act_set=None, slot_set=None, star...
""" Created on June 7, 2016 a rule-based user simulator @author: xiul, t-zalipt """ import random class UserSimulator: """ Parent class for all user sims to inherit from """ def __init__(self, movie_dict=None, act_set=None, slot_set=None, start_set=None, params=None): """ Constructo...
en
0.886609
Created on June 7, 2016 a rule-based user simulator @author: xiul, t-zalipt Parent class for all user sims to inherit from Constructor shared by all user simulators Initialize a new episode (dialog) Add NL to User Dia_Act # NLU #user_nlu_res['diaact'] = user_action['diaact'] # or not?
2.779839
3
kendall_w/__init__.py
ugolbck/KendallW
4
2722
<gh_stars>1-10 from .kendall_w import compute_w __version__ = (1, 0, 0)
from .kendall_w import compute_w __version__ = (1, 0, 0)
none
1
1.129448
1
admin.py
nielsrolf/django-error-logs
0
2723
from django.contrib import admin from .models import * # Register your models here. admin.site.register(ErrorGroup) admin.site.register(Error)
from django.contrib import admin from .models import * # Register your models here. admin.site.register(ErrorGroup) admin.site.register(Error)
en
0.968259
# Register your models here.
1.360247
1
mcpython/common/block/ISlab.py
mcpython4-coding/core
2
2724
<filename>mcpython/common/block/ISlab.py """ mcpython - a minecraft clone written in python licenced under the MIT-licence (https://github.com/mcpython4-coding/core) Contributors: uuk, xkcdjerry (inactive) Based on the game of fogleman (https://github.com/fogleman/Minecraft), licenced under the MIT-licence Original ...
<filename>mcpython/common/block/ISlab.py """ mcpython - a minecraft clone written in python licenced under the MIT-licence (https://github.com/mcpython4-coding/core) Contributors: uuk, xkcdjerry (inactive) Based on the game of fogleman (https://github.com/fogleman/Minecraft), licenced under the MIT-licence Original ...
en
0.838346
mcpython - a minecraft clone written in python licenced under the MIT-licence (https://github.com/mcpython4-coding/core) Contributors: uuk, xkcdjerry (inactive) Based on the game of fogleman (https://github.com/fogleman/Minecraft), licenced under the MIT-licence Original game "minecraft" by Mojang Studios (www.minec...
2.229855
2
CourseOutlineBackend/courseoutline/serializers.py
stancsz/web-development-project-ensf-607
0
2725
from rest_framework import serializers from .models import * class CoordinatorSerializer(serializers.ModelSerializer): # ModelID = serializers.CharField(max_length=100, required=True) CourseID = serializers.CharField(max_length=100, required=True) FName = serializers.CharField(max_length=100, required=Fa...
from rest_framework import serializers from .models import * class CoordinatorSerializer(serializers.ModelSerializer): # ModelID = serializers.CharField(max_length=100, required=True) CourseID = serializers.CharField(max_length=100, required=True) FName = serializers.CharField(max_length=100, required=Fa...
en
0.607095
# ModelID = serializers.CharField(max_length=100, required=True) # Once the request data has been validated, we can create a todo item instance in the database # Once the request data has been validated, we can update the todo item instance in the database # ModelID = serializers.CharField(max_length=100, required=True...
2.309039
2
tools/math_tools.py
oliverscheer/python-pytest-ci
0
2726
<filename>tools/math_tools.py """ some math tools """ class MathTools: """ some math tools """ def add(a, b): """ add two values """ return a + b def sub(a, b): """ subtract two values """
<filename>tools/math_tools.py """ some math tools """ class MathTools: """ some math tools """ def add(a, b): """ add two values """ return a + b def sub(a, b): """ subtract two values """
en
0.42262
some math tools some math tools add two values subtract two values
2.000977
2
hackerrank/Algorithms/Correctness and the Loop Invariant/solution.py
ATrain951/01.python-com_Qproject
4
2727
def insertion_sort(l): for i in range(1, len(l)): j = i - 1 key = l[i] while (j >= 0) and (l[j] > key): l[j + 1] = l[j] j -= 1 l[j + 1] = key m = int(input().strip()) ar = [int(i) for i in input().strip().split()] insertion_sort(ar) print(" ".join(map(str, a...
def insertion_sort(l): for i in range(1, len(l)): j = i - 1 key = l[i] while (j >= 0) and (l[j] > key): l[j + 1] = l[j] j -= 1 l[j + 1] = key m = int(input().strip()) ar = [int(i) for i in input().strip().split()] insertion_sort(ar) print(" ".join(map(str, a...
none
1
3.671704
4
cvp_rest_api_examples/cvpLabelAdd.py
kakkotetsu/CVP-Scripts
8
2728
<gh_stars>1-10 #!/usrb/bin/env python # Copyright (c) 2019, Arista Networks, Inc. # All rights reserved. # # 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 copyri...
#!/usrb/bin/env python # Copyright (c) 2019, Arista Networks, Inc. # All rights reserved. # # 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, # t...
en
0.65514
#!/usrb/bin/env python # Copyright (c) 2019, Arista Networks, Inc. # All rights reserved. # # 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, # t...
1.482624
1
frontends/pytorch/python/torch_mlir_torchscript_e2e_test_configs/torchscript.py
raikonenfnu/mlir-npcomp
0
2729
<reponame>raikonenfnu/mlir-npcomp<filename>frontends/pytorch/python/torch_mlir_torchscript_e2e_test_configs/torchscript.py # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-except...
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception import copy from typing import Any import torch from torch_mlir_torchscript.e2e_test.framework import TestConfig, Tr...
en
0.684246
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception TestConfig that runs the torch.nn.Module through TorchScript # TODO: Deepcopy the torch.jit.ScriptModule, so that if th...
2.06221
2
app/balltracking/pubnubpython/pnconfiguration.py
gdmgent-1718-wot/interactive-wall
0
2730
<reponame>gdmgent-1718-wot/interactive-wall from .enums import PNHeartbeatNotificationOptions, PNReconnectionPolicy from . import utils class PNConfiguration(object): DEFAULT_PRESENCE_TIMEOUT = 300 DEFAULT_HEARTBEAT_INTERVAL = 280 def __init__(self): # TODO: add validation self.uuid = Non...
from .enums import PNHeartbeatNotificationOptions, PNReconnectionPolicy from . import utils class PNConfiguration(object): DEFAULT_PRESENCE_TIMEOUT = 300 DEFAULT_HEARTBEAT_INTERVAL = 280 def __init__(self): # TODO: add validation self.uuid = None self.origin = "ps.pndsn.com" ...
en
0.103107
# TODO: add validation # TODO: set log level # TODO: set log level
2.252395
2
tests/scripts/thread-cert/thread_cert.py
lmaciejonczyk/openthread
0
2731
<filename>tests/scripts/thread-cert/thread_cert.py #!/usr/bin/env python3 # # Copyright (c) 2019, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions ...
<filename>tests/scripts/thread-cert/thread_cert.py #!/usr/bin/env python3 # # Copyright (c) 2019, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions ...
en
0.763824
#!/usr/bin/env python3 # # Copyright (c) 2019, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # ...
1.469009
1
FaceMaskDetection with webcam.py
Anurag-Varma/facemask-detection
1
2732
import cv2 import numpy as np from keras.models import model_from_json from keras.preprocessing.image import img_to_array #load model model = model_from_json(open("fer.json", "r").read()) #change the path accoring to files #load weights model.load_weights('fer.h5') #change the path accor...
import cv2 import numpy as np from keras.models import model_from_json from keras.preprocessing.image import img_to_array #load model model = model_from_json(open("fer.json", "r").read()) #change the path accoring to files #load weights model.load_weights('fer.h5') #change the path accor...
en
0.812276
#load model #change the path accoring to files #load weights #change the path accoring to files #change the path accoring to files #default 0 for webcam #Press ESC to stop/exit
2.483634
2
language/Basics/stringformatting.py
Binary-bug/Python
0
2733
<reponame>Binary-bug/Python<filename>language/Basics/stringformatting.py<gh_stars>0 age = 24 print("My age is " + str(age) + " years ") # the above procedure is tedious since we dont really want to include str for every number we encounter #Method1 Replacement Fields print("My age is {0} years ".format(age)) # {0}...
age = 24 print("My age is " + str(age) + " years ") # the above procedure is tedious since we dont really want to include str for every number we encounter #Method1 Replacement Fields print("My age is {0} years ".format(age)) # {0} is the actual replacement field, number important for multiple replacement fields ...
en
0.780602
# the above procedure is tedious since we dont really want to include str for every number we encounter #Method1 Replacement Fields # {0} is the actual replacement field, number important for multiple replacement fields #each of the arguments of .format are matched to their respective replacement fields January:{2} Feb...
4.004763
4
toggl.py
ulrikpedersen/toggl-gnome-applet
0
2734
#!/usr/bin/env python import logging from datetime import datetime logging.basicConfig(level=logging.WARNING) import os import urllib2, base64, json import dateutil.parser def from_ISO8601( str_iso8601 ): return dateutil.parser.parse(str_iso8601) def to_ISO8601( timestamp ): return timestamp.isoformat() de...
#!/usr/bin/env python import logging from datetime import datetime logging.basicConfig(level=logging.WARNING) import os import urllib2, base64, json import dateutil.parser def from_ISO8601( str_iso8601 ): return dateutil.parser.parse(str_iso8601) def to_ISO8601( timestamp ): return timestamp.isoformat() de...
en
0.628302
#!/usr/bin/env python # Search for an Toggl API token in a list of files # No validation of the collected token # TODO: encryption of tokenfiles could be nice Send a request or command to Toggl, retrieve and parse the json response. returns a list of dictionary objects. Throws an exception if the http r...
2.445836
2
gs_divergence/symmetrized_geodesical_skew_divergence.py
ISMHinoLab/geodesical_skew_divergence
7
2735
from typing import Optional import torch from gs_divergence import gs_div def symmetrized_gs_div( input: torch.Tensor, target: torch.Tensor, alpha: float = -1, lmd: float = 0.5, reduction: Optional[str] = 'sum', ) -> torch.Tensor: lhs = gs_div(input, target, alpha=alpha, lmd=lmd, reduction=re...
from typing import Optional import torch from gs_divergence import gs_div def symmetrized_gs_div( input: torch.Tensor, target: torch.Tensor, alpha: float = -1, lmd: float = 0.5, reduction: Optional[str] = 'sum', ) -> torch.Tensor: lhs = gs_div(input, target, alpha=alpha, lmd=lmd, reduction=re...
none
1
2.50906
3
train.py
kushaliitm/deep-learning
0
2736
<gh_stars>0 import argparse import helper as hp import torch import os import json parser = argparse.ArgumentParser(description = 'train.py') parser.add_argument('--data-dir', nargs = '*', action = "store", default = "./flowers/", help = "folder path for data") parser.add_argument('--save-dir', action = "store", requ...
import argparse import helper as hp import torch import os import json parser = argparse.ArgumentParser(description = 'train.py') parser.add_argument('--data-dir', nargs = '*', action = "store", default = "./flowers/", help = "folder path for data") parser.add_argument('--save-dir', action = "store", required=True, h...
en
0.565925
# saving parameters # load the data - data_load() from help.py # build model # train model # checkpoint the model
2.470718
2
Euler0001.py
rbarillec/project_euler
0
2737
def Euler0001(): max = 1000 sum = 0 for i in range(1, max): if i%3 == 0 or i%5 == 0: sum += i print(sum) Euler0001()
def Euler0001(): max = 1000 sum = 0 for i in range(1, max): if i%3 == 0 or i%5 == 0: sum += i print(sum) Euler0001()
none
1
3.651645
4
models/blip.py
lmathia2/BLIP
0
2738
''' * Copyright (c) 2022, salesforce.com, inc. * All rights reserved. * SPDX-License-Identifier: BSD-3-Clause * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause * By <NAME> ''' import warnings warnings.filterwarnings("ignore") from models.vit import Visi...
''' * Copyright (c) 2022, salesforce.com, inc. * All rights reserved. * SPDX-License-Identifier: BSD-3-Clause * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause * By <NAME> ''' import warnings warnings.filterwarnings("ignore") from models.vit import Visi...
en
0.586818
* Copyright (c) 2022, salesforce.com, inc. * All rights reserved. * SPDX-License-Identifier: BSD-3-Clause * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause * By <NAME> Args: med_config (str): path for the mixture of encoder-decoder model's con...
1.93586
2
venv/Lib/site-packages/pandas/tests/reshape/merge/test_multi.py
OliviaNabbosa89/Disaster_Responses
0
2739
<gh_stars>0 import numpy as np from numpy.random import randn import pytest import pandas as pd from pandas import DataFrame, Index, MultiIndex, Series import pandas._testing as tm from pandas.core.reshape.concat import concat from pandas.core.reshape.merge import merge @pytest.fixture def left(): "...
import numpy as np from numpy.random import randn import pytest import pandas as pd from pandas import DataFrame, Index, MultiIndex, Series import pandas._testing as tm from pandas.core.reshape.concat import concat from pandas.core.reshape.merge import merge @pytest.fixture def left(): """left dataf...
en
0.698316
left dataframe (not multi-indexed) for multi-index join tests # a little relevant example with NAs right dataframe (multi-indexed) for multi-index join tests # a little relevant example with NAs # inject some nulls # compare left vs right merge with multikey # Reorder columns # GH29522 # ~ 40000000 possible unique grou...
2.532327
3
test/api/test_histories.py
mmiladi/galaxy
1
2740
<filename>test/api/test_histories.py # -*- coding: utf-8 -*- from requests import ( get, post, put ) from base import api # noqa: I100 from base.populators import ( # noqa: I100 DatasetCollectionPopulator, DatasetPopulator, wait_on ) class HistoriesApiTestCase(api.ApiTestCase): def set...
<filename>test/api/test_histories.py # -*- coding: utf-8 -*- from requests import ( get, post, put ) from base import api # noqa: I100 from base.populators import ( # noqa: I100 DatasetCollectionPopulator, DatasetPopulator, wait_on ) class HistoriesApiTestCase(api.ApiTestCase): def set...
en
0.875299
# -*- coding: utf-8 -*- # noqa: I100 # noqa: I100 # Create a history. # Make sure new history appears in index of user's histories. # Setup a history and ensure it is in the index # Delete the history # Check can view it - but it is deleted # Verify it is dropped from history index # Add deleted filter to index to view...
2.469616
2
Algorithms_easy/0461. Hamming Distance.py
VinceW0/Leetcode_Python_solutions
4
2741
""" 0461. Hamming Distance The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calculate the Hamming distance. Note: 0 ≤ x, y < 231. Example: Input: x = 1, y = 4 Output: 2 Explanation: 1 (0 0 0 1) 4 (0 1 0 0) ↑ ...
""" 0461. Hamming Distance The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calculate the Hamming distance. Note: 0 ≤ x, y < 231. Example: Input: x = 1, y = 4 Output: 2 Explanation: 1 (0 0 0 1) 4 (0 1 0 0) ↑ ...
en
0.816083
0461. Hamming Distance The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calculate the Hamming distance. Note: 0 ≤ x, y < 231. Example: Input: x = 1, y = 4 Output: 2 Explanation: 1 (0 0 0 1) 4 (0 1 0 0) ↑ ↑ ...
4.129011
4
AllProjects/Projects/Spider/DownloadImage.py
CoderXAndZ/PycharmProjects
3
2742
#! /usr/local/bin/python3 # -*- coding: UTF-8 -*- # 抓取 妹子图 并存储 import urllib.request import os import random def open_url(url): request = urllib.request.Request(url) request.add_header('User-Agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Firefox/60.0') ...
#! /usr/local/bin/python3 # -*- coding: UTF-8 -*- # 抓取 妹子图 并存储 import urllib.request import os import random def open_url(url): request = urllib.request.Request(url) request.add_header('User-Agent', 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Firefox/60.0') ...
zh
0.949148
#! /usr/local/bin/python3 # -*- coding: UTF-8 -*- # 抓取 妹子图 并存储 # 添加代理,改变 ip # 创建 # 安装 # 访问网页 # 获取图片id # 根据 url 获取图片添加到数组并返回 # 找到字符串 # 保存图片 # 下载图片 # 图片列表
2.902579
3
utility/extractor_batch.py
BA-HanseML/NF_Prj_MIMII_Dataset
10
2743
<reponame>BA-HanseML/NF_Prj_MIMII_Dataset<filename>utility/extractor_batch.py print('load extractor_batch') # Utility to run multiple feature extraction # diagrams over many files with multiple threats import pandas as pd import os import sys import glob from tqdm.auto import tqdm from queue import Queue ...
print('load extractor_batch') # Utility to run multiple feature extraction # diagrams over many files with multiple threats import pandas as pd import os import sys import glob from tqdm.auto import tqdm from queue import Queue from threading import Thread from datetime import datetime import time im...
en
0.802614
# Utility to run multiple feature extraction # diagrams over many files with multiple threats # thread class # Get the work from the queue and expand the tuple # execute diagaram # create file handler which logs even debug messages #print(self.fh) #print(done, end ="--") # Main Function # create one augmentation for a ...
2.389805
2
multitenancy/context_processors.py
cmalek/django-site-multitenancy
0
2744
from .models import Tenant def tenant(request): """ Return context variables required by apps that use django-site-multitenancy. If there is no 'tenant' attribute in the request, extract one from the request. """ if hasattr(request, 'tenant'): tenant = request.tenant else: ten...
from .models import Tenant def tenant(request): """ Return context variables required by apps that use django-site-multitenancy. If there is no 'tenant' attribute in the request, extract one from the request. """ if hasattr(request, 'tenant'): tenant = request.tenant else: ten...
en
0.77009
Return context variables required by apps that use django-site-multitenancy. If there is no 'tenant' attribute in the request, extract one from the request.
2.338992
2
hello/forms.py
odhiambocuttice/mypersonalapp
0
2745
<filename>hello/forms.py from django import forms from .models import Project class ProjectForm(forms.ModelForm): class Meta: model = Project fields = ["title", "describe", "technology"]
<filename>hello/forms.py from django import forms from .models import Project class ProjectForm(forms.ModelForm): class Meta: model = Project fields = ["title", "describe", "technology"]
none
1
1.936777
2
pset_classes/class_basics/solutions/p1.py
mottaquikarim/pydev-psets
5
2746
<reponame>mottaquikarim/pydev-psets """ Person class """ # Create a Person class with the following properties # 1. name # 2. age # 3. social security number class Person: def __init__(self, name, age, social_number): self.name = name self.age = age self.social = social_number p1 = Pers...
""" Person class """ # Create a Person class with the following properties # 1. name # 2. age # 3. social security number class Person: def __init__(self, name, age, social_number): self.name = name self.age = age self.social = social_number p1 = Person("John", 36, "111-11-1111") print...
en
0.694034
Person class # Create a Person class with the following properties # 1. name # 2. age # 3. social security number
4.002223
4
python/paddle/fluid/contrib/slim/tests/test_imperative_out_scale.py
huangxu96/Paddle
0
2747
# copyright (c) 2018 paddlepaddle authors. 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. # you may obtain a copy of the license at # # http://www.apache.org/licenses/license-2.0 # # unless required by app...
# copyright (c) 2018 paddlepaddle authors. 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. # you may obtain a copy of the license at # # http://www.apache.org/licenses/license-2.0 # # unless required by app...
en
0.838172
# copyright (c) 2018 paddlepaddle authors. 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. # you may obtain a copy of the license at # # http://www.apache.org/licenses/license-2.0 # # unless required by app...
1.557017
2
grr/server/hunts/results.py
nickamon/grr
0
2748
<gh_stars>0 #!/usr/bin/env python """Classes to store and manage hunt results. """ from grr.lib import rdfvalue from grr.lib import registry from grr.lib.rdfvalues import structs as rdf_structs from grr_response_proto import jobs_pb2 from grr.server import access_control from grr.server import aff4 from grr.server imp...
#!/usr/bin/env python """Classes to store and manage hunt results. """ from grr.lib import rdfvalue from grr.lib import registry from grr.lib.rdfvalues import structs as rdf_structs from grr_response_proto import jobs_pb2 from grr.server import access_control from grr.server import aff4 from grr.server import data_sto...
en
0.864076
#!/usr/bin/env python Classes to store and manage hunt results. # TODO(amoser): The subpath could be part of the notification. A global queue of hunt results which need to be processed. Return unclaimed hunt result notifications for collection. Args: token: The security token to perform database operations w...
2.252306
2
src/simple_sharepoint/site.py
NodeJSmith/py-simple-rest-sharepoint
0
2749
""" Module for higher level SharePoint REST api actions - utilize methods in the api.py module """ class Site(): def __init__(self, sp): self.sp = sp @property def info(self): endpoint = "_api/site" value = self.sp.get(endpoint).json() return value @property def w...
""" Module for higher level SharePoint REST api actions - utilize methods in the api.py module """ class Site(): def __init__(self, sp): self.sp = sp @property def info(self): endpoint = "_api/site" value = self.sp.get(endpoint).json() return value @property def w...
en
0.503314
Module for higher level SharePoint REST api actions - utilize methods in the api.py module # def set_title_field_to_optional(self, list_title): # """Sets the Title field in the given list to optional # :param list_title: str: title of SharePoint list # """ # # TODO - this likely is not necessary anymore...
2.535972
3
pypeit/tests/test_metadata.py
rcooke-ast/PYPIT
0
2750
import os import glob import shutil import yaml from IPython import embed import pytest import numpy as np from pypeit.par.util import parse_pypeit_file from pypeit.pypeitsetup import PypeItSetup from pypeit.tests.tstutils import dev_suite_required, data_path from pypeit.metadata import PypeItMetaData from pypeit.s...
import os import glob import shutil import yaml from IPython import embed import pytest import numpy as np from pypeit.par.util import parse_pypeit_file from pypeit.pypeitsetup import PypeItSetup from pypeit.tests.tstutils import dev_suite_required, data_path from pypeit.metadata import PypeItMetaData from pypeit.s...
en
0.337926
# ------------------------------------------------------------------ # In case of failed tests # ------------------------------------------------------------------ # Generate the pypeit file with the comb_id # Get the spectrograph # Set the metadata #global_frames=['bias', 'dark']) # Test #global_frames=['bias', 'dark'...
1.87217
2
tortoise/query_utils.py
DDevine/tortoise-orm
1
2751
<gh_stars>1-10 from copy import copy from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Type, cast from pypika import Table from pypika.terms import Criterion from tortoise.exceptions import FieldError, OperationalError from tortoise.fields.relational import BackwardFKRelation, ManyToManyFieldInstanc...
from copy import copy from typing import TYPE_CHECKING, Any, Dict, List, Optional, Tuple, Type, cast from pypika import Table from pypika.terms import Criterion from tortoise.exceptions import FieldError, OperationalError from tortoise.fields.relational import BackwardFKRelation, ManyToManyFieldInstance, RelationalFi...
en
0.832823
# pragma: nocoverage # type: ignore # type: ignore Internal structure used to generate SQL Queries. # TODO: This could be optimized? # TODO: This could be optimized? Returns a tuple of the query criterion. Q Expression container. Q Expressions are a useful tool to compose a query from many small parts. :param ...
2.053892
2
L3_numpy_pandas_2D/B_NumPy_Axis.py
angelmtenor/IDAFC
0
2752
<reponame>angelmtenor/IDAFC<gh_stars>0 import numpy as np # Change False to True for this block of code to see what it does # NumPy axis argument if True: a = np.array([ [1, 2, 3], [4, 5, 6], [7, 8, 9] ]) print(a.sum()) print(a.sum(axis=0)) print(a.sum(axis=1)) # Subway r...
import numpy as np # Change False to True for this block of code to see what it does # NumPy axis argument if True: a = np.array([ [1, 2, 3], [4, 5, 6], [7, 8, 9] ]) print(a.sum()) print(a.sum(axis=0)) print(a.sum(axis=1)) # Subway ridership for 5 stations on 10 different...
en
0.888905
# Change False to True for this block of code to see what it does # NumPy axis argument # Subway ridership for 5 stations on 10 different days Fill in this function. First, for each subway station, calculate the mean ridership per day. Then, out of all the subway stations, return the maximum and minimum of thes...
4.050072
4
Protein-ligand-binding/TopBio/Feature/LigandFeature.py
WeilabMSU/TopologyNet
1
2753
import numpy as np import pickle import os def GenerateFeature_alpha(ligand_name, working_dir): Cut = 12.0 LIGELE = ['C','N','O','S','CN','CO','CS','NO','NS','OS','CCl','CBr','CP','CF','CNO','CNS','COS','NOS','CNOS','CNOSPFClBrI','H','CH','NH','OH','SH','CNH','COH','CSH','NOH','NSH','OSH','CNOH','CNSH','COSH'...
import numpy as np import pickle import os def GenerateFeature_alpha(ligand_name, working_dir): Cut = 12.0 LIGELE = ['C','N','O','S','CN','CO','CS','NO','NS','OS','CCl','CBr','CP','CF','CNO','CNS','COS','NOS','CNOS','CNOSPFClBrI','H','CH','NH','OH','SH','CNH','COH','CSH','NOH','NSH','OSH','CNOH','CNSH','COSH'...
none
1
2.320833
2
emailthreads/util.py
emersion/python-emailthreads
34
2754
<filename>emailthreads/util.py import re import sys from email.message import EmailMessage def get_message_by_id(msgs, msg_id): # TODO: handle weird brackets stuff for msg in msgs: if msg["message-id"] == msg_id: return msg return None def strip_prefix(s, prefix): if s.startswith(prefix): s = s[len(prefix)...
<filename>emailthreads/util.py import re import sys from email.message import EmailMessage def get_message_by_id(msgs, msg_id): # TODO: handle weird brackets stuff for msg in msgs: if msg["message-id"] == msg_id: return msg return None def strip_prefix(s, prefix): if s.startswith(prefix): s = s[len(prefix)...
en
0.615294
# TODO: handle weird brackets stuff # TODO: more of these # TODO: more of these # No-break space
2.909734
3
trainval.py
JanAlexanderPersonal/covid19_weak_supervision
0
2755
<gh_stars>0 from haven import haven_chk as hc from haven import haven_results as hr from haven import haven_utils as hu import torch import torchvision import tqdm import pandas as pd import pprint import itertools import os import pylab as plt import exp_configs import time import numpy as np from src import models f...
from haven import haven_chk as hc from haven import haven_results as hr from haven import haven_utils as hu import torch import torchvision import tqdm import pandas as pd import pprint import itertools import os import pylab as plt import exp_configs import time import numpy as np from src import models from src impo...
en
0.506087
Setup the logger for this module # Create the Logger # bookkeepting stuff # ================== # set seed # ================== # Dataset # ================== # train set # val set # test set # val_sampler = torch.utils.data.SequentialSampler(val_set) # sampler=val_sampler, # sampler=val_sampler, # Model # =============...
2.024898
2
languages/pt-br.py
unimauro/eden
1
2756
<filename>languages/pt-br.py # coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" é uma expressão opcional como "field1=\'newvalue\'". Não é possível atualizar ou excluir os resultados de uma junção', '# of International Staff'...
<filename>languages/pt-br.py # coding: utf8 { '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" é uma expressão opcional como "field1=\'newvalue\'". Não é possível atualizar ou excluir os resultados de uma junção', '# of International Staff'...
pt
0.794051
# coding: utf8 #': 'Número de Telefone de doaçao', # of households who are affected by the emergency': '# estimado das famílias que são afetados pela emergência', # of people who are affected by the emergency': '# estimado de pessoas que são afetados pela emergência', # of Target Beneficiaries': 'Nº Total de Beneficiár...
2.256502
2
pyxq/app/__init__.py
goodchinas/pyxq
4
2757
<reponame>goodchinas/pyxq<filename>pyxq/app/__init__.py from .. import ba, cb, actor from ..service import account class A0(ba.App): center: cb.CallBackManager a: account.Account def __init__(self, stg: actor.GateWay): a = account.Account() center = cb.CallBackManager() stg.init(a...
from .. import ba, cb, actor from ..service import account class A0(ba.App): center: cb.CallBackManager a: account.Account def __init__(self, stg: actor.GateWay): a = account.Account() center = cb.CallBackManager() stg.init(a=a, center=center, broker=cb.CallBackManager()) ...
none
1
2.506222
3
python-files/Analysis/plot_rber_curve.py
AdrianLundell/ldpc-investigation-master-thesis
1
2758
#%% #Calculate_capacity
#%% #Calculate_capacity
en
0.172854
#%% #Calculate_capacity
0.980909
1
2_b_builtins_dynamic_recall.py
traff/python_completion_benchmark
1
2759
<reponame>traff/python_completion_benchmark import builtins builtins.foo = 'bar' foo # foo
import builtins builtins.foo = 'bar' foo # foo
none
1
1.306384
1
gva/data/validator/__init__.py
gva-jhabte/gva-data
0
2760
<reponame>gva-jhabte/gva-data """ Schema Validation Tests a dictionary against a schema to test for conformity. Schema definition is similar to - but not the same as - avro schemas Supported Types: - string - a character sequence - format - numeric - a number - min: - max ...
""" Schema Validation Tests a dictionary against a schema to test for conformity. Schema definition is similar to - but not the same as - avro schemas Supported Types: - string - a character sequence - format - numeric - a number - min: - max - date - a datetime.date or...
en
0.60607
Schema Validation Tests a dictionary against a schema to test for conformity. Schema definition is similar to - but not the same as - avro schemas Supported Types: - string - a character sequence - format - numeric - a number - min: - max - date - a datetime.date or an i...
3.276876
3
fuzzers/ECP5/050-pio_routing/fuzzer.py
umarcor/prjtrellis
256
2761
<reponame>umarcor/prjtrellis from fuzzconfig import FuzzConfig import interconnect import nets import pytrellis import re jobs = [ { "pos": [(47, 0), (48, 0), (49, 0)], "cfg": FuzzConfig(job="PIOROUTEL", family="ECP5", device="LFE5U-45F", ncl="pioroute.ncl", tiles=["MIB_R4...
from fuzzconfig import FuzzConfig import interconnect import nets import pytrellis import re jobs = [ { "pos": [(47, 0), (48, 0), (49, 0)], "cfg": FuzzConfig(job="PIOROUTEL", family="ECP5", device="LFE5U-45F", ncl="pioroute.ncl", tiles=["MIB_R47C0:PICL0", "MIB_R48C0:PICL1"...
en
0.848021
# Put fixed connections in the most appropriate tile
1.740347
2
convnet3d/backend/tensorflow_backend.py
yecharlie/convnet3d
6
2762
import tensorflow as tf def _is_tensor(x): """Returns `True` if `x` is a symbolic tensor-like object. From http://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/image_ops_impl.py Args: x: A python object to check. Returns: `True` if `x` is a `tf.Tensor` or `tf.Va...
import tensorflow as tf def _is_tensor(x): """Returns `True` if `x` is a symbolic tensor-like object. From http://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/image_ops_impl.py Args: x: A python object to check. Returns: `True` if `x` is a `tf.Tensor` or `tf.Va...
en
0.815275
Returns `True` if `x` is a symbolic tensor-like object. From http://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/image_ops_impl.py Args: x: A python object to check. Returns: `True` if `x` is a `tf.Tensor` or `tf.Variable`, otherwise `False`. Returns the dimensions o...
3.231036
3
extensions/everywhere.py
cobrab11/black1-bot
3
2763
<gh_stars>1-10 # BS mark.1-55 # /* coding: utf-8 */ # BlackSmith plugin # everywhere_plugin.py # Coded by: WitcherGeralt (<EMAIL>) # http://witcher-team.ucoz.ru/ def handler_everywhere(type, source, body): if body: args = body.split() if len(args) >= 2: mtype = args[0].strip().lower() if mtype == u'чат'...
# BS mark.1-55 # /* coding: utf-8 */ # BlackSmith plugin # everywhere_plugin.py # Coded by: WitcherGeralt (<EMAIL>) # http://witcher-team.ucoz.ru/ def handler_everywhere(type, source, body): if body: args = body.split() if len(args) >= 2: mtype = args[0].strip().lower() if mtype == u'чат': msgtype =...
en
0.571876
# BS mark.1-55 # /* coding: utf-8 */ # BlackSmith plugin # everywhere_plugin.py # Coded by: WitcherGeralt (<EMAIL>) # http://witcher-team.ucoz.ru/
1.951879
2
0100.same_tree/solution.py
WZMJ/Algorithms
5
2764
from utils import TreeNode class Solution: def is_same_tree(self, p: TreeNode, q: TreeNode) -> bool: if p is None and q is None: return True if not p or not q: return False return p.val == q.val and self.is_same_tree(p.left, q.left) and self.is_same_tree(p.right, q....
from utils import TreeNode class Solution: def is_same_tree(self, p: TreeNode, q: TreeNode) -> bool: if p is None and q is None: return True if not p or not q: return False return p.val == q.val and self.is_same_tree(p.left, q.left) and self.is_same_tree(p.right, q....
none
1
3.602909
4
tests/test_azure.py
The-Academic-Observatory/mag-archiver
0
2765
<filename>tests/test_azure.py # Copyright 2020 Curtin University # # 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 applic...
<filename>tests/test_azure.py # Copyright 2020 Curtin University # # 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 applic...
en
0.792892
# Copyright 2020 Curtin University # # 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 writi...
2.492563
2
tensorflow/contrib/framework/python/framework/tensor_util_test.py
uve/tensorflow
0
2766
# Copyright 2016 The TensorFlow Authors. 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
# Copyright 2016 The TensorFlow Authors. 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
en
0.785054
# Copyright 2016 The TensorFlow Authors. 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. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
2.053122
2
tpv/modals/sugerencias.py
vallemrv/tpvB3
3
2767
<reponame>vallemrv/tpvB3 # @Author: <NAME> <valle> # @Date: 10-May-2017 # @Email: <EMAIL> # @Last modified by: valle # @Last modified time: 23-Feb-2018 # @License: Apache license vesion 2.0 from kivy.uix.modalview import ModalView from kivy.uix.button import Button from kivy.properties import ObjectProperty, Str...
# @Author: <NAME> <valle> # @Date: 10-May-2017 # @Email: <EMAIL> # @Last modified by: valle # @Last modified time: 23-Feb-2018 # @License: Apache license vesion 2.0 from kivy.uix.modalview import ModalView from kivy.uix.button import Button from kivy.properties import ObjectProperty, StringProperty, ListProperty...
en
0.41404
# @Author: <NAME> <valle> # @Date: 10-May-2017 # @Email: <EMAIL> # @Last modified by: valle # @Last modified time: 23-Feb-2018 # @License: Apache license vesion 2.0
2.564919
3
templates/integration/__init__.py
p7g/dd-trace-py
308
2768
""" The foo integration instruments the bar and baz features of the foo library. Enabling ~~~~~~~~ The foo integration is enabled automatically when using :ref:`ddtrace-run <ddtracerun>` or :ref:`patch_all() <patch_all>`. Or use :ref:`patch() <patch>` to manually enable the integration:: from ddtrace import pa...
""" The foo integration instruments the bar and baz features of the foo library. Enabling ~~~~~~~~ The foo integration is enabled automatically when using :ref:`ddtrace-run <ddtracerun>` or :ref:`patch_all() <patch_all>`. Or use :ref:`patch() <patch>` to manually enable the integration:: from ddtrace import pa...
en
0.595663
The foo integration instruments the bar and baz features of the foo library. Enabling ~~~~~~~~ The foo integration is enabled automatically when using :ref:`ddtrace-run <ddtracerun>` or :ref:`patch_all() <patch_all>`. Or use :ref:`patch() <patch>` to manually enable the integration:: from ddtrace import patch ...
1.823327
2
libs/linux/wpa_cli.py
hpagseddy/ZPUI
0
2769
<filename>libs/linux/wpa_cli.py from subprocess import check_output, CalledProcessError from ast import literal_eval from time import sleep from helpers import setup_logger logger = setup_logger(__name__, "warning") current_interface = None #wpa_cli related functions and objects def wpa_cli_command(*command): r...
<filename>libs/linux/wpa_cli.py from subprocess import check_output, CalledProcessError from ast import literal_eval from time import sleep from helpers import setup_logger logger = setup_logger(__name__, "warning") current_interface = None #wpa_cli related functions and objects def wpa_cli_command(*command): r...
en
0.855042
#wpa_cli related functions and objects #wpa_cli command wrappers and their helpers #First, looking in the known networks #Then, if it's an open network, just connecting #Else, there's not enough implemented as for now #Might be an approach which doesn't take some things into account #Flags go each after another, enclos...
2.531728
3
demos/ServerSideBrowser.py
eukreign/python-v8
2
2770
#!/usr/bin/env python from __future__ import with_statement import sys, traceback, os, os.path import xml.dom.minidom import logging class Task(object): @staticmethod def waitAll(tasks): pass class FetchFile(Task): def __init__(self, url): self.url = url def _...
#!/usr/bin/env python from __future__ import with_statement import sys, traceback, os, os.path import xml.dom.minidom import logging class Task(object): @staticmethod def waitAll(tasks): pass class FetchFile(Task): def __init__(self, url): self.url = url def _...
ru
0.26433
#!/usr/bin/env python
2.530755
3
pypeira/io/fits.py
WielderOfMjoelnir/pypeira
0
2771
<gh_stars>0 from __future__ import division import fitsio """ A FITS file is comprised of segments called Header/Data Units (HDUs), where the first HDU is called the 'Primary HDU', or 'Primary Array'. The primary data array can contain a 1-999 dimensional array of 1, 2 or 4 byte integers or 4 or 8 byte floating point...
from __future__ import division import fitsio """ A FITS file is comprised of segments called Header/Data Units (HDUs), where the first HDU is called the 'Primary HDU', or 'Primary Array'. The primary data array can contain a 1-999 dimensional array of 1, 2 or 4 byte integers or 4 or 8 byte floating point numbers usi...
en
0.786746
A FITS file is comprised of segments called Header/Data Units (HDUs), where the first HDU is called the 'Primary HDU', or 'Primary Array'. The primary data array can contain a 1-999 dimensional array of 1, 2 or 4 byte integers or 4 or 8 byte floating point numbers using IEEE representation. A typical primary array coul...
3.15762
3
system/lib/update_musl.py
RyanCargan/emscripten
6,541
2772
#!/usr/bin/env python3 # Copyright 2021 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. """Simple script for updating musl from extern...
#!/usr/bin/env python3 # Copyright 2021 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. """Simple script for updating musl from extern...
en
0.770396
#!/usr/bin/env python3 # Copyright 2021 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. Simple script for updating musl from external g...
1.686731
2
src/scout_apm/instruments/pymongo.py
xiamx/scout_apm_python
0
2773
from __future__ import absolute_import, division, print_function, unicode_literals import logging # Used in the exec() call below. from scout_apm.core.monkey import monkeypatch_method, unpatch_method # noqa: F401 from scout_apm.core.tracked_request import TrackedRequest # noqa: F401 logger = logging.getLogger(__na...
from __future__ import absolute_import, division, print_function, unicode_literals import logging # Used in the exec() call below. from scout_apm.core.monkey import monkeypatch_method, unpatch_method # noqa: F401 from scout_apm.core.tracked_request import TrackedRequest # noqa: F401 logger = logging.getLogger(__na...
en
0.413731
# Used in the exec() call below. # noqa: F401 # noqa: F401 # noqa: F401 # noqa: F401 # There is no way the import can fail if self.installable() succeeded. # pragma: no cover @monkeypatch_method(Collection) def {method_str}(original, self, *args, **kwargs): tr = TrackedRequest.instance() name = '/'.join(['Mongo...
1.957056
2
measures/tests/factories.py
uktrade/tamato
14
2774
<reponame>uktrade/tamato<gh_stars>10-100 import random from typing import Optional import factory from common.tests import factories from measures.sheet_importers import MeasureSheetRow class MeasureSheetRowFactory(factory.Factory): """ A factory that produces a row that might be read from a sheet of measur...
import random from typing import Optional import factory from common.tests import factories from measures.sheet_importers import MeasureSheetRow class MeasureSheetRowFactory(factory.Factory): """ A factory that produces a row that might be read from a sheet of measures as recognised by the :class:`measu...
en
0.786771
A factory that produces a row that might be read from a sheet of measures as recognised by the :class:`measures.sheet_importers.MeasureSheetRow` importer. The factory references a MeasureFactory to do the production of an actual Measure, and then references the data produced by the MeasureFactory to ...
2.737647
3
autoscalingsim/scaling/policiesbuilder/metric/correlator/correlator.py
Remit/autoscaling-simulator
6
2775
from abc import ABC, abstractmethod import collections import pandas as pd from autoscalingsim.utils.error_check import ErrorChecker class Correlator(ABC): _Registry = {} @abstractmethod def _compute_correlation(self, metrics_vals_1 : pd.Series, metrics_vals_2 : pd.Series, lag : int): pass ...
from abc import ABC, abstractmethod import collections import pandas as pd from autoscalingsim.utils.error_check import ErrorChecker class Correlator(ABC): _Registry = {} @abstractmethod def _compute_correlation(self, metrics_vals_1 : pd.Series, metrics_vals_2 : pd.Series, lag : int): pass ...
none
1
2.643559
3
tools/test_net.py
by-liu/SegLossBia
18
2776
<reponame>by-liu/SegLossBia import sys import logging from seglossbias.utils import mkdir, setup_logging from seglossbias.engine import default_argument_parser, load_config, DefaultTester logger = logging.getLogger(__name__) def setup(args): cfg = load_config(args) mkdir(cfg.OUTPUT_DIR) setup_logging(ou...
import sys import logging from seglossbias.utils import mkdir, setup_logging from seglossbias.engine import default_argument_parser, load_config, DefaultTester logger = logging.getLogger(__name__) def setup(args): cfg = load_config(args) mkdir(cfg.OUTPUT_DIR) setup_logging(output_dir=cfg.OUTPUT_DIR) ...
none
1
2.185316
2
sarpy/io/nitf/tres/unclass/ENGRDA.py
anielsen001/sarpy
0
2777
<reponame>anielsen001/sarpy<filename>sarpy/io/nitf/tres/unclass/ENGRDA.py # -*- coding: utf-8 -*- from ..tre_elements import TREExtension, TREElement __classification__ = "UNCLASSIFIED" __author__ = "<NAME>" class RECORD(TREElement): def __init__(self, value): super(RECORD, self).__init__() sel...
# -*- coding: utf-8 -*- from ..tre_elements import TREExtension, TREElement __classification__ = "UNCLASSIFIED" __author__ = "<NAME>" class RECORD(TREElement): def __init__(self, value): super(RECORD, self).__init__() self.add_field('ENGLN', 'd', 2, value) self.add_field('ENGLBL', 's', ...
en
0.769321
# -*- coding: utf-8 -*-
2.45623
2
jp_doodle/quantity_forest.py
lingruiluo/jp_doodle
43
2778
<filename>jp_doodle/quantity_forest.py from jp_doodle import doodle_files qf_js = doodle_files.vendor_path("js/quantity_forest.js") from jp_doodle import dual_canvas import jp_proxy_widget import os from subprocess import check_output import pprint if bytes != str: unicode = str def directory_usage(directory, eps...
<filename>jp_doodle/quantity_forest.py from jp_doodle import doodle_files qf_js = doodle_files.vendor_path("js/quantity_forest.js") from jp_doodle import dual_canvas import jp_proxy_widget import os from subprocess import check_output import pprint if bytes != str: unicode = str def directory_usage(directory, eps...
en
0.238614
# py 3 var forest_config = { top_label: top_label, roots: members, width: width, dy: dy, dh: dh, id_click: id_click, degrees: degrees, background: background, x_vector: x_vecto...
2.431042
2
LeetCode-All-Solution/Python3/LC-0035-Search-Insert-Position.py
YuweiYin/Algorithm_YuweiYin
0
2779
#!/usr/bin/env python # -*- coding:utf-8 -*- """================================================================= @Project : Algorithm_YuweiYin/LeetCode-All-Solution/Python3 @File : LC-0035-Search-Insert-Position.py @Author : [YuweiYin](https://github.com/YuweiYin) @Date : 2022-01-01 ============================...
#!/usr/bin/env python # -*- coding:utf-8 -*- """================================================================= @Project : Algorithm_YuweiYin/LeetCode-All-Solution/Python3 @File : LC-0035-Search-Insert-Position.py @Author : [YuweiYin](https://github.com/YuweiYin) @Date : 2022-01-01 ============================...
en
0.607277
#!/usr/bin/env python # -*- coding:utf-8 -*- ================================================================= @Project : Algorithm_YuweiYin/LeetCode-All-Solution/Python3 @File : LC-0035-Search-Insert-Position.py @Author : [YuweiYin](https://github.com/YuweiYin) @Date : 2022-01-01 ===============================...
4.027214
4
coding202-parsing-json/get-ap-json-1.py
firodj/ciscodevnet-coding-skills-sample-code
0
2780
import requests url = 'https://192.168.3.11/api/contextaware/v1/maps/info/DevNetCampus/DevNetBuilding/DevNetZone' headers = {'Authorization': 'Basic bGVhcm5pbmc6bGVhcm5pbmc=='} response = requests.get(url, headers=headers, verify=False) responseString = response.text print(responseString)
import requests url = 'https://192.168.3.11/api/contextaware/v1/maps/info/DevNetCampus/DevNetBuilding/DevNetZone' headers = {'Authorization': 'Basic bGVhcm5pbmc6bGVhcm5pbmc=='} response = requests.get(url, headers=headers, verify=False) responseString = response.text print(responseString)
none
1
2.183876
2
lldb/test/API/lang/swift/optimized_code/bound_generic_enum/TestSwiftOptimizedBoundGenericEnum.py
LaudateCorpus1/llvm-project
605
2781
<gh_stars>100-1000 import lldb from lldbsuite.test.decorators import * import lldbsuite.test.lldbtest as lldbtest import lldbsuite.test.lldbutil as lldbutil import os import unittest2 class TestSwiftOptimizedBoundGenericEnum(lldbtest.TestBase): mydir = lldbtest.TestBase.compute_mydir(__file__) @swiftTest ...
import lldb from lldbsuite.test.decorators import * import lldbsuite.test.lldbtest as lldbtest import lldbsuite.test.lldbutil as lldbutil import os import unittest2 class TestSwiftOptimizedBoundGenericEnum(lldbtest.TestBase): mydir = lldbtest.TestBase.compute_mydir(__file__) @swiftTest def test(self): ...
en
0.720481
Test the bound generic enum types in "optimized" code. # FIXME, this fails with a data extractor error.
2.265626
2
kervi/kervi/plugin/routing/kervi_io/__init__.py
wentzlau/kervi
0
2782
<gh_stars>0 #Copyright 2017 <NAME>. #Distributed under the MIT License. See LICENSE in root of project. def init_plugin(config, manager): from kervi.plugin.routing.kervi_io.mq_router import KerviIORouterPlugin return KerviIORouterPlugin(config, manager) def plugin_type(): return "routing"
#Copyright 2017 <NAME>. #Distributed under the MIT License. See LICENSE in root of project. def init_plugin(config, manager): from kervi.plugin.routing.kervi_io.mq_router import KerviIORouterPlugin return KerviIORouterPlugin(config, manager) def plugin_type(): return "routing"
en
0.795483
#Copyright 2017 <NAME>. #Distributed under the MIT License. See LICENSE in root of project.
1.705159
2
bc_gym_planning_env/envs/base/action.py
ghostFaceKillah/bc-gym-planning-env
2
2783
""" Code for wrapping the motion primitive action in an object. """ from __future__ import division from __future__ import absolute_import import attr import numpy as np from bc_gym_planning_env.utilities.serialize import Serializable @attr.s(cmp=False) class Action(Serializable): """ Object representing an 'ac...
""" Code for wrapping the motion primitive action in an object. """ from __future__ import division from __future__ import absolute_import import attr import numpy as np from bc_gym_planning_env.utilities.serialize import Serializable @attr.s(cmp=False) class Action(Serializable): """ Object representing an 'ac...
en
0.76629
Code for wrapping the motion primitive action in an object. Object representing an 'action' - a motion primitive to execute in the environment
3.127822
3
histogram.py
ccfelius/queueing
1
2784
import matplotlib.pyplot as plt import pandas as pd import math import numpy as np from scipy import stats import seaborn as sns data = pd.read_csv("data/500-4.txt", sep="\t") # example1 = data[data["SIM_TIME"] == 500] simulations = 500 simtimes = [5, 50, 150, 500, 1000] # for i in [1, 2, 4]: # data = pd.read_c...
import matplotlib.pyplot as plt import pandas as pd import math import numpy as np from scipy import stats import seaborn as sns data = pd.read_csv("data/500-4.txt", sep="\t") # example1 = data[data["SIM_TIME"] == 500] simulations = 500 simtimes = [5, 50, 150, 500, 1000] # for i in [1, 2, 4]: # data = pd.read_c...
en
0.166701
# example1 = data[data["SIM_TIME"] == 500] # for i in [1, 2, 4]: # data = pd.read_csv(f"data/500-{i}.txt", sep="\t") # example = data[data["SIM_TIME"] == simtime] # sns.displot(ex_9,) # sns.displot(ex2_9)
2.721807
3
python/1931.py
zheedong/BaekJoon
0
2785
<filename>python/1931.py n = int(input()) conf_set = [] for _ in range(n): conf_set.append(tuple(map(int, input().split()))) conf_set.sort(key=lambda x : (x[1], x[0])) # 끝나는 시간을 기준으로 정렬 # 시작과 종료가 같은 경우를 포함하기 위해선, 시작 시간도 오름차순으로 정렬해 줘야 한다 solution_list = [conf_set[0]] # Greedy Algorithm for conf in conf_set[1:]:...
<filename>python/1931.py n = int(input()) conf_set = [] for _ in range(n): conf_set.append(tuple(map(int, input().split()))) conf_set.sort(key=lambda x : (x[1], x[0])) # 끝나는 시간을 기준으로 정렬 # 시작과 종료가 같은 경우를 포함하기 위해선, 시작 시간도 오름차순으로 정렬해 줘야 한다 solution_list = [conf_set[0]] # Greedy Algorithm for conf in conf_set[1:]:...
ko
1.000068
# 끝나는 시간을 기준으로 정렬 # 시작과 종료가 같은 경우를 포함하기 위해선, 시작 시간도 오름차순으로 정렬해 줘야 한다 # Greedy Algorithm # 정렬된 회의의 list의 마지막 값의 시작 시간과, 정답 list 마지막의 종료 시간을 비교한다
3.213579
3
social_webpy/app.py
python-social-auth/social-app-webpy
2
2786
<gh_stars>1-10 import web from social_core.actions import do_auth, do_complete, do_disconnect from .utils import psa, load_strategy, load_strategy urls = ( r'/login/(?P<backend>[^/]+)/?', 'auth', r'/complete/(?P<backend>[^/]+)/?', 'complete', r'/disconnect/(?P<backend>[^/]+)/?', 'disconnect', r'/dis...
import web from social_core.actions import do_auth, do_complete, do_disconnect from .utils import psa, load_strategy, load_strategy urls = ( r'/login/(?P<backend>[^/]+)/?', 'auth', r'/complete/(?P<backend>[^/]+)/?', 'complete', r'/disconnect/(?P<backend>[^/]+)/?', 'disconnect', r'/disconnect/(?P<bac...
none
1
2.219601
2
stellar/config.py
gomyar/stellar
0
2787
import os import logging import yaml from schema import Use, Schema, SchemaError, Optional class InvalidConfig(Exception): pass class MissingConfig(Exception): pass default_config = { 'logging': 30, 'migrate_from_0_3_2': True } schema = Schema({ 'stellar_url': Use(str), 'url': Use(str), ...
import os import logging import yaml from schema import Use, Schema, SchemaError, Optional class InvalidConfig(Exception): pass class MissingConfig(Exception): pass default_config = { 'logging': 30, 'migrate_from_0_3_2': True } schema = Schema({ 'stellar_url': Use(str), 'url': Use(str), ...
none
1
2.45138
2
egs2/mr_openslr64/asr1/local/data_prep.py
texpomru13/espnet
1
2788
#!/usr/bin/env python3 # Copyright 2021 <NAME> University (<NAME>) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) import argparse import os import random if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("-d", help="downloads directory", type=str, default="downl...
#!/usr/bin/env python3 # Copyright 2021 <NAME> University (<NAME>) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) import argparse import os import random if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("-d", help="downloads directory", type=str, default="downl...
en
0.276209
#!/usr/bin/env python3 # Copyright 2021 <NAME> University (<NAME>) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
2.428684
2
movement_validation/features/feature_processing_options.py
eulerkaku/movement_validation
0
2789
# -*- coding: utf-8 -*- """ This module will hold a class that will be referenced when processing features. I'd like to move things from "config" into here ... - @JimHokanson """ from __future__ import division from .. import utils #Can't do this, would be circular #from .worm_features import WormFeatures class...
# -*- coding: utf-8 -*- """ This module will hold a class that will be referenced when processing features. I'd like to move things from "config" into here ... - @JimHokanson """ from __future__ import division from .. import utils #Can't do this, would be circular #from .worm_features import WormFeatures class...
en
0.847063
# -*- coding: utf-8 -*- This module will hold a class that will be referenced when processing features. I'd like to move things from "config" into here ... - @JimHokanson #Can't do this, would be circular #from .worm_features import WormFeatures #The idea with this attribute is that functions will check if they are #i...
2.563998
3
xos/ec2_observer/steps/__init__.py
wathsalav/xos
0
2790
<filename>xos/ec2_observer/steps/__init__.py #from .sync_external_routes import SyncExternalRoutes #from .sync_network_slivers import SyncNetworkSlivers #from .sync_networks import SyncNetworks #from .sync_network_deployments import SyncNetworkDeployments #from .sync_site_privileges import SyncSitePrivilege #from .sync...
<filename>xos/ec2_observer/steps/__init__.py #from .sync_external_routes import SyncExternalRoutes #from .sync_network_slivers import SyncNetworkSlivers #from .sync_networks import SyncNetworks #from .sync_network_deployments import SyncNetworkDeployments #from .sync_site_privileges import SyncSitePrivilege #from .sync...
en
0.223494
#from .sync_external_routes import SyncExternalRoutes #from .sync_network_slivers import SyncNetworkSlivers #from .sync_networks import SyncNetworks #from .sync_network_deployments import SyncNetworkDeployments #from .sync_site_privileges import SyncSitePrivilege #from .sync_slice_memberships import SyncSliceMembership...
1.054706
1
src/napari_geojson/_tests/test_writer.py
NHPatterson/napari-geojson
0
2791
import geojson import pytest from napari_geojson import write_shapes ellipse = [[[0, 0], [0, 5], [5, 5], [5, 0]], "ellipse", "Polygon"] line = [[[0, 0], [5, 5]], "line", "LineString"] polygon = [[[0, 0], [5, 5], [0, 10]], "polygon", "Polygon"] polyline = [[[0, 0], [5, 5], [0, 10]], "path", "LineString"] rectangle = [...
import geojson import pytest from napari_geojson import write_shapes ellipse = [[[0, 0], [0, 5], [5, 5], [5, 0]], "ellipse", "Polygon"] line = [[[0, 0], [5, 5]], "line", "LineString"] polygon = [[[0, 0], [5, 5], [0, 10]], "polygon", "Polygon"] polyline = [[[0, 0], [5, 5], [0, 10]], "path", "LineString"] rectangle = [...
en
0.984228
# noqa E501 Writer writes a shapes layer as GeoJSON. # shape was written # read back
2.489906
2
algorithms/521. Longest Uncommon Subsequence I.py
woozway/py3-leetcode
1
2792
<gh_stars>1-10 class Solution: def findLUSlength(self, a: str, b: str) -> int: return -1 if a == b else max(len(a), len(b))
class Solution: def findLUSlength(self, a: str, b: str) -> int: return -1 if a == b else max(len(a), len(b))
none
1
3.191061
3
pgmpy/models/ClusterGraph.py
echoyi/pgmpy
0
2793
#!/usr/bin/env python3 from collections import defaultdict import numpy as np from pgmpy.base import UndirectedGraph from pgmpy.factors import factor_product class ClusterGraph(UndirectedGraph): r""" Base class for representing Cluster Graph. Cluster graph is an undirected graph which is associated wi...
#!/usr/bin/env python3 from collections import defaultdict import numpy as np from pgmpy.base import UndirectedGraph from pgmpy.factors import factor_product class ClusterGraph(UndirectedGraph): r""" Base class for representing Cluster Graph. Cluster graph is an undirected graph which is associated wi...
en
0.594088
#!/usr/bin/env python3 Base class for representing Cluster Graph. Cluster graph is an undirected graph which is associated with a subset of variables. The graph contains undirected edges that connects clusters whose scopes have a non-empty intersection. Formally, a cluster graph is :math:`\mathcal{U}` fo...
3.353002
3
plugins/commands_window/plugin.py
stonewell/eim
0
2794
from PySide6.QtWidgets import QListWidgetItem from yapsy.IPlugin import IPlugin class Plugin(IPlugin): def __init__(self): IPlugin.__init__(self) def activate(self): IPlugin.activate(self) return def deactivate(self): IPlugin.deactivate(self) def set_current_window(self, ...
from PySide6.QtWidgets import QListWidgetItem from yapsy.IPlugin import IPlugin class Plugin(IPlugin): def __init__(self): IPlugin.__init__(self) def activate(self): IPlugin.activate(self) return def deactivate(self): IPlugin.deactivate(self) def set_current_window(self, ...
none
1
2.359709
2
custom_components/helpers.py
zroger49/broadlink_custom_component
0
2795
"""Helpers for the Broadlink remote.""" from base64 import b64decode from homeassistant.helpers import config_validation as cv def decode_packet(value): """Decode a data packet given for a Broadlink remote.""" value = cv.string(value) extra = len(value) % 4 if extra > 0: value = value + ("=" ...
"""Helpers for the Broadlink remote.""" from base64 import b64decode from homeassistant.helpers import config_validation as cv def decode_packet(value): """Decode a data packet given for a Broadlink remote.""" value = cv.string(value) extra = len(value) % 4 if extra > 0: value = value + ("=" ...
en
0.656491
Helpers for the Broadlink remote. Decode a data packet given for a Broadlink remote. Format a MAC address.
2.886839
3
problems/139.Word_Break/AC_dp_n2.py
subramp-prep/leetcode
0
2796
<filename>problems/139.Word_Break/AC_dp_n2.py<gh_stars>0 #!/usr/bin/python # -*- coding: utf-8 -*- # Author: illuz <<EMAIL>uzen[at]gmail.com> # File: AC_dp_n2.py # Create Date: 2015-04-21 10:21:18 # Usage: AC_dp_n2.py # Descripton: class Solution: # @param s, a string # @param dict, a set...
<filename>problems/139.Word_Break/AC_dp_n2.py<gh_stars>0 #!/usr/bin/python # -*- coding: utf-8 -*- # Author: illuz <<EMAIL>uzen[at]gmail.com> # File: AC_dp_n2.py # Create Date: 2015-04-21 10:21:18 # Usage: AC_dp_n2.py # Descripton: class Solution: # @param s, a string # @param dict, a set...
en
0.33172
#!/usr/bin/python # -*- coding: utf-8 -*- # Author: illuz <<EMAIL>uzen[at]gmail.com> # File: AC_dp_n2.py # Create Date: 2015-04-21 10:21:18 # Usage: AC_dp_n2.py # Descripton: # @param s, a string # @param dict, a set of string # @return a boolean # debug
3.521246
4
examples/pybullet/gym/pybullet_envs/bullet/kukaCamGymEnv.py
motionfigures/bullet3
51
2797
import os, inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(os.path.dirname(currentdir)) os.sys.path.insert(0,parentdir) import math import gym from gym import spaces from gym.utils import seeding import numpy as np import time import pybullet...
import os, inspect currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) parentdir = os.path.dirname(os.path.dirname(currentdir)) os.sys.path.insert(0,parentdir) import math import gym from gym import spaces from gym.utils import seeding import numpy as np import time import pybullet...
en
0.284922
#timinglog = p.startStateLogging(p.STATE_LOGGING_PROFILE_TIMINGS, "kukaTimings.json") #print("observationDim") #print(observationDim) #camEyePos = [0.03,0.236,0.54] #distance = 1.06 #pitch=-56 #yaw = 258 #roll=0 #upAxisIndex = 2 #camInfo = p.getDebugVisualizerCamera() #print("width,height") #print(camInfo[0]) #print(ca...
1.885364
2
hi-ml-histopathology/src/histopathology/preprocessing/tiling.py
kumar-pratik/hi-ml
402
2798
# ------------------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # -------------------------------------------------------------------...
# ------------------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # -------------------------------------------------------------------...
en
0.656907
# ------------------------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License (MIT). See LICENSE in the repo root for license information. # -------------------------------------------------------------------...
2.931526
3
miniapp/miniapp/hartreefock/hf.py
savcardamone/tyche-
0
2799
from math import pi from numpy import array, ndarray, divide, sqrt, argsort, sort, diag, trace from numpy.linalg import eig, norm class HartreeFock(): zeta = array([38.474970, 5.782948, 1.242567, 0.298073]) num_aos = len(zeta) num_mos = 0 energy_tolerance = 0.0001; density_tolerance = 0.001 ...
from math import pi from numpy import array, ndarray, divide, sqrt, argsort, sort, diag, trace from numpy.linalg import eig, norm class HartreeFock(): zeta = array([38.474970, 5.782948, 1.242567, 0.298073]) num_aos = len(zeta) num_mos = 0 energy_tolerance = 0.0001; density_tolerance = 0.001 ...
en
0.893776
# Make sure we can pair electrons # We're RHF, so pair up spins in each molecular orbital # Initialise our matrices # Get the eigenvalues and eigenvectors of the overlap matrix # Create diagonal matrix with entries given by inverse of eigenvalues of # overlap matrix # Construct the basis transformation matrix and retur...
2.467452
2