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 |
|---|---|---|---|---|---|---|---|---|---|---|
tools/idx/makeIDX.py | vehicle-lang/vehicle | 9 | 6628951 |
# Small script for generating test IDX dataset files
import idx2numpy
import numpy as np
xs = np.array([0.1,3,-2,-3.2]).astype('float32')
f_write = open('datset.idx', 'wb')
idx2numpy.convert_to_file(f_write, xs) |
# Small script for generating test IDX dataset files
import idx2numpy
import numpy as np
xs = np.array([0.1,3,-2,-3.2]).astype('float32')
f_write = open('datset.idx', 'wb')
idx2numpy.convert_to_file(f_write, xs) | en | 0.486895 | # Small script for generating test IDX dataset files | 2.552104 | 3 |
website_event_attendee_fields/models/event_registration.py | RL-OtherApps/website-addons | 0 | 6628952 | # Copyright 2017-2018 <NAME> <https://it-projects.info/team/yelizariev>
# License MIT (https://opensource.org/licenses/MIT).
import logging
from odoo import _, api, models
_logger = logging.getLogger(__name__)
class EventRegistration(models.Model):
_inherit = "event.registration"
@api.model
def create(... | # Copyright 2017-2018 <NAME> <https://it-projects.info/team/yelizariev>
# License MIT (https://opensource.org/licenses/MIT).
import logging
from odoo import _, api, models
_logger = logging.getLogger(__name__)
class EventRegistration(models.Model):
_inherit = "event.registration"
@api.model
def create(... | en | 0.863288 | # Copyright 2017-2018 <NAME> <https://it-projects.info/team/yelizariev> # License MIT (https://opensource.org/licenses/MIT). # be sure, that name and phone in registration are ones from Attendee, # because built-in modules take them from Partner (buyer) if ones are no presented # Update attendee details, if user buys (... | 2.180532 | 2 |
src/vm-builder-0.12.4+bzr489/build/lib.linux-x86_64-2.7/VMBuilder/plugins/ubuntu/lucid.py | cryptorinium/Num2 | 0 | 6628953 | <gh_stars>0
#
# Uncomplicated VM Builder
# Copyright (C) 2010 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundatio... | #
# Uncomplicated VM Builder
# Copyright (C) 2010 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation.
#
# Th... | en | 0.864228 | # # Uncomplicated VM Builder # Copyright (C) 2010 Canonical Ltd. # # See AUTHORS for list of contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3, as # published by the Free Software Foundation. # # Th... | 1.824994 | 2 |
test/functional/test_framework/blocktools.py | hackverket/bitcoin-abc | 0 | 6628954 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Utilities for manipulating blocks and transactions."""
from .mininode import *
from .script import CSc... | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Utilities for manipulating blocks and transactions."""
from .mininode import *
from .script import CSc... | en | 0.784314 | #!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. Utilities for manipulating blocks and transactions. # Create a block (with regtest difficulty) # Will brea... | 2.225386 | 2 |
colosseumrl/envs/tron/TronRllibEnvironment.py | carletonz/colosseumrl | 8 | 6628955 | import numpy as np
from gym.spaces import Dict, Discrete, Box, Space
from colosseumrl import BaseEnvironment
from colosseumrl.envs.wrappers import RllibWrapper
from . import TronGridEnvironment
class TronRllibEnvironment(RllibWrapper):
def create_env(self, *args, **kwargs) -> BaseEnvironment:
return Tro... | import numpy as np
from gym.spaces import Dict, Discrete, Box, Space
from colosseumrl import BaseEnvironment
from colosseumrl.envs.wrappers import RllibWrapper
from . import TronGridEnvironment
class TronRllibEnvironment(RllibWrapper):
def create_env(self, *args, **kwargs) -> BaseEnvironment:
return Tro... | none | 1 | 2.637597 | 3 | |
piped/processors/smtp_processors.py | alexbrasetvik/Piped | 3 | 6628956 | <filename>piped/processors/smtp_processors.py
# Copyright (c) 2010-2011, Found IT A/S and Piped Project Contributors.
# See LICENSE for details.
from email import message
from zope import interface
from twisted.internet import defer
from piped import util, processing, exceptions
from piped.processors import base
from... | <filename>piped/processors/smtp_processors.py
# Copyright (c) 2010-2011, Found IT A/S and Piped Project Contributors.
# See LICENSE for details.
from email import message
from zope import interface
from twisted.internet import defer
from piped import util, processing, exceptions
from piped.processors import base
from... | en | 0.671739 | # Copyright (c) 2010-2011, Found IT A/S and Piped Project Contributors. # See LICENSE for details. Creates an instance of :class:`email.message.Message`. :param output_path: The path in the baton where the :class:`email.message.Message` should be stored. :param payload_path: The path to the payload... | 2.485154 | 2 |
.config/qtile/config.py | garywei944/eva_ubuntu | 0 | 6628957 | <filename>.config/qtile/config.py
# Copyright (c) 2010 <NAME>
# Copyright (c) 2010, 2014 dequis
# Copyright (c) 2012 <NAME>
# Copyright (c) 2012-2014 <NAME>
# Copyright (c) 2012 <NAME>
# Copyright (c) 2013 horsik
# Copyright (c) 2013 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a cop... | <filename>.config/qtile/config.py
# Copyright (c) 2010 <NAME>
# Copyright (c) 2010, 2014 dequis
# Copyright (c) 2012 <NAME>
# Copyright (c) 2012-2014 <NAME>
# Copyright (c) 2012 <NAME>
# Copyright (c) 2013 horsik
# Copyright (c) 2013 <NAME>
#
# Permission is hereby granted, free of charge, to any person obtaining a cop... | en | 0.745192 | # Copyright (c) 2010 <NAME> # Copyright (c) 2010, 2014 dequis # Copyright (c) 2012 <NAME> # Copyright (c) 2012-2014 <NAME> # Copyright (c) 2012 <NAME> # Copyright (c) 2013 horsik # Copyright (c) 2013 <NAME> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associate... | 1.729084 | 2 |
metroid/__init__.py | Bryhn-Bjolgerud/metroid | 0 | 6628958 | from metroid.config import settings
if settings.worker_type == 'celery':
from metroid.celery import MetroidTask # noqa F401
from metroid.publish import publish_event # noqa F401
__version__ = '1.1.0'
default_app_config = 'metroid.apps.MetroidConfig'
| from metroid.config import settings
if settings.worker_type == 'celery':
from metroid.celery import MetroidTask # noqa F401
from metroid.publish import publish_event # noqa F401
__version__ = '1.1.0'
default_app_config = 'metroid.apps.MetroidConfig'
| uz | 0.389047 | # noqa F401 # noqa F401 | 1.328532 | 1 |
src/funky_collections/immutable.py | erinxocon/funky-collections | 0 | 6628959 | <gh_stars>0
import collections
from typing import Any, Generator, List, Optional, Sequence, Union
from .abc import DoublyLinkedList
from .nodes import ImmutableListNode
class ImmutableFixedList(DoublyLinkedList, collections.abc.Sequence):
__slots__ = "_max_len"
def __init__(self, max_len: int = 0, seq: Seq... | import collections
from typing import Any, Generator, List, Optional, Sequence, Union
from .abc import DoublyLinkedList
from .nodes import ImmutableListNode
class ImmutableFixedList(DoublyLinkedList, collections.abc.Sequence):
__slots__ = "_max_len"
def __init__(self, max_len: int = 0, seq: Sequence = ()) ... | none | 1 | 2.946313 | 3 | |
covid.py | pyclass-jjj/proyectos | 0 | 6628960 | import pandas as pd
from os import path
from datetime import datetime, timedelta
class COVID:
def __init__(self):
self.descarga_datos()
self.get_estado()
#self.grafica_matplot()
self.grafica_plotly()
def descarga_datos(self):
hoy = datetime.now() - timedelta(1)
... | import pandas as pd
from os import path
from datetime import datetime, timedelta
class COVID:
def __init__(self):
self.descarga_datos()
self.get_estado()
#self.grafica_matplot()
self.grafica_plotly()
def descarga_datos(self):
hoy = datetime.now() - timedelta(1)
... | es | 0.101117 | #self.grafica_matplot() | 3.138983 | 3 |
tf_mnist.py | latenite4/python3 | 0 | 6628961 | <gh_stars>0
#!/usr/bin/python3
# implement TF model which will be used to classify MNIST digits using keras.
#
# Name: <NAME>
# email: <EMAIL>
# date: 1/3/2021
# based on: https://www.youtube.com/watch?v=bee0GrKBCrE
# you will need sudo apt install nvidia-cuda-toolkit
import tensorflow as tf
from tensorflow import ker... | #!/usr/bin/python3
# implement TF model which will be used to classify MNIST digits using keras.
#
# Name: <NAME>
# email: <EMAIL>
# date: 1/3/2021
# based on: https://www.youtube.com/watch?v=bee0GrKBCrE
# you will need sudo apt install nvidia-cuda-toolkit
import tensorflow as tf
from tensorflow import keras
from matp... | en | 0.608863 | #!/usr/bin/python3 # implement TF model which will be used to classify MNIST digits using keras. # # Name: <NAME> # email: <EMAIL> # date: 1/3/2021 # based on: https://www.youtube.com/watch?v=bee0GrKBCrE # you will need sudo apt install nvidia-cuda-toolkit #try to install TF 2 if it will run on this HW # try: # tenso... | 3.471812 | 3 |
example.py | leonxi/python-qingping | 0 | 6628962 | from qingping.client import QingPing
app_key = "_ysnN4hMg"
app_secret = "51e92ce81cbb11ebae5a00163e06ed69"
client = QingPing(app_key, app_secret)
devices = client.devices.list()
print(devices)
| from qingping.client import QingPing
app_key = "_ysnN4hMg"
app_secret = "51e92ce81cbb11ebae5a00163e06ed69"
client = QingPing(app_key, app_secret)
devices = client.devices.list()
print(devices)
| none | 1 | 1.817903 | 2 | |
technique/right_hand.py | keremkoseoglu/Guitar-Training-Remote | 4 | 6628963 | <reponame>keremkoseoglu/Guitar-Training-Remote
""" Right hand techniques """
import random
from config import get_configuration
class RightHand:
""" Right hand techniques """
def __init__(self):
config = get_configuration()
self._techniques = config["right_hand_exercises"]
def _clone_tec... | """ Right hand techniques """
import random
from config import get_configuration
class RightHand:
""" Right hand techniques """
def __init__(self):
config = get_configuration()
self._techniques = config["right_hand_exercises"]
def _clone_techniques(self) -> []:
output = []
... | en | 0.412256 | Right hand techniques Right hand techniques Returns random right hand techniques # pylint: disable=W0612 | 2.829706 | 3 |
examples/lsm6ds_lsm6dsox_mlc_test.py | adafruit/Adafruit_CircuitPython_LSM6DSOX | 0 | 6628964 | <reponame>adafruit/Adafruit_CircuitPython_LSM6DSOX
# SPDX-FileCopyrightText: Copyright (c) 2020 <NAME> for Adafruit Industries
#
# SPDX-License-Identifier: MIT
# LSM6DSOX IMU MLC (Machine Learning Core) Example.
# Download the raw UCF file, copy to storage and reset.
# NOTE: The pre-trained models (UCF files) for the ... | # SPDX-FileCopyrightText: Copyright (c) 2020 <NAME> for Adafruit Industries
#
# SPDX-License-Identifier: MIT
# LSM6DSOX IMU MLC (Machine Learning Core) Example.
# Download the raw UCF file, copy to storage and reset.
# NOTE: The pre-trained models (UCF files) for the examples can be found here:
# https://github.com/ST... | en | 0.676101 | # SPDX-FileCopyrightText: Copyright (c) 2020 <NAME> for Adafruit Industries # # SPDX-License-Identifier: MIT # LSM6DSOX IMU MLC (Machine Learning Core) Example. # Download the raw UCF file, copy to storage and reset. # NOTE: The pre-trained models (UCF files) for the examples can be found here: # https://github.com/STM... | 2.555432 | 3 |
virus/remote_control_telegram/system.py | theDarkc0mrade/CyberSecurity | 3 | 6628965 | <filename>virus/remote_control_telegram/system.py
import telebot
import os
import requests
from PIL import ImageGrab
import shutil
import sqlite4
import win32crypt
import platform
import webbrowser
import time
import subprocess
import cv2
import sys
import wave
import pyaudio
bot_token = "<KEY>"
chat_id = "ВАШ ЧАТ ID... | <filename>virus/remote_control_telegram/system.py
import telebot
import os
import requests
from PIL import ImageGrab
import shutil
import sqlite4
import win32crypt
import platform
import webbrowser
import time
import subprocess
import cv2
import sys
import wave
import pyaudio
bot_token = "<KEY>"
chat_id = "ВАШ ЧАТ ID... | ru | 0.988867 | # # ПАРОЛИ # Если сообщение /passwords chrome # ИначеЕсли текст /passwords opera # ИНФОРМАЦИЯ # ДИРЕКТОРИЯ # ПРОЦЕССЫ # CMD # Отправка сообщения # ОТКРЫТЬ ССЫЛКУ # ВСЕ ФАЙЛЫ # ПЕРЕЙТИ В ПАПКУ # Переменная принемающая сообщение от юзера # ЗАГРУЗКА ФАЙЛА # Переменная, в которой содержится имя файла # Переменная для POST ... | 2.25546 | 2 |
tests/test_kof.py | danielbrunt57/zha-device-handlers | 0 | 6628966 | <gh_stars>0
"""Tests for KOF."""
from unittest import mock
import zigpy.device
import zigpy.endpoint
import zigpy.quirks
import zhaquirks.kof.kof_mr101z
def test_kof_no_reply():
"""Test KOF No reply."""
class TestCluster(
zhaquirks.kof.kof_mr101z.NoReplyMixin, zigpy.quirks.CustomCluster
):
... | """Tests for KOF."""
from unittest import mock
import zigpy.device
import zigpy.endpoint
import zigpy.quirks
import zhaquirks.kof.kof_mr101z
def test_kof_no_reply():
"""Test KOF No reply."""
class TestCluster(
zhaquirks.kof.kof_mr101z.NoReplyMixin, zigpy.quirks.CustomCluster
):
"""Test C... | en | 0.856493 | Tests for KOF. Test KOF No reply. Test Cluster Class. | 2.276341 | 2 |
azure-mgmt-iothub/azure/mgmt/iothub/models/iot_hub_sku_info.py | v-Ajnava/azure-sdk-for-python | 4 | 6628967 | # 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 ... | # 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.570188 | # 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 ... | 1.784634 | 2 |
src/glue.py | karlotimmerman/glue | 14 | 6628968 | ''' GLUE - THE TOOLKIT FOR MICROSOFT COGNITIVE SERVICES '''
''' <EMAIL> '''
''' Supports Text-To-Speech (TTS), Speech-To-Text (STT), Evaluation, LUIS-Scoring '''
# Import standard packages
import os
import sys
import shutil
import logging
import argparse
import pandas as pd
# Import custom modules
import stt
import t... | ''' GLUE - THE TOOLKIT FOR MICROSOFT COGNITIVE SERVICES '''
''' <EMAIL> '''
''' Supports Text-To-Speech (TTS), Speech-To-Text (STT), Evaluation, LUIS-Scoring '''
# Import standard packages
import os
import sys
import shutil
import logging
import argparse
import pandas as pd
# Import custom modules
import stt
import t... | en | 0.475288 | GLUE - THE TOOLKIT FOR MICROSOFT COGNITIVE SERVICES <EMAIL> Supports Text-To-Speech (TTS), Speech-To-Text (STT), Evaluation, LUIS-Scoring # Import standard packages # Import custom modules COMMAND EXAMPLES # python .\src\glue.py --do_synthesize --input input/scoringfile.txt # Parse arguments # Set arguments # Get confi... | 2.333995 | 2 |
olympics/olympics-api.py | robbie-young/cs257 | 0 | 6628969 | <reponame>robbie-young/cs257<gh_stars>0
'''
olympics-api.py
Authors: <NAME>, 28 October 2021
For use in the 'olympics' project in Carleton's CS257 course, Fall term
'''
import flask
import json
import psycopg2
import argparse
import config
from config import database as config_database
from config import u... | '''
olympics-api.py
Authors: <NAME>, 28 October 2021
For use in the 'olympics' project in Carleton's CS257 course, Fall term
'''
import flask
import json
import psycopg2
import argparse
import config
from config import database as config_database
from config import user as config_user
from config import pa... | en | 0.481259 | olympics-api.py Authors: <NAME>, 28 October 2021 For use in the 'olympics' project in Carleton's CS257 course, Fall term [̲̅$̲̅(̲̅5̲̅)̲̅$̲̅][̲̅$̲̅(̲̅5̲̅)̲̅$̲̅][̲̅$̲̅(̲̅5̲̅)̲̅$̲̅][̲̅$̲̅(̲̅5̲̅)̲̅$̲̅][̲̅$̲̅(̲̅5̲̅)̲̅$̲̅][̲̅$̲̅(̲̅5̲̅)̲̅$̲̅][̲̅$̲̅(̲̅5̲̅)̲̅$̲̅][̲̅$̲̅(̲̅5̲̅)̲̅$̲̅][̲̅$̲̅(̲̅5̲̅)̲̅$̲̅][̲̅$̲̅(̲̅5̲̅)̲̅$̲̅][... | 3.378283 | 3 |
openpype/modules/default_modules/ftrack/interfaces.py | yosuperdope/OpenPype | 0 | 6628970 | from abc import abstractmethod
from openpype.modules import OpenPypeInterface
class IFtrackEventHandlerPaths(OpenPypeInterface):
"""Other modules interface to return paths to ftrack event handlers.
Expected output is dictionary with "server" and "user" keys.
"""
@abstractmethod
def get_event_hand... | from abc import abstractmethod
from openpype.modules import OpenPypeInterface
class IFtrackEventHandlerPaths(OpenPypeInterface):
"""Other modules interface to return paths to ftrack event handlers.
Expected output is dictionary with "server" and "user" keys.
"""
@abstractmethod
def get_event_hand... | en | 0.846927 | Other modules interface to return paths to ftrack event handlers. Expected output is dictionary with "server" and "user" keys. | 2.619809 | 3 |
src/sqlfluff/rules/L042.py | fdw/sqlfluff | 0 | 6628971 | <reponame>fdw/sqlfluff
"""Implementation of Rule L042."""
from typing import Optional
from sqlfluff.core.rules.base import BaseRule, LintResult, RuleContext
from sqlfluff.core.rules.doc_decorators import document_configuration
from sqlfluff.core.rules.functional.segment_predicates import is_type
@document_configurat... | """Implementation of Rule L042."""
from typing import Optional
from sqlfluff.core.rules.base import BaseRule, LintResult, RuleContext
from sqlfluff.core.rules.doc_decorators import document_configuration
from sqlfluff.core.rules.functional.segment_predicates import is_type
@document_configuration
class Rule_L042(Bas... | en | 0.826337 | Implementation of Rule L042. Join/From clauses should not contain subqueries. Use CTEs instead. By default this rule is configured to allow subqueries within ``FROM`` clauses but not within ``JOIN`` clauses. If you prefer a stricter lint then this is configurable. NB: Some dialects don't allow CTEs, a... | 1.871187 | 2 |
lib/galaxy/util/checkers.py | BalthazarPavot/galaxy_project_reports | 1 | 6628972 | import re
import bz2
import gzip
import zipfile
import binascii
import imghdr
from galaxy import util
from six import StringIO
HTML_CHECK_LINES = 100
try:
import Image as PIL
except ImportError:
try:
from PIL import Image as PIL
except:
PIL = None
def check_image( file_path ):
if PIL... | import re
import bz2
import gzip
import zipfile
import binascii
import imghdr
from galaxy import util
from six import StringIO
HTML_CHECK_LINES = 100
try:
import Image as PIL
except ImportError:
try:
from PIL import Image as PIL
except:
PIL = None
def check_image( file_path ):
if PIL... | en | 0.866888 | # TODO: Potentially reading huge lines into string here, this should be # reworked. # Handles files if file_path is True or text if file_path is False # This method returns a tuple of booleans representing ( is_gzipped, is_valid ) # Make sure we have a gzipped file # We support some binary data types, so check if the c... | 2.6736 | 3 |
python/105.construct-binary-tree-from-preorder-and-inorder-traversal.py | fengbaoheng/leetcode | 1 | 6628973 | #
# @lc app=leetcode.cn id=105 lang=python3
#
# [105] 从前序与中序遍历序列构造二叉树
#
from typing import List
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
# 根据前序遍历找到根
# 根据根在中序遍历中划分左右子树
# 递归生成子树
def buildTree(self, preorder: List... | #
# @lc app=leetcode.cn id=105 lang=python3
#
# [105] 从前序与中序遍历序列构造二叉树
#
from typing import List
class TreeNode:
def __init__(self, x):
self.val = x
self.left = None
self.right = None
class Solution:
# 根据前序遍历找到根
# 根据根在中序遍历中划分左右子树
# 递归生成子树
def buildTree(self, preorder: List... | zh | 0.773571 | # # @lc app=leetcode.cn id=105 lang=python3 # # [105] 从前序与中序遍历序列构造二叉树 # # 根据前序遍历找到根 # 根据根在中序遍历中划分左右子树 # 递归生成子树 # 找到根节点 # 划分左右子树的遍历结果 # 生成左右子树 | 3.652464 | 4 |
downloadArtwork.py | panchr/itunes-artwork-downloader | 1 | 6628974 | # <NAME>
# downloadArtwork.py
# STDIN/STDOUT wrapper around iTunes.py
import urllib2
import urllib
import json
import sys
import os
API_URL = "http://itunes.apple.com/search"
def main():
'''Main process: read data from stdin and write to stdout'''
temp_dir = sys.stdin.readline().strip("\n")
if not os.path.exists(... | # <NAME>
# downloadArtwork.py
# STDIN/STDOUT wrapper around iTunes.py
import urllib2
import urllib
import json
import sys
import os
API_URL = "http://itunes.apple.com/search"
def main():
'''Main process: read data from stdin and write to stdout'''
temp_dir = sys.stdin.readline().strip("\n")
if not os.path.exists(... | en | 0.841902 | # <NAME> # downloadArtwork.py # STDIN/STDOUT wrapper around iTunes.py Main process: read data from stdin and write to stdout # AppleScript reads from here # filter out unicode characters from the filepath Get the artwork URL for a given song, with optional artist and album names # form a search query by concatenating t... | 3.2373 | 3 |
app/group/views/group_form.py | TIHLDE/Lepton | 7 | 6628975 | from django.shortcuts import get_object_or_404
from rest_framework import mixins
from rest_framework.viewsets import GenericViewSet
from app.common.permissions import BasicViewPermission, is_admin_user
from app.forms.mixins import APIFormErrorsMixin
from app.forms.models.forms import GroupForm
from app.forms.serialize... | from django.shortcuts import get_object_or_404
from rest_framework import mixins
from rest_framework.viewsets import GenericViewSet
from app.common.permissions import BasicViewPermission, is_admin_user
from app.forms.mixins import APIFormErrorsMixin
from app.forms.models.forms import GroupForm
from app.forms.serialize... | none | 1 | 1.935567 | 2 | |
projects/balancer/tests/test_end_of_funding_date.py | Lido-Finance/rewards-managers | 2 | 6628976 | <reponame>Lido-Finance/rewards-managers
import pytest
from brownie import reverts, chain
from math import floor
rewards_limit = 25 * 1000 * 10**18
rewards_period = 3600 * 24 * 7
@pytest.mark.parametrize(
'period',
[
rewards_period,
floor(0.5*rewards_period),
4*rewards_period ,
... | import pytest
from brownie import reverts, chain
from math import floor
rewards_limit = 25 * 1000 * 10**18
rewards_period = 3600 * 24 * 7
@pytest.mark.parametrize(
'period',
[
rewards_period,
floor(0.5*rewards_period),
4*rewards_period ,
4*rewards_period + 1,
4*r... | none | 1 | 1.894646 | 2 | |
problems/1021-remove-outermost-parentheses.py | tzxyz/leetcode | 0 | 6628977 | <filename>problems/1021-remove-outermost-parentheses.py
class Solution:
"""
有效括号字符串为空 ("")、"(" + A + ")" 或 A + B,其中 A 和 B 都是有效的括号字符串,+ 代表字符串的连接。
例如,"","()","(())()" 和 "(()(()))" 都是有效的括号字符串。
如果有效字符串 S 非空,且不存在将其拆分为 S = A+B 的方法,我们称其为原语(primitive),其中 A 和 B 都是非空有效括号字符串。
给出一个非空有效字符串 S,考虑将其进行原语化分解,使得:S = P... | <filename>problems/1021-remove-outermost-parentheses.py
class Solution:
"""
有效括号字符串为空 ("")、"(" + A + ")" 或 A + B,其中 A 和 B 都是有效的括号字符串,+ 代表字符串的连接。
例如,"","()","(())()" 和 "(()(()))" 都是有效的括号字符串。
如果有效字符串 S 非空,且不存在将其拆分为 S = A+B 的方法,我们称其为原语(primitive),其中 A 和 B 都是非空有效括号字符串。
给出一个非空有效字符串 S,考虑将其进行原语化分解,使得:S = P... | zh | 0.896935 | 有效括号字符串为空 ("")、"(" + A + ")" 或 A + B,其中 A 和 B 都是有效的括号字符串,+ 代表字符串的连接。 例如,"","()","(())()" 和 "(()(()))" 都是有效的括号字符串。 如果有效字符串 S 非空,且不存在将其拆分为 S = A+B 的方法,我们称其为原语(primitive),其中 A 和 B 都是非空有效括号字符串。 给出一个非空有效字符串 S,考虑将其进行原语化分解,使得:S = P_1 + P_2 + ... + P_k,其中 P_i 是有效括号字符串原语。 对 S 进行原语化分解,删除分解中每个原语字符串的最外层括号,返回 S 。 ... | 3.413991 | 3 |
utils.py | shun1024/noisystudent | 0 | 6628978 | <gh_stars>0
# coding=utf-8
# Copyright 2019 The Google NoisyStudent Team 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... | # coding=utf-8
# Copyright 2019 The Google NoisyStudent Team 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... | en | 0.805988 | # coding=utf-8 # Copyright 2019 The Google NoisyStudent Team 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... | 2.098331 | 2 |
data.py | XieResearchGroup/CLEIT | 0 | 6628979 | <filename>data.py
import os
import datetime
import numpy as np
import random
import pandas as pd
import data_config
import torch
from torch.utils.data import TensorDataset, DataLoader
from sklearn.model_selection import train_test_split, StratifiedKFold
_RNG_SEED = None
DRUG_DICT = {
'gem': 'gemcitabine',
'av... | <filename>data.py
import os
import datetime
import numpy as np
import random
import pandas as pd
import data_config
import torch
from torch.utils.data import TensorDataset, DataLoader
from sklearn.model_selection import train_test_split, StratifiedKFold
_RNG_SEED = None
DRUG_DICT = {
'gem': 'gemcitabine',
'av... | en | 0.327723 | This function is copied from `tensorpack <https://github.com/ppwwyyxx/tensorpack/blob/master/tensorpack/utils/utils.py>`__. Get a good RNG seeded with time, pid and the object. Args: obj: some object to use to generate random seed. Returns: np.random.RandomState: the RNG. # ccle_sample_i... | 2.377337 | 2 |
build/botzone_tank2.py | zhongxinghong/Botzone-Tank2 | 11 | 6628980 | # -*- coding: utf-8 -*-
# @author: Rabbit
# @filename: botzone_tank2.py
# @date: 2019-05-29 21:31:38
# @site: https://github.com/zhongxinghong/Botzone-Tank2
# @description: Automatically built Python single-file script for Botzone/Tank2 game
"""
MIT License
Copyright (c) 2019 Rabbit
Permission i... | # -*- coding: utf-8 -*-
# @author: Rabbit
# @filename: botzone_tank2.py
# @date: 2019-05-29 21:31:38
# @site: https://github.com/zhongxinghong/Botzone-Tank2
# @description: Automatically built Python single-file script for Botzone/Tank2 game
"""
MIT License
Copyright (c) 2019 Rabbit
Permission i... | zh | 0.898004 | # -*- coding: utf-8 -*- # @author: Rabbit # @filename: botzone_tank2.py # @date: 2019-05-29 21:31:38 # @site: https://github.com/zhongxinghong/Botzone-Tank2 # @description: Automatically built Python single-file script for Botzone/Tank2 game MIT License Copyright (c) 2019 Rabbit Permission is he... | 2.000118 | 2 |
api/ext/tor.py | MrNaif2018/bitcart | 48 | 6628981 | import ipaddress
import json
import os
from dataclasses import asdict as dataclass_asdict
from dataclasses import dataclass
from typing import Optional
from api import settings, utils
from api.logger import get_logger
logger = get_logger(__name__)
REDIS_KEY = "bitcartcc_tor_ext"
@dataclass(frozen=True)
class PortD... | import ipaddress
import json
import os
from dataclasses import asdict as dataclass_asdict
from dataclasses import dataclass
from typing import Optional
from api import settings, utils
from api.logger import get_logger
logger = get_logger(__name__)
REDIS_KEY = "bitcartcc_tor_ext"
@dataclass(frozen=True)
class PortD... | en | 0.743497 | # all parsing exceptions are ValueError # pragma: no cover: used in production only | 2.448224 | 2 |
python/testData/optimizeImports/commentsInsideParenthesesInCombinedFromImports.py | jnthn/intellij-community | 2 | 6628982 | <gh_stars>1-10
from datetime import (timedelta as name, # bcc
time as bbb) # cbc
from datetime import (datetime as ccc) # abc
print(name, bbb, ccc)
| from datetime import (timedelta as name, # bcc
time as bbb) # cbc
from datetime import (datetime as ccc) # abc
print(name, bbb, ccc) | en | 0.763149 | # bcc # cbc # abc | 2.06236 | 2 |
scripts/field/first_DemianNormal1.py | Snewmy/swordie | 9 | 6628983 | <gh_stars>1-10
from net.swordie.ms.constants import BossConstants
from net.swordie.ms.life.mob.boss.demian import Demian
from net.swordie.ms.connection.packet import DemianFieldPacket
from net.swordie.ms.life.mob.boss.demian.sword import DemianFlyingSword
from net.swordie.ms.connection.packet import FieldPacket
field ... | from net.swordie.ms.constants import BossConstants
from net.swordie.ms.life.mob.boss.demian import Demian
from net.swordie.ms.connection.packet import DemianFieldPacket
from net.swordie.ms.life.mob.boss.demian.sword import DemianFlyingSword
from net.swordie.ms.connection.packet import FieldPacket
field = chr.getField(... | en | 0.619358 | # spawn Demian # start Pillar # create # show corruption window # start stigma timer on corruption window | 2.006403 | 2 |
WonderPy/__init__.py | avrabe/WonderPy | 1 | 6628984 | <reponame>avrabe/WonderPy
from . import components # noqa
from . import core # noqa
from . import util # noqa
| from . import components # noqa
from . import core # noqa
from . import util # noqa | uz | 0.446344 | # noqa # noqa # noqa | 1.026277 | 1 |
gae_proxy/local/connect_manager.py | vanish87/XX-Net | 1 | 6628985 | #!/usr/bin/env python
# coding:utf-8
import os
import binascii
import time
import socket
import struct
import threading
import operator
import httplib
import socks
from xlog import getLogger
xlog = getLogger("gae_proxy")
current_path = os.path.dirname(os.path.abspath(__file__))
import OpenSSL
SSLError = OpenSSL.SS... | #!/usr/bin/env python
# coding:utf-8
import os
import binascii
import time
import socket
import struct
import threading
import operator
import httplib
import socks
from xlog import getLogger
xlog = getLogger("gae_proxy")
current_path = os.path.dirname(os.path.abspath(__file__))
import OpenSSL
SSLError = OpenSSL.SS... | en | 0.44673 | #!/usr/bin/env python # coding:utf-8 #if not google_ip.is_traffic_quota_allow(ip): # continue #logging.debug("inactive_time:%d", inactive_time * 1000) # http://docs.python.org/dev/library/ssl.html # http://blog.ivanristic.com/2009/07/examples-of-the-information-collected-from-ssl-handshakes.html # http://src.chromiu... | 2.205275 | 2 |
src/models/feature_nets.py | yewzijian/RPMNet | 223 | 6628986 | """Feature Extraction and Parameter Prediction networks
"""
import logging
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from models.pointnet_util import sample_and_group_multi
_raw_features_sizes = {'xyz': 3, 'dxyz': 3, 'ppf': 4}
_raw_features_order = {'xyz': 0, 'dxyz': 1, 'pp... | """Feature Extraction and Parameter Prediction networks
"""
import logging
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from models.pointnet_util import sample_and_group_multi
_raw_features_sizes = {'xyz': 3, 'dxyz': 3, 'ppf': 4}
_raw_features_order = {'xyz': 0, 'dxyz': 1, 'pp... | en | 0.814857 | Feature Extraction and Parameter Prediction networks PointNet based Parameter prediction network Args: weights_dim: Number of weights to predict (excluding beta), should be something like [3], or [64, 3], for 3 types of features # Pointnet Returns alpha, beta, and gating_we... | 2.58284 | 3 |
kfac/python/ops/kfac_utils/data_reader.py | ntselepidis/kfac | 179 | 6628987 | <gh_stars>100-1000
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | # Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | en | 0.789527 | # Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica... | 3.008675 | 3 |
DigitalSignalProcessing/dsp_rectangle_anime.py | tam17aki/speech_process_exercise | 74 | 6628988 | <filename>DigitalSignalProcessing/dsp_rectangle_anime.py<gh_stars>10-100
#!/usr/bin/env python
""" 音声情報処理 n本ノック !! """
# MIT License
# Copyright (C) 2020 by <NAME>
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the Software"), ... | <filename>DigitalSignalProcessing/dsp_rectangle_anime.py<gh_stars>10-100
#!/usr/bin/env python
""" 音声情報処理 n本ノック !! """
# MIT License
# Copyright (C) 2020 by <NAME>
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the Software"), ... | en | 0.687849 | #!/usr/bin/env python 音声情報処理 n本ノック !! # MIT License # Copyright (C) 2020 by <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 right... | 2.011335 | 2 |
google-datacatalog-sisense-connector/src/google/datacatalog_connectors/sisense/prepare/datacatalog_tag_factory.py | anugrah86/datacatalog-connectors-bi | 27 | 6628989 | #!/usr/bin/python
#
# Copyright 2021 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | #!/usr/bin/python
#
# Copyright 2021 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | en | 0.904791 | #!/usr/bin/python # # Copyright 2021 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag... | 2.002572 | 2 |
helpers/drugui.py | teghdeep/Build_It_Up | 0 | 6628990 | <filename>helpers/drugui.py<gh_stars>0
from PyQt5 import QtCore, QtGui, QtWidgets
from bs4 import BeautifulSoup
import requests
import html5lib
from PyQt5.QtWidgets import QMessageBox
class Ui_Drugs(object):
def setupUi(self, Drugs):
Drugs.setObjectName("Drugs")
Drugs.resize(572, 449)
f... | <filename>helpers/drugui.py<gh_stars>0
from PyQt5 import QtCore, QtGui, QtWidgets
from bs4 import BeautifulSoup
import requests
import html5lib
from PyQt5.QtWidgets import QMessageBox
class Ui_Drugs(object):
def setupUi(self, Drugs):
Drugs.setObjectName("Drugs")
Drugs.resize(572, 449)
f... | zh | 0.453391 | #3CB7A1;\n" | 2.355406 | 2 |
dist/dulwich/contrib/diffstat.py | evandroforks/CrowdAnki | 2 | 6628991 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# Copyright (c) 2020 <NAME>, Stratford Ontario Canada
# All rights reserved.
#
# This diffstat code was extracted and heavily modified from:
#
# https://github.com/techtonik/python-patch
# Under the following licen... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
# Copyright (c) 2020 <NAME>, Stratford Ontario Canada
# All rights reserved.
#
# This diffstat code was extracted and heavily modified from:
#
# https://github.com/techtonik/python-patch
# Under the following licen... | en | 0.587035 | #!/usr/bin/env python # -*- coding: utf-8 -*- # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab # Copyright (c) 2020 <NAME>, Stratford Ontario Canada # All rights reserved. # # This diffstat code was extracted and heavily modified from: # # https://github.com/techtonik/python-patch # Under the following licens... | 2.22 | 2 |
mva_demo/cms/urls.py | dieterplex/cookiebutter-django-demo | 0 | 6628992 | from django.urls import path
from .views import (
song_all,
song_detail,
category_list,
like_song,
unlike_song
)
app_name = 'cms'
urlpatterns = [
path('', song_all, name='song_all'),
path('<slug:slug>', song_detail, name='song_detail'),
path('category/<slug:category_slug>/', category_... | from django.urls import path
from .views import (
song_all,
song_detail,
category_list,
like_song,
unlike_song
)
app_name = 'cms'
urlpatterns = [
path('', song_all, name='song_all'),
path('<slug:slug>', song_detail, name='song_detail'),
path('category/<slug:category_slug>/', category_... | none | 1 | 1.854293 | 2 | |
src/nexus_streamer/data_source.py | ess-dmsc/nexus-streamer-python | 0 | 6628993 | <filename>src/nexus_streamer/data_source.py
from typing import Union
from .event_data_source import EventDataSource, FakeEventDataSource
from .log_data_source import LogDataSource
from .isis_data_source import IsisDataSource
DataSource = Union[LogDataSource, EventDataSource, FakeEventDataSource, IsisDataSource]
| <filename>src/nexus_streamer/data_source.py
from typing import Union
from .event_data_source import EventDataSource, FakeEventDataSource
from .log_data_source import LogDataSource
from .isis_data_source import IsisDataSource
DataSource = Union[LogDataSource, EventDataSource, FakeEventDataSource, IsisDataSource]
| none | 1 | 1.260138 | 1 | |
2019/day20/solutions.py | ivobatkovic/advent-of-code | 3 | 6628994 | <reponame>ivobatkovic/advent-of-code<gh_stars>1-10
from os.path import dirname
from os.path import realpath
from os.path import join
import time
import pytest
import sys
sys.path.append(join(dirname(realpath(__file__)), *[".."]))
from day20.donut import Donut
def part1(input_):
donut = Donut(input_)
return d... | from os.path import dirname
from os.path import realpath
from os.path import join
import time
import pytest
import sys
sys.path.append(join(dirname(realpath(__file__)), *[".."]))
from day20.donut import Donut
def part1(input_):
donut = Donut(input_)
return donut.shortest_path()
def part2(input_):
donut... | en | 0.956298 | # Open data file and read through all lines | 2.608625 | 3 |
191.number of 1 bits.py | zhuxiangxiao/leetcode | 0 | 6628995 | <filename>191.number of 1 bits.py
class Solution(object):
def hammingWeight(self, n):
"""
:type n: int
:rtype: int
"""
return len(str(bin(n)).split('1'))-1
def hammingWeightSolution2(self, n):
"""
:type n: int
:rtype: int
"""
ans=0... | <filename>191.number of 1 bits.py
class Solution(object):
def hammingWeight(self, n):
"""
:type n: int
:rtype: int
"""
return len(str(bin(n)).split('1'))-1
def hammingWeightSolution2(self, n):
"""
:type n: int
:rtype: int
"""
ans=0... | en | 0.260107 | :type n: int :rtype: int :type n: int :rtype: int | 3.659936 | 4 |
cybox/test/objects/win_filemapping_test.py | Mattlk13/python-cybox | 40 | 6628996 | # Copyright (c) 2017, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import unittest
from mixbox.vendor.six import u
from cybox.compat import long
from cybox.objects.win_filemapping_object import WinFilemapping
from cybox.test.objects import ObjectTestCase
class TestWinFilemappin... | # Copyright (c) 2017, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import unittest
from mixbox.vendor.six import u
from cybox.compat import long
from cybox.objects.win_filemapping_object import WinFilemapping
from cybox.test.objects import ObjectTestCase
class TestWinFilemappin... | en | 0.854889 | # Copyright (c) 2017, The MITRE Corporation. All rights reserved. # See LICENSE.txt for complete terms. | 1.997469 | 2 |
tasks/search.py | Lifeistrange/WeiboSpider | 1 | 6628997 | # coding:utf-8
from urllib import parse as url_parse
from logger.log import crawler
from tasks.workers import app
from page_get.basic import get_page
from config.conf import get_max_search_page
from page_parse import search as parse_search
from db.search_words import get_search_keywords
from db.keywords_wbdata import i... | # coding:utf-8
from urllib import parse as url_parse
from logger.log import crawler
from tasks.workers import app
from page_get.basic import get_page
from config.conf import get_max_search_page
from page_parse import search as parse_search
from db.search_words import get_search_keywords
from db.keywords_wbdata import i... | zh | 0.989169 | # coding:utf-8 # 只抓取原创微博,默认是按照时间进行排序,如果只抓首页,那么就不需要登录 # 先判断数据库里是否存在相关的微博,如果是已有的,那就说明是已经抓取的微博(因为结果默认按时间排序),就退出循环 # 这里暂时使用网络调用而非本地调用,权衡两种方法的好处 # 判断是否包含下一页 | 2.545891 | 3 |
scripts/PT_WebExtractor_v2_0/scripts/obsolete/SK_Other_extractor.py | Dan-Eli/FGP_Docs | 0 | 6628998 | <filename>scripts/PT_WebExtractor_v2_0/scripts/obsolete/SK_Other_extractor.py
import os
import sys
import urllib2
from bs4 import BeautifulSoup, Comment
import collections
import math
import csv
import re
import numpy as np
import json
import urlparse
import argparse
import traceback
import datetime
impo... | <filename>scripts/PT_WebExtractor_v2_0/scripts/obsolete/SK_Other_extractor.py
import os
import sys
import urllib2
from bs4 import BeautifulSoup, Comment
import collections
import math
import csv
import re
import numpy as np
import json
import urlparse
import argparse
import traceback
import datetime
impo... | en | 0.482465 | # Get the shared.py # Create CSV file # Get a list of all the anchors in the treeview at the side of the page #print browse_url # Load the sub result # Determine the number of pages in the search # Load the current page # Get the resource list # Get the ID of the resource # Get the name of the resource # If the resourc... | 2.433635 | 2 |
youtube_dl/extractor/srf.py | zoogaezee/youtubeDL | 0 | 6628999 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
parse_iso8601,
xpath_text,
)
class SrfIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.srf\.ch/play(?:er)?/(?:tv|radio)/[^/]+/(?P<media_type>video|audio)/(?P<disp... | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
parse_iso8601,
xpath_text,
)
class SrfIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.srf\.ch/play(?:er)?/(?:tv|radio)/[^/]+/(?P<media_type>video|audio)/(?P<disp... | en | 0.831412 | # coding: utf-8 # No Speichern (Save) button # requires rtmpdump # The <duration> field in XML is different from the exact duration, skipping | 2.091546 | 2 |
eval.py | Limingxing00/Retinal-Vessel-Segmentation-ISBI2022 | 9 | 6629000 | <reponame>Limingxing00/Retinal-Vessel-Segmentation-ISBI2022<gh_stars>1-10
import numpy as np
from matplotlib import pyplot as plt
# scikit learn
from sklearn.metrics import roc_curve
from sklearn.metrics import roc_auc_score
from sklearn.metrics import confusion_matrix
from sklearn.metrics import precision_recall_curv... | import numpy as np
from matplotlib import pyplot as plt
# scikit learn
from sklearn.metrics import roc_curve
from sklearn.metrics import roc_auc_score
from sklearn.metrics import confusion_matrix
from sklearn.metrics import precision_recall_curve
from sklearn.metrics import jaccard_similarity_score
from sklearn.metric... | en | 0.611579 | # scikit learn calculate metrics for entire retinal vessel images. :param foreground: pixel value 255 is foreground. # pdb.set_trace() # label[label <= 128] = 0 # label[label > 128] = 1 # pdb.set_trace() # check the pixel value # pdb.set_trace() # test another datasets ISBI 2012 # Area under the ROC curve # pdb.set_tra... | 2.434173 | 2 |
numpy_summation.py | khinthandarkyaw98/Python_Practice | 0 | 6629001 | # add() is done between two elements : return an array
# sum([]) happens over n elements : return an element
import numpy as np
arr1 = np.array([1, 2, 3])
arr2 = np.array([4, 5, 6])
newarr = np.add(arr1, arr2)
print("add():", newarr)
newarr = np.sum([arr1, arr2])
# note that sum([])
print("sum(): ... | # add() is done between two elements : return an array
# sum([]) happens over n elements : return an element
import numpy as np
arr1 = np.array([1, 2, 3])
arr2 = np.array([4, 5, 6])
newarr = np.add(arr1, arr2)
print("add():", newarr)
newarr = np.sum([arr1, arr2])
# note that sum([])
print("sum(): ... | en | 0.741707 | # add() is done between two elements : return an array # sum([]) happens over n elements : return an element # note that sum([]) # Summation over an axis # cummulative sum : partially adding the elements in array # The partial sum of [1, 2, 3, 4] would be [1, 1+2, 1+2+3, 1+2+3+4] = [1, 3, 6, 10] # cumsum() # import num... | 4.294552 | 4 |
tests/threading_demo.py | liunx/vimusic | 0 | 6629002 | #!/usr/bin/env python3
import threading
import queue
import time
def worker(q):
"""thread worker function"""
while True:
if not q.empty():
item = q.get_nowait()
print(item)
q.task_done()
if item == 99:
break
time.sleep(0.001)
i... | #!/usr/bin/env python3
import threading
import queue
import time
def worker(q):
"""thread worker function"""
while True:
if not q.empty():
item = q.get_nowait()
print(item)
q.task_done()
if item == 99:
break
time.sleep(0.001)
i... | en | 0.315547 | #!/usr/bin/env python3 thread worker function | 3.406824 | 3 |
dotmodules/modules/modules.py | dotmodules/dm | 0 | 6629003 | from collections import OrderedDict
from dataclasses import dataclass
from enum import Enum
from pathlib import Path
from typing import Dict, Generator, List, Sequence
from dotmodules.modules.hooks import (
Hook,
LinkCleanUpHook,
LinkDeploymentHook,
ShellScriptHook,
)
from dotmodules.modules.links impo... | from collections import OrderedDict
from dataclasses import dataclass
from enum import Enum
from pathlib import Path
from typing import Dict, Generator, List, Sequence
from dotmodules.modules.hooks import (
Hook,
LinkCleanUpHook,
LinkDeploymentHook,
ShellScriptHook,
)
from dotmodules.modules.links impo... | en | 0.831445 | Exception that will be raised on module level errors. Aggregation class that contains the loaded modules. It provides an interface to load the modules, and to collect the aggregated variables and hooks from them. # Sorting the modules in alphabetical path order. | 2.033155 | 2 |
backend/app/cli.py | SeanFitzpatrick0/BugKiller | 0 | 6629004 | from typing import NoReturn
from bug_killer_client_2.cli.builder import generate_cli
from bug_killer_client_2.cli.builder import get_cli_defaults
from bug_killer_client_2.cli.executor import execute_operation
from bug_killer_client_2.service import project, bug
from bug_killer_utils.object import get_local_function_in... | from typing import NoReturn
from bug_killer_client_2.cli.builder import generate_cli
from bug_killer_client_2.cli.builder import get_cli_defaults
from bug_killer_client_2.cli.executor import execute_operation
from bug_killer_client_2.service import project, bug
from bug_killer_utils.object import get_local_function_in... | none | 1 | 2.036013 | 2 | |
test/unit/tool_util/test_tool_linters.py | brinkmanlab/galaxy | 0 | 6629005 | import pytest
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.linters import inputs
from galaxy.util import etree
NO_SECTIONS_XML = """
<tool name="BWA Mapper" id="bwa" version="1.0.1" is_multi_byte="true" display_interface="true" require_login="true" hidden="true">
<description>The BWA Mappe... | import pytest
from galaxy.tool_util.lint import LintContext
from galaxy.tool_util.linters import inputs
from galaxy.util import etree
NO_SECTIONS_XML = """
<tool name="BWA Mapper" id="bwa" version="1.0.1" is_multi_byte="true" display_interface="true" require_login="true" hidden="true">
<description>The BWA Mappe... | en | 0.149762 | <tool name="BWA Mapper" id="bwa" version="1.0.1" is_multi_byte="true" display_interface="true" require_login="true" hidden="true"> <description>The BWA Mapper</description> <version_command interpreter="python">bwa.py --version</version_command> </tool> <tool name="BWA Mapper" id="bwa" version="1.0.1" is_multi_... | 2.008105 | 2 |
main/find-pow-a-b-mod-m/find-pow-a-b-mod-m.py | EliahKagan/old-practice-snapshot | 0 | 6629006 | <gh_stars>0
for t in xrange(int(raw_input())):
a, b, m = map(int, raw_input().split())
print pow(a, b, m)
| for t in xrange(int(raw_input())):
a, b, m = map(int, raw_input().split())
print pow(a, b, m) | none | 1 | 2.845691 | 3 | |
src/pylibgen/__init__.py | ABHISHEKVALSAN/python-package-creator | 0 | 6629007 | <reponame>ABHISHEKVALSAN/python-package-creator
__version__=1.0
#There is no plan for Version Control System,
#All the changes will be pushed to version 1.0
| __version__=1.0
#There is no plan for Version Control System,
#All the changes will be pushed to version 1.0 | en | 0.796709 | #There is no plan for Version Control System, #All the changes will be pushed to version 1.0 | 1.19271 | 1 |
km_api/know_me/views.py | knowmetools/km-api | 4 | 6629008 | <reponame>knowmetools/km-api<gh_stars>1-10
"""Views for the ``know_me`` module.
"""
import logging
from django.conf import settings
from django.db.models import Case, PositiveSmallIntegerField, Q, Value, When
from django.http import HttpResponse, HttpRequest
from django.shortcuts import get_object_or_404
from dry_rest... | """Views for the ``know_me`` module.
"""
import logging
from django.conf import settings
from django.db.models import Case, PositiveSmallIntegerField, Q, Value, When
from django.http import HttpResponse, HttpRequest
from django.shortcuts import get_object_or_404
from dry_rest_permissions.generics import DRYGlobalPermi... | en | 0.822414 | Views for the ``know_me`` module. post: Determine if an Apple receipt is already in use. If a valid Apple receipt is passed to the endpoint, the response will contain an `is_used` key indicating if the receipt is in use. If it is in use, the `email` key of the response will contain the primary emai... | 2.203823 | 2 |
commentbot/commentbot.py | cmccvic/CBOnetwork | 0 | 6629009 | <gh_stars>0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Python bot for comment a list of urls in YouTube
import time
import numpy as np
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Python bot for comment a list of urls in YouTube
import time
import numpy as np
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions ... | en | 0.67824 | #!/usr/bin/env python # -*- coding: utf-8 -*- # Python bot for comment a list of urls in YouTube # Browser #identifier') # find email, send data and submit # find password, send data and submit # Check if there still urls # Pop a URL from the array # Visite the page # Is video avaliable (deleted,private) ? # Scroll, wa... | 2.920219 | 3 |
Digital Holographic Refocusing/myfunctions.py | monakhova/Fourier-Optics-Demos | 8 | 6629010 | <filename>Digital Holographic Refocusing/myfunctions.py
# Functions
def rgb2gray(rgb):
import numpy as np
return np.dot(rgb[...,:3], [0.299, 0.587, 0.114])
def contrast(g_in):
import numpy as np
I_max = np.max(np.abs(g_in)**2)
I_min = np.min(np.abs(g_in)**2)
C = (I_max - I_min)/(I_max+I_... | <filename>Digital Holographic Refocusing/myfunctions.py
# Functions
def rgb2gray(rgb):
import numpy as np
return np.dot(rgb[...,:3], [0.299, 0.587, 0.114])
def contrast(g_in):
import numpy as np
I_max = np.max(np.abs(g_in)**2)
I_min = np.min(np.abs(g_in)**2)
C = (I_max - I_min)/(I_max+I_... | en | 0.729042 | # Functions # Digitally refocuses a complex field a given distance, z. # (ref pg 67,<NAME>, Introduction to Fourier Optics) #inputs: # ein - complex field at input plane # lmda - wavelength of light [um] # z - vector of propagation distances [um] # ps - pixel size [um] # Sp... | 3.127892 | 3 |
Source/MediaPlayer.py | matias225/mp3TagEditor | 0 | 6629011 | import vlc
from PyQt5 import QtWidgets
import os
class MediaPlayer(QtWidgets.QMainWindow):
def __init__(self, *args, **kwargs):
QtWidgets.QMainWindow.__init__(self, *args, **kwargs)
self.instance = vlc.Instance()
self.mediaplayer = self.instance.media_player_new()
self.is_paused = ... | import vlc
from PyQt5 import QtWidgets
import os
class MediaPlayer(QtWidgets.QMainWindow):
def __init__(self, *args, **kwargs):
QtWidgets.QMainWindow.__init__(self, *args, **kwargs)
self.instance = vlc.Instance()
self.mediaplayer = self.instance.media_player_new()
self.is_paused = ... | none | 1 | 2.848945 | 3 | |
sdk/identity/azure-identity/tests/test_username_password_credential.py | szaher/azure-sdk-for-python | 0 | 6629012 | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from azure.core.exceptions import ClientAuthenticationError
from azure.core.pipeline.policies import ContentDecodePolicy, SansIOHTTPPolicy
from azure.identity import Use... | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
from azure.core.exceptions import ClientAuthenticationError
from azure.core.pipeline.policies import ContentDecodePolicy, SansIOHTTPPolicy
from azure.identity import Use... | en | 0.782511 | # ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ # python < 3.3 # type: ignore The credential should raise when get_token is called with no scopes # not validating requests because they're formed by MSAL # tenant disco... | 2.106439 | 2 |
jind/df_to_rds.py | mohit1997/JIND | 11 | 6629013 | <reponame>mohit1997/JIND
import pandas as pd
import rpy2
from rpy2 import robjects
from rpy2.robjects import pandas2ri
import numpy as np
import argparse
import pickle
parser = argparse.ArgumentParser()
parser.add_argument('-d', action='store', default=None,
dest='data',
help='choose dataframe pickle file')
... | import pandas as pd
import rpy2
from rpy2 import robjects
from rpy2.robjects import pandas2ri
import numpy as np
import argparse
import pickle
parser = argparse.ArgumentParser()
parser.add_argument('-d', action='store', default=None,
dest='data',
help='choose dataframe pickle file')
parser.add_argument('-out... | none | 1 | 3.108344 | 3 | |
mapproxy/test/system/test_cache_mbtiles.py | cunha17/mapproxy | 347 | 6629014 | # This file is part of the MapProxy project.
# Copyright (C) 2011 Omniscale <http://omniscale.de>
#
# 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... | # This file is part of the MapProxy project.
# Copyright (C) 2011 Omniscale <http://omniscale.de>
#
# 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.835497 | # This file is part of the MapProxy project. # Copyright (C) 2011 Omniscale <http://omniscale.de> # # 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... | 1.947264 | 2 |
blatann/examples/peripheral.py | dkkeller/blatann | 0 | 6629015 | <filename>blatann/examples/peripheral.py
"""
This example exhibits some of the functionality of a peripheral BLE device,
such as reading, writing and notifying characteristics.
This peripheral can be used with one of the central examples running on a separate nordic device,
or can be run with the nRF Connect app ... | <filename>blatann/examples/peripheral.py
"""
This example exhibits some of the functionality of a peripheral BLE device,
such as reading, writing and notifying characteristics.
This peripheral can be used with one of the central examples running on a separate nordic device,
or can be run with the nRF Connect app ... | en | 0.795256 | This example exhibits some of the functionality of a peripheral BLE device,
such as reading, writing and notifying characteristics.
This peripheral can be used with one of the central examples running on a separate nordic device,
or can be run with the nRF Connect app to explore the contents of the service Event c... | 2.925374 | 3 |
PP4E-Examples-1.4/changes/book-web-site/snapshot-oct13/ACA_utils.py | AngelLiang/PP4E | 0 | 6629016 | <filename>PP4E-Examples-1.4/changes/book-web-site/snapshot-oct13/ACA_utils.py
#!/usr/bin/python3
"""
=====================================================================================
Compute ACA (a.k.a. "obamacare") health insurance premium tax credit
from income, number people, actual and benchmark plan premiums,... | <filename>PP4E-Examples-1.4/changes/book-web-site/snapshot-oct13/ACA_utils.py
#!/usr/bin/python3
"""
=====================================================================================
Compute ACA (a.k.a. "obamacare") health insurance premium tax credit
from income, number people, actual and benchmark plan premiums,... | en | 0.703796 | #!/usr/bin/python3 ===================================================================================== Compute ACA (a.k.a. "obamacare") health insurance premium tax credit from income, number people, actual and benchmark plan premiums, IRS povertylevel%=>contribution% mappings, and HHS poverty levels. Main entry poin... | 2.037086 | 2 |
welcome/models.py | fathtus/abc | 0 | 6629017 | from django.db import models
from django.forms import ModelForm
# Create your models here.
class PageView(models.Model):
hostname = models.CharField(max_length=32)
timestamp = models.DateTimeField(auto_now_add=True)
TITLE_CHOICES = (
('MR', 'Mr.'),
('MRS', 'Mrs.'),
('MS', 'Ms.'),
)
class Autho... | from django.db import models
from django.forms import ModelForm
# Create your models here.
class PageView(models.Model):
hostname = models.CharField(max_length=32)
timestamp = models.DateTimeField(auto_now_add=True)
TITLE_CHOICES = (
('MR', 'Mr.'),
('MRS', 'Mrs.'),
('MS', 'Ms.'),
)
class Autho... | en | 0.963489 | # Create your models here. | 2.683809 | 3 |
Python/memory.py | A01352283/TC1001S.100-202211 | 0 | 6629018 | """Memory, puzzle game of number pairs.
Exercises:
1. Count and print how many taps occur.
2. Decrease the number of tiles to a 4x4 grid.
3. Detect when all tiles are revealed.
4. Center single-digit tile.
5. Use letters instead of tiles.
"""
from random import *
from turtle import *
from freegames im... | """Memory, puzzle game of number pairs.
Exercises:
1. Count and print how many taps occur.
2. Decrease the number of tiles to a 4x4 grid.
3. Detect when all tiles are revealed.
4. Center single-digit tile.
5. Use letters instead of tiles.
"""
from random import *
from turtle import *
from freegames im... | en | 0.809697 | Memory, puzzle game of number pairs.
Exercises:
1. Count and print how many taps occur.
2. Decrease the number of tiles to a 4x4 grid.
3. Detect when all tiles are revealed.
4. Center single-digit tile.
5. Use letters instead of tiles. | 3.786451 | 4 |
setup.py | samuelbroscheit/kge | 0 | 6629019 | <reponame>samuelbroscheit/kge
from setuptools import setup
setup(
name="libkge",
version="0.1",
description="A knowledge graph embedding library",
url="https://github.com/uma-pi1/kge",
author="<NAME>",
author_email="<EMAIL>",
packages=["kge"],
install_requires=[
"torch>=1.3.1",
... | from setuptools import setup
setup(
name="libkge",
version="0.1",
description="A knowledge graph embedding library",
url="https://github.com/uma-pi1/kge",
author="<NAME>",
author_email="<EMAIL>",
packages=["kge"],
install_requires=[
"torch>=1.3.1",
"pyyaml",
"pan... | en | 0.703964 | # LibKGE uses numba typed-dicts which is part of the experimental numba API # in version 0.48 # see http://numba.pydata.org/numba-doc/0.48.0/reference/pysupported.html | 1.498927 | 1 |
venv/lib/python2.7/site-packages/github/File.py | sravani-m/Web-Application-Security-Framework | 3 | 6629020 | <filename>venv/lib/python2.7/site-packages/github/File.py
# -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2012 <NAME> <<EMAIL>> #
# Copyright 2012 Zearin... | <filename>venv/lib/python2.7/site-packages/github/File.py
# -*- coding: utf-8 -*-
############################ Copyrights and license ############################
# #
# Copyright 2012 <NAME> <<EMAIL>> #
# Copyright 2012 Zearin... | en | 0.644241 | # -*- coding: utf-8 -*- ############################ Copyrights and license ############################ # # # Copyright 2012 <NAME> <<EMAIL>> # # Copyright 2012 Zearin <<EMAIL>> # # Copyrig... | 1.750119 | 2 |
application/alveo/views/datastore/store.py | Alveo/alveo-transcriber-services | 1 | 6629021 | <gh_stars>1-10
import json
import uuid
import datetime
from flask import g, abort
from application import db
from application.users.model import User
from application.datastore.model import Datastore
from application.alveo.module import DOMAIN, SUPPORTED_STORAGE_KEYS
from application.auth.required import auth_requ... | import json
import uuid
import datetime
from flask import g, abort
from application import db
from application.users.model import User
from application.datastore.model import Datastore
from application.alveo.module import DOMAIN, SUPPORTED_STORAGE_KEYS
from application.auth.required import auth_required
from appli... | none | 1 | 2.031347 | 2 | |
ossync/sdk/oss_api.py | lanbaba/Ossyncone | 22 | 6629022 | <reponame>lanbaba/Ossyncone
#!/usr/bin/env python
#coding=utf-8
# Copyright (c) 2011, Alibaba Cloud Computing
# All rights reserved.
#
# 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... | #!/usr/bin/env python
#coding=utf-8
# Copyright (c) 2011, Alibaba Cloud Computing
# All rights reserved.
#
# 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
# wi... | en | 0.60478 | #!/usr/bin/env python #coding=utf-8 # Copyright (c) 2011, Alibaba Cloud Computing # All rights reserved. # # 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 # wit... | 1.290394 | 1 |
extrap/modelers/loader.py | Shadowjockey/extrap | 0 | 6629023 | # This file is part of the Extra-P software (http://www.scalasca.org/software/extra-p)
#
# Copyright (c) 2020, Technical University of Darmstadt, Germany
#
# This software may be modified and distributed under the terms of a BSD-style license.
# See the LICENSE file in the base directory for details.
import inspect
im... | # This file is part of the Extra-P software (http://www.scalasca.org/software/extra-p)
#
# Copyright (c) 2020, Technical University of Darmstadt, Germany
#
# This software may be modified and distributed under the terms of a BSD-style license.
# See the LICENSE file in the base directory for details.
import inspect
im... | en | 0.838465 | # This file is part of the Extra-P software (http://www.scalasca.org/software/extra-p) # # Copyright (c) 2020, Technical University of Darmstadt, Germany # # This software may be modified and distributed under the terms of a BSD-style license. # See the LICENSE file in the base directory for details. | 1.890008 | 2 |
SWIM-Executables/Windows/pyinstaller-2.0 for windows/buildtests/import/test_onefile_c_extension.py | alexsigaras/SWIM | 47 | 6629024 | #
# Copyright (C) 2012, <NAME>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the ... | #
# Copyright (C) 2012, <NAME>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the ... | en | 0.820691 | # # Copyright (C) 2012, <NAME> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the ... | 2.325927 | 2 |
db/__init__.py | TiMed-dev/TIMed-backend | 0 | 6629025 | # -*- coding: utf-8 -*-
"""
db module
=========
Provides:
1. Asynchronous interface for connecting to a RDBMS service
2. Asynchronous execution of SQL transactions and queries
How to use the documentation
----------------------------
Documentation is available in one form: docstrings provided
with the code
... | # -*- coding: utf-8 -*-
"""
db module
=========
Provides:
1. Asynchronous interface for connecting to a RDBMS service
2. Asynchronous execution of SQL transactions and queries
How to use the documentation
----------------------------
Documentation is available in one form: docstrings provided
with the code
... | en | 0.752614 | # -*- coding: utf-8 -*- db module ========= Provides: 1. Asynchronous interface for connecting to a RDBMS service 2. Asynchronous execution of SQL transactions and queries How to use the documentation ---------------------------- Documentation is available in one form: docstrings provided with the code Copyr... | 2.011058 | 2 |
populus/config/compiler.py | mandarvaze/populus | 1 | 6629026 | <gh_stars>1-10
from __future__ import absolute_import
from eth_utils import (
is_string,
)
from populus.utils.module_loading import (
import_string,
)
from populus.config.helpers import (
ClassImportPath,
)
from .base import Config
BACKEND_IDENTIFIER_MAP = {
'solc:combined-json': 'populus.compilati... | from __future__ import absolute_import
from eth_utils import (
is_string,
)
from populus.utils.module_loading import (
import_string,
)
from populus.config.helpers import (
ClassImportPath,
)
from .base import Config
BACKEND_IDENTIFIER_MAP = {
'solc:combined-json': 'populus.compilation.backends.sol... | none | 1 | 2.112915 | 2 | |
pickle_save_load.py | DeepsMoseli/LSTMGAN-for-melody-generation | 12 | 6629027 | <reponame>DeepsMoseli/LSTMGAN-for-melody-generation
import pickle
# create dictionary containing all your data
data = {'stim': np.array([1, 2, 3]), 'response': np.array([6, 2, 0])}
# save data in pickle format
with open('my_data.pickle', 'wb') as f:
pickle.dump(data, f)
# open data from file
with open('my_data.p... | import pickle
# create dictionary containing all your data
data = {'stim': np.array([1, 2, 3]), 'response': np.array([6, 2, 0])}
# save data in pickle format
with open('my_data.pickle', 'wb') as f:
pickle.dump(data, f)
# open data from file
with open('my_data.pickle', 'rb') as f:
new_data_variable = pickle.l... | en | 0.584995 | # create dictionary containing all your data # save data in pickle format # open data from file #now the data will be in dictionary new_data_variable | 3.020201 | 3 |
alipay/aop/api/domain/AlipayCommerceMedicalCardQueryModel.py | snowxmas/alipay-sdk-python-all | 32 | 6629028 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayCommerceMedicalCardQueryModel(object):
def __init__(self):
self._auth_code = None
self._buyer_id = None
self._card_org_no = None
self._extend_params = None
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayCommerceMedicalCardQueryModel(object):
def __init__(self):
self._auth_code = None
self._buyer_id = None
self._card_org_no = None
self._extend_params = None
... | en | 0.352855 | #!/usr/bin/env python # -*- coding: utf-8 -*- | 2.06078 | 2 |
test/features/environment.py | biovault/nptsne | 30 | 6629029 | import os
from six.moves import urllib
from scipy.io import loadmat
from behave import *
import logging
def parse_number(text):
"""
Convert parsed text into a number.
:param text: Parsed text, called by :py:meth:`parse.Parser.parse()`.
:return: Number instance (integer), created from parsed text.
"... | import os
from six.moves import urllib
from scipy.io import loadmat
from behave import *
import logging
def parse_number(text):
"""
Convert parsed text into a number.
:param text: Parsed text, called by :py:meth:`parse.Parser.parse()`.
:return: Number instance (integer), created from parsed text.
"... | en | 0.480549 | Convert parsed text into a number. :param text: Parsed text, called by :py:meth:`parse.Parser.parse()`. :return: Number instance (integer), created from parsed text. # -- REGISTER: User-defined type converter (parse_type). Convert parsed text into a number. :param text: Parsed text, called by :py:meth:`pars... | 2.510736 | 3 |
maven/internal/require.bzl | Globegitter/rules_maven | 0 | 6629030 | <filename>maven/internal/require.bzl
def _needs_install(name, dep, hkeys=["sha256", "sha1", "tag"], verbose=0):
# Does it already exist?
existing_rule = native.existing_rule(name)
if not existing_rule:
return True
# If it has already been defined and our dependency lists a
# hash, do these... | <filename>maven/internal/require.bzl
def _needs_install(name, dep, hkeys=["sha256", "sha1", "tag"], verbose=0):
# Does it already exist?
existing_rule = native.existing_rule(name)
if not existing_rule:
return True
# If it has already been defined and our dependency lists a
# hash, do these... | en | 0.893348 | # Does it already exist? # If it has already been defined and our dependency lists a # hash, do these match? If a hash mismatch is encountered, has # the user specifically granted permission to continue? An existing {0} rule '{1}' was already loaded with a {2} value of '{3}'. Overwriting this with the requested value ... | 1.943064 | 2 |
dito/utils.py | dhaase-de/dito | 0 | 6629031 | <gh_stars>0
import collections
import datetime
import errno
import os
import tempfile
import cv2
import numpy as np
####
#%%% OpenCV-related
####
def cv2_version():
return tuple(int(value) for value in cv2.__version__.split("."))
####
#%%% checks
####
def get_validated_tuple(x, type_, count, min_value=None... | import collections
import datetime
import errno
import os
import tempfile
import cv2
import numpy as np
####
#%%% OpenCV-related
####
def cv2_version():
return tuple(int(value) for value in cv2.__version__.split("."))
####
#%%% checks
####
def get_validated_tuple(x, type_, count, min_value=None, max_value=... | en | 0.701296 | #### #%%% OpenCV-related #### #### #%%% checks #### # check tuple/list # check length # check value ranges #### #%%% number-related #### Rounds a number to the first `digit_count` digits after the appearance of the first non-zero digit. This function supports Python `float`s and `int`s as well as NumPy scalars... | 2.972224 | 3 |
os_vif/tests/test_host_info.py | mail2nsrajesh/os-vif | 0 | 6629032 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | en | 0.859654 | # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t... | 2.021569 | 2 |
pca_main/pcabuilder.py | p2424630/PCA | 0 | 6629033 | # @Author: GKarseras
# @Date: 15 Nov 2020 11:13
from itertools import product
from pca_main import pcaprop, pcaparser, pcalaws
class InitProp(pcalaws.Laws):
__slots__ = '_parsed'
def __init__(self, proposition: str) -> None:
self._parsed = pcaparser.PARSER.parse(proposition)
def __eq__(self,... | # @Author: GKarseras
# @Date: 15 Nov 2020 11:13
from itertools import product
from pca_main import pcaprop, pcaparser, pcalaws
class InitProp(pcalaws.Laws):
__slots__ = '_parsed'
def __init__(self, proposition: str) -> None:
self._parsed = pcaparser.PARSER.parse(proposition)
def __eq__(self,... | en | 0.732378 | # @Author: GKarseras # @Date: 15 Nov 2020 11:13 Structural equivalence 'A or B' != 'B or A' 'A or B' == '(A or B)' :param other: :return: bool :return: Sorted list of all unique variables. Recursively traverse proposition and return a list of all variables. :param op: Propo... | 2.452456 | 2 |
src/python/director/actionhandlers.py | ori-drs/director | 18 | 6629034 | import os
from PythonQt import QtCore, QtGui
import director.applogic as app
import director.objectmodel as om
import director.ioutils as io
import director.visualization as vis
from director import roboturdf
from director import otdfmodel
_lastDir = None
def getDefaultDirectory():
return _lastDir or os.getcwd... | import os
from PythonQt import QtCore, QtGui
import director.applogic as app
import director.objectmodel as om
import director.ioutils as io
import director.visualization as vis
from director import roboturdf
from director import otdfmodel
_lastDir = None
def getDefaultDirectory():
return _lastDir or os.getcwd... | none | 1 | 2.253147 | 2 | |
src/logging/02_final_logging_data_auto_service/restful_auto_service/infrastructure/auth.py | turing4ever/restful-services-in-pyramid | 58 | 6629035 | <reponame>turing4ever/restful-services-in-pyramid<gh_stars>10-100
from pyramid.response import Response
from restful_auto_service.data.repository import Repository
def parse_api_key(request):
auth_header = request.headers.get('Authorization')
if not auth_header:
return None, "You must specify an Auth... | from pyramid.response import Response
from restful_auto_service.data.repository import Repository
def parse_api_key(request):
auth_header = request.headers.get('Authorization')
if not auth_header:
return None, "You must specify an Authorization header."
parts = auth_header.split(':')
if len(... | none | 1 | 2.814682 | 3 | |
motorturbine/updateset.py | BFriedrichs/motorturbine | 1 | 6629036 | <filename>motorturbine/updateset.py
def to_operator(current, new_value):
is_operator = isinstance(new_value, UpdateOperator)
is_set = isinstance(new_value, Set)
if is_operator:
if not is_set and current is None:
raise Exception('Cant use operator on None')
else:
new_value = ... | <filename>motorturbine/updateset.py
def to_operator(current, new_value):
is_operator = isinstance(new_value, UpdateOperator)
is_set = isinstance(new_value, Set)
if is_operator:
if not is_set and current is None:
raise Exception('Cant use operator on None')
else:
new_value = ... | en | 0.629647 | UpdateOperators can be used to automatically generate update queries that are understood by mongo. Each of the operators can be used as defined in the mongo manual as they're just a direct mapping. Is used to set the specified field to any given value. Not using it is the default case and functional... | 3.702328 | 4 |
layers/drawing.py | MEDVEDx64/Graphone | 0 | 6629037 | <filename>layers/drawing.py
from . import base
from . import interactive
from pygame import gfxdraw, display
from utils.data import DataContainer
class Drawing(list, DataContainer):
def __init__(self):
super(Drawing, self).__init__()
self.color = (255, 255, 255)
def prefix(self):
ret... | <filename>layers/drawing.py
from . import base
from . import interactive
from pygame import gfxdraw, display
from utils.data import DataContainer
class Drawing(list, DataContainer):
def __init__(self):
super(Drawing, self).__init__()
self.color = (255, 255, 255)
def prefix(self):
ret... | none | 1 | 2.782963 | 3 | |
tests/pymcell4_positive/1515_tetrahedron_box_collision_moving_3_w_wall_wall_hit/model.py | mcellteam/mcell-tests | 1 | 6629038 | #!/usr/bin/env python3
import sys
import os
import copy
import numpy as np
MCELL_PATH = os.environ.get('MCELL_PATH', '')
if MCELL_PATH:
sys.path.append(os.path.join(MCELL_PATH, 'lib'))
else:
print("Error: variable MCELL_PATH that is used to find the mcell library was not set.")
sys.exit(1)
import mcell a... | #!/usr/bin/env python3
import sys
import os
import copy
import numpy as np
MCELL_PATH = os.environ.get('MCELL_PATH', '')
if MCELL_PATH:
sys.path.append(os.path.join(MCELL_PATH, 'lib'))
else:
print("Error: variable MCELL_PATH that is used to find the mcell library was not set.")
sys.exit(1)
import mcell a... | en | 0.782162 | #!/usr/bin/env python3 # TODO viz in cellblender without any molecules does not work yet # not moving with the last vertex # checking depends on Tetrahedron having internal object id 0 and Box id 1 | 1.968094 | 2 |
seahub/options/views.py | saukrIppl/newsea | 2 | 6629039 | <gh_stars>1-10
# -*- coding: utf-8 -*-
from django.http import HttpResponse, HttpResponseBadRequest, \
HttpResponseRedirect , Http404
from django.views.decorators.http import require_POST
from django.contrib import messages
from django.utils.translation import ugettext as _
from seahub.auth.decorators import login... | # -*- coding: utf-8 -*-
from django.http import HttpResponse, HttpResponseBadRequest, \
HttpResponseRedirect , Http404
from django.views.decorators.http import require_POST
from django.contrib import messages
from django.utils.translation import ugettext as _
from seahub.auth.decorators import login_required
from ... | en | 0.769321 | # -*- coding: utf-8 -*- | 2.004739 | 2 |
demo/person/project/infrastructure/drivers/elasticsearch/connector.py | giovannifarlley/ms--fastapi-template | 24 | 6629040 | <gh_stars>10-100
from elasticsearch import Elasticsearch
from project.infrastructure.environments.loader import Configs
from project.infrastructure.monitoring_layer.aplication_general_log import Log
from project.infrastructure.monitoring_layer.aplication_kpi import Monitor
import sys
log = Log()
class Elk(object):
... | from elasticsearch import Elasticsearch
from project.infrastructure.environments.loader import Configs
from project.infrastructure.monitoring_layer.aplication_general_log import Log
from project.infrastructure.monitoring_layer.aplication_kpi import Monitor
import sys
log = Log()
class Elk(object):
def __init__... | pt | 0.980697 | Na inicialização da classe de conexão com o elasticsearch, as configurações de ambiente são carregadas em tempo de execução, e servidas sob o contexto da instancia. Cria uma conexão com o elasticsearch Raises: error: Exception Returns: Elasticsearch | 2.561241 | 3 |
ledger/payments/api.py | jawaidm/ledger | 1 | 6629041 | import json
from django.db import transaction
from django.conf import settings
from django.http import HttpResponse, HttpResponseRedirect
from django.template.loader import get_template
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from wsgiref.util import FileWrapper
f... | import json
from django.db import transaction
from django.conf import settings
from django.http import HttpResponse, HttpResponseRedirect
from django.template.loader import get_template
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from wsgiref.util import FileWrapper
f... | de | 0.301638 | ####################################################### # # # BPAY # # # ####################################################### #date_modifier = serializers.SerializerM... | 1.536754 | 2 |
wandb/sdk/internal/writer.py | Qwasser/client | 0 | 6629042 | #
# -*- coding: utf-8 -*-
"""Writer thread."""
from __future__ import print_function
import logging
from . import datastore
logger = logging.getLogger(__name__)
class WriteManager(object):
def __init__(
self, settings, record_q, result_q,
):
self._settings = settings
self._record_... | #
# -*- coding: utf-8 -*-
"""Writer thread."""
from __future__ import print_function
import logging
from . import datastore
logger = logging.getLogger(__name__)
class WriteManager(object):
def __init__(
self, settings, record_q, result_q,
):
self._settings = settings
self._record_... | en | 0.909929 | # # -*- coding: utf-8 -*- Writer thread. | 2.693127 | 3 |
Examples/SVD_py/imgcomp.py | madhavakrishna/libStubs | 0 | 6629043 | #!/usr/bin/python3
import sys
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
def imageCompressionSVD(imggray,k):
# Read image as matrix
imgmat = np.array(list(imggray.getdata(band=0)),float)
img_width = imggray.size[0]
img_height = imggray.size[1]
imgmat.shape = (img_height, img_width)
... | #!/usr/bin/python3
import sys
import numpy as np
import matplotlib.pyplot as plt
from PIL import Image
def imageCompressionSVD(imggray,k):
# Read image as matrix
imgmat = np.array(list(imggray.getdata(band=0)),float)
img_width = imggray.size[0]
img_height = imggray.size[1]
imgmat.shape = (img_height, img_width)
... | en | 0.742139 | #!/usr/bin/python3 # Read image as matrix #plot image #convert to gray-scale | 3.060578 | 3 |
packages/taucmdr/cf/software/papi_installation.py | eugeneswalker/taucmdr | 0 | 6629044 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, ParaTools, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# (1) Redistributions of source code must retain the above copyright notice,
# t... | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015, ParaTools, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# (1) Redistributions of source code must retain the above copyright notice,
# t... | en | 0.743592 | # -*- coding: utf-8 -*- # # Copyright (c) 2015, ParaTools, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # (1) Redistributions of source code must retain the above copyright notice, # t... | 1.033652 | 1 |
app/analyzer.py | luizhenriquelongo/legal-process-analyzer | 1 | 6629045 | def analyze_case(soup):
label_processo = soup.find("label", text="Processo:")
label_classe = soup.find("label", text="Classe:")
label_valor_da_causa = soup.find("label", text="Valor da ação:")
label_juiz = soup.find("label", text="Juiz:")
partes_do_processo = soup.find(id="tablePartesPrincipais")
... | def analyze_case(soup):
label_processo = soup.find("label", text="Processo:")
label_classe = soup.find("label", text="Classe:")
label_valor_da_causa = soup.find("label", text="Valor da ação:")
label_juiz = soup.find("label", text="Juiz:")
partes_do_processo = soup.find(id="tablePartesPrincipais")
... | none | 1 | 2.944269 | 3 | |
dirhunt/sources/google.py | cqr-cryeye-forks/dirhunt | 0 | 6629046 | <filename>dirhunt/sources/google.py
from dirhunt.sources.base import Source
from dirhunt._compat import URLError
from googlesearch import search
class Google(Source):
def callback(self, domain):
results = search('site:{}'.format(domain), stop=20)
while True:
try:
url = ... | <filename>dirhunt/sources/google.py
from dirhunt.sources.base import Source
from dirhunt._compat import URLError
from googlesearch import search
class Google(Source):
def callback(self, domain):
results = search('site:{}'.format(domain), stop=20)
while True:
try:
url = ... | none | 1 | 2.785759 | 3 | |
curve_to_svg.py | crantisz/blender-curve-to-svg | 0 | 6629047 | <reponame>crantisz/blender-curve-to-svg
bl_info = {
'name': "Export 2D Curve to SVG",
'author': "<NAME>",
'version': (0, 0, 2),
'blender': (2, 80, 0),
'location': "Properties > Data > Export SVG",
'description': "Generate a SVG file from selected 2D Curves",
'warning': "Curve splines may be ... | bl_info = {
'name': "Export 2D Curve to SVG",
'author': "<NAME>",
'version': (0, 0, 2),
'blender': (2, 80, 0),
'location': "Properties > Data > Export SVG",
'description': "Generate a SVG file from selected 2D Curves",
'warning': "Curve splines may be inverted, so self intersections can be w... | en | 0.721666 | Returns SVG transform for object Converts linear channel to sRGB and then to hexadecimal # Author: @brecht # Link: https://devtalk.blender.org/t/get-hex-gamma-corrected-color/2422/2 Converts a Color object to hexadecimal Returns a pretty-printed XML string for the Element Creates a Panel in the data context of the prop... | 2.630674 | 3 |
pyfileconf/io/file/load/lazy/pipeline.py | nickderobertis/py-file-conf | 2 | 6629048 | from pyfileconf.io.file.load.lazy.pipelineast import PipelineAstLoader
from pyfileconf.io.file.load.parsers.collections import extract_collection_from_ast
class PipelineDictLoader(PipelineAstLoader):
def load(self):
# Get pipeline_dict_ast
super().load()
# Convert ast dicts and ast lists ... | from pyfileconf.io.file.load.lazy.pipelineast import PipelineAstLoader
from pyfileconf.io.file.load.parsers.collections import extract_collection_from_ast
class PipelineDictLoader(PipelineAstLoader):
def load(self):
# Get pipeline_dict_ast
super().load()
# Convert ast dicts and ast lists ... | en | 0.909322 | # Get pipeline_dict_ast # Convert ast dicts and ast lists to normal dicts and lists, store as self.pipeline_dict Iterates through ast tree of pipeline dict, producing a dict/list structure, while leaving other objects as ast representations Returns: | 2.786314 | 3 |
Utilities/MessageUtilities/SwarmAnalyticsUtility/MessageInterface/Enums/ChatNumber.py | IshmaGurca/SwarmAnalytics | 0 | 6629049 | from enum import Enum
import numpy as np
class ChatNumberEnum(Enum):
CHATNR0 = 0
CHATNR1 = 1
#CHATNR2 = 2
#CHATNR3 = 3
#CHATNR4 = 4
#CHATNR5 = 5
class ChatNumber:
def __init__(self):
self.Enum = ChatNumberEnum
self.n = len(self.Enum)
def IndexToOneHot(self, indic... | from enum import Enum
import numpy as np
class ChatNumberEnum(Enum):
CHATNR0 = 0
CHATNR1 = 1
#CHATNR2 = 2
#CHATNR3 = 3
#CHATNR4 = 4
#CHATNR5 = 5
class ChatNumber:
def __init__(self):
self.Enum = ChatNumberEnum
self.n = len(self.Enum)
def IndexToOneHot(self, indic... | en | 0.891665 | #CHATNR2 = 2 #CHATNR3 = 3 #CHATNR4 = 4 #CHATNR5 = 5 | 2.922037 | 3 |
temp_log.py | millerii/rpi-temp-logger | 0 | 6629050 | <gh_stars>0
#!/usr/bin/env python3
# DS1820 and DS18S20 have the Family Code 10
# DS18B20 has Code 28
# DS1822 the 22.
# Don't know will this work with 'B' or x22 -sensors
import os
import sys
import openpyxl
import datetime
# Remove first comma from path if using with real sensors
dir_w1_bus = "./sys/bus/w1/devic... | #!/usr/bin/env python3
# DS1820 and DS18S20 have the Family Code 10
# DS18B20 has Code 28
# DS1822 the 22.
# Don't know will this work with 'B' or x22 -sensors
import os
import sys
import openpyxl
import datetime
# Remove first comma from path if using with real sensors
dir_w1_bus = "./sys/bus/w1/devices/"
def sc... | en | 0.648982 | #!/usr/bin/env python3 # DS1820 and DS18S20 have the Family Code 10 # DS18B20 has Code 28 # DS1822 the 22. # Don't know will this work with 'B' or x22 -sensors # Remove first comma from path if using with real sensors # Pick only valid sensor-folders, folder starts with correct family code # List of temp-sensors id's #... | 2.690725 | 3 |