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
seagrass/hooks/__init__.py
kernelmethod/Seagrass
0
4700
<filename>seagrass/hooks/__init__.py # flake8: noqa: F401 from .context_manager_hook import ContextManagerHook from .counter_hook import CounterHook from .file_open_hook import FileOpenHook from .logging_hook import LoggingHook from .profiler_hook import ProfilerHook from .runtime_audit_hook import RuntimeAuditHook fro...
<filename>seagrass/hooks/__init__.py # flake8: noqa: F401 from .context_manager_hook import ContextManagerHook from .counter_hook import CounterHook from .file_open_hook import FileOpenHook from .logging_hook import LoggingHook from .profiler_hook import ProfilerHook from .runtime_audit_hook import RuntimeAuditHook fro...
en
0.133126
# flake8: noqa: F401
1.204769
1
tests/test_internal.py
aschleg/hypy
40
4701
<reponame>aschleg/hypy<filename>tests/test_internal.py import pytest import numpy as np import pandas as pd from hypothetical._lib import _build_des_mat def test_array(): d = np.array([[1., 1.11, 2.569, 3.58, 0.76], [1., 1.19, 2.928, 3.75, 0.821], [1., 1.09, 2.865, 3.93, 0.928]...
import pytest import numpy as np import pandas as pd from hypothetical._lib import _build_des_mat def test_array(): d = np.array([[1., 1.11, 2.569, 3.58, 0.76], [1., 1.19, 2.928, 3.75, 0.821], [1., 1.09, 2.865, 3.93, 0.928], [1., 1.25, 3.844, 3.94, 1.009], ...
none
1
2.395779
2
download.py
JamesWang007/Open3D-PointNet
120
4702
<reponame>JamesWang007/Open3D-PointNet<gh_stars>100-1000 #!/usr/bin/env python3 # Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma de # Barcelona (UAB). # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """Download big fil...
#!/usr/bin/env python3 # Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma de # Barcelona (UAB). # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """Download big files from Google Drive.""" import shutil import sys import...
en
0.64989
#!/usr/bin/env python3 # Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma de # Barcelona (UAB). # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. Download big files from Google Drive. # https://stackoverflow.com/a/1094933/53...
2.624863
3
ls12/demo5.py
cklwblove/python-100-days-source-code
0
4703
<gh_stars>0 # -*- coding: utf-8 -*- """ 将耗时间的任务放到线程中以获得更好的用户体验。 """ import time import tkinter import tkinter.messagebox def download(): # 模拟下载任务需要花费10秒时间 time.sleep(10) tkinter.messagebox.showinfo('提示', '下载完成') def show_about(): tkinter.messagebox.showinfo('关于', '作者:罗浩') def ma...
# -*- coding: utf-8 -*- """ 将耗时间的任务放到线程中以获得更好的用户体验。 """ import time import tkinter import tkinter.messagebox def download(): # 模拟下载任务需要花费10秒时间 time.sleep(10) tkinter.messagebox.showinfo('提示', '下载完成') def show_about(): tkinter.messagebox.showinfo('关于', '作者:罗浩') def main(): t...
zh
0.974657
# -*- coding: utf-8 -*- 将耗时间的任务放到线程中以获得更好的用户体验。 # 模拟下载任务需要花费10秒时间
3.45069
3
hangupsbot/sinks/gitlab/simplepush.py
mygreentour/hangoutsbot
0
4704
""" GitLab webhook receiver - see http://doc.gitlab.com/ee/web_hooks/web_hooks.html """ import asyncio import json import logging from sinks.base_bot_request_handler import AsyncRequestHandler logger = logging.getLogger(__name__) try: import dateutil.parser except ImportError: logger.error("missing module p...
""" GitLab webhook receiver - see http://doc.gitlab.com/ee/web_hooks/web_hooks.html """ import asyncio import json import logging from sinks.base_bot_request_handler import AsyncRequestHandler logger = logging.getLogger(__name__) try: import dateutil.parser except ImportError: logger.error("missing module p...
en
0.831545
GitLab webhook receiver - see http://doc.gitlab.com/ee/web_hooks/web_hooks.html Receive REST API posts from GitLab Process a received POST to a given converstation
2.445566
2
evsim/assessor.py
cbchoi/nppsim
3
4705
<reponame>cbchoi/nppsim<gh_stars>1-10 from evsim.system_simulator import SystemSimulator from evsim.behavior_model_executor import BehaviorModelExecutor from evsim.system_message import SysMessage from evsim.definition import * import os import subprocess as sp class Assessor(BehaviorModelExecutor): def ...
from evsim.system_simulator import SystemSimulator from evsim.behavior_model_executor import BehaviorModelExecutor from evsim.system_message import SysMessage from evsim.definition import * import os import subprocess as sp class Assessor(BehaviorModelExecutor): def __init__(self, instance_time, destruct...
en
0.189442
# Open CSV #print("Assessor") #print(str(datetime.datetime.now()) + " " + str(data[0])) #temp = "[%f] %s" % (SystemSimulator().get_engine(self.engine_name).get_global_time(), str(data[0])) #print(temp) #temp = "[%f] %s" % (SystemSimulator().get_engine(self.engine_name).get_global_time(), "Human Receiver Object: Move")...
2.47139
2
tei_entity_enricher/interface/postprocessing/gnd_connector.py
NEISSproject/TEIEntityEnricher
0
4706
import os from typing import Union, List from tei_entity_enricher.interface.postprocessing.io import FileReader, FileWriter from tei_entity_enricher.util.helper import local_save_path, makedir_if_necessary from tei_entity_enricher.util.exceptions import FileNotFound class GndConnector: def __init__( ...
import os from typing import Union, List from tei_entity_enricher.interface.postprocessing.io import FileReader, FileWriter from tei_entity_enricher.util.helper import local_save_path, makedir_if_necessary from tei_entity_enricher.util.exceptions import FileNotFound class GndConnector: def __init__( ...
en
0.731428
establishes connection to api, from which norm data for entities of Deutsche Nationalbibliothek´s database is retrieved, loaded data can be passed to an instance of Cache class for further processing or FileWriter class to save it gnd_id: gnd id number(s) apiindex: ...
2.286618
2
neslter/workflow/__init__.py
WHOIGit/nes-lter-ims
3
4707
<filename>neslter/workflow/__init__.py import logging logger = logging.getLogger(__name__) logger.addHandler(logging.NullHandler()) logger.level = logging.DEBUG
<filename>neslter/workflow/__init__.py import logging logger = logging.getLogger(__name__) logger.addHandler(logging.NullHandler()) logger.level = logging.DEBUG
none
1
1.447284
1
inference/_archive/render_section.py
emitch/SEAMLeSS
4
4708
<filename>inference/_archive/render_section.py from args import get_argparser, parse_args, get_aligner, get_bbox def render(aligner, bbox, z): aligner.total_bbox = bbox aligner.zs = z aligner.render_section_all_mips(z, bbox) if __name__ == '__main__': parser = get_argparser() args = parse_args(parser) a...
<filename>inference/_archive/render_section.py from args import get_argparser, parse_args, get_aligner, get_bbox def render(aligner, bbox, z): aligner.total_bbox = bbox aligner.zs = z aligner.render_section_all_mips(z, bbox) if __name__ == '__main__': parser = get_argparser() args = parse_args(parser) a...
none
1
2.392529
2
venv/lib/python3.9/site-packages/google/cloud/spanner_admin_instance_v1/gapic/instance_admin_client.py
qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3
0
4709
<reponame>qarik-hanrattyjen/apache-airflow-backport-providers-google-2021.3.3 # -*- coding: utf-8 -*- # # Copyright 2020 Google LLC # # 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 # # htt...
# -*- coding: utf-8 -*- # # Copyright 2020 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
en
0.748495
# -*- coding: utf-8 -*- # # Copyright 2020 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law...
1.165364
1
src/ScaleHD/__backend.py
helloabunai/ScaleHD
3
4710
#/usr/bin/python __version__ = '1.0' __author__ = '<EMAIL>' ## ## Imports import string import os import errno import shutil import sys import glob import datetime import subprocess import logging as log import numpy as np import csv from io import StringIO import PyPDF2 from sklearn import preprocessing from collecti...
#/usr/bin/python __version__ = '1.0' __author__ = '<EMAIL>' ## ## Imports import string import os import errno import shutil import sys import glob import datetime import subprocess import logging as log import numpy as np import csv from io import StringIO import PyPDF2 from sklearn import preprocessing from collecti...
en
0.661971
#/usr/bin/python ## ## Imports The configuration file reader. Opens a configuration file, and if valid, converts the parameters within the file to a dictionary object, reader to be viewed through accessing the config_dict variable. ## ## Instance variables ## ## Check for configuration file (just incase) ## ## Check ...
2.419879
2
tests/test_models/test_backbones/test_encoder_decoders/test_deepfill_encoder.py
Jian137/mmediting-1
1,884
4711
<gh_stars>1000+ # Copyright (c) OpenMMLab. All rights reserved. import torch from mmedit.models.backbones import ContextualAttentionNeck, DeepFillEncoder from mmedit.models.common import SimpleGatedConvModule def test_deepfill_enc(): encoder = DeepFillEncoder() x = torch.randn((2, 5, 256, 256)) outputs =...
# Copyright (c) OpenMMLab. All rights reserved. import torch from mmedit.models.backbones import ContextualAttentionNeck, DeepFillEncoder from mmedit.models.common import SimpleGatedConvModule def test_deepfill_enc(): encoder = DeepFillEncoder() x = torch.randn((2, 5, 256, 256)) outputs = encoder(x) ...
en
0.498511
# Copyright (c) OpenMMLab. All rights reserved. # TODO: add unittest for contextual attention module
2.176903
2
mvp/migrations/0004_auto_20201127_0649.py
Wastecoinng/mvp_beta
0
4712
# Generated by Django 2.2.13 on 2020-11-27 05:49 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('mvp', '0003_hublocation'), ] operations = [ migrations.RemoveField( model_name='hublocation', name='longitude', ...
# Generated by Django 2.2.13 on 2020-11-27 05:49 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('mvp', '0003_hublocation'), ] operations = [ migrations.RemoveField( model_name='hublocation', name='longitude', ...
en
0.785121
# Generated by Django 2.2.13 on 2020-11-27 05:49
1.623825
2
adminapp/migrations/0012_auto_20210714_1155.py
mofresh27/MuseumExperience-Group2-Python-BE-1
0
4713
<filename>adminapp/migrations/0012_auto_20210714_1155.py # Generated by Django 3.2.4 on 2021-07-14 11:55 from django.db import migrations, models import uuid class Migration(migrations.Migration): dependencies = [ ('adminapp', '0011_faq'), ] operations = [ migrations.AddField( ...
<filename>adminapp/migrations/0012_auto_20210714_1155.py # Generated by Django 3.2.4 on 2021-07-14 11:55 from django.db import migrations, models import uuid class Migration(migrations.Migration): dependencies = [ ('adminapp', '0011_faq'), ] operations = [ migrations.AddField( ...
en
0.864783
# Generated by Django 3.2.4 on 2021-07-14 11:55
1.635726
2
scripts/json_parse.py
andrewsimonds14/Capstone
0
4714
<reponame>andrewsimonds14/Capstone import json import os import nibabel as nib import csv from operator import itemgetter # PATH TO PREPROCESSED DATA raw_data_path = '/home/lab/nnUNet_data/nnUNet_raw_data_base/nnUNet_raw_data/Task500_BrainMets' pixdim_ind = [1,2,3] # Indexes at which the voxel size [x,y,z] is stored ...
import json import os import nibabel as nib import csv from operator import itemgetter # PATH TO PREPROCESSED DATA raw_data_path = '/home/lab/nnUNet_data/nnUNet_raw_data_base/nnUNet_raw_data/Task500_BrainMets' pixdim_ind = [1,2,3] # Indexes at which the voxel size [x,y,z] is stored # PATH TO JSON FILE with open('/h...
en
0.781088
# PATH TO PREPROCESSED DATA # Indexes at which the voxel size [x,y,z] is stored # PATH TO JSON FILE # Get dice score on image # Get nifti data on image # Get tumor dimensions # tumor_size = # Get case number corresponding to image # Write to csv file
2.64341
3
tests/gen_test.py
tinylambda/tornadio2
0
4715
# -*- coding: utf-8 -*- """ tornadio2.tests.gen ~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2011 by the <NAME>, see AUTHORS for more details. :license: Apache, see LICENSE for more details. """ from collections import deque from nose.tools import eq_ from tornadio2 import gen _queue = None def init_envir...
# -*- coding: utf-8 -*- """ tornadio2.tests.gen ~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2011 by the <NAME>, see AUTHORS for more details. :license: Apache, see LICENSE for more details. """ from collections import deque from nose.tools import eq_ from tornadio2 import gen _queue = None def init_envir...
en
0.606292
# -*- coding: utf-8 -*- tornadio2.tests.gen ~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2011 by the <NAME>, see AUTHORS for more details. :license: Apache, see LICENSE for more details. # Verify value # Verify value # Verify value # Verify value
1.99011
2
DeepBrainSeg/tumor/Tester.py
JordanMicahBennett/DeepBrainSeg
1
4716
#! /usr/bin/env python # -*- coding: utf-8 -*- # # author: <NAME> # contact: <EMAIL> import torch import SimpleITK as sitk import numpy as np import nibabel as nib from torch.autograd import Variable from skimage.transform import resize from torchvision import transforms from time import gmtime, strftime from tqdm i...
#! /usr/bin/env python # -*- coding: utf-8 -*- # # author: <NAME> # contact: <EMAIL> import torch import SimpleITK as sitk import numpy as np import nibabel as nib from torch.autograd import Variable from skimage.transform import resize from torchvision import transforms from time import gmtime, strftime from tqdm i...
en
0.531371
#! /usr/bin/env python # -*- coding: utf-8 -*- # # author: <NAME> # contact: <EMAIL> #======================================================================================== # prediction functions..................... class performs segmentation for a given sequence of patient data. to main platform for segme...
2.420765
2
statsmodels/discrete/tests/test_conditional.py
porcpine1967/statsmodels
0
4717
import numpy as np from statsmodels.discrete.conditional_models import ( ConditionalLogit, ConditionalPoisson) from statsmodels.tools.numdiff import approx_fprime from numpy.testing import assert_allclose import pandas as pd def test_logit_1d(): y = np.r_[0, 1, 0, 1, 0, 1, 0, 1, 1, 1] g = np.r_[0, 0, 0...
import numpy as np from statsmodels.discrete.conditional_models import ( ConditionalLogit, ConditionalPoisson) from statsmodels.tools.numdiff import approx_fprime from numpy.testing import assert_allclose import pandas as pd def test_logit_1d(): y = np.r_[0, 1, 0, 1, 0, 1, 0, 1, 1, 1] g = np.r_[0, 0, 0...
en
0.738661
# Check the gradient for the denominator of the partial likelihood # Check the gradient for the loglikelihood # From Stata # Check the gradient for the denominator of the partial likelihood # Check the gradient for the loglikelihood # From Stata # Check the gradient for the loglikelihood # From Stata # Check the gradie...
2.527825
3
bert_e/workflow/gitwaterflow/utils.py
tcarmet/bert-e
0
4718
<reponame>tcarmet/bert-e def bypass_incompatible_branch(job): return (job.settings.bypass_incompatible_branch or job.author_bypass.get('bypass_incompatible_branch', False)) def bypass_peer_approval(job): return (job.settings.bypass_peer_approval or job.author_bypass.get('bypass_peer_a...
def bypass_incompatible_branch(job): return (job.settings.bypass_incompatible_branch or job.author_bypass.get('bypass_incompatible_branch', False)) def bypass_peer_approval(job): return (job.settings.bypass_peer_approval or job.author_bypass.get('bypass_peer_approval', False)) def by...
none
1
2.156677
2
bkt/library/powerpoint/elements.py
pyro-team/bkt-toolbox
12
4719
<filename>bkt/library/powerpoint/elements.py # -*- coding: utf-8 -*- ''' Created on 02.11.2017 @author: fstallmann ''' from __future__ import absolute_import from collections import deque import bkt from bkt import dotnet Drawing = dotnet.import_drawing() from . import helpers as pplib class TextframeSpinnerBox...
<filename>bkt/library/powerpoint/elements.py # -*- coding: utf-8 -*- ''' Created on 02.11.2017 @author: fstallmann ''' from __future__ import absolute_import from collections import deque import bkt from bkt import dotnet Drawing = dotnet.import_drawing() from . import helpers as pplib class TextframeSpinnerBox...
en
0.543118
# -*- coding: utf-8 -*- Created on 02.11.2017 @author: fstallmann ### Instance initialization attr examples: MarginTop, MarginBottom, MarginLeft, MarginRight #self.attr is automatically set through RibbonControl attribute handling ##', ### Spinner Box callbacks ### #e.g. no textframe detected #replace large negative n...
1.910564
2
sc2/unit.py
guliverza/AdditionalPylons
0
4720
<filename>sc2/unit.py from __future__ import annotations import warnings from typing import Any, Dict, List, Optional, Set, Tuple, Union, TYPE_CHECKING from .cache import property_immutable_cache, property_mutable_cache from .constants import ( transforming, IS_STRUCTURE, IS_LIGHT, IS_ARMORED, IS_B...
<filename>sc2/unit.py from __future__ import annotations import warnings from typing import Any, Dict, List, Optional, Set, Tuple, Union, TYPE_CHECKING from .cache import property_immutable_cache, property_mutable_cache from .constants import ( transforming, IS_STRUCTURE, IS_LIGHT, IS_ARMORED, IS_B...
en
0.830252
:param ability: :param target: :param progress: :param proto_data: :param bot_object: # Used by property_immutable_cache Returns string of this form: Unit(name='SCV', tag=4396941328). UnitTypeId found in sc2/ids/unit_typeid. Caches all type_ids of the same unit type. Provides the unit ty...
2.149991
2
healthy_candies/load/__init__.py
striantafyllouEPFL/healthy-candies
1
4721
from .load import load_data, NUTRI_COLS, load_clean_rel_to_nutri
from .load import load_data, NUTRI_COLS, load_clean_rel_to_nutri
none
1
1.04678
1
simglucose/sensor/cgm.py
mia-jingyi/simglucose
0
4722
<gh_stars>0 # from .noise_gen import CGMNoiseGenerator from .noise_gen import CGMNoise import pandas as pd import logging logger = logging.getLogger(__name__) class CGMSensor(object): def __init__(self, params, seed=None): self._params = params self.name = params.Name self.sample_time = p...
# from .noise_gen import CGMNoiseGenerator from .noise_gen import CGMNoise import pandas as pd import logging logger = logging.getLogger(__name__) class CGMSensor(object): def __init__(self, params, seed=None): self._params = params self.name = params.Name self.sample_time = params.sample...
en
0.16976
# from .noise_gen import CGMNoiseGenerator # Zero-Order Hold
2.563295
3
var/spack/repos/builtin/packages/thepeg/package.py
carlabguillen/spack
1
4723
<reponame>carlabguillen/spack # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Thepeg(AutotoolsPackage): """Toolkit for High Energy Physics...
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack import * class Thepeg(AutotoolsPackage): """Toolkit for High Energy Physics Event Generation""" home...
en
0.27518
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) Toolkit for High Energy Physics Event Generation # The commented out versions exist, but may need patches # and/or recipe c...
1.440717
1
vmca/python/get_cert.py
wfu8/lightwave
357
4724
<gh_stars>100-1000 #!/usr/bin/env python # # Copyright © 2012-2016 VMware, Inc. 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...
#!/usr/bin/env python # # Copyright © 2012-2016 VMware, Inc. 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 requi...
en
0.780468
#!/usr/bin/env python # # Copyright © 2012-2016 VMware, Inc. 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 requi...
2.309064
2
sdk/python/pulumi_gcp/securitycenter/notification_config.py
sisisin/pulumi-gcp
121
4725
<filename>sdk/python/pulumi_gcp/securitycenter/notification_config.py # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing i...
<filename>sdk/python/pulumi_gcp/securitycenter/notification_config.py # coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** import warnings import pulumi import pulumi.runtime from typing i...
en
0.671277
# coding=utf-8 # *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** # *** Do not edit by hand unless you're certain you know what you are doing! *** The set of arguments for constructing a NotificationConfig resource. :param pulumi.Input[str] config_id: This must be unique wit...
1.830329
2
malib/agents/tabular/q_learning/base_tabular_agent.py
wwxFromTju/malib
6
4726
from abc import ABCMeta, abstractmethod import numpy as np class Agent(object): __metaclass__ = ABCMeta def __init__(self, name, id_, action_num, env): self.name = name self.id_ = id_ self.action_num = action_num # len(env.action_space[id_]) # self.opp_action_space = e...
from abc import ABCMeta, abstractmethod import numpy as np class Agent(object): __metaclass__ = ABCMeta def __init__(self, name, id_, action_num, env): self.name = name self.id_ = id_ self.action_num = action_num # len(env.action_space[id_]) # self.opp_action_space = e...
en
0.217317
# len(env.action_space[id_]) # self.opp_action_space = env.action_space[0:id_] + env.action_space[id_:-1] # assert len(pi) == self.actin_num # s = humanfriendly.format_size(n) # return s.replace(' ', '').replace('bytes', '').replace('byte', '').rstrip('B')
3.204011
3
290.word-pattern.py
Lonitch/hackerRank
0
4727
# # @lc app=leetcode id=290 lang=python3 # # [290] Word Pattern # # https://leetcode.com/problems/word-pattern/description/ # # algorithms # Easy (35.86%) # Likes: 825 # Dislikes: 113 # Total Accepted: 164K # Total Submissions: 455.9K # Testcase Example: '"abba"\n"dog cat cat dog"' # # Given a pattern and a stri...
# # @lc app=leetcode id=290 lang=python3 # # [290] Word Pattern # # https://leetcode.com/problems/word-pattern/description/ # # algorithms # Easy (35.86%) # Likes: 825 # Dislikes: 113 # Total Accepted: 164K # Total Submissions: 455.9K # Testcase Example: '"abba"\n"dog cat cat dog"' # # Given a pattern and a stri...
en
0.673804
# # @lc app=leetcode id=290 lang=python3 # # [290] Word Pattern # # https://leetcode.com/problems/word-pattern/description/ # # algorithms # Easy (35.86%) # Likes: 825 # Dislikes: 113 # Total Accepted: 164K # Total Submissions: 455.9K # Testcase Example: '"abba"\n"dog cat cat dog"' # # Given a pattern and a stri...
3.83478
4
s1_getting_started/exercise_files/final_exercise/model.py
jaschn/dtu_mlops
0
4728
from torch import nn class MyAwesomeModel(nn.Module): def __init__(self): super().__init__() self.cnn = nn.Sequential(nn.Conv2d(in_channels=1, out_channels=5, kernel_size=3), nn.ReLU(), nn.Conv2d(in_channels=5, out_channels=3, kernel...
from torch import nn class MyAwesomeModel(nn.Module): def __init__(self): super().__init__() self.cnn = nn.Sequential(nn.Conv2d(in_channels=1, out_channels=5, kernel_size=3), nn.ReLU(), nn.Conv2d(in_channels=5, out_channels=3, kernel...
none
1
3.182034
3
musket_core/tests/coders_test.py
dreamflyer/musket_core
16
4729
import unittest from musket_core import coders import numpy as np import pandas as pd import os import math fl=__file__ fl=os.path.dirname(fl) class TestCoders(unittest.TestCase): def test_binary_num(self): a=np.array([0,1,0,1]) bc=coders.get_coder("binary",a, None) self.as...
import unittest from musket_core import coders import numpy as np import pandas as pd import os import math fl=__file__ fl=os.path.dirname(fl) class TestCoders(unittest.TestCase): def test_binary_num(self): a=np.array([0,1,0,1]) bc=coders.get_coder("binary",a, None) self.as...
none
1
2.918822
3
manage.py
isijara/zulip
1
4730
#!/usr/bin/env python3 import os import sys BASE_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(BASE_DIR) import scripts.lib.setup_path_on_import if __name__ == "__main__": if 'posix' in os.name and os.geteuid() == 0: print("manage.py should not be run as root. Use `su zulip` to drop ro...
#!/usr/bin/env python3 import os import sys BASE_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.append(BASE_DIR) import scripts.lib.setup_path_on_import if __name__ == "__main__": if 'posix' in os.name and os.geteuid() == 0: print("manage.py should not be run as root. Use `su zulip` to drop ro...
en
0.929174
#!/usr/bin/env python3 # The best way to detect running manage.py as another user in # production before importing anything that would require that # access is to check for access to /etc/zulip/zulip.conf (in # which case it's a production server, not a dev environment) # and lack of access for /etc/zulip/zulip-secrets...
1.962354
2
core/scripts/fetch_instructions_specs.py
merwaaan/mr.system
0
4731
<filename>core/scripts/fetch_instructions_specs.py<gh_stars>0 import json, requests from bs4 import BeautifulSoup def fetch(): r = requests.get('http://clrhome.org/table/') if not r.ok: print('Cannot fetch {})'.format(r.url)) return None # remove newlines text = r.text.replace('\n', '') # Return ...
<filename>core/scripts/fetch_instructions_specs.py<gh_stars>0 import json, requests from bs4 import BeautifulSoup def fetch(): r = requests.get('http://clrhome.org/table/') if not r.ok: print('Cannot fetch {})'.format(r.url)) return None # remove newlines text = r.text.replace('\n', '') # Return ...
en
0.840197
# remove newlines # Return the data as a BeautifulSoup object for easy querying # row # column # Conditional instructions have different durations depending on how they # branch so the possible durations are stored in an array. Otherwise, the # duration is just stored as a single value. # Flag condition # Alt registers...
2.769603
3
unittests/tools/test_intsights_parser.py
M-Rod101/django-DefectDojo
249
4732
from ..dojo_test_case import DojoTestCase from dojo.models import Test from dojo.tools.intsights.parser import IntSightsParser class TestIntSightsParser(DojoTestCase): def test_intsights_parser_with_one_critical_vuln_has_one_findings_json( self): testfile = open("unittests/scans/intsights/ints...
from ..dojo_test_case import DojoTestCase from dojo.models import Test from dojo.tools.intsights.parser import IntSightsParser class TestIntSightsParser(DojoTestCase): def test_intsights_parser_with_one_critical_vuln_has_one_findings_json( self): testfile = open("unittests/scans/intsights/ints...
en
0.665392
#/threat-command/alerts?search=5c80dbf83b4a3900078b6be6",
2.609439
3
tools/testutils.py
sktollman/p4c
1
4733
<reponame>sktollman/p4c #!/usr/bin/env python # Copyright 2013-present Barefoot Networks, Inc. # Copyright 2018 VMware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www...
#!/usr/bin/env python # Copyright 2013-present Barefoot Networks, Inc. # Copyright 2018 VMware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LIC...
en
0.796116
#!/usr/bin/env python # Copyright 2013-present Barefoot Networks, Inc. # Copyright 2018 VMware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LIC...
2.345652
2
AlgorithmsAndDataStructures/mod2/Heap.py
BootyAss/bmstu
0
4734
<gh_stars>0 class Heap: def __init__(self): self.items = dict() # key - (value, index) self.indexes = [] # index - key // to know indexes # Usefull functions def swap(self, i, j): x = self.indexes[i] # key of 1 item y = self.indexes[j] # key of 2 item ...
class Heap: def __init__(self): self.items = dict() # key - (value, index) self.indexes = [] # index - key // to know indexes # Usefull functions def swap(self, i, j): x = self.indexes[i] # key of 1 item y = self.indexes[j] # key of 2 item # swa...
en
0.630976
# key - (value, index) # index - key // to know indexes # Usefull functions # key of 1 item # key of 2 item # swap keys in index array # index of 1 item # swap indexes in dictionary # Check family UwU # heapifys # all needed methods # set last item index of deleted # set key of last item to deleted index # dont heapif...
3.751409
4
django_comments_xtd/tests/test_api_views.py
Boondockers-Welcome/django-comments-xtd
1
4735
from __future__ import unicode_literals try: from unittest.mock import patch except ImportError: from mock import patch from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.test import TestCase from django.urls import reverse from rest_framework.t...
from __future__ import unicode_literals try: from unittest.mock import patch except ImportError: from mock import patch from django.contrib.auth.models import User from django.contrib.contenttypes.models import ContentType from django.test import TestCase from django.urls import reverse from rest_framework.t...
en
0.963941
# It uses an authenticated user, but the user has no mail address.
2.408605
2
LC/358.py
szhu3210/LeetCode_Solutions
2
4736
class Solution(object): def rearrangeString(self, str, k): """ :type str: str :type k: int :rtype: str """ ## greedy: count keeps the # of chars, valid keeps the leftmost valid index of a char. res=[] # count # of chars d=coll...
class Solution(object): def rearrangeString(self, str, k): """ :type str: str :type k: int :rtype: str """ ## greedy: count keeps the # of chars, valid keeps the leftmost valid index of a char. res=[] # count # of chars d=coll...
en
0.696686
:type str: str :type k: int :rtype: str ## greedy: count keeps the # of chars, valid keeps the leftmost valid index of a char. # count # of chars # create a valid dict # add char one by one, that with max # first, must have valid leftmost index # get c with max # and be valid
3.226438
3
momentumopt/python/momentumopt/kinoptpy/momentum_kinematics_optimizer.py
ferdinand-wood/kino_dynamic_opt
0
4737
''' @file momentum_kinematics_optimizer.py @package momentumopt @author <NAME> (<EMAIL>) @license License BSD-3-Clause @copyright Copyright (c) 2019, New York University and Max Planck Gesellschaft. @date 2019-10-08 ''' import os import numpy as np from momentumopt.kinoptpy.qp import QpSolver from momentumopt.kinoptp...
''' @file momentum_kinematics_optimizer.py @package momentumopt @author <NAME> (<EMAIL>) @license License BSD-3-Clause @copyright Copyright (c) 2019, New York University and Max Planck Gesellschaft. @date 2019-10-08 ''' import os import numpy as np from momentumopt.kinoptpy.qp import QpSolver from momentumopt.kinoptp...
en
0.609971
@file momentum_kinematics_optimizer.py @package momentumopt @author <NAME> (<EMAIL>) @license License BSD-3-Clause @copyright Copyright (c) 2019, New York University and Max Planck Gesellschaft. @date 2019-10-08 # Create a constant polynominal for endeffector on the ground. # If there is a contact following, add the tr...
2.264971
2
gullveig/web/__init__.py
Addvilz/gullveig
8
4738
<reponame>Addvilz/gullveig import logging from gullveig import bootstrap_default_logger # Configure default logging def _configure_default_web_logger(): logger = logging.getLogger('gullveig-web') bootstrap_default_logger(logger) api_logger = logging.getLogger('gullveig-api') bootstrap_default_logger...
import logging from gullveig import bootstrap_default_logger # Configure default logging def _configure_default_web_logger(): logger = logging.getLogger('gullveig-web') bootstrap_default_logger(logger) api_logger = logging.getLogger('gullveig-api') bootstrap_default_logger(api_logger) aio_logge...
en
0.159089
# Configure default logging
1.618851
2
jupyterhub_http_authenticator/httpauthenticator.py
clockfly/jupterhub_http_authenticator
0
4739
import json import urllib import os import jupyterhub from tornado.httpclient import HTTPRequest, AsyncHTTPClient from traitlets import Unicode from jupyterhub.auth import Authenticator from tornado import gen class HttpAuthenticator(Authenticator): server = Unicode( None, allow_none=True, ...
import json import urllib import os import jupyterhub from tornado.httpclient import HTTPRequest, AsyncHTTPClient from traitlets import Unicode from jupyterhub.auth import Authenticator from tornado import gen class HttpAuthenticator(Authenticator): server = Unicode( None, allow_none=True, ...
en
0.671994
Http authentication server. Application Id recognized by the http authentication server
2.646776
3
src/lr_find.py
KushajveerSingh/fastai_without_fastai
12
4740
import torch import torch.nn as nn import numpy as np import matplotlib.pyplot as plt # NOT -> ParameterModule # NOT -> children_and_parameters # NOT -> flatten_model # NOT -> lr_range # NOT -> scheduling functions # NOT -> SmoothenValue # YES -> lr_find # NOT -> plot_lr_find # NOT TO BE MODIFIED class ParameterModu...
import torch import torch.nn as nn import numpy as np import matplotlib.pyplot as plt # NOT -> ParameterModule # NOT -> children_and_parameters # NOT -> flatten_model # NOT -> lr_range # NOT -> scheduling functions # NOT -> SmoothenValue # YES -> lr_find # NOT -> plot_lr_find # NOT TO BE MODIFIED class ParameterModu...
en
0.651784
# NOT -> ParameterModule # NOT -> children_and_parameters # NOT -> flatten_model # NOT -> lr_range # NOT -> scheduling functions # NOT -> SmoothenValue # YES -> lr_find # NOT -> plot_lr_find # NOT TO BE MODIFIED # NOT TO BE MODIFIED # To be used to flatten_model # NOT TO BE MODIFIED # NOT TO BE MODIFIED Build different...
2.546784
3
SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypesDisassembly.py
Polidea/SiriusObfuscator
427
4741
<gh_stars>100-1000 """ Test the lldb disassemble command on each call frame when stopped on C's ctor. """ from __future__ import print_function import os import time import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class IterateFrameAndDi...
""" Test the lldb disassemble command on each call frame when stopped on C's ctor. """ from __future__ import print_function import os import time import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbutil class IterateFrameAndDisassembleTestCase(T...
en
0.822498
Test the lldb disassemble command on each call frame when stopped on C's ctor. Disassemble each call frame when stopped on C's constructor. ^\s\sframe # heading for the frame info, .* # wildcard, and 0x[0-9a-f]{16} # the frame pc, and ...
2.433028
2
reservedwords.py
irinaid/MAlice
1
4742
''' All the reserved, individual words used in MAlice. ''' A = "a" ALICE = "Alice" AND = "and" ATE = "ate" BECAME = "became" BECAUSE = "because" BUT = "but" CLOSED = "closed" COMMA = "," CONTAINED = "contained" DOT = "." DRANK = "drank" EITHER = "either" ENOUGH = "enough" EVENTUALLY = "eventually" FOUND = "found" H...
''' All the reserved, individual words used in MAlice. ''' A = "a" ALICE = "Alice" AND = "and" ATE = "ate" BECAME = "became" BECAUSE = "because" BUT = "but" CLOSED = "closed" COMMA = "," CONTAINED = "contained" DOT = "." DRANK = "drank" EITHER = "either" ENOUGH = "enough" EVENTUALLY = "eventually" FOUND = "found" H...
en
0.801196
All the reserved, individual words used in MAlice.
2.249878
2
leetcode/0057_Insert_Interval/result.py
theck17/notes
0
4743
# !/usr/bin/env python3 # Author: C.K # Email: <EMAIL> # DateTime:2021-04-12 18:35:15 # Description: import os import sys class Solution: def insert(self, intervals: List[List[int]], newInterval: List[int]) -> List[List[int]]: res, i = [], 0 for interval in intervals: ...
# !/usr/bin/env python3 # Author: C.K # Email: <EMAIL> # DateTime:2021-04-12 18:35:15 # Description: import os import sys class Solution: def insert(self, intervals: List[List[int]], newInterval: List[int]) -> List[List[int]]: res, i = [], 0 for interval in intervals: ...
en
0.336794
# !/usr/bin/env python3 # Author: C.K # Email: <EMAIL> # DateTime:2021-04-12 18:35:15 # Description:
3.544982
4
src/pymortests/benchmarks.py
TiKeil/pymor
1
4744
# This file is part of the pyMOR project (http://www.pymor.org). # Copyright 2013-2020 pyMOR developers and contributors. All rights reserved. # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) from pymortests.base import runmodule if __name__ == "__main__": runmodule(filename=__file__...
# This file is part of the pyMOR project (http://www.pymor.org). # Copyright 2013-2020 pyMOR developers and contributors. All rights reserved. # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) from pymortests.base import runmodule if __name__ == "__main__": runmodule(filename=__file__...
en
0.704563
# This file is part of the pyMOR project (http://www.pymor.org). # Copyright 2013-2020 pyMOR developers and contributors. All rights reserved. # License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
1.093206
1
storage3/_sync/client.py
anand2312/storage-py
0
4745
<reponame>anand2312/storage-py<gh_stars>0 from ..utils import SyncClient, __version__ from .bucket import SyncStorageBucketAPI from .file_api import SyncBucketProxy __all__ = [ "SyncStorageClient", ] class SyncStorageClient(SyncStorageBucketAPI): """Manage storage buckets and files.""" def __init__(self...
from ..utils import SyncClient, __version__ from .bucket import SyncStorageBucketAPI from .file_api import SyncBucketProxy __all__ = [ "SyncStorageClient", ] class SyncStorageClient(SyncStorageBucketAPI): """Manage storage buckets and files.""" def __init__(self, url: str, headers: dict[str, str]) -> No...
en
0.687598
Manage storage buckets and files. Run a storage file operation. Parameters ---------- id The unique identifier of the bucket
2.416843
2
repo/script.module.liveresolver/lib/js2py/translators/__init__.py
Hades01/Addons
3
4746
# The MIT License # # Copyright 2014, 2015 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the 'Software'), # to deal in the Software without restriction, including without limitation the rights # to use, copy, modify, merge,...
# The MIT License # # Copyright 2014, 2015 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the 'Software'), # to deal in the Software without restriction, including without limitation the rights # to use, copy, modify, merge,...
en
0.75989
# The MIT License # # Copyright 2014, 2015 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the 'Software'), # to deal in the Software without restriction, including without limitation the rights # to use, copy, modify, merge,...
1.698386
2
src/test/python/test_scc_pacs.py
xchange11/ttconv-1
66
4747
<filename>src/test/python/test_scc_pacs.py #!/usr/bin/env python # -*- coding: UTF-8 -*- # Copyright (c) 2020, Sandflow Consulting LLC # # 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 co...
<filename>src/test/python/test_scc_pacs.py #!/usr/bin/env python # -*- coding: UTF-8 -*- # Copyright (c) 2020, Sandflow Consulting LLC # # 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 co...
en
0.658674
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Copyright (c) 2020, Sandflow Consulting LLC # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, t...
1.369027
1
azure-mgmt-devtestlabs/azure/mgmt/devtestlabs/models/custom_image_properties_custom.py
NMijat1024/azure-sdk-for-python
1
4748
<reponame>NMijat1024/azure-sdk-for-python # coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microso...
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
en
0.603457
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
2.001918
2
distance_torch_no_compile/chamfer.py
nicolalandro/softpool
0
4749
import torch def expanded_pairwise_distances(x, y): ''' Input: x is a bxNxd matrix y is an optional bxMxd matirx Output: dist is a bxNxM matrix where dist[i,j] is the square norm between x[i,:] and y[j,:] if y is not given then use 'y=x'. i.e. dist[i,j] = ||x[i,:]-y[j,:]||^2 ...
import torch def expanded_pairwise_distances(x, y): ''' Input: x is a bxNxd matrix y is an optional bxMxd matirx Output: dist is a bxNxM matrix where dist[i,j] is the square norm between x[i,:] and y[j,:] if y is not given then use 'y=x'. i.e. dist[i,j] = ||x[i,:]-y[j,:]||^2 ...
en
0.720888
Input: x is a bxNxd matrix y is an optional bxMxd matirx Output: dist is a bxNxM matrix where dist[i,j] is the square norm between x[i,:] and y[j,:] if y is not given then use 'y=x'. i.e. dist[i,j] = ||x[i,:]-y[j,:]||^2 input x and y are bxNxM matrix, b: batch, N:number of point, M: point...
3.176021
3
isiscb/curation/authority_views/relation_views.py
crispzips/IsisCB
4
4750
from __future__ import absolute_import from __future__ import print_function from __future__ import division from __future__ import unicode_literals from django.http import HttpResponse, HttpResponseRedirect, JsonResponse, QueryDict #, HttpResponseForbidden, Http404, , JsonResponse from django.shortcuts import get_obj...
from __future__ import absolute_import from __future__ import print_function from __future__ import division from __future__ import unicode_literals from django.http import HttpResponse, HttpResponseRedirect, JsonResponse, QueryDict #, HttpResponseForbidden, Http404, , JsonResponse from django.shortcuts import get_obj...
ru
0.146387
#, HttpResponseForbidden, Http404, , JsonResponse
1.800914
2
run_tests.py
silx-kit/silx
94
4751
#!/usr/bin/env python3 # coding: utf8 # /*########################################################################## # # Copyright (c) 2015-2021 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files ...
#!/usr/bin/env python3 # coding: utf8 # /*########################################################################## # # Copyright (c) 2015-2021 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files ...
en
0.708689
#!/usr/bin/env python3 # coding: utf8 # /*########################################################################## # # Copyright (c) 2015-2021 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files ...
1.417146
1
src/robot/utils/error.py
vprashanth777/Selenium
1
4752
# Copyright 2008-2015 Nokia Solutions and Networks # # 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 l...
# Copyright 2008-2015 Nokia Solutions and Networks # # 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 l...
en
0.807726
# Copyright 2008-2015 Nokia Solutions and Networks # # 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 l...
1.823581
2
dedupe/_init.py
neozhangthe1/dedupe
0
4753
from dedupe.api import StaticDedupe, Dedupe from dedupe.api import StaticRecordLink, RecordLink from dedupe.api import StaticGazetteer, Gazetteer from dedupe.core import randomPairs, randomPairsMatch, frozendict from dedupe.convenience import consoleLabel, trainingDataDedupe, trainingDataLink, canonicalize
from dedupe.api import StaticDedupe, Dedupe from dedupe.api import StaticRecordLink, RecordLink from dedupe.api import StaticGazetteer, Gazetteer from dedupe.core import randomPairs, randomPairsMatch, frozendict from dedupe.convenience import consoleLabel, trainingDataDedupe, trainingDataLink, canonicalize
none
1
1.046695
1
scalability/tests/test_misc.py
ggreif/ic
941
4754
import unittest from unittest import TestCase from misc import verify class TestVerify(TestCase): """Tests misc.py verifies function.""" def test_verify__with_zero_threshold_and_expected_succeeds(self): """Test passes when expected rate, actual rate and threshold are all zero.""" result = ve...
import unittest from unittest import TestCase from misc import verify class TestVerify(TestCase): """Tests misc.py verifies function.""" def test_verify__with_zero_threshold_and_expected_succeeds(self): """Test passes when expected rate, actual rate and threshold are all zero.""" result = ve...
en
0.795452
Tests misc.py verifies function. Test passes when expected rate, actual rate and threshold are all zero. Test fails when positive delta between actual rate and expected rate exceeds positive threshold. Test fails when negative delta between actual rate and expected rate exceeds negative threshold. Test fails when delta...
3.573175
4
mars/tensor/fft/ifft.py
tomzhang/mars-1
2
4755
<reponame>tomzhang/mars-1 #!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2020 Alibaba Group Holding Ltd. # # 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.ap...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2020 Alibaba Group Holding Ltd. # # 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-...
en
0.748717
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2020 Alibaba Group Holding Ltd. # # 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.724979
3
server/api/src/db/migrate/versions/v_2.py
mminamina/311-data
0
4756
def migrate(): print('migrating to version 2')
def migrate(): print('migrating to version 2')
none
1
1.182677
1
Physics250-ME29/magAverageEMFinCoil.py
illusion173/Physics250
0
4757
<reponame>illusion173/Physics250 import numpy as np import math extraNumber = 4 * math.pi * pow(10,-7) def avgEMF(): turns = input("Input how many turns: ") radius = input("Input the radius (cm):") resistance = input("Input resistance (Ω): ") magField0 = input("Input the first magnetic Field ...
import numpy as np import math extraNumber = 4 * math.pi * pow(10,-7) def avgEMF(): turns = input("Input how many turns: ") radius = input("Input the radius (cm):") resistance = input("Input resistance (Ω): ") magField0 = input("Input the first magnetic Field value (T): ") magField1 = in...
none
1
3.379261
3
bench_cupy.py
zhouxzh/Jetson_nano_stft_benchmark
0
4758
<reponame>zhouxzh/Jetson_nano_stft_benchmark #!/usr/bin/env python # -*- coding: utf-8 -*- """ Computes the spectrogram of a test signal using cupy and cuFFT. Author: <NAME> """ import sys import os import timeit import numpy as np import cupy as cp INPUT_ON_GPU = True OUTPUT_ON_GPU = True from testfile import ma...
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Computes the spectrogram of a test signal using cupy and cuFFT. Author: <NAME> """ import sys import os import timeit import numpy as np import cupy as cp INPUT_ON_GPU = True OUTPUT_ON_GPU = True from testfile import make_test_signal def spectrogram(signal, samp...
en
0.700844
#!/usr/bin/env python # -*- coding: utf-8 -*- Computes the spectrogram of a test signal using cupy and cuFFT. Author: <NAME> Computes a magnitude spectrogram at a given sample rate (in Hz), frame length (in samples) and frame rate (in Hz), on CUDA using cupy. # already blown up to a list of frames # apply window f...
2.626937
3
geotrek/appconfig.py
Cynthia-Borot-PNE/Geotrek-admin
0
4759
from django.apps import AppConfig from django.contrib.admin.apps import AdminConfig from django.contrib.auth.apps import AuthConfig from django.contrib.contenttypes.apps import ContentTypesConfig from django.contrib.sessions.apps import SessionsConfig from django.db.models.signals import post_migrate from django_celery...
from django.apps import AppConfig from django.contrib.admin.apps import AdminConfig from django.contrib.auth.apps import AuthConfig from django.contrib.contenttypes.apps import ContentTypesConfig from django.contrib.sessions.apps import SessionsConfig from django.db.models.signals import post_migrate from django_celery...
en
0.591555
Base class to handle table move on right schemas, and load SQL files !! WARNING !! need to create subclass in geotrek.myapp.apps for project apps, and create subclasses here for external subclasses bind for django.contrib.auth bind for django.contrib.contenttype
1.807073
2
dtr_code/shared/run_torch_trial.py
merrymercy/dtr-prototype
1
4760
<reponame>merrymercy/dtr-prototype<gh_stars>1-10 """ To avoid any issues of memory hanging around between inputs, we run each input as a separate process. A little ugly but effective """ import gc import glob import json import os import random import time import numpy as np import torch from common import invoke_ma...
""" To avoid any issues of memory hanging around between inputs, we run each input as a separate process. A little ugly but effective """ import gc import glob import json import os import random import time import numpy as np import torch from common import invoke_main, read_json, write_json, prepare_out_file, chec...
en
0.892469
To avoid any issues of memory hanging around between inputs, we run each input as a separate process. A little ugly but effective Find the last DTR log produced in the trial (if any exist) and move it to the directory # if we delete all logs in advance, there should be at most one log # rename and move # (new name...
1.892271
2
pythonTools/downloadPDBsInList.py
rsanchezgarc/BIPSPI
5
4761
import sys, os from subprocess import call try: from downloadPdb import downloadPDB except ImportError: from .downloadPdb import downloadPDB pdbListFile="/home/rsanchez/Tesis/rriPredMethod/data/joanDimers/117_dimers_list.tsv" outPath="/home/rsanchez/Tesis/rriPredMethod/data/joanDimers/pdbFiles/rawPDBs" USE_BIO_...
import sys, os from subprocess import call try: from downloadPdb import downloadPDB except ImportError: from .downloadPdb import downloadPDB pdbListFile="/home/rsanchez/Tesis/rriPredMethod/data/joanDimers/117_dimers_list.tsv" outPath="/home/rsanchez/Tesis/rriPredMethod/data/joanDimers/pdbFiles/rawPDBs" USE_BIO_...
en
0.154036
##def downloadPDB(pdbId, pdbOutPath, useBioUnit): #### descargar pdb: wget ftp://ftp.wwpdb.org/pub/pdb/data/biounit/coordinates/all/1i1q.pdb2.gz o ya descomprimido #### wget -qO- ftp://ftp.wwpdb.org/pub/pdb/data/biounit/coordinates/all/1i1q.pdb2.gz |zcat > 1i1q.pdb ## outName= os.path.join(pdbOutPath,pdbId+'.pdb') #...
2.301203
2
code/python3/search_facets.py
hsethi2709/xapian-docsprint
47
4762
<gh_stars>10-100 #!/usr/bin/env python import json import sys import xapian import support def search(dbpath, querystring, offset=0, pagesize=10): # offset - defines starting point within result set # pagesize - defines number of records to retrieve # Open the database we're going to search. db = xap...
#!/usr/bin/env python import json import sys import xapian import support def search(dbpath, querystring, offset=0, pagesize=10): # offset - defines starting point within result set # pagesize - defines number of records to retrieve # Open the database we're going to search. db = xapian.Database(dbpa...
en
0.604495
#!/usr/bin/env python # offset - defines starting point within result set # pagesize - defines number of records to retrieve # Open the database we're going to search. # Set up a QueryParser with a stemmer and suitable prefixes # And parse the query # Use an Enquire object on the database to run the query # And print o...
2.68585
3
iconcollections/serializers.py
plrthink/myicons
83
4763
import re from rest_framework import serializers from .models import Collection, CollectionIcon class CollectionSerializer(serializers.ModelSerializer): """Collections's serializer""" class Meta: model = Collection read_only = ('token', ) class CollectionIconSerializer(serializers.ModelSe...
import re from rest_framework import serializers from .models import Collection, CollectionIcon class CollectionSerializer(serializers.ModelSerializer): """Collections's serializer""" class Meta: model = Collection read_only = ('token', ) class CollectionIconSerializer(serializers.ModelSe...
en
0.768179
Collections's serializer CollectionIcon's Serializer.
2.500682
3
Python/partition-to-k-equal-sum-subsets.py
sm2774us/leetcode_interview_prep_2021
0
4764
# Time: O(n*2^n) # Space: O(2^n) class Solution(object): def canPartitionKSubsets(self, nums, k): """ :type nums: List[int] :type k: int :rtype: bool """ def dfs(nums, target, used, todo, lookup): if lookup[used] is None: targ = (todo-1)%...
# Time: O(n*2^n) # Space: O(2^n) class Solution(object): def canPartitionKSubsets(self, nums, k): """ :type nums: List[int] :type k: int :rtype: bool """ def dfs(nums, target, used, todo, lookup): if lookup[used] is None: targ = (todo-1)%...
en
0.424962
# Time: O(n*2^n) # Space: O(2^n) :type nums: List[int] :type k: int :rtype: bool # Time: O(k^(n-k) * k!) # Space: O(n) # DFS solution with pruning. :type nums: List[int] :type k: int :rtype: bool
3.033913
3
var/spack/repos/builtin/packages/aspell/package.py
jeanbez/spack
0
4765
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack.package import * # See also: AspellDictPackage class Aspell(AutotoolsPackage, GNUMirrorPackage): """GNU A...
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) from spack.package import * # See also: AspellDictPackage class Aspell(AutotoolsPackage, GNUMirrorPackage): """GNU A...
en
0.676467
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) # See also: AspellDictPackage GNU Aspell is a Free and Open Source spell checker designed to eventually replace Ispell....
1.122851
1
third_party_package/RDKit_2015_03_1/rdkit/ML/Descriptors/UnitTestParser.py
Ivy286/cluster_basedfps
9
4766
<reponame>Ivy286/cluster_basedfps<filename>third_party_package/RDKit_2015_03_1/rdkit/ML/Descriptors/UnitTestParser.py # # Copyright (C) 2001 <NAME> # """ unit testing code for compound descriptors """ from __future__ import print_function import unittest import Parser from rdkit.six.moves import xrange class ...
# # Copyright (C) 2001 <NAME> # """ unit testing code for compound descriptors """ from __future__ import print_function import unittest import Parser from rdkit.six.moves import xrange class TestCase(unittest.TestCase): def setUp(self): print('\n%s: '%self.shortDescription(),end='') self.piece1 = [...
en
0.217018
# # Copyright (C) 2001 <NAME> # unit testing code for compound descriptors #self.assertTrue(abs(res[0]-self.results[i])<self.tol,'Expression %s failed'%(cExpr)) #self.assertTrue((res[1]-self.results[i])<self.tol,'Expression %s failed'%(cExpr))
2.654937
3
setup.py
maciek3000/data_dashboard
8
4767
from setuptools import setup, find_packages import pathlib here = pathlib.Path(__file__).parent.resolve() long_description = (here / "readme.md").read_text(encoding="utf-8") setup( name="data_dashboard", version="0.1.1", description="Dashboard to explore the data and to create baseline Machine Learning m...
from setuptools import setup, find_packages import pathlib here = pathlib.Path(__file__).parent.resolve() long_description = (here / "readme.md").read_text(encoding="utf-8") setup( name="data_dashboard", version="0.1.1", description="Dashboard to explore the data and to create baseline Machine Learning m...
none
1
1.568079
2
test/e2e/tests/test_instance.py
acornett21/ack-ec2-controller
0
4768
<filename>test/e2e/tests/test_instance.py # Copyright 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...
<filename>test/e2e/tests/test_instance.py # Copyright 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...
en
0.850639
# Copyright 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" file accompanyin...
2.280521
2
web/app/forms.py
Devidence7/Break
0
4769
<reponame>Devidence7/Break from flask_wtf import FlaskForm from wtforms import Form, StringField, PasswordField, BooleanField, SubmitField, IntegerField, validators, FileField, \ MultipleFileField, SelectField, RadioField, HiddenField, DecimalField, TextAreaField from wtforms.fields.html5 import DateField from wtfo...
from flask_wtf import FlaskForm from wtforms import Form, StringField, PasswordField, BooleanField, SubmitField, IntegerField, validators, FileField, \ MultipleFileField, SelectField, RadioField, HiddenField, DecimalField, TextAreaField from wtforms.fields.html5 import DateField from wtforms.validators import DataR...
es
0.291676
# Structure of the Login form # Structure of the Register form # username = StringField('Username', [ # validators.Length(min=4, max=25, message='El nombre de usuario debe tener entre 4 y 25 carácteres')]) # Structure of the Login form # Structure of the Subir Anuncio form # pictures = HiddenField("Imágenes") # mime...
2.987059
3
hello.py
LMiceOrg/postdoc-voting
0
4770
#coding: utf-8 import sys import os import asyncio import websockets import json import socket import xlrd #global vars phd_data = None pro_data = None def get_host_ip(): try: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(('192.168.127.12', 65535)) ip = s.getsockname()[0]...
#coding: utf-8 import sys import os import asyncio import websockets import json import socket import xlrd #global vars phd_data = None pro_data = None def get_host_ip(): try: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(('192.168.127.12', 65535)) ip = s.getsockname()[0]...
en
0.256455
#coding: utf-8 #global vars #生成json
2.645015
3
runtime/Python3/src/antlr4/dfa/DFASerializer.py
maximmenshikov/antlr4
11,811
4771
# # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. # Use of this file is governed by the BSD 3-clause license that # can be found in the LICENSE.txt file in the project root. #/ # A DFA walker that knows how to dump them to serialized strings.#/ from io import StringIO from antlr4 import DFA from antl...
# # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. # Use of this file is governed by the BSD 3-clause license that # can be found in the LICENSE.txt file in the project root. #/ # A DFA walker that knows how to dump them to serialized strings.#/ from io import StringIO from antlr4 import DFA from antl...
en
0.941799
# # Copyright (c) 2012-2017 The ANTLR Project. All rights reserved. # Use of this file is governed by the BSD 3-clause license that # can be found in the LICENSE.txt file in the project root. #/ # A DFA walker that knows how to dump them to serialized strings.#/
1.938581
2
sw/calibrate.py
microsoft/moabian
13
4772
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. """ Calibration Controller Performs calibration for hue, center of camera position, and servo offsets """ import os import cv2 import time import json import argparse import datetime import numpy as np import logging as log from env import Moa...
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. """ Calibration Controller Performs calibration for hue, center of camera position, and servo offsets """ import os import cv2 import time import json import argparse import datetime import numpy as np import logging as log from env import Moa...
en
0.840675
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. Calibration Controller Performs calibration for hue, center of camera position, and servo offsets # Reasonable default # If menu is pressed before the calibration is complete # If menu is pressed before the calibration is complete # If menu is pr...
3.022476
3
marketing/tests_celery_tasks.py
renzyndrome/lits-crm
1
4773
from datetime import datetime, timedelta from django.test import TestCase from django.test.utils import override_settings from marketing.tasks import ( delete_multiple_contacts_tasks, list_all_bounces_unsubscribes, run_all_campaigns, run_campaign, send_campaign_email_to_admin_contact, send_sch...
from datetime import datetime, timedelta from django.test import TestCase from django.test.utils import override_settings from marketing.tasks import ( delete_multiple_contacts_tasks, list_all_bounces_unsubscribes, run_all_campaigns, run_campaign, send_campaign_email_to_admin_contact, send_sch...
none
1
2.151437
2
doc's/3-labels_and_titles.py
andreluispy/py2html
0
4774
<filename>doc's/3-labels_and_titles.py<gh_stars>0 from py2html.main import * page = web() page.create() # Header Parameters # text = header text # n = title level page.header(text='My Site', n=1) # Label Parameters # text = label text # color = label color page.label(text='', color='') page.compile()
<filename>doc's/3-labels_and_titles.py<gh_stars>0 from py2html.main import * page = web() page.create() # Header Parameters # text = header text # n = title level page.header(text='My Site', n=1) # Label Parameters # text = label text # color = label color page.label(text='', color='') page.compile()
en
0.352146
# Header Parameters # text = header text # n = title level # Label Parameters # text = label text # color = label color
2.581515
3
JorGpi/tests/test_pickup.py
adujovic/JorG
1
4775
import unittest from JorGpi.pickup.pickup import SmartPickUp,Reference,CommandLineOptions class TestPickupIron(unittest.TestCase): @staticmethod def options(*args): return CommandLineOptions(*args) def test_iron_001(self): _input = "test -R _VASP/Fe/noFlip -D _VASP/Fe/flip00000 -E Fe -J1 ...
import unittest from JorGpi.pickup.pickup import SmartPickUp,Reference,CommandLineOptions class TestPickupIron(unittest.TestCase): @staticmethod def options(*args): return CommandLineOptions(*args) def test_iron_001(self): _input = "test -R _VASP/Fe/noFlip -D _VASP/Fe/flip00000 -E Fe -J1 ...
none
1
2.511483
3
jwt_auth/admin.py
alaraayan/todo-backend
0
4776
<reponame>alaraayan/todo-backend<filename>jwt_auth/admin.py from django.contrib import admin from django.contrib.auth import get_user_model User = get_user_model() admin.site.register(User)
from django.contrib import admin from django.contrib.auth import get_user_model User = get_user_model() admin.site.register(User)
none
1
1.465793
1
spotseeker_server/test/search/distance.py
uw-it-aca/spotseeker_server
5
4777
<reponame>uw-it-aca/spotseeker_server # Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 from django.test import TestCase from django.conf import settings from django.test.client import Client from spotseeker_server.models import Spot import simplejson as json from decimal import * ...
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 from django.test import TestCase from django.conf import settings from django.test.client import Client from spotseeker_server.models import Spot import simplejson as json from decimal import * from django.test.utils import override...
en
0.912195
# Copyright 2021 UW-IT, University of Washington # SPDX-License-Identifier: Apache-2.0 # Spots are in the atlantic to make them less likely to collide # with actual spots # Inner spots are 10 meters away from the center # Mid spots are 50 meters away from the center # Outer spots are 100 meters away from the center # F...
2.315703
2
get_active_LSPs.py
JNPRAutomate/northstar_SDN_controller_automation
3
4778
# this python script makes a rest call to Juniper Northstar to get active LSPs # usage: python get_active_LSPs.py import json import requests from requests.auth import HTTPBasicAuth from pprint import pprint import yaml from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3...
# this python script makes a rest call to Juniper Northstar to get active LSPs # usage: python get_active_LSPs.py import json import requests from requests.auth import HTTPBasicAuth from pprint import pprint import yaml from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3...
en
0.702497
# this python script makes a rest call to Juniper Northstar to get active LSPs # usage: python get_active_LSPs.py # r = requests.get(url, headers=headers, auth=(authuser, authpwd)) # type(r.json()) # pprint(r.json()) # This gives the names of all the LSPs that are active
2.633461
3
bindings/python/tests/cdef_types.py
mewbak/dragonffi
0
4779
# Copyright 2018 <NAME> <<EMAIL>> # # 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 w...
# Copyright 2018 <NAME> <<EMAIL>> # # 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 w...
en
0.785172
# Copyright 2018 <NAME> <<EMAIL>> # # 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 writ...
2.235999
2
hierarchical_foresight/env/environment.py
deepneuralmachine/google-research
23,901
4780
<gh_stars>1000+ # coding=utf-8 # Copyright 2021 The Google Research 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 requ...
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
en
0.842168
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
2.401943
2
trips/migrations/0004_invoice.py
chorna/taxi24
0
4781
<gh_stars>0 # Generated by Django 3.2.5 on 2021-07-11 23:51 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('trips', '0003_alter_trip_state'), ] operations = [ migrations.CreateModel( name='In...
# Generated by Django 3.2.5 on 2021-07-11 23:51 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('trips', '0003_alter_trip_state'), ] operations = [ migrations.CreateModel( name='Invoice', ...
en
0.828208
# Generated by Django 3.2.5 on 2021-07-11 23:51
1.61547
2
src/general_harvester.py
Badger-Finance/python-keepers
0
4782
<gh_stars>0 import logging import os from decimal import Decimal from time import sleep import requests from hexbytes import HexBytes from web3 import Web3 from web3 import contract from web3.contract import Contract from config.constants import BASE_CURRENCIES from config.constants import GAS_LIMITS from config.cons...
import logging import os from decimal import Decimal from time import sleep import requests from hexbytes import HexBytes from web3 import Web3 from web3 import contract from web3.contract import Contract from config.constants import BASE_CURRENCIES from config.constants import GAS_LIMITS from config.constants import...
en
0.791219
# min ratio of want to total vault AUM required to harvest # Times of last harvest # Don't care about poly/arbitrum Calculates the time between harvests for the supplied strategy and returns true if it has been longer than the supplied harvest_interval_threshold which is measured in seconds Args: ...
1.812921
2
clickhouse_plantuml/column.py
yonesko/clickhouse-plantuml
0
4783
<reponame>yonesko/clickhouse-plantuml #!/usr/bin/env python # License: Apache-2.0 # Copyright (C) 2020 <NAME> class Column(object): """ Represents ClickHouse column """ def __init__( self, database: str, table: str, name: str, type: str, default_kind: ...
#!/usr/bin/env python # License: Apache-2.0 # Copyright (C) 2020 <NAME> class Column(object): """ Represents ClickHouse column """ def __init__( self, database: str, table: str, name: str, type: str, default_kind: str, default_expression: str, ...
en
0.464487
#!/usr/bin/env python # License: Apache-2.0 # Copyright (C) 2020 <NAME> Represents ClickHouse column
2.835188
3
contrib/micronet/scripts/file2buf.py
pmalhaire/WireHub
337
4784
<reponame>pmalhaire/WireHub #!/usr/bin/env python3 import os import sys MAX = 8 fpath = sys.argv[1] name = sys.argv[2] with open(fpath, "rb") as fh: sys.stdout.write("char %s[] = {" % (name,) ) i = 0 while True: if i > 0: sys.stdout.write(", ") if i % MAX == 0: ...
#!/usr/bin/env python3 import os import sys MAX = 8 fpath = sys.argv[1] name = sys.argv[2] with open(fpath, "rb") as fh: sys.stdout.write("char %s[] = {" % (name,) ) i = 0 while True: if i > 0: sys.stdout.write(", ") if i % MAX == 0: sys.stdout.write("\n\t") ...
fr
0.221828
#!/usr/bin/env python3
2.874717
3
tests/test_observable/test_skip.py
christiansandberg/RxPY
0
4785
<reponame>christiansandberg/RxPY import unittest from reactivex import operators as ops from reactivex.testing import ReactiveTest, TestScheduler on_next = ReactiveTest.on_next on_completed = ReactiveTest.on_completed on_error = ReactiveTest.on_error subscribe = ReactiveTest.subscribe subscribed = ReactiveTest.subscr...
import unittest from reactivex import operators as ops from reactivex.testing import ReactiveTest, TestScheduler on_next = ReactiveTest.on_next on_completed = ReactiveTest.on_completed on_error = ReactiveTest.on_error subscribe = ReactiveTest.subscribe subscribed = ReactiveTest.subscribed disposed = ReactiveTest.disp...
none
1
2.467958
2
CF#691/python/A.py
chaitanya1243/CP
0
4786
def solve(n, red , blue): rcount = bcount = 0 for i in range(n): if int(red[i]) > int(blue[i]): rcount = rcount +1 elif int(red[i]) < int(blue[i]): bcount = bcount + 1 print( 'RED' if rcount>bcount else ('BLUE' if bcount>rcount else 'EQUAL')) if __name__ == "__ma...
def solve(n, red , blue): rcount = bcount = 0 for i in range(n): if int(red[i]) > int(blue[i]): rcount = rcount +1 elif int(red[i]) < int(blue[i]): bcount = bcount + 1 print( 'RED' if rcount>bcount else ('BLUE' if bcount>rcount else 'EQUAL')) if __name__ == "__ma...
none
1
3.348223
3
shudder/__main__.py
fitpay/shudder
0
4787
# Copyright 2014 Scopely, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
# Copyright 2014 Scopely, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
en
0.818448
# Copyright 2014 Scopely, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
2.016459
2
example/hydrogen.py
NLESC-JCER/pyCHAMP
4
4788
import autograd.numpy as np from pyCHAMP.wavefunction.wf_base import WF from pyCHAMP.optimizer.minimize import Minimize from pyCHAMP.sampler.metropolis import Metropolis from pyCHAMP.sampler.hamiltonian import Hamiltonian from pyCHAMP.solver.vmc import VMC class Hydrogen(WF): def __init__(self, nelec, ndim): ...
import autograd.numpy as np from pyCHAMP.wavefunction.wf_base import WF from pyCHAMP.optimizer.minimize import Minimize from pyCHAMP.sampler.metropolis import Metropolis from pyCHAMP.sampler.hamiltonian import Hamiltonian from pyCHAMP.solver.vmc import VMC class Hydrogen(WF): def __init__(self, nelec, ndim): ...
en
0.34745
Compute the value of the wave function. Args: parameters : parameters of th wf x: position of the electron Returns: values of psi # VMS solver # single point # optimization
2.424901
2
braintree/account_updater_daily_report.py
futureironman/braintree_python
182
4789
from braintree.configuration import Configuration from braintree.resource import Resource class AccountUpdaterDailyReport(Resource): def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "report_url" in attributes: self.report_url = attributes.pop("re...
from braintree.configuration import Configuration from braintree.resource import Resource class AccountUpdaterDailyReport(Resource): def __init__(self, gateway, attributes): Resource.__init__(self, gateway, attributes) if "report_url" in attributes: self.report_url = attributes.pop("re...
none
1
2.306897
2
game/ball.py
geoncic/PyBlock
0
4790
import pygame import pygame.gfxdraw from constants import Constants class Balls(object): def __init__(self, all_sprites, all_balls): self.all_sprites = all_sprites self.all_balls = all_balls def spawn_ball(self, pos, vel, team): # Todo: Figure out how to spawn multiple balls with some...
import pygame import pygame.gfxdraw from constants import Constants class Balls(object): def __init__(self, all_sprites, all_balls): self.all_sprites = all_sprites self.all_balls = all_balls def spawn_ball(self, pos, vel, team): # Todo: Figure out how to spawn multiple balls with some...
en
0.81896
# Todo: Figure out how to spawn multiple balls with some sort of delay # self.rect.center = pygame.mouse.get_pos() # has sprite follow the mouse
3.093997
3
program/eggUI.py
otills/embryocv
1
4791
<gh_stars>1-10 from pyqtgraph.Qt import QtCore, QtGui import numpy as np from scipy.spatial import distance as dist import glob import re import os from PyQt5 import QtGui from PyQt5.QtCore import * from PyQt5.QtGui import * import sys import cv2 import pandas as pd from PyQt5.Qt import * import pyqtgraph as pg #from P...
from pyqtgraph.Qt import QtCore, QtGui import numpy as np from scipy.spatial import distance as dist import glob import re import os from PyQt5 import QtGui from PyQt5.QtCore import * from PyQt5.QtGui import * import sys import cv2 import pandas as pd from PyQt5.Qt import * import pyqtgraph as pg #from PyQt4.Qt import ...
en
0.455551
#from PyQt4.Qt import * #%% createOpenCVEggROI : take eggID defined ROIs and visualise # Make QDialog #============================================================================== # #============================================================================== # Make ImageView # Make ROI # Remove buttons from ImageV...
2.409932
2
Curso em Vídeo/Mundo 2 Estruturas de Controle/Desafios/desafio053.py
henriqueumeda/-Estudo-python
0
4792
frase = input('Digite uma frase: ').upper().strip().replace(' ', '') tamanho = int(len(frase)) inverso = '' #Opção mais simples: # inverso = frase[::-1] for contador in range(tamanho-1, -1, -1): inverso += frase[contador] print('O inverso de {} é {}'.format(frase, inverso)) if frase == inverso: print('Temos...
frase = input('Digite uma frase: ').upper().strip().replace(' ', '') tamanho = int(len(frase)) inverso = '' #Opção mais simples: # inverso = frase[::-1] for contador in range(tamanho-1, -1, -1): inverso += frase[contador] print('O inverso de {} é {}'.format(frase, inverso)) if frase == inverso: print('Temos...
pt
0.973215
#Opção mais simples: # inverso = frase[::-1]
3.988323
4
tests/unittest/options/pricing/test_binomial_trees.py
yiluzhu/quant
1
4793
from unittest import TestCase from options.pricing.binomial_trees import BinomialTreePricer from options.option import OptionType, Option class BinomialTreeTestCase(TestCase): def test_basic(self): """European option, spot price 50, strike price 52, risk free interest rate 5% expiry 2 years, vo...
from unittest import TestCase from options.pricing.binomial_trees import BinomialTreePricer from options.option import OptionType, Option class BinomialTreeTestCase(TestCase): def test_basic(self): """European option, spot price 50, strike price 52, risk free interest rate 5% expiry 2 years, vo...
en
0.735047
European option, spot price 50, strike price 52, risk free interest rate 5% expiry 2 years, volatility 30%
3.26667
3
mctimer.py
Sharpieman20/MCtimer
0
4794
import atexit import os import sys import platform import json import glob import datetime import time import threading import tkinter as tk from pynput import mouse from pathlib import Path from playsound import playsound from enum import Enum import copy #"THE BEER-WARE LICENSE" (Revision 42): #bleach86 wrote this ...
import atexit import os import sys import platform import json import glob import datetime import time import threading import tkinter as tk from pynput import mouse from pathlib import Path from playsound import playsound from enum import Enum import copy #"THE BEER-WARE LICENSE" (Revision 42): #bleach86 wrote this ...
en
0.453458
#"THE BEER-WARE LICENSE" (Revision 42): #bleach86 wrote this file. As long as you retain this notice you can do whatever you want with this stuff. #If we meet some day, and you think this stuff is worth it, you can buy me a beer in return # continuously read from input file every 10ms # when you get a "reset timer" mes...
2.421371
2
kafka/structs.py
informatique-cdc/kafka-python
4,389
4795
""" Other useful structs """ from __future__ import absolute_import from collections import namedtuple """A topic and partition tuple Keyword Arguments: topic (str): A topic name partition (int): A partition id """ TopicPartition = namedtuple("TopicPartition", ["topic", "partition"]) """A Kafka broker...
""" Other useful structs """ from __future__ import absolute_import from collections import namedtuple """A topic and partition tuple Keyword Arguments: topic (str): A topic name partition (int): A partition id """ TopicPartition = namedtuple("TopicPartition", ["topic", "partition"]) """A Kafka broker...
en
0.725407
Other useful structs A topic and partition tuple Keyword Arguments: topic (str): A topic name partition (int): A partition id A Kafka broker metadata used by admin tools. Keyword Arguments: nodeID (int): The Kafka broker id. host (str): The Kafka broker hostname. port (int): The Kafka broker port....
2.770589
3
Vehicle_Counting_colab.py
manolosolalinde/Vehicle-Counting
0
4796
import cv2 from trackers.tracker import create_blob, add_new_blobs, remove_duplicates import numpy as np from collections import OrderedDict from detectors.detector import get_bounding_boxes import uuid import os import contextlib from datetime import datetime import argparse from utils.detection_roi import get_roi_fra...
import cv2 from trackers.tracker import create_blob, add_new_blobs, remove_duplicates import numpy as np from collections import OrderedDict from detectors.detector import get_bounding_boxes import uuid import os import contextlib from datetime import datetime import argparse from utils.detection_roi import get_roi_fra...
en
0.664514
# parse CLI arguments # capture traffic scene video # configs # init video object and log file to record counting # set counting line # create detection ROI # initialize trackers and create new blobs # update trackers # delete untracked blobs # count vehicles # log count data to a file (vehicle_id, count, datetime) # r...
2.499336
2
app/resources/magic_castle_api.py
ComputeCanada/mc-hub
5
4797
<filename>app/resources/magic_castle_api.py from flask import request from resources.api_view import ApiView from exceptions.invalid_usage_exception import InvalidUsageException from models.user.user import User from models.user.authenticated_user import AuthenticatedUser class MagicCastleAPI(ApiView): def get(se...
<filename>app/resources/magic_castle_api.py from flask import request from resources.api_view import ApiView from exceptions.invalid_usage_exception import InvalidUsageException from models.user.user import User from models.user.authenticated_user import AuthenticatedUser class MagicCastleAPI(ApiView): def get(se...
none
1
2.412327
2
tests/rbac/api/role/propose_member_test.py
kthblmfld/sawtooth-next-directory
0
4798
# Copyright 2018 Contributors to Hyperledger Sawtooth # # 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 ...
# Copyright 2018 Contributors to Hyperledger Sawtooth # # 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.815222
# Copyright 2018 Contributors to Hyperledger Sawtooth # # 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.932414
2
f2v.py
ClimberY/video_super_resolution_toolbox
0
4799
import cv2 import os import numpy as np from PIL import Image def frame2video(im_dir, video_dir, fps): im_list = os.listdir(im_dir) im_list.sort(key=lambda x: int(x.replace("_RBPNF7", "").split('.')[0])) img = Image.open(os.path.join(im_dir, im_list[0])) img_size = img.size # 获得图片分辨率,im_dir文件夹下的图片分辨率...
import cv2 import os import numpy as np from PIL import Image def frame2video(im_dir, video_dir, fps): im_list = os.listdir(im_dir) im_list.sort(key=lambda x: int(x.replace("_RBPNF7", "").split('.')[0])) img = Image.open(os.path.join(im_dir, im_list[0])) img_size = img.size # 获得图片分辨率,im_dir文件夹下的图片分辨率...
zh
0.865041
# 获得图片分辨率,im_dir文件夹下的图片分辨率需要一致 # 帧存放路径 # 合成视频存放的路径 # 帧率
2.746668
3