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 |
|---|---|---|---|---|---|---|---|---|---|---|
beet/contrib/render.py | Arcensoth/beet | 46 | 12100 | <filename>beet/contrib/render.py
"""Plugin that invokes the built-in template renderer."""
__all__ = [
"RenderOptions",
"render",
]
from typing import Dict, List
from pydantic import BaseModel
from beet import Context, configurable
class RenderOptions(BaseModel):
resource_pack: Dict[str, List[str]] ... | <filename>beet/contrib/render.py
"""Plugin that invokes the built-in template renderer."""
__all__ = [
"RenderOptions",
"render",
]
from typing import Dict, List
from pydantic import BaseModel
from beet import Context, configurable
class RenderOptions(BaseModel):
resource_pack: Dict[str, List[str]] ... | en | 0.68117 | Plugin that invokes the built-in template renderer. Plugin that processes the data pack and the resource pack with Jinja. | 2.316741 | 2 |
customtkinter/customtkinter_progressbar.py | thisSELFmySELF/CustomTkinter | 1 | 12101 | import sys
import tkinter
from .customtkinter_tk import CTk
from .customtkinter_frame import CTkFrame
from .appearance_mode_tracker import AppearanceModeTracker
from .customtkinter_color_manager import CTkColorManager
class CTkProgressBar(tkinter.Frame):
""" tkinter custom progressbar, always horizontal, values ... | import sys
import tkinter
from .customtkinter_tk import CTk
from .customtkinter_frame import CTkFrame
from .appearance_mode_tracker import AppearanceModeTracker
from .customtkinter_color_manager import CTkColorManager
class CTkProgressBar(tkinter.Frame):
""" tkinter custom progressbar, always horizontal, values ... | en | 0.871474 | tkinter custom progressbar, always horizontal, values are from 0 to 1 # overwrite configure methods of master when master is tkinter widget, so that bg changes get applied on child CTk widget too # args[0] is dict when attribute gets changed by widget[<attribut>] syntax # 0: "Light" 1: "Dark" # Each time an item is res... | 2.554008 | 3 |
backtest/tests/test_strategy.py | Christakou/backtest | 0 | 12102 | import pytest
from backtest.strategy import BuyAndHoldEqualAllocation
@pytest.fixture
def strategy():
symbols = ('AAPL', 'GOOG')
strategy = BuyAndHoldEqualAllocation(relevant_symbols=symbols)
return strategy
def test_strategy_execute(strategy):
strategy.execute()
assert len(strategy.holdings) > 0... | import pytest
from backtest.strategy import BuyAndHoldEqualAllocation
@pytest.fixture
def strategy():
symbols = ('AAPL', 'GOOG')
strategy = BuyAndHoldEqualAllocation(relevant_symbols=symbols)
return strategy
def test_strategy_execute(strategy):
strategy.execute()
assert len(strategy.holdings) > 0... | none | 1 | 2.718437 | 3 | |
onnx/backend/test/case/node/constant.py | stillmatic/onnx | 0 | 12103 | # SPDX-License-Identifier: Apache-2.0
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import onnx
from ..base import Base
from . import expect
class Constant(Base):
@staticmethod
def exp... | # SPDX-License-Identifier: Apache-2.0
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import onnx
from ..base import Base
from . import expect
class Constant(Base):
@staticmethod
def exp... | de | 0.279145 | # SPDX-License-Identifier: Apache-2.0 # type: () -> None | 1.963538 | 2 |
nvd3/multiChart.py | areski/python-nvd3 | 442 | 12104 | <filename>nvd3/multiChart.py<gh_stars>100-1000
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Python-nvd3 is a Python wrapper for NVD3 graph library.
NVD3 is an attempt to build re-usable charts and chart components
for d3.js without taking away the power that d3.js gives you.
Project location : https://github.com/are... | <filename>nvd3/multiChart.py<gh_stars>100-1000
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Python-nvd3 is a Python wrapper for NVD3 graph library.
NVD3 is an attempt to build re-usable charts and chart components
for d3.js without taking away the power that d3.js gives you.
Project location : https://github.com/are... | en | 0.348568 | #!/usr/bin/python # -*- coding: utf-8 -*- Python-nvd3 is a Python wrapper for NVD3 graph library. NVD3 is an attempt to build re-usable charts and chart components for d3.js without taking away the power that d3.js gives you. Project location : https://github.com/areski/python-nvd3 A multiChart is a type of chart whic... | 3.217003 | 3 |
utils/config.py | AlbertiPot/nar | 2 | 12105 | """
Date: 2021/09/23
Target: config utilities for yml file.
implementation adapted from Slimmable: https://github.com/JiahuiYu/slimmable_networks.git
"""
import os
import yaml
class LoaderMeta(type):
"""
Constructor for supporting `!include`.
"""
def __new__(mcs, __name__, __bases__, __dict__):
... | """
Date: 2021/09/23
Target: config utilities for yml file.
implementation adapted from Slimmable: https://github.com/JiahuiYu/slimmable_networks.git
"""
import os
import yaml
class LoaderMeta(type):
"""
Constructor for supporting `!include`.
"""
def __new__(mcs, __name__, __bases__, __dict__):
... | en | 0.833735 | Date: 2021/09/23 Target: config utilities for yml file. implementation adapted from Slimmable: https://github.com/JiahuiYu/slimmable_networks.git Constructor for supporting `!include`. Add include constructer to class. # register the include constructor on the class YAML Loader with `!include` constructor. Include fil... | 2.357227 | 2 |
src/api/fundings/entities.py | cbn-alpin/gefiproj-api | 2 | 12106 | <filename>src/api/fundings/entities.py<gh_stars>1-10
from marshmallow import Schema, fields, validate
from sqlalchemy import Column, String, Integer, Float, Date, ForeignKey
from sqlalchemy.orm import relationship
from ..funders.entities import Funder, FunderSchema
from src.api import db
from src.shared.entity import ... | <filename>src/api/fundings/entities.py<gh_stars>1-10
from marshmallow import Schema, fields, validate
from sqlalchemy import Column, String, Integer, Float, Date, ForeignKey
from sqlalchemy.orm import relationship
from ..funders.entities import Funder, FunderSchema
from src.api import db
from src.shared.entity import ... | en | 0.852938 | # TODO find solution to replace because option unknown=INCLUDE don't work in a list | 2.345562 | 2 |
src/extensions/COMMANDS/CommitCommand.py | DMTF/python-redfish-utility | 15 | 12107 | <filename>src/extensions/COMMANDS/CommitCommand.py<gh_stars>10-100
###
# Copyright Notice:
# Copyright 2016 Distributed Management Task Force, Inc. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/python-redfish-utility/blob/master/LICENSE.md
###
""" Commit Co... | <filename>src/extensions/COMMANDS/CommitCommand.py<gh_stars>10-100
###
# Copyright Notice:
# Copyright 2016 Distributed Management Task Force, Inc. All rights reserved.
# License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/python-redfish-utility/blob/master/LICENSE.md
###
""" Commit Co... | en | 0.649683 | ### # Copyright Notice: # Copyright 2016 Distributed Management Task Force, Inc. All rights reserved. # License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/python-redfish-utility/blob/master/LICENSE.md ### Commit Command for RDMC Constructor Main commit worker function
:param optio... | 2.072937 | 2 |
rosetta/views.py | evrenesat/ganihomes | 24 | 12108 | from django.conf import settings
from django.contrib.auth.decorators import user_passes_test
from django.core.paginator import Paginator
from django.core.urlresolvers import reverse
from django.http import Http404, HttpResponseRedirect, HttpResponse
from django.shortcuts import render_to_response
from django.template i... | from django.conf import settings
from django.contrib.auth.decorators import user_passes_test
from django.core.paginator import Paginator
from django.core.urlresolvers import reverse
from django.http import Http404, HttpResponseRedirect, HttpResponse
from django.shortcuts import render_to_response
from django.template i... | en | 0.810598 | Displays a list of messages to be translated Fixes submitted translations by filtering carriage returns and pairing newlines at the begging and end of the translated string with the original # polib parses .po files into unicode strings, but # doesn't bother to convert plural indexes to int, # so we need unicod... | 1.880811 | 2 |
examples/experiment_pulse.py | HySynth/HySynth | 4 | 12109 | # to run this, add code from experiments_HSCC2021.py
def time_series_pulse():
path = Path(__file__).parent.parent / "data" / "real_data" / "datasets" / "basic_data"
filename1 = path / "pulse1-1.csv"
filename2 = path / "pulse1-2.csv"
filename3 = path / "pulse1-3.csv"
f1 = load_time_series(filename1,... | # to run this, add code from experiments_HSCC2021.py
def time_series_pulse():
path = Path(__file__).parent.parent / "data" / "real_data" / "datasets" / "basic_data"
filename1 = path / "pulse1-1.csv"
filename2 = path / "pulse1-2.csv"
filename3 = path / "pulse1-3.csv"
f1 = load_time_series(filename1,... | en | 0.854755 | # to run this, add code from experiments_HSCC2021.py | 2.558675 | 3 |
ironic/drivers/modules/drac/management.py | Tehsmash/ironic | 0 | 12110 | # -*- coding: utf-8 -*-
#
# Copyright 2014 Red Hat, 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... | # -*- coding: utf-8 -*-
#
# Copyright 2014 Red Hat, 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... | en | 0.746853 | # -*- coding: utf-8 -*- # # Copyright 2014 Red Hat, 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... | 1.728222 | 2 |
matrix_diagonalization/finite_barrier_square_well.py | coherent17/physics_calculation | 1 | 12111 | import numpy as np
import matplotlib.pyplot as plt
#grid number on half space (without the origin)
N=150
#total grid number = 2*N + 1 (with origin)
N_g=2*N+1
#finite barrier potential value = 300 (meV)
potential_value=300
#building potential:
def potential(potential_value):
V=np.zeros((1,N_g),dtype=float)
V[0... | import numpy as np
import matplotlib.pyplot as plt
#grid number on half space (without the origin)
N=150
#total grid number = 2*N + 1 (with origin)
N_g=2*N+1
#finite barrier potential value = 300 (meV)
potential_value=300
#building potential:
def potential(potential_value):
V=np.zeros((1,N_g),dtype=float)
V[0... | en | 0.592868 | #grid number on half space (without the origin) #total grid number = 2*N + 1 (with origin) #finite barrier potential value = 300 (meV) #building potential: # #Hamiltonian matrix: #0.1 (nanometer) #position #sort the eigenvalue and get the corresponding eigenvector #visualize #x/lamda_0 | 2.880367 | 3 |
SVDD/__init__.py | SolidusAbi/SVDD-Python | 0 | 12112 | <filename>SVDD/__init__.py
from .BaseSVDD import BaseSVDD | <filename>SVDD/__init__.py
from .BaseSVDD import BaseSVDD | none | 1 | 1.001268 | 1 | |
setup.py | SteveLTN/iex-api-python | 0 | 12113 | <reponame>SteveLTN/iex-api-python<filename>setup.py
import setuptools
import glob
import os
required = [
"requests",
"pandas",
"arrow",
"socketIO-client-nexus"
]
setuptools.setup(name='iex-api-python',
version="0.0.5",
description='Fetch data from the IEX API',
... | import setuptools
import glob
import os
required = [
"requests",
"pandas",
"arrow",
"socketIO-client-nexus"
]
setuptools.setup(name='iex-api-python',
version="0.0.5",
description='Fetch data from the IEX API',
long_description=open('README.md').read()... | none | 1 | 1.549188 | 2 | |
src/models/train_model.py | 4c697361/e-commerce | 3 | 12114 | import os
import click
import logging
from pathlib import Path
from dotenv import find_dotenv, load_dotenv
from keras.callbacks import ModelCheckpoint, EarlyStopping
import src.utils.utils as ut
import src.utils.model_utils as mu
import src.models.model as md
import src.models.data_generator as dg
import src.data.da... | import os
import click
import logging
from pathlib import Path
from dotenv import find_dotenv, load_dotenv
from keras.callbacks import ModelCheckpoint, EarlyStopping
import src.utils.utils as ut
import src.utils.model_utils as mu
import src.models.model as md
import src.models.data_generator as dg
import src.data.da... | nl | 0.163385 | #verbose=1, | 2.020263 | 2 |
Jobs/pm_match.py | Shantanu48114860/DPN-SA | 2 | 12115 | <gh_stars>1-10
"""
MIT License
Copyright (c) 2020 <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, ... | """
MIT License
Copyright (c) 2020 <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, publish, distri... | en | 0.737257 | MIT License Copyright (c) 2020 <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, publish, distribute... | 1.668706 | 2 |
varcode/effects/effect_prediction.py | openvax/varcode | 39 | 12116 | # Copyright (c) 2016-2019. Mount Sinai School of Medicine
#
# 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 ... | # Copyright (c) 2016-2019. Mount Sinai School of Medicine
#
# 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 ... | en | 0.905385 | # Copyright (c) 2016-2019. Mount Sinai School of Medicine # # 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 ... | 1.815385 | 2 |
configs.py | platonic-realm/UM-PDD | 0 | 12117 | # OS-Level Imports
import os
import sys
import multiprocessing
from multiprocessing import cpu_count
# Library Imports
import tensorflow as tf
from tensorflow.keras import mixed_precision
from tensorflow.python.distribute.distribute_lib import Strategy
# Internal Imports
from Utils.enums import Environme... | # OS-Level Imports
import os
import sys
import multiprocessing
from multiprocessing import cpu_count
# Library Imports
import tensorflow as tf
from tensorflow.keras import mixed_precision
from tensorflow.python.distribute.distribute_lib import Strategy
# Internal Imports
from Utils.enums import Environme... | de | 0.294266 | # OS-Level Imports # Library Imports # Internal Imports # Global Configuration Variables # Configurations ######################################################### # To enable xla compiler ######################################################### # To print out on which device operation is taking place ################... | 2.163254 | 2 |
Legacy/Audit_Sweep/daily_audit_cron.py | QualiSystemsLab/Power-Management | 0 | 12118 | <filename>Legacy/Audit_Sweep/daily_audit_cron.py
from power_audit import PowerAudit
def main():
local = PowerAudit()
local.full_audit()
if __name__ == '__main__':
main()
| <filename>Legacy/Audit_Sweep/daily_audit_cron.py
from power_audit import PowerAudit
def main():
local = PowerAudit()
local.full_audit()
if __name__ == '__main__':
main()
| none | 1 | 1.415885 | 1 | |
python/hayate/store/actions.py | tao12345666333/Talk-Is-Cheap | 4 | 12119 | from turbo.flux import Mutation, register, dispatch, register_dispatch
import mutation_types
@register_dispatch('user', mutation_types.INCREASE)
def increase(rank):
pass
def decrease(rank):
return dispatch('user', mutation_types.DECREASE, rank)
| from turbo.flux import Mutation, register, dispatch, register_dispatch
import mutation_types
@register_dispatch('user', mutation_types.INCREASE)
def increase(rank):
pass
def decrease(rank):
return dispatch('user', mutation_types.DECREASE, rank)
| none | 1 | 1.858237 | 2 | |
data_service/api/data_api.py | statisticsnorway/microdata-data-service | 0 | 12120 | import logging
import os
import io
from fastapi import APIRouter, Depends, Header
from fastapi.responses import FileResponse, StreamingResponse
from fastapi import HTTPException, status
import pyarrow as pa
import pyarrow.parquet as pq
from data_service.api.query_models import (
InputTimePeriodQuery, InputTimeQue... | import logging
import os
import io
from fastapi import APIRouter, Depends, Header
from fastapi.responses import FileResponse, StreamingResponse
from fastapi import HTTPException, status
import pyarrow as pa
import pyarrow.parquet as pq
from data_service.api.query_models import (
InputTimePeriodQuery, InputTimeQue... | en | 0.837244 | Stream a generated result parquet file. Create result set of data with temporality type event, and write result to file. Returns name of file in response. Create result set of data with temporality type status, and write result to file. Returns name of file in response. Create result set of data with temporalit... | 2.214231 | 2 |
lib/parser/augur/Bonus.py | Innoviox/QuizDB | 0 | 12121 | <filename>lib/parser/augur/Bonus.py
from utils import sanitize
class Bonus:
def __init__(self, number, leadin="", texts=None, answers=None,
category="", subcategory="",
tournament="", round=""):
self.number = number
self.leadin = leadin
self.texts = texts... | <filename>lib/parser/augur/Bonus.py
from utils import sanitize
class Bonus:
def __init__(self, number, leadin="", texts=None, answers=None,
category="", subcategory="",
tournament="", round=""):
self.number = number
self.leadin = leadin
self.texts = texts... | none | 1 | 2.952164 | 3 | |
train_folds.py | wubinbai/argus-freesound | 1 | 12122 | import json
import argparse
from argus.callbacks import MonitorCheckpoint, \
EarlyStopping, LoggingToFile, ReduceLROnPlateau
from torch.utils.data import DataLoader
from src.datasets import FreesoundDataset, FreesoundNoisyDataset, RandomDataset
from src.datasets import get_corrected_noisy_data, FreesoundCorrecte... | import json
import argparse
from argus.callbacks import MonitorCheckpoint, \
EarlyStopping, LoggingToFile, ReduceLROnPlateau
from torch.utils.data import DataLoader
from src.datasets import FreesoundDataset, FreesoundNoisyDataset, RandomDataset
from src.datasets import get_corrected_noisy_data, FreesoundCorrecte... | none | 1 | 1.733092 | 2 | |
source_code/day001/input-exercise.py | MKutka/100daysofcode | 0 | 12123 | #Day 1.3 Exercise!!
#First way I thought to do it without help
name = input("What is your name? ")
print(len(name))
#Way I found to do it from searching google
print(len(input("What is your name? "))) | #Day 1.3 Exercise!!
#First way I thought to do it without help
name = input("What is your name? ")
print(len(name))
#Way I found to do it from searching google
print(len(input("What is your name? "))) | en | 0.925991 | #Day 1.3 Exercise!! #First way I thought to do it without help #Way I found to do it from searching google | 4.176939 | 4 |
pyvalidator/is_strong_password.py | theteladras/py.validator | 15 | 12124 | from typing import TypedDict
from .utils.Classes.String import String
from .utils.assert_string import assert_string
from .utils.merge import merge
class _IsStrongPasswordOptions(TypedDict):
min_length: int
min_uppercase: int
min_lowercase: int
min_numbers: int
min_symbols: int
return_score: ... | from typing import TypedDict
from .utils.Classes.String import String
from .utils.assert_string import assert_string
from .utils.merge import merge
class _IsStrongPasswordOptions(TypedDict):
min_length: int
min_uppercase: int
min_lowercase: int
min_numbers: int
min_symbols: int
return_score: ... | zh | 0.126016 | #!$@%^&*()_+|~=`{}\[\]:\";'<>?,./ ]$" | 2.756635 | 3 |
boilerplate_app/serializers.py | taher-systango/DjangoUnboxed | 0 | 12125 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# Python imports.
import logging
import datetime
import calendar
# Django imports.
from django.db import transaction
# Rest Framework imports.
from rest_framework import serializers
# Third Party Library imports
# local imports.... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
# Python imports.
import logging
import datetime
import calendar
# Django imports.
from django.db import transaction
# Rest Framework imports.
from rest_framework import serializers
# Third Party Library imports
# local imports.... | en | 0.638609 | #!/usr/bin/env python # -*- coding: utf-8 -*- # Python imports. # Django imports. # Rest Framework imports. # Third Party Library imports # local imports. # Register new users | 2.142646 | 2 |
wagtail/wagtailadmin/blocks.py | patphongs/wagtail | 3 | 12126 | <gh_stars>1-10
from __future__ import absolute_import, unicode_literals
import warnings
from wagtail.wagtailcore.blocks import * # noqa
warnings.warn("wagtail.wagtailadmin.blocks has moved to wagtail.wagtailcore.blocks", UserWarning, stacklevel=2)
| from __future__ import absolute_import, unicode_literals
import warnings
from wagtail.wagtailcore.blocks import * # noqa
warnings.warn("wagtail.wagtailadmin.blocks has moved to wagtail.wagtailcore.blocks", UserWarning, stacklevel=2) | none | 1 | 1.100243 | 1 | |
src/olympia/stats/management/commands/theme_update_counts_from_file.py | mstriemer/olympia | 0 | 12127 | <reponame>mstriemer/olympia
import codecs
from datetime import datetime, timedelta
from optparse import make_option
from os import path, unlink
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
import commonware.log
from olympia import amo
from olympia.addons.models i... | import codecs
from datetime import datetime, timedelta
from optparse import make_option
from os import path, unlink
from django.conf import settings
from django.core.management.base import BaseCommand, CommandError
import commonware.log
from olympia import amo
from olympia.addons.models import Addon, Persona
from ol... | en | 0.83845 | Process hive results stored in different files and store them in the db. Usage: ./manage.py theme_update_counts_from_file <folder> --date=YYYY-MM-DD If no date is specified, the default is the day before. If not folder is specified, the default is `hive_results/<YYYY-MM-DD>/`. This folder will be ... | 2.112978 | 2 |
KRR/Saved/Run 4/plot_all.py | MadsAW/machine-learning-on-materials | 2 | 12128 | <reponame>MadsAW/machine-learning-on-materials
import numpy as np
import pickle
import matplotlib.pyplot as plt
import os
import fnmatch
folder = "GP/"
ktype = "lin/"
matrices=os.listdir(folder+ktype)
for matrix in matrices:
if fnmatch.fnmatch(matrix, '*_val_*'):
with open(folder+ktype+matrix, "rb") as pic... | import numpy as np
import pickle
import matplotlib.pyplot as plt
import os
import fnmatch
folder = "GP/"
ktype = "lin/"
matrices=os.listdir(folder+ktype)
for matrix in matrices:
if fnmatch.fnmatch(matrix, '*_val_*'):
with open(folder+ktype+matrix, "rb") as pickleFile:
results = pickle.load(pick... | en | 0.591393 | # Enable interactive mode # Draw the grid lines | 2.625789 | 3 |
FATERUI/common/camera/mindvision/camera_mindvision.py | LynnChan706/Fater | 4 | 12129 | <reponame>LynnChan706/Fater
#!/usr/bin/env python2.7
# coding=utf-8
import logging
import traceback
import time
from FATERUI.common.camera.camera import Camera
from . import CameraMindVision
from FATERUI.common.camera.common_tools import *
import cv2
# from aoi.common.infraredcontrol import infraredcontrol
from time ... | #!/usr/bin/env python2.7
# coding=utf-8
import logging
import traceback
import time
from FATERUI.common.camera.camera import Camera
from . import CameraMindVision
from FATERUI.common.camera.common_tools import *
import cv2
# from aoi.common.infraredcontrol import infraredcontrol
from time import sleep
import datetim... | en | 0.312855 | #!/usr/bin/env python2.7 # coding=utf-8 # from aoi.common.infraredcontrol import infraredcontrol # self.__control=infraredcontrol.infrared() # logging.getLogger('logger_system').exception(u'error in take_picture:%s' % traceback.print_exc()) | 2.323815 | 2 |
tests/conftest.py | arosen93/jobflow | 10 | 12130 | import pytest
@pytest.fixture(scope="session")
def test_data():
from pathlib import Path
module_dir = Path(__file__).resolve().parent
test_dir = module_dir / "test_data"
return test_dir.resolve()
@pytest.fixture(scope="session")
def database():
return "jobflow_test"
@pytest.fixture(scope="ses... | import pytest
@pytest.fixture(scope="session")
def test_data():
from pathlib import Path
module_dir = Path(__file__).resolve().parent
test_dir = module_dir / "test_data"
return test_dir.resolve()
@pytest.fixture(scope="session")
def database():
return "jobflow_test"
@pytest.fixture(scope="ses... | none | 1 | 1.845386 | 2 | |
src/utilities/download_file_from_zip.py | Bhaskers-Blu-Org2/arcticseals | 16 | 12131 | # This script allows to download a single file from a remote ZIP archive
# without downloading the whole ZIP file itself.
# The hosting server needs to support the HTTP range header for it to work
import zipfile
import requests
import argparse
class HTTPIO(object):
def __init__(self, url):
self.url = url... | # This script allows to download a single file from a remote ZIP archive
# without downloading the whole ZIP file itself.
# The hosting server needs to support the HTTP range header for it to work
import zipfile
import requests
import argparse
class HTTPIO(object):
def __init__(self, url):
self.url = url... | en | 0.881382 | # This script allows to download a single file from a remote ZIP archive # without downloading the whole ZIP file itself. # The hosting server needs to support the HTTP range header for it to work | 3.569874 | 4 |
cxphasing/CXFileReader.py | jbgastineau/cxphasing | 3 | 12132 | <filename>cxphasing/CXFileReader.py
import Image
import readMDA
import h5py
import os
import numpy
from mmpad_image import open_mmpad_tif
import numpy as np
import scipy as sp
import sys
#import libtiff
from cxparams import CXParams as CXP
class CXFileReader(object):
"""
file_reader
A generic and confi... | <filename>cxphasing/CXFileReader.py
import Image
import readMDA
import h5py
import os
import numpy
from mmpad_image import open_mmpad_tif
import numpy as np
import scipy as sp
import sys
#import libtiff
from cxparams import CXParams as CXP
class CXFileReader(object):
"""
file_reader
A generic and confi... | en | 0.49006 | #import libtiff file_reader A generic and configurable file reader. The file reader determines the file type from the extension. For hierarchical data files a method for extracting the data must be specified. Inputs ------ filename - the name of the file to read h5_file_path - hdf5 file... | 2.821193 | 3 |
homeassistant/components/notify/file.py | SKarthick5121995/karthickmaduraai | 0 | 12133 | <filename>homeassistant/components/notify/file.py
"""
Support for file notification.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.file/
"""
import logging
import os
import homeassistant.util.dt as dt_util
from homeassistant.components.notify im... | <filename>homeassistant/components/notify/file.py
"""
Support for file notification.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/notify.file/
"""
import logging
import os
import homeassistant.util.dt as dt_util
from homeassistant.components.notify im... | en | 0.79871 | Support for file notification. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/notify.file/ Get the file notification service. # pylint: disable=too-few-public-methods Implement the notification service for the File service. Initialize the service. Send a... | 2.611704 | 3 |
app/eSignature/views/eg035_scheduled_sending.py | docusign/eg-03-python-auth-code-grant | 7 | 12134 |
""" Example 035: Scheduled sending and delayed routing """
from os import path
from docusign_esign.client.api_exception import ApiException
from flask import render_template, session, Blueprint, request
from ..examples.eg035_scheduled_sending import Eg035ScheduledSendingController
from ...docusign import authentica... |
""" Example 035: Scheduled sending and delayed routing """
from os import path
from docusign_esign.client.api_exception import ApiException
from flask import render_template, session, Blueprint, request
from ..examples.eg035_scheduled_sending import Eg035ScheduledSendingController
from ...docusign import authentica... | en | 0.788017 | Example 035: Scheduled sending and delayed routing # reference (and url) for this example Get request and session arguments # More data validation would be a good idea here # Strip anything other than characters listed 1. Get required arguments 2. Call the worker method 3. Render success response with envelopeI... | 2.350941 | 2 |
Informatik1/Finals Prep/HS20/1 Warmup/tally.py | Queentaker/uzh | 8 | 12135 | #-- THIS LINE SHOULD BE THE FIRST LINE OF YOUR SUBMISSION! --#
def tally(costs, discounts, rebate_factor):
cost = sum(costs)
discount = sum(discounts)
pre = (cost - discount) * rebate_factor
if pre < 0:
return 0
else:
return round(pre, 2)
#-- THIS LINE SHOULD BE THE LAST LINE OF ... | #-- THIS LINE SHOULD BE THE FIRST LINE OF YOUR SUBMISSION! --#
def tally(costs, discounts, rebate_factor):
cost = sum(costs)
discount = sum(discounts)
pre = (cost - discount) * rebate_factor
if pre < 0:
return 0
else:
return round(pre, 2)
#-- THIS LINE SHOULD BE THE LAST LINE OF ... | en | 0.377347 | #-- THIS LINE SHOULD BE THE FIRST LINE OF YOUR SUBMISSION! --# #-- THIS LINE SHOULD BE THE LAST LINE OF YOUR SUBMISSION! ---# ### DO NOT SUBMIT THE FOLLOWING LINES!!! THESE ARE FOR LOCAL TESTING ONLY! # ((10+24) - (3+4+3)) * 0.3 # if the result would be negative, 0 is returned instead | 3.140946 | 3 |
linear_sequence_of_dominos/valid_sequence.py | bhpayne/domino_tile_floor | 0 | 12136 | <reponame>bhpayne/domino_tile_floor
#!/usr/bin/env python3
"""
Given a set of dominos, construct a linear sequence
For example, if the set of dominos is
[ (0,0) (1,0), (1,1)]
then a valid linear sequence of length four would be
(0,0),(0,1),(1,1),(1,0)
In this script we first create a set of dominos to sample from.
The... | #!/usr/bin/env python3
"""
Given a set of dominos, construct a linear sequence
For example, if the set of dominos is
[ (0,0) (1,0), (1,1)]
then a valid linear sequence of length four would be
(0,0),(0,1),(1,1),(1,0)
In this script we first create a set of dominos to sample from.
Then every permutation of that set is t... | en | 0.740578 | #!/usr/bin/env python3 Given a set of dominos, construct a linear sequence For example, if the set of dominos is [ (0,0) (1,0), (1,1)] then a valid linear sequence of length four would be (0,0),(0,1),(1,1),(1,0) In this script we first create a set of dominos to sample from. Then every permutation of that set is teste... | 4.068986 | 4 |
Projects/Arena/old-version.py | hastysun/Python | 1 | 12137 | ## Unit 4 Project - Two Player Game
## <NAME> - Computer Programming II
## The Elder Scrolls X
# A fan made 2 player game successor the The Elder Scrolls Series
# Two players start off in an arena
# Can choose starting items
# Can choose classes
## Libraries
import time # Self explanatory
import random # ... | ## Unit 4 Project - Two Player Game
## <NAME> - Computer Programming II
## The Elder Scrolls X
# A fan made 2 player game successor the The Elder Scrolls Series
# Two players start off in an arena
# Can choose starting items
# Can choose classes
## Libraries
import time # Self explanatory
import random # ... | en | 0.859215 | ## Unit 4 Project - Two Player Game ## <NAME> - Computer Programming II ## The Elder Scrolls X # A fan made 2 player game successor the The Elder Scrolls Series # Two players start off in an arena # Can choose starting items # Can choose classes ## Libraries # Self explanatory # Self explanatory # Used for Linux comman... | 3.547632 | 4 |
chromium/tools/telemetry/telemetry/internal/image_processing/video.py | wedataintelligence/vivaldi-source | 925 | 12138 | <gh_stars>100-1000
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import subprocess
from catapult_base import cloud_storage
from telemetry.core import platform
from telemetry.util import image_util
from ... | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import subprocess
from catapult_base import cloud_storage
from telemetry.core import platform
from telemetry.util import image_util
from telemetry.util impo... | en | 0.903518 | # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. Utilities for storing and interacting with the video capture. Uploads video file to cloud storage. Args: target_path: Path indicating where to stor... | 2.393968 | 2 |
homeassistant/components/renault/renault_coordinator.py | basicpail/core | 5 | 12139 | <gh_stars>1-10
"""Proxy to handle account communication with Renault servers."""
from __future__ import annotations
from collections.abc import Awaitable
from datetime import timedelta
import logging
from typing import Callable, TypeVar
from renault_api.kamereon.exceptions import (
AccessDeniedException,
Kame... | """Proxy to handle account communication with Renault servers."""
from __future__ import annotations
from collections.abc import Awaitable
from datetime import timedelta
import logging
from typing import Callable, TypeVar
from renault_api.kamereon.exceptions import (
AccessDeniedException,
KamereonResponseExc... | en | 0.783107 | Proxy to handle account communication with Renault servers. Handle vehicle communication with Renault servers. Initialise coordinator. Fetch the latest data from the source. # Disable because the account is not allowed to access this Renault endpoint. # Disable because the vehicle does not support this Renault endpoint... | 2.056044 | 2 |
Pacote Dowload/pythonProject/aula020.py | J297-hub/exercicios-de-python | 0 | 12140 | <reponame>J297-hub/exercicios-de-python<filename>Pacote Dowload/pythonProject/aula020.py
def soma (a,b):
print(f'A = {a} e B = {b}')
s=a+b
print(f'A soma A + B ={s}')
#Programa Principal
soma(4,5)
| Dowload/pythonProject/aula020.py
def soma (a,b):
print(f'A = {a} e B = {b}')
s=a+b
print(f'A soma A + B ={s}')
#Programa Principal
soma(4,5) | en | 0.782286 | #Programa Principal | 2.815011 | 3 |
docs/script/CLI_docker_image_uri_script.py | ai4eu/on-boarding | 0 | 12141 | #!/usr/bin/env python3
# ===================================================================================
# Copyright (C) 2019 Fraunhofer Gesellschaft. All rights reserved.
# ===================================================================================
# This Acumos software file is distributed by Fraunhofer G... | #!/usr/bin/env python3
# ===================================================================================
# Copyright (C) 2019 Fraunhofer Gesellschaft. All rights reserved.
# ===================================================================================
# This Acumos software file is distributed by Fraunhofer G... | en | 0.636955 | #!/usr/bin/env python3 # =================================================================================== # Copyright (C) 2019 Fraunhofer Gesellschaft. All rights reserved. # =================================================================================== # This Acumos software file is distributed by Fraunhofer G... | 1.747568 | 2 |
zeus/networks/pytorch/backbones/getter.py | shaido987/vega | 1 | 12142 | <filename>zeus/networks/pytorch/backbones/getter.py
# -*- coding: utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be ... | <filename>zeus/networks/pytorch/backbones/getter.py
# -*- coding: utf-8 -*-
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the MIT License.
# This program is distributed in the hope that it will be ... | en | 0.795761 | # -*- coding: utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the terms of the MIT License. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the ... | 2.018306 | 2 |
pure_ee/lista.py | geosconsulting/gee_wapor | 2 | 12143 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 20 08:40:22 2017
@author: fabio
"""
import ee
import ee.mapclient
ee.Initialize()
collection = ee.ImageCollection('MODIS/MCD43A4_NDVI')
lista = collection.toList(10)
#print lista.getInfo()
image = ee.Image('LC8_L1T/LC81910312016217LGN00')
#prin... | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 20 08:40:22 2017
@author: fabio
"""
import ee
import ee.mapclient
ee.Initialize()
collection = ee.ImageCollection('MODIS/MCD43A4_NDVI')
lista = collection.toList(10)
#print lista.getInfo()
image = ee.Image('LC8_L1T/LC81910312016217LGN00')
#prin... | en | 0.275921 | #!/usr/bin/env python2 # -*- coding: utf-8 -*- Created on Fri Jan 20 08:40:22 2017 @author: fabio #print lista.getInfo() #print image.getInfo() | 2.365948 | 2 |
pkg/tests/helpers_test.py | hborawski/rules_pkg | 0 | 12144 | <filename>pkg/tests/helpers_test.py
# Copyright 2019 The Bazel 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
... | <filename>pkg/tests/helpers_test.py
# Copyright 2019 The Bazel 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
... | en | 0.876638 | # Copyright 2019 The Bazel 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 applicable la... | 2.346378 | 2 |
atendimento/admin.py | alantinoco/django-crmsmart | 0 | 12145 | from django.contrib import admin
from .models import Contato, Venda, FormaPagamento
admin.site.register(Contato)
admin.site.register(Venda)
admin.site.register(FormaPagamento)
| from django.contrib import admin
from .models import Contato, Venda, FormaPagamento
admin.site.register(Contato)
admin.site.register(Venda)
admin.site.register(FormaPagamento)
| none | 1 | 1.299681 | 1 | |
pome/models/transaction.py | pome-gr/pome | 3 | 12146 | <filename>pome/models/transaction.py
import os
import re
import urllib
from datetime import datetime
from pathlib import Path
from typing import Dict, List, Tuple, Union
from money.currency import Currency
from money.money import Money
from werkzeug.utils import secure_filename
from pome import g
from pome.models.enc... | <filename>pome/models/transaction.py
import os
import re
import urllib
from datetime import datetime
from pathlib import Path
from typing import Dict, List, Tuple, Union
from money.currency import Currency
from money.money import Money
from werkzeug.utils import secure_filename
from pome import g
from pome.models.enc... | en | 0.80526 | # Putting this there to avoid circular imports Stores all the metadata associated to a transaction. | 2.297018 | 2 |
site/external/moya.logins/py/oauth1.py | moyaproject/moya-techblog | 31 | 12147 | from __future__ import unicode_literals
from __future__ import print_function
import moya
from moya.compat import text_type
from requests_oauthlib import OAuth1Session
def get_credentials(provider, credentials):
client_id = credentials.client_id or provider.get('client_id', None)
client_secret = credentials... | from __future__ import unicode_literals
from __future__ import print_function
import moya
from moya.compat import text_type
from requests_oauthlib import OAuth1Session
def get_credentials(provider, credentials):
client_id = credentials.client_id or provider.get('client_id', None)
client_secret = credentials... | fa | 0.079898 | #if(context['.debug']): # context['.console'].obj(context, scope_data) | 2.134638 | 2 |
cgp.py | BakudanKame/CGPCatAndRat | 0 | 12148 | """
Cartesian genetic programming
"""
import operator as op
import random
import copy
import math
from settings import VERBOSE, N_COLS, LEVEL_BACK
class Function:
"""
A general function
"""
def __init__(self, f, arity, name=None):
self.f = f
self.arity = arity
self.name = f.... | """
Cartesian genetic programming
"""
import operator as op
import random
import copy
import math
from settings import VERBOSE, N_COLS, LEVEL_BACK
class Function:
"""
A general function
"""
def __init__(self, f, arity, name=None):
self.f = f
self.arity = arity
self.name = f.... | en | 0.724142 | Cartesian genetic programming A general function A node in CGP graph Initialize this node randomly An individual (chromosome, genotype, etc.) in evolution Determine which nodes in the CGP graph are active # check each node in reverse order # a node (not an input) Given inputs, evaluate the output of this CGP individual... | 3.199759 | 3 |
historia/pops/logic/refiner.py | eranimo/historia | 6 | 12149 | <filename>historia/pops/logic/refiner.py
from historia.pops.logic.logic_base import LogicBase
from historia.economy.enums.resource import Good
class RefinerLogic(LogicBase):
def perform(self):
bread = self.get_good(Good.bread)
tools = self.get_good(Good.tools)
iron_ore = self.get_good(Good... | <filename>historia/pops/logic/refiner.py
from historia.pops.logic.logic_base import LogicBase
from historia.economy.enums.resource import Good
class RefinerLogic(LogicBase):
def perform(self):
bread = self.get_good(Good.bread)
tools = self.get_good(Good.tools)
iron_ore = self.get_good(Good... | en | 0.70754 | # fine $2 for being idle # convert iron_ore to iron # convert iron_ore to iron | 2.629231 | 3 |
image_processing/manual_features/extract-features.py | ColoredInsaneAsylums/PrivacySensitiveTranscription | 0 | 12150 | <reponame>ColoredInsaneAsylums/PrivacySensitiveTranscription
import argparse
import cv2
import numpy as np
import os
import _pickle as pickle
from descriptors import HOG
#from skimage.morphology import skeletonize
# run image filtering and HOG feature extraction
def main(im_path, desc_name):
print('[INFO] Prepari... | import argparse
import cv2
import numpy as np
import os
import _pickle as pickle
from descriptors import HOG
#from skimage.morphology import skeletonize
# run image filtering and HOG feature extraction
def main(im_path, desc_name):
print('[INFO] Preparing to extract features for images in \'' + im_path + '\'')
... | en | 0.618262 | #from skimage.morphology import skeletonize # run image filtering and HOG feature extraction # track HOG feature vectors and corresponding images # image dimensions # feature descriptor # evaluate image files # resize image # binarize using Otsu's method # thin using Zhang and Suen's method #im = skeletonize(im) #im = ... | 3.198039 | 3 |
src/exco/extractor_spec/spec_source.py | thegangtechnology/excel_comment_orm | 2 | 12151 | import abc
class SpecSource(abc.ABC):
@abc.abstractmethod
def describe(self) -> str:
"""
Returns:
str to print in case there is an error constructing extractor for tracing back
"""
raise NotImplementedError()
class UnknownSource(SpecSource):
def describe(sel... | import abc
class SpecSource(abc.ABC):
@abc.abstractmethod
def describe(self) -> str:
"""
Returns:
str to print in case there is an error constructing extractor for tracing back
"""
raise NotImplementedError()
class UnknownSource(SpecSource):
def describe(sel... | en | 0.851377 | Returns: str to print in case there is an error constructing extractor for tracing back | 3.25333 | 3 |
app/admin.py | CS-Hunt/Get-Placed | 14 | 12152 | <filename>app/admin.py
from django.contrib import admin
from .models import Placement_Company_Detail,Profile,StudentBlogModel,ResorcesModel
admin.site.register(Placement_Company_Detail)
admin.site.register(Profile)
admin.site.register(StudentBlogModel)
admin.site.register(ResorcesModel) | <filename>app/admin.py
from django.contrib import admin
from .models import Placement_Company_Detail,Profile,StudentBlogModel,ResorcesModel
admin.site.register(Placement_Company_Detail)
admin.site.register(Profile)
admin.site.register(StudentBlogModel)
admin.site.register(ResorcesModel) | none | 1 | 1.428876 | 1 | |
data/mapping.py | wby1905/Graph-Transformer-SSPR | 2 | 12153 | import torch as t
import torch_geometric.utils as utils
def qw_score(graph):
"""
未实现qw_score,采用度数代替
:param graph:
"""
score = utils.degree(graph.edge_index[0])
return score.sort()
def pre_processing(graph, m, score, trees):
score, indices = score
indices.squeeze_()
old_edges = gr... | import torch as t
import torch_geometric.utils as utils
def qw_score(graph):
"""
未实现qw_score,采用度数代替
:param graph:
"""
score = utils.degree(graph.edge_index[0])
return score.sort()
def pre_processing(graph, m, score, trees):
score, indices = score
indices.squeeze_()
old_edges = gr... | zh | 0.695676 | 未实现qw_score,采用度数代替 :param graph: 找到分值最大的2阶节点并与源节点连接 和论文有一些不一样,会在加入二阶节点后把它视为一阶节点 :param root: 源节点(度小于m) 找到分值最小的1阶节点并删除连接 默认图为简单图 :param root: 源节点 # 对于孤立点对它的子树加哑节点 生成目标节点的 K_level, m_ary 树 :param graph: :param node: :param opt: | 2.394214 | 2 |
.archived/snakecode/0460.py | gearbird/calgo | 4 | 12154 | <gh_stars>1-10
from typing import Optional, Any
class Node:
def __init__(self, key: int = 0, val: int = 0):
self.key: int = key
self.val: int = val
self.freq: int = 0
self.pre: Optional[Node] = None
self.next: Optional[Node] = None
class DLList:
def __init__(self):
... | from typing import Optional, Any
class Node:
def __init__(self, key: int = 0, val: int = 0):
self.key: int = key
self.val: int = val
self.freq: int = 0
self.pre: Optional[Node] = None
self.next: Optional[Node] = None
class DLList:
def __init__(self):
self.size =... | en | 0.704581 | Get Node, update Cache and Node status If it's a existing Node, update Cache and Node.\n If it's a new Node and there're space, update Cache.\n If it's a new Node but no space, kick out one Node, update Cache Given a Node in cache, update it's freq and cache status Simply kickout the least frequently us... | 3.416942 | 3 |
scripts/sha3.py | cidox479/ecc | 0 | 12155 | #/*
# * Copyright (C) 2017 - This file is part of libecc project
# *
# * Authors:
# * <NAME> <<EMAIL>>
# * <NAME> <<EMAIL>>
# * <NAME> <<EMAIL>>
# *
# * Contributors:
# * <NAME> <<EMAIL>>
# * <NAME> <<EMAIL>>
# *
# * This software is licensed under a dual BSD and GPL v2 license.
# * See LI... | #/*
# * Copyright (C) 2017 - This file is part of libecc project
# *
# * Authors:
# * <NAME> <<EMAIL>>
# * <NAME> <<EMAIL>>
# * <NAME> <<EMAIL>>
# *
# * Contributors:
# * <NAME> <<EMAIL>>
# * <NAME> <<EMAIL>>
# *
# * This software is licensed under a dual BSD and GPL v2 license.
# * See LI... | en | 0.582303 | #/* # * Copyright (C) 2017 - This file is part of libecc project # * # * Authors: # * <NAME> <<EMAIL>> # * <NAME> <<EMAIL>> # * <NAME> <<EMAIL>> # * # * Contributors: # * <NAME> <<EMAIL>> # * <NAME> <<EMAIL>> # * # * This software is licensed under a dual BSD and GPL v2 license. # * See LI... | 2.064452 | 2 |
lps/seeds.py | fernandoleira/lps-platform | 0 | 12156 | <reponame>fernandoleira/lps-platform
import csv
from pathlib import Path
from datetime import datetime
from lps.models import *
from lps.schemas import *
SEED_FOLDER_PATH = Path("db/seeds/")
def import_from_csv(csv_filename):
with open(SEED_FOLDER_PATH / csv_filename) as csv_file:
csv_read = csv.DictRe... | import csv
from pathlib import Path
from datetime import datetime
from lps.models import *
from lps.schemas import *
SEED_FOLDER_PATH = Path("db/seeds/")
def import_from_csv(csv_filename):
with open(SEED_FOLDER_PATH / csv_filename) as csv_file:
csv_read = csv.DictReader(csv_file, delimiter=',')
... | en | 0.658974 | # Users # Api Key # Units # Locator Points # Units # Locator Points # Users # Api Keys | 2.771663 | 3 |
Python/Least_Common_Multiple_for_large_numbers.py | DeathcallXD/DS-Algo-Point | 0 | 12157 | <reponame>DeathcallXD/DS-Algo-Point<gh_stars>0
def GCD(a,b):
if b == 0:
return a
else:
return GCD(b, a%b)
a = int(input())
b = int(input())
print(a*b//(GCD(a,b)))
| def GCD(a,b):
if b == 0:
return a
else:
return GCD(b, a%b)
a = int(input())
b = int(input())
print(a*b//(GCD(a,b))) | none | 1 | 3.902149 | 4 | |
matgendb/builders/examples/maxvalue_builder.py | Tinaatucsd/pymatgen-db | 0 | 12158 | <filename>matgendb/builders/examples/maxvalue_builder.py
"""
Build a derived collection with the maximum
value from each 'group' defined in the source
collection.
"""
__author__ = '<NAME> <<EMAIL>>'
__date__ = '5/21/14'
from matgendb.builders import core
from matgendb.builders import util
from matgendb.query_engine im... | <filename>matgendb/builders/examples/maxvalue_builder.py
"""
Build a derived collection with the maximum
value from each 'group' defined in the source
collection.
"""
__author__ = '<NAME> <<EMAIL>>'
__date__ = '5/21/14'
from matgendb.builders import core
from matgendb.builders import util
from matgendb.query_engine im... | en | 0.781802 | Build a derived collection with the maximum value from each 'group' defined in the source collection. Example of incremental builder that requires some custom logic for incremental case. Get all records from source collection to add to target. :param source: Input collection :type source: QueryEngi... | 2.60283 | 3 |
dvc/dependency/ssh.py | yfarjoun/dvc | 2 | 12159 | from __future__ import unicode_literals
from dvc.output.ssh import OutputSSH
from dvc.dependency.base import DependencyBase
class DependencySSH(DependencyBase, OutputSSH):
pass
| from __future__ import unicode_literals
from dvc.output.ssh import OutputSSH
from dvc.dependency.base import DependencyBase
class DependencySSH(DependencyBase, OutputSSH):
pass
| none | 1 | 1.222189 | 1 | |
multiscaleloss.py | praveeenbadimala/flow_unsupervised | 0 | 12160 | import torch
import torch.nn as nn
import optflow.compute_tvl1_energy as compute_tvl1_energy
def EPE(input_flow, target_flow, sparse=False, mean=True):
EPE_map = torch.norm(target_flow-input_flow,2,1)
if sparse:
EPE_map = EPE_map[target_flow != 0]
if mean:
return EPE_map.mean()
else:
... | import torch
import torch.nn as nn
import optflow.compute_tvl1_energy as compute_tvl1_energy
def EPE(input_flow, target_flow, sparse=False, mean=True):
EPE_map = torch.norm(target_flow-input_flow,2,1)
if sparse:
EPE_map = EPE_map[target_flow != 0]
if mean:
return EPE_map.mean()
else:
... | en | 0.752292 | # more preference for starting layers | 2.162909 | 2 |
object_detector/src/object_detector/object_detector.py | Ajapaik/ml-2021-ajapaik | 0 | 12161 | <gh_stars>0
import numpy as np
import time
import cv2
import argparse
import sys
import os
import glob
import json
from pathlib import Path
class ObjectDetector:
def file_exist(file_names_list: list) -> bool:
if all(list(map(os.path.isfile,file_names_list))):
return True
else:
... | import numpy as np
import time
import cv2
import argparse
import sys
import os
import glob
import json
from pathlib import Path
class ObjectDetector:
def file_exist(file_names_list: list) -> bool:
if all(list(map(os.path.isfile,file_names_list))):
return True
else:
print("P... | en | 0.837025 | # if coco.names, yolov4.{cfg,weights} are relative to cli-tool # no need to pass them as cli options # Check if the provided file paths exists # load all files matching ext from im_dir # defaults to "current" dir # various extensions of files that can be fetched # determine only the *output* layer names that we need f... | 2.631152 | 3 |
pipeline/tests/engine/core/data/test_api.py | wkma/bk-sops | 2 | 12162 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | en | 0.861479 | # -*- coding: utf-8 -*- Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compli... | 1.928946 | 2 |
pactools/mne_api.py | mathurinm/pactools | 0 | 12163 | import numpy as np
def _check_mne(name):
"""Helper to check if h5py is installed"""
try:
import mne
except ImportError:
raise ImportError('Please install MNE-python to use %s.' % name)
return mne
def raw_to_mask(raw, ixs, events=None, tmin=None, tmax=None):
"""
A function to ... | import numpy as np
def _check_mne(name):
"""Helper to check if h5py is installed"""
try:
import mne
except ImportError:
raise ImportError('Please install MNE-python to use %s.' % name)
return mne
def raw_to_mask(raw, ixs, events=None, tmin=None, tmax=None):
"""
A function to ... | en | 0.825719 | Helper to check if h5py is installed A function to transform MNE data into pactools input signals. It select the one channel on which you to estimate PAC, or two channels for cross-channel PAC. It also returns a mask generator, that mask the data outside a given window around an event. The mask generator re... | 2.784875 | 3 |
1101-1200/1152-Analyze User Website Visit Pattern/1152-Analyze User Website Visit Pattern.py | jiadaizhao/LeetCode | 49 | 12164 | <filename>1101-1200/1152-Analyze User Website Visit Pattern/1152-Analyze User Website Visit Pattern.py
import collections
from itertools import combinations
from collections import Counter
class Solution:
def mostVisitedPattern(self, username: List[str], timestamp: List[int], website: List[str]) -> List[str]:
... | <filename>1101-1200/1152-Analyze User Website Visit Pattern/1152-Analyze User Website Visit Pattern.py
import collections
from itertools import combinations
from collections import Counter
class Solution:
def mostVisitedPattern(self, username: List[str], timestamp: List[int], website: List[str]) -> List[str]:
... | none | 1 | 3.050131 | 3 | |
src/tarot/magicEight.py | tjweldon/St_Germain | 0 | 12165 | import random
async def magicEightBall(ctx, message=True):
if message:
eightBall = random.randint(0, 19)
outlooks = [
"As I see it, yes.",
"Ask again later.",
"Better not tell you now.",
"Cannot predict now.",
"Concentrate and ask again."... | import random
async def magicEightBall(ctx, message=True):
if message:
eightBall = random.randint(0, 19)
outlooks = [
"As I see it, yes.",
"Ask again later.",
"Better not tell you now.",
"Cannot predict now.",
"Concentrate and ask again."... | none | 1 | 2.559964 | 3 | |
app/mod_check/MySQL.py | RITC3/Hermes | 2 | 12166 | <reponame>RITC3/Hermes
import pymysql.cursors
from ..mod_check import app
@app.task
def check(host, port, username, password, db):
result = None
connection = None
try:
connection = pymysql.connect(host=host,
port=port,
user... | import pymysql.cursors
from ..mod_check import app
@app.task
def check(host, port, username, password, db):
result = None
connection = None
try:
connection = pymysql.connect(host=host,
port=port,
user=username,
... | none | 1 | 2.091817 | 2 | |
src/adafruit-circuitpython-bundle-4.x-mpy-20190713/examples/hue_simpletest.py | mbaaba/solar_panel | 1 | 12167 | import time
import board
import busio
from digitalio import DigitalInOut
from adafruit_esp32spi import adafruit_esp32spi
from adafruit_esp32spi import adafruit_esp32spi_wifimanager
import neopixel
# Import Philips Hue Bridge
from adafruit_hue import Bridge
# Get wifi details and more from a secrets.py file
... | import time
import board
import busio
from digitalio import DigitalInOut
from adafruit_esp32spi import adafruit_esp32spi
from adafruit_esp32spi import adafruit_esp32spi_wifimanager
import neopixel
# Import Philips Hue Bridge
from adafruit_hue import Bridge
# Get wifi details and more from a secrets.py file
... | en | 0.727078 | # Import Philips Hue Bridge # Get wifi details and more from a secrets.py file # ESP32 SPI # Attempt to load bridge username and IP address from secrets.py # Perform first-time bridge setup # Enumerate all lights on the bridge # Turn on the light # RGB colors to Hue-Compatible HSL colors # Set the light to Python color... | 2.507147 | 3 |
examples/python-echo/src/echo.py | mdelete/kore | 0 | 12168 | #
# Copyright (c) 2013-2018 <NAME> <<EMAIL>>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIM... | #
# Copyright (c) 2013-2018 <NAME> <<EMAIL>>
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIM... | en | 0.742565 | # # Copyright (c) 2013-2018 <NAME> <<EMAIL>> # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIM... | 2.287505 | 2 |
src/token/__init__.py | mingz2013/py.script | 1 | 12169 | <gh_stars>1-10
# -*- coding:utf-8 -*-
"""
"""
__date__ = "14/12/2017"
__author__ = "zhaojm"
| # -*- coding:utf-8 -*-
"""
"""
__date__ = "14/12/2017"
__author__ = "zhaojm" | en | 0.736017 | # -*- coding:utf-8 -*- | 0.958015 | 1 |
pesto-cli/pesto/ws/service/process.py | CS-SI/pesto | 25 | 12170 | import asyncio
import logging
import traceback
import uuid
from typing import Optional, Tuple, Any, Callable
from pesto.ws.core.payload_parser import PayloadParser, PestoConfig
from pesto.ws.core.pesto_feature import PestoFeatures
from pesto.ws.core.utils import load_class, async_exec
from pesto.ws.features.algorithm_... | import asyncio
import logging
import traceback
import uuid
from typing import Optional, Tuple, Any, Callable
from pesto.ws.core.payload_parser import PayloadParser, PestoConfig
from pesto.ws.core.pesto_feature import PestoFeatures
from pesto.ws.core.utils import load_class, async_exec
from pesto.ws.features.algorithm_... | en | 0.686489 | # if no ROI: None # bypass compute crop info and remove margins in pipeline | 1.772233 | 2 |
migration_runner/helpers.py | beveradb/ecs-digital-interview-test | 0 | 12171 | # -*- coding: utf-8 -*-
import logging
import os
import re
import sys
class Helpers:
def __init__(self, logger=None):
if logger is None:
self.logger = logging.getLogger(__name__)
else:
self.logger = logger
@staticmethod
def extract_sequence_num(filename):
s... | # -*- coding: utf-8 -*-
import logging
import os
import re
import sys
class Helpers:
def __init__(self, logger=None):
if logger is None:
self.logger = logging.getLogger(__name__)
else:
self.logger = logger
@staticmethod
def extract_sequence_num(filename):
s... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.685659 | 3 |
sitri/providers/contrib/ini.py | Elastoo-Team/sitri | 11 | 12172 | import configparser
import os
import typing
from sitri.providers.base import ConfigProvider
class IniConfigProvider(ConfigProvider):
"""Config provider for Initialization file (Ini)."""
provider_code = "ini"
def __init__(
self,
ini_path: str = "./config.ini",
):
"""
... | import configparser
import os
import typing
from sitri.providers.base import ConfigProvider
class IniConfigProvider(ConfigProvider):
"""Config provider for Initialization file (Ini)."""
provider_code = "ini"
def __init__(
self,
ini_path: str = "./config.ini",
):
"""
... | en | 0.320597 | Config provider for Initialization file (Ini). :param ini_path: path to ini file # type: ignore Get value from ini file. :param key: key or path for search :param section: section of ini file # type: ignore Get keys of section. :param section: section of ini file | 2.59774 | 3 |
xpanse/api/assets/v2/ip_range.py | PaloAltoNetworks/cortex-xpanse-python-sdk | 3 | 12173 | <reponame>PaloAltoNetworks/cortex-xpanse-python-sdk<gh_stars>1-10
from typing import Any, Dict, List
from xpanse.const import V2_PREFIX
from xpanse.endpoint import ExEndpoint
from xpanse.iterator import ExResultIterator
class IpRangeEndpoint(ExEndpoint):
"""
Part of the Assets v2 API for handling IP Ranges.
... | from typing import Any, Dict, List
from xpanse.const import V2_PREFIX
from xpanse.endpoint import ExEndpoint
from xpanse.iterator import ExResultIterator
class IpRangeEndpoint(ExEndpoint):
"""
Part of the Assets v2 API for handling IP Ranges.
See: https://api.expander.expanse.co/api/v1/docs/
"""
... | en | 0.695367 | Part of the Assets v2 API for handling IP Ranges. See: https://api.expander.expanse.co/api/v1/docs/ Returns the list of IP Ranges. Arguments should be passed as keyword args using the names below. Args: limit (int, optional): Returns at most this many results in a single... | 2.634928 | 3 |
polus-color-pyramid-builder-plugin/src/main.py | blowekamp/polus-plugins | 0 | 12174 | <reponame>blowekamp/polus-plugins<gh_stars>0
from bfio import BioReader
import argparse, logging
import numpy as np
from pathlib import Path
import filepattern, multiprocessing, utils
from concurrent.futures import ThreadPoolExecutor
COLORS = ['red',
'green',
'blue',
'yellow',
'... | from bfio import BioReader
import argparse, logging
import numpy as np
from pathlib import Path
import filepattern, multiprocessing, utils
from concurrent.futures import ThreadPoolExecutor
COLORS = ['red',
'green',
'blue',
'yellow',
'magenta',
'cyan',
'gray']... | en | 0.651704 | Check that s is number If s is a number, first attempt to convert it to an int. If integer conversion fails, attempt to convert it to a float. If float conversion fails, return None. Inputs: s - An input string or number Outputs: value - Either float, int or None Calculate ... | 2.804134 | 3 |
kinetics/reaction_classes/general_rate_Law.py | wlawler45/kinetics | 13 | 12175 | from kinetics.reaction_classes.reaction_base_class import Reaction
class Generic(Reaction):
"""
This Reaction class allows you to specify your own rate equation.
Enter the parameter names in params, and the substrate names used in the reaction in species.
Type the rate equation as a string in rate_equa... | from kinetics.reaction_classes.reaction_base_class import Reaction
class Generic(Reaction):
"""
This Reaction class allows you to specify your own rate equation.
Enter the parameter names in params, and the substrate names used in the reaction in species.
Type the rate equation as a string in rate_equa... | en | 0.864159 | This Reaction class allows you to specify your own rate equation. Enter the parameter names in params, and the substrate names used in the reaction in species. Type the rate equation as a string in rate_equation, using these same names. Enter the substrates used up, and the products made in the reaction as ... | 3.454564 | 3 |
examples/03-interception/api.py | nomadsinteractive/migi | 3 | 12176 | <gh_stars>1-10
from ctypes import *
from migi.decorators import stdcall
@stdcall('MessageBoxW', 'User32.dll', interceptable=True)
def _native_message_box_w(hwnd: c_void_p, content: c_wchar_p, title: c_wchar_p, flags: c_uint32) -> c_int32:
if wstring_at(content) == "I'm in":
return _native_message_box_w.c... | from ctypes import *
from migi.decorators import stdcall
@stdcall('MessageBoxW', 'User32.dll', interceptable=True)
def _native_message_box_w(hwnd: c_void_p, content: c_wchar_p, title: c_wchar_p, flags: c_uint32) -> c_int32:
if wstring_at(content) == "I'm in":
return _native_message_box_w.call_original(hw... | none | 1 | 1.973984 | 2 | |
adapters/heiman/HS1RC.py | russdan/domoticz-zigbee2mqtt-plugin | 146 | 12177 | <filename>adapters/heiman/HS1RC.py
from adapters.adapter_with_battery import AdapterWithBattery
from devices.switch.selector_switch import SelectorSwitch
class HeimanAlarmRemoteAdapter(AdapterWithBattery):
def __init__(self):
super().__init__()
self.switch = SelectorSwitch('Remote', 'action')
... | <filename>adapters/heiman/HS1RC.py
from adapters.adapter_with_battery import AdapterWithBattery
from devices.switch.selector_switch import SelectorSwitch
class HeimanAlarmRemoteAdapter(AdapterWithBattery):
def __init__(self):
super().__init__()
self.switch = SelectorSwitch('Remote', 'action')
... | none | 1 | 2.375146 | 2 | |
tennis_model_scraper/tennis_model_scraper/spiders/tennis_data_co_uk_spider.py | DrAndrey/tennis_model | 0 | 12178 | # -*- coding: utf-8 -*-
"""
"""
import scrapy
from tennis_model.tennis_model_scraper.tennis_model_scraper import items
class TennisDataCoUkSpider(scrapy.Spider):
name = "tennis_data_co_uk"
allowed_domains = ["www.tennis-data.co.uk"]
start_urls = ["http://www.tennis-data.co.uk/alldata.php"]
custom_... | # -*- coding: utf-8 -*-
"""
"""
import scrapy
from tennis_model.tennis_model_scraper.tennis_model_scraper import items
class TennisDataCoUkSpider(scrapy.Spider):
name = "tennis_data_co_uk"
allowed_domains = ["www.tennis-data.co.uk"]
start_urls = ["http://www.tennis-data.co.uk/alldata.php"]
custom_... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.710848 | 3 |
aoc20211219b.py | BarnabyShearer/aoc | 0 | 12179 | <reponame>BarnabyShearer/aoc
from aoc20211219a import *
def aoc(data):
sensors, _ = slam(parse(data))
return max(sum(abs(x) for x in sub(a, b)) for a in sensors for b in sensors)
| from aoc20211219a import *
def aoc(data):
sensors, _ = slam(parse(data))
return max(sum(abs(x) for x in sub(a, b)) for a in sensors for b in sensors) | none | 1 | 2.359883 | 2 | |
pyhmy/rpc/request.py | difengJ/pyhmy | 37 | 12180 | import json
import requests
from .exceptions import (
RequestsError,
RequestsTimeoutError,
RPCError
)
_default_endpoint = 'http://localhost:9500'
_default_timeout = 30
def base_request(method, params=None, endpoint=_default_endpoint, timeout=_default_timeout) -> str:
"""
Basic RPC request
... | import json
import requests
from .exceptions import (
RequestsError,
RequestsTimeoutError,
RPCError
)
_default_endpoint = 'http://localhost:9500'
_default_timeout = 30
def base_request(method, params=None, endpoint=_default_endpoint, timeout=_default_timeout) -> str:
"""
Basic RPC request
... | en | 0.358297 | Basic RPC request Parameters --------- method: str RPC Method to call params: :obj:`list`, optional Parameters for the RPC method endpoint: :obj:`str`, optional Endpoint to send request to timeout: :obj:`int`, optional Timeout in seconds Returns ------- ... | 2.747698 | 3 |
gaze_api/scripts/vidPub.py | ajdroid/tobii_ros | 0 | 12181 | <reponame>ajdroid/tobii_ros
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import socket
import threading
import rospy
from publisher import *
import cv2
import imagezmq
import numpy as np
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
def parse_sent_msg(msg):
ctr, fram... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import socket
import threading
import rospy
from publisher import *
import cv2
import imagezmq
import numpy as np
from sensor_msgs.msg import Image
from cv_bridge import CvBridge, CvBridgeError
def parse_sent_msg(msg):
ctr, frame_time = msg.split()
fra... | en | 0.633214 | #!/usr/bin/env python # -*- coding: utf-8 -*- # setup socket to python3 video streamer # Helper class implementing an IO daemon thread for imgzmq recv # ipc operation rather than tcp # self._data = receiver.recv_image() # Receive from broadcast # There are 2 hostname styles; comment out the one you don't need # Use to ... | 2.821039 | 3 |
LAImapping_SNAP/snappy_backscatterLAI.py | dipankar05/aws4agrisar | 5 | 12182 | import sys
import numpy
import numpy as np
from snappy import Product
from snappy import ProductData
from snappy import ProductIO
from snappy import ProductUtils
from snappy import FlagCoding
##############
import csv
###############MSVR
from sklearn.svm import SVR
from sklearn.preprocessing import StandardScaler
fro... | import sys
import numpy
import numpy as np
from snappy import Product
from snappy import ProductData
from snappy import ProductIO
from snappy import ProductUtils
from snappy import FlagCoding
##############
import csv
###############MSVR
from sklearn.svm import SVR
from sklearn.preprocessing import StandardScaler
fro... | en | 0.165552 | ############## ###############MSVR ######################## ##--------------------------------------------------------------------------------- #SVR training # Predictfor validation data ##--------------------------------------------------------------------------------- #print(dir(group)) #ndvi = (r10 - r7) / (r10 + r7... | 2.409091 | 2 |
test_fiona_issue383.py | thomasaarholt/fiona-wheels | 0 | 12183 | <filename>test_fiona_issue383.py<gh_stars>0
import fiona
d = {
"type": "Feature",
"id": "0",
"properties": {
"ADMINFORES": "99081600010343",
"REGION": "08",
"FORESTNUMB": "16",
"FORESTORGC": "0816",
"FORESTNAME": "El Yunque National Forest",
"GIS_ACRES": 5582... | <filename>test_fiona_issue383.py<gh_stars>0
import fiona
d = {
"type": "Feature",
"id": "0",
"properties": {
"ADMINFORES": "99081600010343",
"REGION": "08",
"FORESTNUMB": "16",
"FORESTORGC": "0816",
"FORESTNAME": "El Yunque National Forest",
"GIS_ACRES": 5582... | none | 1 | 1.831855 | 2 | |
pre_commit_hooks/forbid_crlf.py | henryiii/pre-commit-hooks | 62 | 12184 | from __future__ import print_function
import argparse, sys
from .utils import is_textfile
def contains_crlf(filename):
with open(filename, mode='rb') as file_checked:
for line in file_checked.readlines():
if line.endswith(b'\r\n'):
return True
return False
def main(argv=Non... | from __future__ import print_function
import argparse, sys
from .utils import is_textfile
def contains_crlf(filename):
with open(filename, mode='rb') as file_checked:
for line in file_checked.readlines():
if line.endswith(b'\r\n'):
return True
return False
def main(argv=Non... | none | 1 | 3.25665 | 3 | |
backend/code/start.py | socek/iep | 0 | 12185 | if __name__ == "__main__":
print("Nothing yet...")
| if __name__ == "__main__":
print("Nothing yet...")
| none | 1 | 1.297539 | 1 | |
vantage6/server/model/organization.py | jaspersnel/vantage6-server | 2 | 12186 | <gh_stars>1-10
import base64
from sqlalchemy import Column, String, LargeBinary
from sqlalchemy.orm import relationship
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm.exc import NoResultFound
from vantage6.common.globals import STRING_ENCODING
from .base import Base, Database
class Organizat... | import base64
from sqlalchemy import Column, String, LargeBinary
from sqlalchemy.orm import relationship
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.orm.exc import NoResultFound
from vantage6.common.globals import STRING_ENCODING
from .base import Base, Database
class Organization(Base):
... | en | 0.926281 | A legal entity. An organization plays a central role in managing distributed tasks. Each Organization contains a public key which other organizations can use to send encrypted messages that only this organization can read. # fields # relations # TODO this should be fixed properly Assumes that the public ke... | 2.314802 | 2 |
checkov/terraform/checks/resource/aws/EKSSecretsEncryption.py | cclauss/checkov | 1 | 12187 | <reponame>cclauss/checkov<gh_stars>1-10
from checkov.common.models.enums import CheckResult, CheckCategories
from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
class EKSSecretsEncryption(BaseResourceCheck):
def __init__(self):
name = "Ensure EKS Cluster has Secrets Encrypt... | from checkov.common.models.enums import CheckResult, CheckCategories
from checkov.terraform.checks.resource.base_resource_check import BaseResourceCheck
class EKSSecretsEncryption(BaseResourceCheck):
def __init__(self):
name = "Ensure EKS Cluster has Secrets Encryption Enabled"
id = "CKV_AWS_58"
... | none | 1 | 2.19375 | 2 | |
analysis/models/nodes/analysis_node.py | SACGF/variantgrid | 5 | 12188 | <gh_stars>1-10
""" AnalysisNode is the base class that all analysis nodes inherit from. """
import logging
import operator
from functools import reduce
from random import random
from time import time
from typing import Tuple, Sequence, List, Dict, Optional
from celery.canvas import Signature
from django.conf import se... | """ AnalysisNode is the base class that all analysis nodes inherit from. """
import logging
import operator
from functools import reduce
from random import random
from time import time
from typing import Tuple, Sequence, List, Dict, Optional
from celery.canvas import Signature
from django.conf import settings
from dja... | en | 0.856329 | AnalysisNode is the base class that all analysis nodes inherit from. # Queryset version # Node suggests parents use a cache # This is set to node/version you cloned - cleared upon modification Returns the node loaded as a subclass Checks that the node is still there and has the version we expect - or throw exception Vi... | 1.721702 | 2 |
lbrc_flask/standard_views.py | LCBRU/lbrc_flask_ui | 0 | 12189 | <reponame>LCBRU/lbrc_flask_ui<filename>lbrc_flask/standard_views.py<gh_stars>0
import os
import traceback
from flask import render_template, send_from_directory, current_app, g
from .emailing import email
def init_standard_views(app):
@app.route("/favicon.ico")
def favicon():
return send_from... | import os
import traceback
from flask import render_template, send_from_directory, current_app, g
from .emailing import email
def init_standard_views(app):
@app.route("/favicon.ico")
def favicon():
return send_from_directory(
os.path.join(app.root_path, "static"),
"f... | en | 0.285435 | Catch internal 404 errors, display
a nice error page and log the error. Catch internal 404 errors, display
a nice error page and log the error. Catch internal 404 errors, display
a nice error page and log the error. Catch internal 404 errors, display
a nice error page... | 2.633199 | 3 |
tests/data/program_analysis/PyAST2CAST/import/test_import_3.py | rsulli55/automates | 17 | 12190 | <filename>tests/data/program_analysis/PyAST2CAST/import/test_import_3.py
# 'from ... import ...' statement
from sys import exit
def main():
exit(0)
main() | <filename>tests/data/program_analysis/PyAST2CAST/import/test_import_3.py
# 'from ... import ...' statement
from sys import exit
def main():
exit(0)
main() | en | 0.366328 | # 'from ... import ...' statement | 1.313337 | 1 |
postmanparser/form_parameter.py | appknox/postmanparser | 5 | 12191 | from dataclasses import dataclass
from typing import List
from typing import Union
from postmanparser.description import Description
from postmanparser.exceptions import InvalidObjectException
from postmanparser.exceptions import MissingRequiredFieldException
@dataclass
class FormParameter:
key: str
value: s... | from dataclasses import dataclass
from typing import List
from typing import Union
from postmanparser.description import Description
from postmanparser.exceptions import InvalidObjectException
from postmanparser.exceptions import MissingRequiredFieldException
@dataclass
class FormParameter:
key: str
value: s... | en | 0.753164 | # should override content-type in header | 2.621894 | 3 |
pip-check.py | Urucas/pip-check | 0 | 12192 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import pip
import os
import sys
def err(msg):
print "\033[31m✗ \033[0m%s" % msg
def ok(msg):
print "\033[32m✓ \033[0m%s" % msg
def main():
cwd = os.getcwd()
json_file = os.path.join(cwd, 'dependencies.json')
if os.path.isfile(json_file) =... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import pip
import os
import sys
def err(msg):
print "\033[31m✗ \033[0m%s" % msg
def ok(msg):
print "\033[32m✓ \033[0m%s" % msg
def main():
cwd = os.getcwd()
json_file = os.path.join(cwd, 'dependencies.json')
if os.path.isfile(json_file) =... | en | 0.352855 | #!/usr/bin/env python # -*- coding: utf-8 -*- | 2.482064 | 2 |
hxl/scripts.py | HXLStandard/libhxl-python | 30 | 12193 | <filename>hxl/scripts.py
"""
Console scripts
<NAME>
April 2015
This is a big, ugly module to support the libhxl
console scripts, including (mainly) argument parsing.
License: Public Domain
Documentation: https://github.com/HXLStandard/libhxl-python/wiki
"""
from __future__ import print_function
import argparse, jso... | <filename>hxl/scripts.py
"""
Console scripts
<NAME>
April 2015
This is a big, ugly module to support the libhxl
console scripts, including (mainly) argument parsing.
License: Public Domain
Documentation: https://github.com/HXLStandard/libhxl-python/wiki
"""
from __future__ import print_function
import argparse, jso... | en | 0.411863 | Console scripts <NAME> April 2015 This is a big, ugly module to support the libhxl console scripts, including (mainly) argument parsing. License: Public Domain Documentation: https://github.com/HXLStandard/libhxl-python/wiki # Do not import hxl, to avoid circular imports # In Python2, sys.stdin is a byte stream; in P... | 2.693419 | 3 |
1801-1900/1807.evaluate-thebracket-pairs-of-a-string.py | guangxu-li/leetcode-in-python | 0 | 12194 | #
# @lc app=leetcode id=1807 lang=python3
#
# [1807] Evaluate the Bracket Pairs of a String
#
# @lc code=start
import re
class Solution:
def evaluate(self, s: str, knowledge: list[list[str]]) -> str:
mapping = dict(knowledge)
return re.sub(r"\((\w+?)\)", lambda m: mapping.get(m.group(1), "?"), s)... | #
# @lc app=leetcode id=1807 lang=python3
#
# [1807] Evaluate the Bracket Pairs of a String
#
# @lc code=start
import re
class Solution:
def evaluate(self, s: str, knowledge: list[list[str]]) -> str:
mapping = dict(knowledge)
return re.sub(r"\((\w+?)\)", lambda m: mapping.get(m.group(1), "?"), s)... | en | 0.450719 | # # @lc app=leetcode id=1807 lang=python3 # # [1807] Evaluate the Bracket Pairs of a String # # @lc code=start # @lc code=end | 3.27483 | 3 |
Math Functions/Uncategorized/Herons formula.py | adrikagupta/Must-Know-Programming-Codes | 13 | 12195 | <reponame>adrikagupta/Must-Know-Programming-Codes
#Heron's formula#
import math
unit_of_measurement = "cm"
side1 = int(input("Enter the length of side A in cm: "))
side2 = int(input("Enter the length of side B in cm: "))
side3 = int(input("Enter the length of side C in cm: "))
braket1 = (side1 ** 2) * (side2**2) + (... | #Heron's formula#
import math
unit_of_measurement = "cm"
side1 = int(input("Enter the length of side A in cm: "))
side2 = int(input("Enter the length of side B in cm: "))
side3 = int(input("Enter the length of side C in cm: "))
braket1 = (side1 ** 2) * (side2**2) + (side1**2)*(side3**2) + (side2**2)*(side3**2)
brake... | en | 0.750172 | #Heron's formula# | 4.31602 | 4 |
viewer/bitmap_from_array.py | TiankunZhou/dials | 2 | 12196 | from __future__ import absolute_import, division, print_function
import numpy as np
import wx
from dials.array_family import flex
from dials_viewer_ext import rgb_img
class wxbmp_from_np_array(object):
def __init__(
self, lst_data_in, show_nums=True, palette="black2white", lst_data_mask_in=None
):
... | from __future__ import absolute_import, division, print_function
import numpy as np
import wx
from dials.array_family import flex
from dials_viewer_ext import rgb_img
class wxbmp_from_np_array(object):
def __init__(
self, lst_data_in, show_nums=True, palette="black2white", lst_data_mask_in=None
):
... | en | 0.895073 | # remember to put here some assertion to check that # both arrays have the same shape # print "z =", z # display text in center # assuming "hot descend" | 2.157257 | 2 |
spinesTS/utils/_validation.py | BirchKwok/spinesTS | 2 | 12197 | import numpy as np
def check_x_y(x, y):
assert isinstance(x, np.ndarray) and isinstance(y, np.ndarray)
assert np.ndim(x) <= 3 and np.ndim(y) <= 2
assert len(x) == len(y)
| import numpy as np
def check_x_y(x, y):
assert isinstance(x, np.ndarray) and isinstance(y, np.ndarray)
assert np.ndim(x) <= 3 and np.ndim(y) <= 2
assert len(x) == len(y)
| none | 1 | 2.979677 | 3 | |
sphinxsharp-pro/sphinxsharp.py | madTeddy/sphinxsharp-pro | 2 | 12198 | """
CSharp (С#) domain for sphinx
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sphinxsharp Pro (with custom styling)
:copyright: Copyright 2021 by MadTeddy
"""
import re
import warnings
from os import path
from collections import defaultdict, namedtuple
from docutils import nodes
from docutils.parsers.rst import... | """
CSharp (С#) domain for sphinx
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sphinxsharp Pro (with custom styling)
:copyright: Copyright 2021 by MadTeddy
"""
import re
import warnings
from os import path
from collections import defaultdict, namedtuple
from docutils import nodes
from docutils.parsers.rst import... | en | 0.352336 | CSharp (С#) domain for sphinx ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Sphinxsharp Pro (with custom styling) :copyright: Copyright 2021 by MadTeddy Called before main ``signode`` appends Called after main ``signode`` appends Get ``contentnode`` before main content will append Get ``contentnode`` after main content w... | 1.601515 | 2 |
articles/migrations/0003_article_published_at.py | mosalaheg/django3.2 | 0 | 12199 | <filename>articles/migrations/0003_article_published_at.py
# Generated by Django 3.2.7 on 2021-10-02 08:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('articles', '0002_auto_20211002_1019'),
]
operations = [
migrations.AddField(
... | <filename>articles/migrations/0003_article_published_at.py
# Generated by Django 3.2.7 on 2021-10-02 08:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('articles', '0002_auto_20211002_1019'),
]
operations = [
migrations.AddField(
... | en | 0.896604 | # Generated by Django 3.2.7 on 2021-10-02 08:24 | 1.430227 | 1 |