hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c37044b4e4177925e4f73319dd19a41dcfe4d41 | 2,897 | py | Python | CPX_GBoard/universal/code.py | albinger/Adafruit_Learning_System_Guides | 4fe2da261fe5d1ca282b86bd3b93ee1466346fa7 | [
"MIT"
] | null | null | null | CPX_GBoard/universal/code.py | albinger/Adafruit_Learning_System_Guides | 4fe2da261fe5d1ca282b86bd3b93ee1466346fa7 | [
"MIT"
] | null | null | null | CPX_GBoard/universal/code.py | albinger/Adafruit_Learning_System_Guides | 4fe2da261fe5d1ca282b86bd3b93ee1466346fa7 | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2018 Dave Astels for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""
Circuit Playground Express GBoard: universal/customizable version
Adafruit invests time and resources providing this open source code.
Please support Adafruit and open source hardware by purchasing
products from Ad... | 26.577982 | 69 | 0.722126 |
import time
from adafruit_circuitplayground.express import cpx
DOT_DURATION = 0.20
DASH_DURATION = 0.5
def touch_a():
return False
def touch_b():
return False
def dot():
p... | true | true |
1c37069c91fd874e7d4b8325001cf39f9c41f9ae | 743 | py | Python | BB8-MindWave-TestColor.py | titos-carrasco/MindWave-BB8-Python | f1d4b9bb3f7bdac08b01f5a795c3fd2772bb014e | [
"MIT"
] | null | null | null | BB8-MindWave-TestColor.py | titos-carrasco/MindWave-BB8-Python | f1d4b9bb3f7bdac08b01f5a795c3fd2772bb014e | [
"MIT"
] | null | null | null | BB8-MindWave-TestColor.py | titos-carrasco/MindWave-BB8-Python | f1d4b9bb3f7bdac08b01f5a795c3fd2772bb014e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
import time
from rcr.SpheroBB8 import SpheroBB8
from rcr.mindwave.MindWave import *
sphero = SpheroBB8.Sphero( 'FA:8B:91:F4:9D:22' )
mw = MindWave( "/dev/ttyUSB0", 1000, 0X0000 )
if( mw.connect() ):
mwd = MindWaveData()
sphero.setRGBLedOutput( 0, 0... | 26.535714 | 70 | 0.629879 |
from __future__ import print_function
import time
from rcr.SpheroBB8 import SpheroBB8
from rcr.mindwave.MindWave import *
sphero = SpheroBB8.Sphero( 'FA:8B:91:F4:9D:22' )
mw = MindWave( "/dev/ttyUSB0", 1000, 0X0000 )
if( mw.connect() ):
mwd = MindWaveData()
sphero.setRGBLedOutput( 0, 0, 0 )
last = 0
... | true | true |
1c370808538c07636c42fc8d7996e45d389055b3 | 2,165 | py | Python | qriscloud/_vendor/ldap3/protocol/sasl/plain.py | UQ-RCC/uq-globus-tools | a5191cd223b841fd404eddc90402947247b6504f | [
"Apache-2.0"
] | 2 | 2021-12-15T21:58:43.000Z | 2021-12-15T22:17:26.000Z | qriscloud/_vendor/ldap3/protocol/sasl/plain.py | UQ-RCC/uq-globus-tools | a5191cd223b841fd404eddc90402947247b6504f | [
"Apache-2.0"
] | null | null | null | qriscloud/_vendor/ldap3/protocol/sasl/plain.py | UQ-RCC/uq-globus-tools | a5191cd223b841fd404eddc90402947247b6504f | [
"Apache-2.0"
] | 1 | 2021-12-19T17:02:02.000Z | 2021-12-19T17:02:02.000Z | """
"""
# Created on 2014.01.04
#
# Author: Giovanni Cannata
#
# Copyright 2014 - 2020 Giovanni Cannata
#
# This file is part of ldap3.
#
# ldap3 is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either ... | 30.492958 | 74 | 0.67806 |
from ...protocol.sasl.sasl import send_sasl_negotiation
from .sasl import sasl_prep
from ...utils.conv import to_raw, to_unicode
def sasl_plain(connection, controls):
authzid = connection.sasl_credentials[0]
authcid = connection.sasl_credentials[1]
passwd = connect... | true | true |
1c370ac7ecdbaef944c3afe36b20291ffe1464d0 | 5,049 | py | Python | zfused_maya/zfused_maya/node/core/upload_shot.py | qinningfx/zfused_outsource | bfc5558f05e3d6005653794a47bd863b61b009b1 | [
"Apache-2.0"
] | 2 | 2019-02-22T03:33:26.000Z | 2019-02-23T03:29:26.000Z | zfused_maya/zfused_maya/node/core/upload_shot.py | qinningfx/zfused_outsource | bfc5558f05e3d6005653794a47bd863b61b009b1 | [
"Apache-2.0"
] | null | null | null | zfused_maya/zfused_maya/node/core/upload_shot.py | qinningfx/zfused_outsource | bfc5558f05e3d6005653794a47bd863b61b009b1 | [
"Apache-2.0"
] | null | null | null | # coding:utf-8
# --author-- binglu.wang
import os
try:
from PySide import QtGui
from PySide import QtCore, QtUiTools
from shiboken import wrapInstance
except ImportError:
from PySide2 import QtWidgets as QtGui
from PySide2 import QtCore, QtUiTools
from shiboken2 import wrapInstance
import zfus... | 33.66 | 102 | 0.63775 |
import os
try:
from PySide import QtGui
from PySide import QtCore, QtUiTools
from shiboken import wrapInstance
except ImportError:
from PySide2 import QtWidgets as QtGui
from PySide2 import QtCore, QtUiTools
from shiboken2 import wrapInstance
import zfused_maya.core.resource as resource
impo... | false | true |
1c370ad31b9d3ffba5a530eca0f05b3ede73c539 | 1,061 | py | Python | examples/cattools_merging_cat.py | CHEN-Zhaohui/geoist | 06a00db3e0ed3d92abf3e45b7b3bfbef6a858a5b | [
"MIT"
] | null | null | null | examples/cattools_merging_cat.py | CHEN-Zhaohui/geoist | 06a00db3e0ed3d92abf3e45b7b3bfbef6a858a5b | [
"MIT"
] | null | null | null | examples/cattools_merging_cat.py | CHEN-Zhaohui/geoist | 06a00db3e0ed3d92abf3e45b7b3bfbef6a858a5b | [
"MIT"
] | null | null | null | """
EXAMPLE 5 - CATALOGUE MERGING
"""
from os.path import dirname
from geoist.cattools import Catalogue as Cat
from geoist.cattools import Selection as Sel
from geoist.cattools import MagRules as MR
#-----------------------------------------------------------------------------------------
# Import Catalogues
pathname ... | 30.314286 | 90 | 0.556079 | from os.path import dirname
from geoist.cattools import Catalogue as Cat
from geoist.cattools import Selection as Sel
from geoist.cattools import MagRules as MR
pathname = dirname(__file__)
Db1 = Cat.Database()
Db1.Load(pathname+'/data/isc-rev-africa-select.bin')
Db2 = Cat.Database()
Db2.Load(pathname+'/data/isc-ge... | true | true |
1c370b05c5cc627069d70811b53fb4f1c442b302 | 611 | py | Python | asreview/webapp/tests/__init__.py | DominiqueMaciejewski/asreview | eb1066074613a5f6f930ff610ff92184e9244f4f | [
"Apache-2.0"
] | 280 | 2020-02-06T12:40:16.000Z | 2022-03-19T21:13:55.000Z | asreview/webapp/tests/__init__.py | DominiqueMaciejewski/asreview | eb1066074613a5f6f930ff610ff92184e9244f4f | [
"Apache-2.0"
] | 519 | 2020-02-06T12:08:29.000Z | 2022-03-31T16:02:01.000Z | asreview/webapp/tests/__init__.py | DominiqueMaciejewski/asreview | eb1066074613a5f6f930ff610ff92184e9244f4f | [
"Apache-2.0"
] | 77 | 2020-03-06T15:22:08.000Z | 2022-03-30T11:21:06.000Z | # Copyright 2019-2021 The ASReview 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 appl... | 43.642857 | 74 | 0.765957 | true | true | |
1c370b4e461c0ea748683076354b39a440ba6a14 | 3,331 | py | Python | pykrita/camera_layer/ui/camera_layer_widget.py | akirfin/krita_python_fun | 74173d140b39f7f80f43f9474381e4adfa3b5f01 | [
"MIT"
] | 1 | 2021-10-01T00:25:43.000Z | 2021-10-01T00:25:43.000Z | pykrita/camera_layer/ui/camera_layer_widget.py | akirfin/krita_python_fun | 74173d140b39f7f80f43f9474381e4adfa3b5f01 | [
"MIT"
] | null | null | null | pykrita/camera_layer/ui/camera_layer_widget.py | akirfin/krita_python_fun | 74173d140b39f7f80f43f9474381e4adfa3b5f01 | [
"MIT"
] | null | null | null |
from krita import Krita, Node
from PyQt5.QtCore import Qt
from PyQt5.QtCore import pyqtSlot as QSlot
from PyQt5.QtCore import pyqtSignal as QSignal
from PyQt5.QtCore import pyqtProperty as QProperty
from PyQt5.QtWidgets import \
QWidget, QComboBox, QPushButton, QFormLayout
from camera_layer.common.utils_qt... | 30.559633 | 111 | 0.687181 |
from krita import Krita, Node
from PyQt5.QtCore import Qt
from PyQt5.QtCore import pyqtSlot as QSlot
from PyQt5.QtCore import pyqtSignal as QSignal
from PyQt5.QtCore import pyqtProperty as QProperty
from PyQt5.QtWidgets import \
QWidget, QComboBox, QPushButton, QFormLayout
from camera_layer.common.utils_qt... | true | true |
1c370d7e2a52c30783c1af1f149612a6ccffc521 | 12,133 | py | Python | pymatgen/io/tests/test_gaussian.py | MahdiDavari/pymatgen | eb6cd95230c11ac761a96ebf82b98f71177bb71f | [
"MIT"
] | null | null | null | pymatgen/io/tests/test_gaussian.py | MahdiDavari/pymatgen | eb6cd95230c11ac761a96ebf82b98f71177bb71f | [
"MIT"
] | null | null | null | pymatgen/io/tests/test_gaussian.py | MahdiDavari/pymatgen | eb6cd95230c11ac761a96ebf82b98f71177bb71f | [
"MIT"
] | 1 | 2018-04-09T21:49:14.000Z | 2018-04-09T21:49:14.000Z | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import division, unicode_literals
"""
Created on Apr 17, 2012
"""
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "S... | 39.392857 | 99 | 0.515042 |
from __future__ import division, unicode_literals
__author__ = "Shyue Ping Ong"
__copyright__ = "Copyright 2012, The Materials Project"
__version__ = "0.1"
__maintainer__ = "Shyue Ping Ong"
__email__ = "shyuep@gmail.com"
__date__ = "Apr 17, 2012"
import unittest2 as unittest
import os
from pymatgen import Mole... | true | true |
1c370da239c348eda2837ba54cbbd7e8c8216542 | 2,135 | py | Python | cirq/_doc.py | satw1knandala/Cirq | ca307cd7ffdd2e8659c84c484788c8b5d15cc09d | [
"Apache-2.0"
] | null | null | null | cirq/_doc.py | satw1knandala/Cirq | ca307cd7ffdd2e8659c84c484788c8b5d15cc09d | [
"Apache-2.0"
] | null | null | null | cirq/_doc.py | satw1knandala/Cirq | ca307cd7ffdd2e8659c84c484788c8b5d15cc09d | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 37.45614 | 80 | 0.703981 |
from typing import Any, Dict
RECORDED_CONST_DOCS: Dict[int, str] = {}
def document(value: Any, doc_string: str = ''):
RECORDED_CONST_DOCS[id(value)] = doc_string
pass
return value
| true | true |
1c370f1e01d6fa55e58a5d7090684e96c216762b | 19,528 | py | Python | scrapli/channel/base_channel.py | carlmontanari/nssh | fa2277ea0b8fdb81de3064e1d48bad9264f0cd64 | [
"MIT"
] | 1 | 2020-02-09T17:43:43.000Z | 2020-02-09T17:43:43.000Z | scrapli/channel/base_channel.py | carlmontanari/nssh | fa2277ea0b8fdb81de3064e1d48bad9264f0cd64 | [
"MIT"
] | null | null | null | scrapli/channel/base_channel.py | carlmontanari/nssh | fa2277ea0b8fdb81de3064e1d48bad9264f0cd64 | [
"MIT"
] | null | null | null | """scrapli.channel.base_channel"""
import re
from dataclasses import dataclass
from datetime import datetime
from functools import lru_cache
from io import SEEK_END, BytesIO
from typing import BinaryIO, List, Optional, Pattern, Tuple, Union
from scrapli.exceptions import ScrapliAuthenticationFailed, ScrapliTypeError, ... | 32.384743 | 100 | 0.612659 | import re
from dataclasses import dataclass
from datetime import datetime
from functools import lru_cache
from io import SEEK_END, BytesIO
from typing import BinaryIO, List, Optional, Pattern, Tuple, Union
from scrapli.exceptions import ScrapliAuthenticationFailed, ScrapliTypeError, ScrapliValueError
from scrapli.logg... | true | true |
1c370f6140eb0cb74ae1838d3926f731766d19f4 | 3,756 | py | Python | code/lib/LoadFileFromHTTPClass.py | kassi/water-meter-system-complete | e020e38e4243425c7ab6fcd12f3fb0ccb8323471 | [
"MIT"
] | 135 | 2019-07-27T21:02:13.000Z | 2022-03-27T05:43:32.000Z | code/lib/LoadFileFromHTTPClass.py | kassi/water-meter-system-complete | e020e38e4243425c7ab6fcd12f3fb0ccb8323471 | [
"MIT"
] | 24 | 2019-09-24T06:56:04.000Z | 2021-12-07T23:18:17.000Z | code/lib/LoadFileFromHTTPClass.py | kassi/water-meter-system-complete | e020e38e4243425c7ab6fcd12f3fb0ccb8323471 | [
"MIT"
] | 41 | 2019-09-23T10:22:39.000Z | 2022-02-01T14:59:47.000Z | import configparser
import urllib.request
from multiprocessing import Process, Event
from PIL import Image
from shutil import copyfile
import time
import os
class LoadFileFromHttp:
def __init__(self):
config = configparser.ConfigParser()
config.read('./config/config.ini')
self.TimeoutLoad... | 37.939394 | 152 | 0.59984 | import configparser
import urllib.request
from multiprocessing import Process, Event
from PIL import Image
from shutil import copyfile
import time
import os
class LoadFileFromHttp:
def __init__(self):
config = configparser.ConfigParser()
config.read('./config/config.ini')
self.TimeoutLoad... | true | true |
1c370fe1858ce8a4bff2b92caed2da2987120927 | 5,444 | py | Python | lib/galaxy/job_metrics/collectl/cli.py | beatrizserrano/galaxy | e149d9d32e1bca6c07c38b1a9cdabfee60323610 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/job_metrics/collectl/cli.py | beatrizserrano/galaxy | e149d9d32e1bca6c07c38b1a9cdabfee60323610 | [
"CC-BY-3.0"
] | 2 | 2017-05-18T16:12:55.000Z | 2022-03-08T12:08:43.000Z | lib/galaxy/job_metrics/collectl/cli.py | beatrizserrano/galaxy | e149d9d32e1bca6c07c38b1a9cdabfee60323610 | [
"CC-BY-3.0"
] | null | null | null | """This module describes :class:`CollectlCli` - an abstraction for building collectl command lines."""
import logging
import subprocess
from string import Template
log = logging.getLogger(__name__)
COMMAND_LINE_TEMPLATE = Template(
"$collectl_path $destination_arg $mode_arg $subsystems_arg $interval_arg $procfilt... | 38.338028 | 111 | 0.656319 | import logging
import subprocess
from string import Template
log = logging.getLogger(__name__)
COMMAND_LINE_TEMPLATE = Template(
"$collectl_path $destination_arg $mode_arg $subsystems_arg $interval_arg $procfilt_arg $flush_arg $sep_arg"
)
MODE_RECORD = "record"
MODE_PLAYBACK = "playback"
class CollectlCli:
... | true | true |
1c3710ae5d49fac1641726e712798402f792d830 | 702 | py | Python | decode_one.py | vmindru/ambp3client | 072b0084cdb8989258be9e78e01961d7c1c602fa | [
"Apache-2.0"
] | 7 | 2019-10-05T11:45:55.000Z | 2022-03-15T06:00:32.000Z | decode_one.py | vmindru/ambp3client | 072b0084cdb8989258be9e78e01961d7c1c602fa | [
"Apache-2.0"
] | 1 | 2021-04-19T19:53:00.000Z | 2021-04-19T19:53:00.000Z | decode_one.py | vmindru/ambp3client | 072b0084cdb8989258be9e78e01961d7c1c602fa | [
"Apache-2.0"
] | 4 | 2019-11-06T18:03:08.000Z | 2020-05-05T19:36:24.000Z | #!/usr/bin/env python
from argparse import ArgumentParser
from AmbP3.decoder import p3decode as decode
from AmbP3.decoder import bin_dict_to_ascii as dict_to_ascii
from AmbP3.decoder import hex_to_binary
DEFAULT_DATA = "8e023300c922000001000104a468020003042f79340004087802cd052083050005\
02990006021c0008020000810413180... | 25.071429 | 83 | 0.750712 |
from argparse import ArgumentParser
from AmbP3.decoder import p3decode as decode
from AmbP3.decoder import bin_dict_to_ascii as dict_to_ascii
from AmbP3.decoder import hex_to_binary
DEFAULT_DATA = "8e023300c922000001000104a468020003042f79340004087802cd052083050005\
02990006021c00080200008104131804008f"
def get_args... | true | true |
1c3711a3cc54160b9893027fe68fddc73ee0735e | 2,482 | py | Python | aliyun-python-sdk-acms-open/setup.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-acms-open/setup.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-acms-open/setup.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.000Z | #!/usr/bin/python
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"... | 31.820513 | 69 | 0.668815 |
from setuptools import setup, find_packages
import os
import sys
PACKAGE = "aliyunsdkacms_open"
NAME = "aliyun-python-sdk-acms-open"
DESCRIPTION = "The acms-open module of Aliyun Python sdk."
AUTHOR = "Aliyun"
AUTHOR_EMAIL = "aliyun-developers-efficiency@list.alibaba-inc.com"
URL = "http://develop.aliyun.com/sdk/py... | true | true |
1c371389acf302befa08bfb5a339ea556417505b | 3,317 | py | Python | Macros/3HB9/trainRF.py | pcumani/Tutorial_CTAMARSAnalysis | d0bf5adaf4ef3cdf8d3ea06a53c270f6760442f8 | [
"MIT"
] | null | null | null | Macros/3HB9/trainRF.py | pcumani/Tutorial_CTAMARSAnalysis | d0bf5adaf4ef3cdf8d3ea06a53c270f6760442f8 | [
"MIT"
] | null | null | null | Macros/3HB9/trainRF.py | pcumani/Tutorial_CTAMARSAnalysis | d0bf5adaf4ef3cdf8d3ea06a53c270f6760442f8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Author: Paolo Cumani, Tarek Hassan, Abelardo Moralejo
Submit a Job to train the g/h RF
The training is run in parallel for each telescope type. It is NOT possible to hadd the output
It should be run once with ~10-30 files, get the statistic and re-run with the number of files
... | 32.519608 | 119 | 0.593006 |
"""
Author: Paolo Cumani, Tarek Hassan, Abelardo Moralejo
Submit a Job to train the g/h RF
The training is run in parallel for each telescope type. It is NOT possible to hadd the output
It should be run once with ~10-30 files, get the statistic and re-run with the number of files
needed to reach ~1500... | false | true |
1c3713c02a2b658f10fb321502b0988a765cc791 | 12,784 | py | Python | tests/integration/test_s3_zero_copy_replication/test.py | pdv-ru/ClickHouse | 0ff975bcf3008fa6c6373cbdfed16328e3863ec5 | [
"Apache-2.0"
] | 4 | 2020-01-02T01:52:17.000Z | 2020-06-15T13:10:37.000Z | tests/integration/test_s3_zero_copy_replication/test.py | pdv-ru/ClickHouse | 0ff975bcf3008fa6c6373cbdfed16328e3863ec5 | [
"Apache-2.0"
] | 3 | 2021-12-13T14:45:52.000Z | 2021-12-20T21:01:10.000Z | tests/integration/test_s3_zero_copy_replication/test.py | pdv-ru/ClickHouse | 0ff975bcf3008fa6c6373cbdfed16328e3863ec5 | [
"Apache-2.0"
] | 1 | 2022-03-19T17:31:29.000Z | 2022-03-19T17:31:29.000Z | import datetime
import logging
import time
import pytest
from helpers.cluster import ClickHouseCluster
logging.getLogger().setLevel(logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler())
@pytest.fixture(scope="module")
def cluster():
try:
cluster = ClickHouseCluster(__file__)
clus... | 40.713376 | 136 | 0.660904 | import datetime
import logging
import time
import pytest
from helpers.cluster import ClickHouseCluster
logging.getLogger().setLevel(logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler())
@pytest.fixture(scope="module")
def cluster():
try:
cluster = ClickHouseCluster(__file__)
clus... | true | true |
1c3713c65a243f5b58f9797d11119f784e2d2d9c | 224 | py | Python | QRCode/scan.py | sinalma/taobao_tools | 222800ccd808ef4bbbcbcffc6b3f4fde133d8685 | [
"MIT"
] | null | null | null | QRCode/scan.py | sinalma/taobao_tools | 222800ccd808ef4bbbcbcffc6b3f4fde133d8685 | [
"MIT"
] | null | null | null | QRCode/scan.py | sinalma/taobao_tools | 222800ccd808ef4bbbcbcffc6b3f4fde133d8685 | [
"MIT"
] | null | null | null | from PIL import Image
import tesserocr, requests
if __name__ == '__main__':
image_path='F:/Python/Code/QRCode/test1431049.jpg'#图片文件路径
image = Image.open(image_path)
result = tesserocr.image_to_text(image)
print(result)
| 24.888889 | 58 | 0.776786 | from PIL import Image
import tesserocr, requests
if __name__ == '__main__':
image_path='F:/Python/Code/QRCode/test1431049.jpg'
image = Image.open(image_path)
result = tesserocr.image_to_text(image)
print(result)
| true | true |
1c371414f8f302c1bfc87457632c7eb0eca5574e | 887 | py | Python | preproc.py | YasenPetrov/char-rnn-experiments | ae010e3f69173bb3a70a18907862529414d86d1a | [
"MIT"
] | null | null | null | preproc.py | YasenPetrov/char-rnn-experiments | ae010e3f69173bb3a70a18907862529414d86d1a | [
"MIT"
] | null | null | null | preproc.py | YasenPetrov/char-rnn-experiments | ae010e3f69173bb3a70a18907862529414d86d1a | [
"MIT"
] | null | null | null | import argparse
from datautils.dataset import Alphabet
from utils.general_utils import clean_and_split_file
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='''Preprocesses files for PPM training''')
parser.add_argument('source_file', metavar='source_file', type=str,
... | 49.277778 | 113 | 0.715896 | import argparse
from datautils.dataset import Alphabet
from utils.general_utils import clean_and_split_file
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='''Preprocesses files for PPM training''')
parser.add_argument('source_file', metavar='source_file', type=str,
... | true | true |
1c3714f8b97190de54387c05067462c712019aa2 | 7,071 | py | Python | pyxform/tests_v1/test_support_external_instances.py | PMA-2020/pmaxform3 | 9d36f97f25cb09f0fb8aafb69370454731ecbbd5 | [
"BSD-2-Clause"
] | null | null | null | pyxform/tests_v1/test_support_external_instances.py | PMA-2020/pmaxform3 | 9d36f97f25cb09f0fb8aafb69370454731ecbbd5 | [
"BSD-2-Clause"
] | null | null | null | pyxform/tests_v1/test_support_external_instances.py | PMA-2020/pmaxform3 | 9d36f97f25cb09f0fb8aafb69370454731ecbbd5 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Test external instance syntax
"""
from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class ExternalCSVInstancesTest(PyxformTestCase):
def test_external_csv_instances(self):
# re: https://github.com/XLSForm/pyxform/issues/30
self.assertPyxformXform(
... | 42.089286 | 119 | 0.424975 |
from pyxform.tests_v1.pyxform_test_case import PyxformTestCase
class ExternalCSVInstancesTest(PyxformTestCase):
def test_external_csv_instances(self):
self.assertPyxformXform(
name="ecsv",
md="""
| survey | | ... | true | true |
1c371548320574c02348dc736e51e1f71f3c4366 | 1,379 | py | Python | run/core/setup/schema.py | matthewmuccio/TweetTweet | 4ca6ae31fd3b8a1f32fd65676e945a3ec745ba9c | [
"MIT"
] | 1 | 2020-03-30T04:00:15.000Z | 2020-03-30T04:00:15.000Z | run/core/setup/schema.py | matthewmuccio/TweetTweet | 4ca6ae31fd3b8a1f32fd65676e945a3ec745ba9c | [
"MIT"
] | null | null | null | run/core/setup/schema.py | matthewmuccio/TweetTweet | 4ca6ae31fd3b8a1f32fd65676e945a3ec745ba9c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sqlite3
connection = sqlite3.connect("master.db", check_same_thread=False)
cursor = connection.cursor()
# Creates users table.
cursor.execute(
"""CREATE TABLE users(
id INTEGER PRIMARY KEY AUTOINCREMENT,
username VARCHAR(20) UNIQUE NOT NULL,
password VARCHAR(128) ... | 26.519231 | 67 | 0.729514 |
import sqlite3
connection = sqlite3.connect("master.db", check_same_thread=False)
cursor = connection.cursor()
cursor.execute(
"""CREATE TABLE users(
id INTEGER PRIMARY KEY AUTOINCREMENT,
username VARCHAR(20) UNIQUE NOT NULL,
password VARCHAR(128) NOT NULL,
first_name VARCHAR(50) NOT NULL,
... | true | true |
1c371550e1fc5c82bcba8cb87d91667ed7bcd636 | 4,883 | py | Python | src/python/pants/backend/jvm/subsystems/jvm_tool_mixin.py | areitz/pants | 9bfb3feb0272c05f36e190c9147091b97ee1950d | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/jvm/subsystems/jvm_tool_mixin.py | areitz/pants | 9bfb3feb0272c05f36e190c9147091b97ee1950d | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/jvm/subsystems/jvm_tool_mixin.py | areitz/pants | 9bfb3feb0272c05f36e190c9147091b97ee1950d | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.base.addr... | 48.83 | 106 | 0.670489 |
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from pants.base.address_lookup_error import AddressLookupError
from pants.base.exceptions import TaskError
from pants.option.custom_types import target_list_option... | true | true |
1c3715d4e6766bf36a21922def2df4a36fcbc0b5 | 10 | py | Python | Toolkit/Flattenizer/flattenizer_gui.py | croxis/RenderPipeline | 43482c03a835dd620e6d45b08e56fa5679742482 | [
"WTFPL"
] | null | null | null | Toolkit/Flattenizer/flattenizer_gui.py | croxis/RenderPipeline | 43482c03a835dd620e6d45b08e56fa5679742482 | [
"WTFPL"
] | null | null | null | Toolkit/Flattenizer/flattenizer_gui.py | croxis/RenderPipeline | 43482c03a835dd620e6d45b08e56fa5679742482 | [
"WTFPL"
] | null | null | null |
# todo
| 2 | 6 | 0.4 | true | true | |
1c371601e8e865fd0e4a08277966d6ce798dac89 | 3,104 | py | Python | textattack/constraints/grammaticality/language_models/learning_to_write/rnn_model.py | k-ivey/TextAttack | 47d15acea90bf92e6a7f19200a59da29e74731e6 | [
"MIT"
] | 1 | 2020-12-04T18:05:44.000Z | 2020-12-04T18:05:44.000Z | textattack/constraints/grammaticality/language_models/learning_to_write/rnn_model.py | k-ivey/TextAttack | 47d15acea90bf92e6a7f19200a59da29e74731e6 | [
"MIT"
] | null | null | null | textattack/constraints/grammaticality/language_models/learning_to_write/rnn_model.py | k-ivey/TextAttack | 47d15acea90bf92e6a7f19200a59da29e74731e6 | [
"MIT"
] | null | null | null | from torch import nn as nn
from torch.autograd import Variable
from .adaptive_softmax import AdaptiveSoftmax
class RNNModel(nn.Module):
"""Container module with an encoder, a recurrent module, and a decoder.
Based on official pytorch examples
"""
def __init__(
self,
rnn_type,
... | 29.561905 | 92 | 0.545425 | from torch import nn as nn
from torch.autograd import Variable
from .adaptive_softmax import AdaptiveSoftmax
class RNNModel(nn.Module):
def __init__(
self,
rnn_type,
ntoken,
ninp,
nhid,
nlayers,
cutoffs,
proj=False,
dropout=0.5,
tie... | true | true |
1c371610c95e03dca0b7df0fdff01ba7ea7c9f2a | 8,512 | py | Python | test/test_gameservice.py | pteichman/wildcatting-classic | bfe7d4cf699f6792f43d70f32b5d83969d29f91e | [
"MIT"
] | 1 | 2020-04-13T21:21:04.000Z | 2020-04-13T21:21:04.000Z | test/test_gameservice.py | pteichman/wildcatting-classic | bfe7d4cf699f6792f43d70f32b5d83969d29f91e | [
"MIT"
] | null | null | null | test/test_gameservice.py | pteichman/wildcatting-classic | bfe7d4cf699f6792f43d70f32b5d83969d29f91e | [
"MIT"
] | null | null | null | import unittest
import base64
from wildcatting.exceptions import WildcattingException
from wildcatting.server import GameService
from wildcatting.model import Site, Well
from wildcatting.theme import DefaultTheme
class TestGameService(unittest.TestCase):
def testGameStart(self):
service = GameService(Def... | 32.48855 | 79 | 0.645794 | import unittest
import base64
from wildcatting.exceptions import WildcattingException
from wildcatting.server import GameService
from wildcatting.model import Site, Well
from wildcatting.theme import DefaultTheme
class TestGameService(unittest.TestCase):
def testGameStart(self):
service = GameService(Def... | true | true |
1c37161cbdb144f148feab8b0fd5cde889335344 | 11,874 | py | Python | tests/sentry/tasks/test_deletion.py | kinghuang/sentry | 5c22673994a62f54a782d1c595852986ccc51ae9 | [
"BSD-3-Clause"
] | 1 | 2019-10-17T17:46:16.000Z | 2019-10-17T17:46:16.000Z | tests/sentry/tasks/test_deletion.py | kinghuang/sentry | 5c22673994a62f54a782d1c595852986ccc51ae9 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/tasks/test_deletion.py | kinghuang/sentry | 5c22673994a62f54a782d1c595852986ccc51ae9 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from datetime import datetime, timedelta
from mock import patch
from uuid import uuid4
import pytest
from sentry.constants import ObjectStatus
from sentry.exceptions import DeleteAborted
from sentry.models import (
ApiApplication,
ApiApplicationStatus,
ApiGrant,
... | 36.875776 | 100 | 0.666161 | from __future__ import absolute_import
from datetime import datetime, timedelta
from mock import patch
from uuid import uuid4
import pytest
from sentry.constants import ObjectStatus
from sentry.exceptions import DeleteAborted
from sentry.models import (
ApiApplication,
ApiApplicationStatus,
ApiGrant,
... | true | true |
1c37161fbb98dd1f93525f52f546809b3ad06b4d | 438 | py | Python | test/test_spi_opi.py | osterwood/litex | db20cb172dc982c5879aa8080ec7aa18de181cc5 | [
"ADSL"
] | 1,501 | 2016-04-19T18:16:21.000Z | 2022-03-31T17:46:31.000Z | test/test_spi_opi.py | osterwood/litex | db20cb172dc982c5879aa8080ec7aa18de181cc5 | [
"ADSL"
] | 1,135 | 2016-04-19T05:49:14.000Z | 2022-03-31T15:21:19.000Z | test/test_spi_opi.py | osterwood/litex | db20cb172dc982c5879aa8080ec7aa18de181cc5 | [
"ADSL"
] | 357 | 2016-04-19T05:00:24.000Z | 2022-03-31T11:28:32.000Z | #
# This file is part of LiteX.
#
# Copyright (c) 2020 Florent Kermarrec <florent@enjoy-digital.fr>
# SPDX-License-Identifier: BSD-2-Clause
import unittest
from migen import *
from litex.soc.cores.spi_opi import S7SPIOPI
class TestI2S(unittest.TestCase):
def test_s7spiopi_syntax(self):
spi_opi_pads = R... | 23.052632 | 94 | 0.678082 |
import unittest
from migen import *
from litex.soc.cores.spi_opi import S7SPIOPI
class TestI2S(unittest.TestCase):
def test_s7spiopi_syntax(self):
spi_opi_pads = Record([("dqs", 1), ("dq", 8), ("sclk", 1), ("cs_n", 1), ("ecs_n", 1)])
spi_opi = S7SPIOPI(pads=spi_opi_pads)
| true | true |
1c37162a832c23c29e1286d1ec49eadb1b07d246 | 1,260 | py | Python | 28_OpenCV_FaceImageExtraction/imgGenerate.py | ManMohan291/PyProgram | edcaa927bd70676bd14355acad7262ae2d32b8e5 | [
"MIT"
] | 2 | 2018-09-07T17:44:54.000Z | 2018-09-07T17:44:57.000Z | 28_OpenCV_FaceImageExtraction/imgGenerate.py | ManMohan291/PyProgram | edcaa927bd70676bd14355acad7262ae2d32b8e5 | [
"MIT"
] | null | null | null | 28_OpenCV_FaceImageExtraction/imgGenerate.py | ManMohan291/PyProgram | edcaa927bd70676bd14355acad7262ae2d32b8e5 | [
"MIT"
] | null | null | null | import numpy as np
import cv2 as cv2
import sys
#im = cv2.imread("ManMohan\frame1.jpg")
#cv2.imshow('Videoc', im)
#cascPath = sys.argv[1]
faceCascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
video_capture = cv2.VideoCapture(0)
count = 0
while True:
# Capture frame-by-frame
ret, frame ... | 24.230769 | 74 | 0.607143 | import numpy as np
import cv2 as cv2
import sys
faceCascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
video_capture = cv2.VideoCapture(0)
count = 0
while True:
ret, frame = video_capture.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
faces = faceCascade.detectMultiS... | true | true |
1c3716a6997641010abbad3897b4e9154b9d5e1d | 220 | py | Python | students/K33401/practical_works/Kasatkin_Daniil/simple_django_web_project/simple_django_web_project/djangoApp/admin.py | aglaya-pill/ITMO_ICT_WebDevelopment_2021-2022 | a63691317a72fb9b29ae537bc3d7766661458c22 | [
"MIT"
] | null | null | null | students/K33401/practical_works/Kasatkin_Daniil/simple_django_web_project/simple_django_web_project/djangoApp/admin.py | aglaya-pill/ITMO_ICT_WebDevelopment_2021-2022 | a63691317a72fb9b29ae537bc3d7766661458c22 | [
"MIT"
] | null | null | null | students/K33401/practical_works/Kasatkin_Daniil/simple_django_web_project/simple_django_web_project/djangoApp/admin.py | aglaya-pill/ITMO_ICT_WebDevelopment_2021-2022 | a63691317a72fb9b29ae537bc3d7766661458c22 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import User, Car, DriversLicense, Ownership
admin.site.register(User)
admin.site.register(Car)
admin.site.register(Ownership)
admin.site.register(DriversLicense)
| 22 | 57 | 0.781818 | from django.contrib import admin
from .models import User, Car, DriversLicense, Ownership
admin.site.register(User)
admin.site.register(Car)
admin.site.register(Ownership)
admin.site.register(DriversLicense)
| true | true |
1c371750f041b8a0f7d3ca39767fd031f8a351d0 | 3,892 | py | Python | google/ads/googleads/v9/services/services/topic_constant_service/transports/base.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v9/services/services/topic_constant_service/transports/base.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v9/services/services/topic_constant_service/transports/base.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 35.706422 | 78 | 0.670606 |
import abc
import typing
import pkg_resources
import google.auth
from google.api_core import gapic_v1
from google.auth import credentials as ga_credentials
from google.ads.googleads.v9.resources.types import topic_constant
from google.ads.googleads.v9.services.types import topic_constant_service
t... | true | true |
1c3719a95a9ee64094fcb1c02f19bb4e976313b9 | 4,678 | py | Python | src/natcap/invest/ui/recreation.py | testacc-art/invest | 8f34712f89b8245ed7a4593b833d7d7a7d5e0c6e | [
"BSD-3-Clause"
] | null | null | null | src/natcap/invest/ui/recreation.py | testacc-art/invest | 8f34712f89b8245ed7a4593b833d7d7a7d5e0c6e | [
"BSD-3-Clause"
] | 1 | 2021-12-08T19:49:56.000Z | 2021-12-11T01:59:55.000Z | src/natcap/invest/ui/recreation.py | emlys/invest | 5b0391fd456df5a6afd2fdfbaed542a090f58f17 | [
"BSD-3-Clause"
] | null | null | null | # coding=UTF-8
from natcap.invest.ui import model, inputs
from natcap.invest.recreation import recmodel_client
class Recreation(model.InVESTModel):
def __init__(self):
model.InVESTModel.__init__(
self,
label='Recreation Model',
target=recmodel_client.execute,
... | 41.767857 | 79 | 0.592347 |
from natcap.invest.ui import model, inputs
from natcap.invest.recreation import recmodel_client
class Recreation(model.InVESTModel):
def __init__(self):
model.InVESTModel.__init__(
self,
label='Recreation Model',
target=recmodel_client.execute,
validator=r... | true | true |
1c3719c29c4c320accf134850e237b449aec24fa | 419 | py | Python | server/test_server.py | doas3140/face-pipeline | e1d8affb945beb0d257e75d865dfdb1ee9cda75e | [
"Apache-2.0"
] | null | null | null | server/test_server.py | doas3140/face-pipeline | e1d8affb945beb0d257e75d865dfdb1ee9cda75e | [
"Apache-2.0"
] | 2 | 2021-09-28T00:52:38.000Z | 2022-02-26T06:39:29.000Z | server/test_server.py | doas3140/face-pipeline | e1d8affb945beb0d257e75d865dfdb1ee9cda75e | [
"Apache-2.0"
] | null | null | null | from __future__ import print_function
import requests
import json
import cv2
test_url = 'http://localhost:5000/api/test'
img = cv2.imread('newfam.jpg')
print(img)
_, img_encoded = cv2.imencode('.jpg', img)
response = requests.post(test_url, files={'image': img_encoded.tostring()})
res = json.loads(response.text)
i... | 24.647059 | 75 | 0.73747 | from __future__ import print_function
import requests
import json
import cv2
test_url = 'http://localhost:5000/api/test'
img = cv2.imread('newfam.jpg')
print(img)
_, img_encoded = cv2.imencode('.jpg', img)
response = requests.post(test_url, files={'image': img_encoded.tostring()})
res = json.loads(response.text)
i... | true | true |
1c371a60fb4a30220579e772c0528de6944a2052 | 421 | py | Python | config.py | higuseonhye/visual-comet | df8b8f8ac27f41c6340985b09967b61173f3a847 | [
"MIT"
] | 1 | 2020-09-02T14:30:02.000Z | 2020-09-02T14:30:02.000Z | config.py | higuseonhye/visual-comet | df8b8f8ac27f41c6340985b09967b61173f3a847 | [
"MIT"
] | null | null | null | config.py | higuseonhye/visual-comet | df8b8f8ac27f41c6340985b09967b61173f3a847 | [
"MIT"
] | null | null | null | import os
USE_IMAGENET_PRETRAINED = True # otherwise use detectron, but that doesnt seem to work?!?
# Change these to match where your annotations and images are
VCR_IMAGES_DIR = '/home/jamesp/data/vcr/vcr1images'# os.environ['VCR_PARENT_DIR']
if not os.path.exists(VCR_IMAGES_DIR):
raise ValueError("Update config.... | 46.777778 | 89 | 0.783848 | import os
USE_IMAGENET_PRETRAINED = True
VCR_IMAGES_DIR = '/home/jamesp/data/vcr/vcr1images'
if not os.path.exists(VCR_IMAGES_DIR):
raise ValueError("Update config.py with where you saved VCR images to.")
VCR_FEATURES_DIR = '/home/jamesp/data/visualcomet/features' | true | true |
1c371a82c00eb77226772d507aab6da3d5d6dfcb | 9,798 | py | Python | optimade/filtertransformers/elasticsearch.py | ltalirz/optimade-python-tools | ddf11f51ba34f8dea6b46a1f37a7574e902521dd | [
"MIT"
] | 1 | 2020-01-20T15:24:23.000Z | 2020-01-20T15:24:23.000Z | optimade/filtertransformers/elasticsearch.py | blokhin/optimade-python-tools | be7816b5614a28e9870502e26de6c3e7eca85424 | [
"MIT"
] | null | null | null | optimade/filtertransformers/elasticsearch.py | blokhin/optimade-python-tools | be7816b5614a28e9870502e26de6c3e7eca85424 | [
"MIT"
] | null | null | null | import lark
from elasticsearch_dsl import Q, Text, Keyword, Integer, Field
from optimade.models import CHEMICAL_SYMBOLS, ATOMIC_NUMBERS
_cmp_operators = {">": "gt", ">=": "gte", "<": "lt", "<=": "lte"}
_rev_cmp_operators = {">": "<", ">=": "<=", "<": ">", "<=": "=>"}
_has_operators = {"ALL": "must", "ANY": "should"}
... | 34.258741 | 90 | 0.599408 | import lark
from elasticsearch_dsl import Q, Text, Keyword, Integer, Field
from optimade.models import CHEMICAL_SYMBOLS, ATOMIC_NUMBERS
_cmp_operators = {">": "gt", ">=": "gte", "<": "lt", "<=": "lte"}
_rev_cmp_operators = {">": "<", ">=": "<=", "<": ">", "<=": "=>"}
_has_operators = {"ALL": "must", "ANY": "should"}
... | true | true |
1c371aabba46c58425637f54217fa76dc4623b54 | 262 | py | Python | lopy4_firmware/lib/lorakeys.py | dnear1/smarterbham | 864215844e1017366c69b6c77119476d50c2e7c1 | [
"MIT"
] | 3 | 2020-01-03T18:24:19.000Z | 2020-06-06T22:38:34.000Z | lopy4_firmware/lib/lorakeys.py | alyssafrost/smarterbham | 6e5878ded0c31b418b2b3dfd561746e6b9e31da6 | [
"MIT"
] | 3 | 2019-07-06T16:50:46.000Z | 2020-03-26T21:28:56.000Z | lopy4_firmware/lib/lorakeys.py | alyssafrost/smarterbham | 6e5878ded0c31b418b2b3dfd561746e6b9e31da6 | [
"MIT"
] | 4 | 2020-02-13T02:39:14.000Z | 2020-06-06T22:38:21.000Z | #store Lora OTAA keys here - but don't back this up to Github
import struct
import ubinascii
_dev_eui = ubinascii.unhexlify('0000000000000000')
_app_eui = ubinascii.unhexlify('0000000000000000')
_app_key = ubinascii.unhexlify('00000000000000000000000000000000')
| 37.428571 | 66 | 0.820611 |
import struct
import ubinascii
_dev_eui = ubinascii.unhexlify('0000000000000000')
_app_eui = ubinascii.unhexlify('0000000000000000')
_app_key = ubinascii.unhexlify('00000000000000000000000000000000')
| true | true |
1c371acf466b43b5acc94830e7f79b70ef48c763 | 10,059 | py | Python | isi_sdk_8_1_0/isi_sdk_8_1_0/models/job_event.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_1_0/isi_sdk_8_1_0/models/job_event.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_1_0/isi_sdk_8_1_0/models/job_event.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 5
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class JobEvent(object):
"""N... | 26.611111 | 161 | 0.545482 |
import pprint
import re
import six
class JobEvent(object):
swagger_types = {
'flags': 'str',
'fmt_type': 'str',
'id': 'int',
'job_id': 'int',
'job_type': 'str',
'key': 'str',
'phase': 'int',
'raw_type': 'int',
'time': 'int',
'... | true | true |
1c371c19caeb1241fb3379853889d5e1c5d178ad | 5,192 | py | Python | kargers.py | mkner/algorithms | 4eec707f6ca8f65ee4659064a61f12326d2d049e | [
"MIT"
] | null | null | null | kargers.py | mkner/algorithms | 4eec707f6ca8f65ee4659064a61f12326d2d049e | [
"MIT"
] | null | null | null | kargers.py | mkner/algorithms | 4eec707f6ca8f65ee4659064a61f12326d2d049e | [
"MIT"
] | null | null | null | #
#
# kargers min-cut randomized contraction algorithm
#
#
# (c) Mike Knerr 2019
#
# ver: 0.15
# based on tim roughgarden's version
# of karger's min-cut algorithm
import numpy as np
import matplotlib.pyplot as plt
import os
#import math as m
#from statistics import median
import random as rand
... | 25.576355 | 124 | 0.547188 |
# of karger's min-cut algorithm
import numpy as np
import matplotlib.pyplot as plt
import os
import random as rand
import copy
def load_graph_from(fname):
g={}
ilist=[]
f = open(fname, 'r')
ilist = f.readlines()
f.close()
... | true | true |
1c371e23e8db86e74aa72b244b98f0b0ae0bbd54 | 2,180 | py | Python | app/utils/pokemon.py | antonpirker/asyncdjango | 855a4425f345fd9685980447a56cd11af9078e89 | [
"MIT"
] | null | null | null | app/utils/pokemon.py | antonpirker/asyncdjango | 855a4425f345fd9685980447a56cd11af9078e89 | [
"MIT"
] | 4 | 2021-06-24T11:36:05.000Z | 2021-07-27T08:32:28.000Z | app/utils/pokemon.py | antonpirker/asyncdjango | 855a4425f345fd9685980447a56cd11af9078e89 | [
"MIT"
] | null | null | null | import requests
import psycopg2
import aiohttp
import asyncio
import asyncpg
from django.conf import settings
import time
import logging
logger = logging.getLogger(__name__)
POKEMON_NUMBER = 25
SQL_STATEMENT = "SELECT * FROM app_pokemon ORDER BY number;"
SQL_STATEMENT_ONE = f"SELECT * FROM app_pokemon WHERE number... | 25.952381 | 104 | 0.66055 | import requests
import psycopg2
import aiohttp
import asyncio
import asyncpg
from django.conf import settings
import time
import logging
logger = logging.getLogger(__name__)
POKEMON_NUMBER = 25
SQL_STATEMENT = "SELECT * FROM app_pokemon ORDER BY number;"
SQL_STATEMENT_ONE = f"SELECT * FROM app_pokemon WHERE number... | true | true |
1c3720d78947bec0e2b0220515498d9e4e2de982 | 96,051 | py | Python | saleor/graphql/translations/tests/test_translations.py | haoyang09/saleor | 33f17288459012aab28d517c899fac439a07b729 | [
"CC-BY-4.0"
] | 1 | 2021-08-23T09:23:43.000Z | 2021-08-23T09:23:43.000Z | saleor/graphql/translations/tests/test_translations.py | haoyang09/saleor | 33f17288459012aab28d517c899fac439a07b729 | [
"CC-BY-4.0"
] | 172 | 2021-05-03T04:34:37.000Z | 2022-03-28T04:41:53.000Z | saleor/graphql/translations/tests/test_translations.py | twocucao/saleor | 308413ed9c19e7938e690fe3cf339b526fd34df2 | [
"CC-BY-4.0"
] | 1 | 2022-03-24T08:37:58.000Z | 2022-03-24T08:37:58.000Z | import json
from unittest.mock import patch
import graphene
import pytest
from django.contrib.auth.models import Permission
from freezegun import freeze_time
from ....tests.utils import dummy_editorjs
from ....webhook.event_types import WebhookEventAsyncType
from ....webhook.payloads import generate_translation_paylo... | 32.526583 | 88 | 0.641316 | import json
from unittest.mock import patch
import graphene
import pytest
from django.contrib.auth.models import Permission
from freezegun import freeze_time
from ....tests.utils import dummy_editorjs
from ....webhook.event_types import WebhookEventAsyncType
from ....webhook.payloads import generate_translation_paylo... | true | true |
1c3721a8501d5daf751b1b30d68f6b31e8b544fe | 2,321 | py | Python | utilities/CGI-pythons/terrainXYINC.py | sinotec2/Focus-on-Air-Quality | eac84651eaf6300a16f25a4d76b97a7f53454035 | [
"MIT"
] | null | null | null | utilities/CGI-pythons/terrainXYINC.py | sinotec2/Focus-on-Air-Quality | eac84651eaf6300a16f25a4d76b97a7f53454035 | [
"MIT"
] | null | null | null | utilities/CGI-pythons/terrainXYINC.py | sinotec2/Focus-on-Air-Quality | eac84651eaf6300a16f25a4d76b97a7f53454035 | [
"MIT"
] | null | null | null |
import twd97
Latitude_Pole, Longitude_Pole = 23.61000, 120.990
Xcent, Ycent = twd97.fromwgs84(Latitude_Pole, Longitude_Pole)
def twdIJ1(xv,yv):
return (int((xv-Xcent)/1000)+int(83*3/2))*1000+int((yv-Ycent)/1000)+int(137*3/2)
def terrainXYINC(pth,STR):
from pandas import read_csv, DataFrame
import os
WEB='/L... | 31.794521 | 112 | 0.605773 |
import twd97
Latitude_Pole, Longitude_Pole = 23.61000, 120.990
Xcent, Ycent = twd97.fromwgs84(Latitude_Pole, Longitude_Pole)
def twdIJ1(xv,yv):
return (int((xv-Xcent)/1000)+int(83*3/2))*1000+int((yv-Ycent)/1000)+int(137*3/2)
def terrainXYINC(pth,STR):
from pandas import read_csv, DataFrame
import os
WEB='/L... | true | true |
1c37220ee62e64d4ce2c17fdbb3b737d9e8b50e4 | 7,848 | py | Python | docs/conf.py | jimmysyss/cookiecutter | 945cb4c24b8e1dddded3de98013a6288d5ee056b | [
"MIT"
] | null | null | null | docs/conf.py | jimmysyss/cookiecutter | 945cb4c24b8e1dddded3de98013a6288d5ee056b | [
"MIT"
] | null | null | null | docs/conf.py | jimmysyss/cookiecutter | 945cb4c24b8e1dddded3de98013a6288d5ee056b | [
"MIT"
] | null | null | null | # CookieCutter documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that... | 32.163934 | 80 | 0.707569 |
import os
import sys
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'CookieCutter'
copyright = """2018, Daniel Roy Greenfeld"""
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# T... | true | true |
1c372218d7aa5cfffebbb9b7067fe2dd28384c63 | 486 | py | Python | portfolio_main/migrations/0005_auto_20180711_2119.py | lucasLB7/LucasPortfiolio | 6579c0622f1e071d41b497561e4261605978ffc6 | [
"Unlicense"
] | null | null | null | portfolio_main/migrations/0005_auto_20180711_2119.py | lucasLB7/LucasPortfiolio | 6579c0622f1e071d41b497561e4261605978ffc6 | [
"Unlicense"
] | 4 | 2020-02-12T01:07:27.000Z | 2021-06-08T19:10:47.000Z | portfolio_main/migrations/0005_auto_20180711_2119.py | lucasLB7/LucasPortfiolio | 6579c0622f1e071d41b497561e4261605978ffc6 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.14 on 2018-07-11 18:19
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('portfolio_main', '0004_resume_live_app_deployment'),
]
operations = [
migr... | 23.142857 | 62 | 0.633745 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('portfolio_main', '0004_resume_live_app_deployment'),
]
operations = [
migrations.AlterField(
model_name='resume',
name='ar... | true | true |
1c3722f576e3f0b7a472c92e35a478344f09b2bd | 26,692 | py | Python | src/pymwm/cylinder/__init__.py | mnishida/pymwm | 820d0a9056982fd37972b0e10f5dad9d1697ed2f | [
"MIT"
] | 3 | 2020-04-16T14:55:34.000Z | 2021-08-04T07:03:31.000Z | src/pymwm/cylinder/__init__.py | mnishida/pymwm | 820d0a9056982fd37972b0e10f5dad9d1697ed2f | [
"MIT"
] | 1 | 2021-08-13T04:45:50.000Z | 2021-08-18T03:33:08.000Z | src/pymwm/cylinder/__init__.py | mnishida/pymwm | 820d0a9056982fd37972b0e10f5dad9d1697ed2f | [
"MIT"
] | 2 | 2021-04-05T07:10:26.000Z | 2021-08-04T03:15:43.000Z | from __future__ import annotations
import cmath
import numpy as np
import psutil
import ray
import scipy.special as ssp
from pymwm.utils import cylinder_utils
from pymwm.waveguide import Database, Sampling, Waveguide
from .samples import Samples, SamplesForRay, SamplesLowLoss, SamplesLowLossForRay
class Cylinder(... | 39.838806 | 87 | 0.469804 | from __future__ import annotations
import cmath
import numpy as np
import psutil
import ray
import scipy.special as ssp
from pymwm.utils import cylinder_utils
from pymwm.waveguide import Database, Sampling, Waveguide
from .samples import Samples, SamplesForRay, SamplesLowLoss, SamplesLowLossForRay
class Cylinder(... | true | true |
1c372394c43365cc6edb330992a413a6145abc03 | 15,760 | py | Python | homeassistant/setup.py | tafehe/ha-core | 2478ec887aba87842bf52969b7ab1137826f7b98 | [
"Apache-2.0"
] | 5 | 2020-10-08T12:59:44.000Z | 2021-12-28T06:46:25.000Z | homeassistant/setup.py | tafehe/ha-core | 2478ec887aba87842bf52969b7ab1137826f7b98 | [
"Apache-2.0"
] | 75 | 2020-08-05T07:22:42.000Z | 2022-03-23T21:54:57.000Z | homeassistant/setup.py | winning1120xx/home-assistant | 53d4c0ce2d374b5e97bbdc37742656c27adf8eea | [
"Apache-2.0"
] | 1 | 2021-08-01T06:12:13.000Z | 2021-08-01T06:12:13.000Z | """All methods needed to bootstrap a Home Assistant instance."""
from __future__ import annotations
import asyncio
from collections.abc import Awaitable, Generator, Iterable
import contextlib
import logging.handlers
from timeit import default_timer as timer
from types import ModuleType
from typing import Callable
fro... | 32.361396 | 88 | 0.656789 | from __future__ import annotations
import asyncio
from collections.abc import Awaitable, Generator, Iterable
import contextlib
import logging.handlers
from timeit import default_timer as timer
from types import ModuleType
from typing import Callable
from homeassistant import config as conf_util, core, loader, require... | true | true |
1c3723b9d06e9defea155a9527cedb42fac01add | 975 | py | Python | tests/integration/test_catboost_model_first_evaluate/test.py | uniquechao/ClickHouse | 1533f9b9aad3e8e6135179f11b4d8fdc99ce4be6 | [
"Apache-2.0"
] | 18 | 2021-05-29T01:12:33.000Z | 2021-11-18T12:34:48.000Z | tests/integration/test_catboost_model_first_evaluate/test.py | uniquechao/ClickHouse | 1533f9b9aad3e8e6135179f11b4d8fdc99ce4be6 | [
"Apache-2.0"
] | 13 | 2019-06-06T09:45:53.000Z | 2020-05-15T12:03:45.000Z | tests/integration/test_catboost_model_first_evaluate/test.py | uniquechao/ClickHouse | 1533f9b9aad3e8e6135179f11b4d8fdc99ce4be6 | [
"Apache-2.0"
] | 22 | 2019-06-14T10:31:51.000Z | 2020-10-12T14:57:44.000Z | import os
import sys
import time
import pytest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance('node', stay_alive=T... | 26.351351 | 115 | 0.718974 | import os
import sys
import time
import pytest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__)
node = cluster.add_instance('node', stay_alive=T... | true | true |
1c372400c2ae24bca1f8114ea4e25800791a55a6 | 1,663 | py | Python | src/test_wrapped_jira_connection_stub.py | riptano/argus | df1f7e772cdaa78632faff8198a12f8947f1dc6d | [
"Apache-2.0"
] | 2 | 2018-02-05T18:13:32.000Z | 2018-04-23T17:08:20.000Z | src/test_wrapped_jira_connection_stub.py | riptano/argus | df1f7e772cdaa78632faff8198a12f8947f1dc6d | [
"Apache-2.0"
] | 119 | 2018-02-20T21:15:43.000Z | 2019-03-08T20:43:10.000Z | src/test_wrapped_jira_connection_stub.py | riptano/argus | df1f7e772cdaa78632faff8198a12f8947f1dc6d | [
"Apache-2.0"
] | 6 | 2018-02-01T23:01:20.000Z | 2019-12-26T15:35:32.000Z | # Copyright 2018 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 31.377358 | 95 | 0.667468 |
from typing import List
from jira import Issue
from jira.client import Project, ResultList
class TestWrappedJiraConnectionStub:
name_prefix = 1
def __init__(self) -> None:
self.prefix = TestWrappedJiraConnectionStub.name_prefix
TestWrappedJiraConnectionStub.name_prefix += 1
... | true | true |
1c37250c9fe8592bfe185b5e47473cb8c7e53064 | 263 | py | Python | src/utoolbox/io/dataset/__init__.py | thhsieh00/utoolbox-core | e46704348d60985c205a16f41788d2c185e11fb6 | [
"Apache-2.0"
] | 3 | 2020-08-21T02:34:32.000Z | 2021-04-06T06:56:46.000Z | src/utoolbox/io/dataset/__init__.py | liuyenting/utoolbox-core | d1430967458204b99780c547eaca60d066490946 | [
"Apache-2.0"
] | null | null | null | src/utoolbox/io/dataset/__init__.py | liuyenting/utoolbox-core | d1430967458204b99780c547eaca60d066490946 | [
"Apache-2.0"
] | null | null | null | from .base import (
MultiChannelDatasetIterator,
MultiViewDatasetIterator,
TiledDatasetIterator,
TimeSeriesDatasetIterator,
)
from .bdv import *
from .latticescope import *
from .mm import *
from .smartspim import *
from .zarr import *
| 21.916667 | 33 | 0.722433 | from .base import (
MultiChannelDatasetIterator,
MultiViewDatasetIterator,
TiledDatasetIterator,
TimeSeriesDatasetIterator,
)
from .bdv import *
from .latticescope import *
from .mm import *
from .smartspim import *
from .zarr import *
| true | true |
1c3726518d310309c85699905ba246185a641c02 | 9,110 | py | Python | buildingspy/tests/test_simulate_Dymola.py | lbl-srg/BuildingsPy | 27d3c76a0974a70f06fc477cdb7d90f19f8f4552 | [
"BSD-3-Clause-LBNL"
] | 66 | 2015-01-26T15:57:05.000Z | 2022-03-24T18:43:01.000Z | buildingspy/tests/test_simulate_Dymola.py | lbl-srg/BuildingsPy | 27d3c76a0974a70f06fc477cdb7d90f19f8f4552 | [
"BSD-3-Clause-LBNL"
] | 259 | 2015-01-06T21:37:52.000Z | 2022-03-07T18:02:38.000Z | buildingspy/tests/test_simulate_Dymola.py | lbl-srg/BuildingsPy | 27d3c76a0974a70f06fc477cdb7d90f19f8f4552 | [
"BSD-3-Clause-LBNL"
] | 34 | 2015-01-14T11:35:57.000Z | 2022-03-15T22:10:25.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
import unittest
import os
from buildingspy.simulate.Dymola import Simulator
def _simulate(cas):
"""
Class to simulate models. This needs to be at the top-level for multiprocessing
to be able to serialize it.
"""
from buildingspy.simulate.Dymola impor... | 34.770992 | 101 | 0.602086 |
import unittest
import os
from buildingspy.simulate.Dymola import Simulator
def _simulate(cas):
from buildingspy.simulate.Dymola import Simulator
packagePath = os.path.abspath(os.path.join("buildingspy", "tests"))
s = Simulator(cas['model'], outputDirectory=f"out-{cas['tol']}", packagePath=packagePath... | true | true |
1c3727033a8d05e6d0f8cdbbab323598d378be11 | 9,487 | py | Python | Shear_Ratio_Test/cosmology.py | KiDS-WL/Cat_to_Obs_K1000_P1 | 0de7f79cab150416859ffe58ac2d0f5659aedb5d | [
"MIT"
] | 7 | 2020-11-18T12:58:03.000Z | 2021-07-01T08:54:29.000Z | Shear_Ratio_Test/cosmology.py | KiDS-WL/Cat_to_Obs_K1000_P1 | 0de7f79cab150416859ffe58ac2d0f5659aedb5d | [
"MIT"
] | null | null | null | Shear_Ratio_Test/cosmology.py | KiDS-WL/Cat_to_Obs_K1000_P1 | 0de7f79cab150416859ffe58ac2d0f5659aedb5d | [
"MIT"
] | 3 | 2020-12-09T13:30:22.000Z | 2022-03-02T01:40:13.000Z | #!/usr/bin/env python
# From Hendrik
import math, string, sys, os
import scipy
import scipy.integrate
def norm(k_vec): # the norm of a 3d vector
return math.sqrt(k_vec[0]**2+k_vec[1]**2+k_vec[2]**2)
def W_k(k_vec): # the Fourier transform of the survey volume
a=k_vec[0]*l[0]/2
b=k_vec[1]*l[1]/2
c=k_v... | 41.069264 | 137 | 0.592495 |
import math, string, sys, os
import scipy
import scipy.integrate
def norm(k_vec):
return math.sqrt(k_vec[0]**2+k_vec[1]**2+k_vec[2]**2)
def W_k(k_vec):
a=k_vec[0]*l[0]/2
b=k_vec[1]*l[1]/2
c=k_vec[2]**2*l[2]**2/2
return exp(-c)*math.sin(a)/a*math.sin(b)/b
def f_k(k,R):
y=R*k
return 3... | true | true |
1c37285a602b682b314ecd6fd1b1d5a9221fd720 | 2,215 | py | Python | coeusfactory/ConnectorFactory.py | mamerisawesome/coeusfactory | 73530e118a9354b8b91f8d4a59f7f025008f366d | [
"MIT"
] | 1 | 2020-02-19T03:03:32.000Z | 2020-02-19T03:03:32.000Z | coeusfactory/ConnectorFactory.py | mamerisawesome/coeusfactory | 73530e118a9354b8b91f8d4a59f7f025008f366d | [
"MIT"
] | null | null | null | coeusfactory/ConnectorFactory.py | mamerisawesome/coeusfactory | 73530e118a9354b8b91f8d4a59f7f025008f366d | [
"MIT"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
class ConnectorFactory():
def __init__(self, interface=None, raw_name=False, **kwargs):
if not interface:
logger.warning("No database interface selected")
self.handler = None
return None
from pubsub import pub... | 35.15873 | 77 | 0.623025 | import logging
logger = logging.getLogger(__name__)
class ConnectorFactory():
def __init__(self, interface=None, raw_name=False, **kwargs):
if not interface:
logger.warning("No database interface selected")
self.handler = None
return None
from pubsub import pub... | true | true |
1c3728df0c54b1c7cd720de32f058a8438ed26a4 | 4,103 | py | Python | pinax/apps/signup_codes/views.py | peiwei/pinax | 34f95b1df4318655fe9bd90dcda8fe824e0c4117 | [
"MIT"
] | 1 | 2019-02-12T04:45:09.000Z | 2019-02-12T04:45:09.000Z | pinax/apps/signup_codes/views.py | peiwei/pinax | 34f95b1df4318655fe9bd90dcda8fe824e0c4117 | [
"MIT"
] | null | null | null | pinax/apps/signup_codes/views.py | peiwei/pinax | 34f95b1df4318655fe9bd90dcda8fe824e0c4117 | [
"MIT"
] | 1 | 2019-02-12T04:45:40.000Z | 2019-02-12T04:45:40.000Z | from django.conf import settings
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils.translation import ugettext
from django.contrib import messages
from django.contrib.admin.views.decorators import staff_member_requi... | 31.320611 | 92 | 0.62369 | from django.conf import settings
from django.http import HttpResponseRedirect
from django.shortcuts import render_to_response
from django.template import RequestContext
from django.utils.translation import ugettext
from django.contrib import messages
from django.contrib.admin.views.decorators import staff_member_requi... | true | true |
1c3728f11e3a370fa5a01f074d2e0ec86fb69378 | 3,286 | py | Python | src/OCSBttrack/BTcrypto.py | stevenshiau/ocs-bttrack | d19c025f2eff9fd6c9a6f95584c3f4ecabdb1467 | [
"MIT"
] | 3 | 2018-05-29T20:20:57.000Z | 2021-01-28T06:48:37.000Z | src/OCSBttrack/BTcrypto.py | stevenshiau/ocs-bttrack | d19c025f2eff9fd6c9a6f95584c3f4ecabdb1467 | [
"MIT"
] | null | null | null | src/OCSBttrack/BTcrypto.py | stevenshiau/ocs-bttrack | d19c025f2eff9fd6c9a6f95584c3f4ecabdb1467 | [
"MIT"
] | 2 | 2020-07-29T22:17:07.000Z | 2021-06-08T14:57:03.000Z | # Written by John Hoffman
# based on code by Uoti Urpala
# see LICENSE.txt for license information
from __future__ import generators # for python 2.2
from random import randrange,randint,seed
try:
from os import urandom
urandom(1)
except:
seed()
urandom = lambda x: ''.join([chr(randint(0,2... | 30.425926 | 206 | 0.614729 |
from __future__ import generators
from random import randrange,randint,seed
try:
from os import urandom
urandom(1)
except:
seed()
urandom = lambda x: ''.join([chr(randint(0,255)) for i in xrange(x)])
try:
from hashlib import sha1 as sha
except ImportError:
from sha import sha
... | false | true |
1c3729e83c584d1e74615514deac2b24c5a0a105 | 627 | py | Python | python-lib/dku_model_accessor/constants.py | dataiku/dss-plugin-model-fairness-report | a1405aa5790083a90565c897e91c156ad1f23ab9 | [
"Apache-2.0"
] | 1 | 2021-02-26T20:03:27.000Z | 2021-02-26T20:03:27.000Z | python-lib/dku_model_accessor/constants.py | dataiku/dss-plugin-model-fairness-report | a1405aa5790083a90565c897e91c156ad1f23ab9 | [
"Apache-2.0"
] | 2 | 2020-11-12T09:26:56.000Z | 2021-05-20T08:32:04.000Z | python-lib/dku_model_accessor/constants.py | dataiku/dss-plugin-model-fairness-report | a1405aa5790083a90565c897e91c156ad1f23ab9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
class DkuModelAccessorConstants(object):
MODEL_ID = 'model_id'
VERSION_ID = 'version_id'
REGRRSSION_TYPE = 'REGRESSION'
CLASSIFICATION_TYPE = 'CLASSIFICATION'
CLUSTERING_TYPE = 'CLUSTERING'
ORIGINAL_DATASET = 'original_dataset'
NEW_DATASET = 'new_dataset'
MIN... | 24.115385 | 51 | 0.701754 |
class DkuModelAccessorConstants(object):
MODEL_ID = 'model_id'
VERSION_ID = 'version_id'
REGRRSSION_TYPE = 'REGRESSION'
CLASSIFICATION_TYPE = 'CLASSIFICATION'
CLUSTERING_TYPE = 'CLUSTERING'
ORIGINAL_DATASET = 'original_dataset'
NEW_DATASET = 'new_dataset'
MIN_NUM_ROWS = 500
MAX... | true | true |
1c372a0d5049c595b66a0fb7771aacf845d485f5 | 8,994 | py | Python | quadruplet_utils.py | ikathuria/SignatureVerification | 4d0f26eb2652ecdf8cd5a679c6d3468046ab0d88 | [
"MIT"
] | 4 | 2021-07-07T21:59:01.000Z | 2022-01-24T09:37:40.000Z | quadruplet_utils.py | ikathuria/SignatureVerification | 4d0f26eb2652ecdf8cd5a679c6d3468046ab0d88 | [
"MIT"
] | null | null | null | quadruplet_utils.py | ikathuria/SignatureVerification | 4d0f26eb2652ecdf8cd5a679c6d3468046ab0d88 | [
"MIT"
] | null | null | null | """Quadruplet loss utility functions.
embedding_net
build_metric_network
QuadrupletLossLayer
build_quadruplet_model
compute_l2_dist
compute_probs
compute_metrics
find_nearest
draw_roc
draw_eval_quadruplets
"""
import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import math
import numpy as np
from tqdm import tqdm
imp... | 32.824818 | 193 | 0.642095 | import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import math
import numpy as np
from tqdm import tqdm
import keras.backend as K
from tensorflow.keras.models import Sequential, Model
from tensorflow.keras.layers import Input, concatenate, Layer
from tensorflow.keras.layers import Conv2D, MaxPooling2D, Lambda, Flatte... | true | true |
1c372a84d0c0a66c44b636fe394d8e5f211640fb | 8,612 | py | Python | test.py | sile16/purerackdiagram | e97b64dc7cd4e0309c01f252225b5639977df00f | [
"MIT"
] | 2 | 2019-01-17T15:59:42.000Z | 2020-02-25T03:45:51.000Z | test.py | sile16/purerackdiagram | e97b64dc7cd4e0309c01f252225b5639977df00f | [
"MIT"
] | null | null | null | test.py | sile16/purerackdiagram | e97b64dc7cd4e0309c01f252225b5639977df00f | [
"MIT"
] | 3 | 2019-01-17T15:59:46.000Z | 2020-10-29T18:11:21.000Z | from pprint import pprint
import logging
import base64
from multiprocessing import Pool
import hashlib
import io
import os
import lambdaentry
from purerackdiagram.utils import global_config
import purerackdiagram
import json
import traceback
logger = logging.getLogger()
ch = logging.StreamHandler()
ch.setLevel(logging... | 26.176292 | 97 | 0.458895 | from pprint import pprint
import logging
import base64
from multiprocessing import Pool
import hashlib
import io
import os
import lambdaentry
from purerackdiagram.utils import global_config
import purerackdiagram
import json
import traceback
logger = logging.getLogger()
ch = logging.StreamHandler()
ch.setLevel(logging... | true | true |
1c372b563caf36fc15b7df371635d5eee730660e | 547 | py | Python | contributors.py | neerajp99/pycodes | ecb3ad0cecfcf344f8ea92cedba399763f787ce9 | [
"MIT"
] | null | null | null | contributors.py | neerajp99/pycodes | ecb3ad0cecfcf344f8ea92cedba399763f787ce9 | [
"MIT"
] | null | null | null | contributors.py | neerajp99/pycodes | ecb3ad0cecfcf344f8ea92cedba399763f787ce9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Python script to get the list of all contributors
in a github repository
"""
import requests
import sys
if len(sys.argv) < 3:
print "Enter desired username and repo name"
exit(1)
baseURL = "https://api.github.com/repos/"
# https://api.github.com/repos/fossasia/gci15.fossasia.org/contri... | 18.233333 | 71 | 0.694698 |
"""
Python script to get the list of all contributors
in a github repository
"""
import requests
import sys
if len(sys.argv) < 3:
print "Enter desired username and repo name"
exit(1)
baseURL = "https://api.github.com/repos/"
username = sys.argv[1]
repo = sys.argv[2]
finalURL = baseURL + username + "/" + rep... | false | true |
1c372b939922eff63ff1df763d408ff650b3920b | 2,063 | py | Python | app/cache/lock.py | TouchPal/guldan | 74cc0bf687109d16c3eb94010b4cc25bd5c5bcc0 | [
"BSD-3-Clause"
] | 43 | 2017-12-27T13:20:15.000Z | 2021-04-15T03:02:03.000Z | app/cache/lock.py | TouchPal/guldan | 74cc0bf687109d16c3eb94010b4cc25bd5c5bcc0 | [
"BSD-3-Clause"
] | null | null | null | app/cache/lock.py | TouchPal/guldan | 74cc0bf687109d16c3eb94010b4cc25bd5c5bcc0 | [
"BSD-3-Clause"
] | 4 | 2018-03-28T08:46:07.000Z | 2018-10-12T09:33:38.000Z | # -*- coding: utf-8 -*-
import logging
import time
logger = logging.getLogger(__name__)
NOT_REGENERATED = object()
class Lock(object):
def __init__(
self,
mutex,
creator,
value_and_created_fn,
expiretime,
):
self.mutex = mutex
self.creator = creator
... | 25.469136 | 68 | 0.564712 |
import logging
import time
logger = logging.getLogger(__name__)
NOT_REGENERATED = object()
class Lock(object):
def __init__(
self,
mutex,
creator,
value_and_created_fn,
expiretime,
):
self.mutex = mutex
self.creator = creator
self.value_and_cre... | true | true |
1c372c30b6cb770005e3148b8bb715b36a15c0f5 | 230 | py | Python | pages/views.py | irahulgulati/Cryptoic | bd4a6e3d8dd9c383b350ca3496c4144c9a5f7200 | [
"MIT"
] | 1 | 2020-02-29T23:38:46.000Z | 2020-02-29T23:38:46.000Z | pages/views.py | irahulgulati/Cryptoic | bd4a6e3d8dd9c383b350ca3496c4144c9a5f7200 | [
"MIT"
] | 1 | 2020-03-23T00:00:41.000Z | 2020-03-23T00:00:41.000Z | pages/views.py | irahulgulati/Cryptoic | bd4a6e3d8dd9c383b350ca3496c4144c9a5f7200 | [
"MIT"
] | null | null | null | from django.http import HttpResponse
from django.shortcuts import render
# Create your views here.
def home_view(request, *args, **kwargs):
# return HttpResponse("<h1>Hello World</h1>")
return render(request,"home.html", {})
| 23 | 46 | 0.73913 | from django.http import HttpResponse
from django.shortcuts import render
def home_view(request, *args, **kwargs):
return render(request,"home.html", {})
| true | true |
1c372c90ee71850a70ae21000a9def3d42186ef1 | 7,624 | py | Python | flask_appbuilder/upload.py | zchencq/Flask-AppBuilder | 06dc6f85493ff75db21fb5f19e0a40be1b1172b0 | [
"BSD-3-Clause"
] | 1 | 2020-10-31T19:11:44.000Z | 2020-10-31T19:11:44.000Z | flask_appbuilder/upload.py | zchencq/Flask-AppBuilder | 06dc6f85493ff75db21fb5f19e0a40be1b1172b0 | [
"BSD-3-Clause"
] | null | null | null | flask_appbuilder/upload.py | zchencq/Flask-AppBuilder | 06dc6f85493ff75db21fb5f19e0a40be1b1172b0 | [
"BSD-3-Clause"
] | 1 | 2020-04-14T19:32:31.000Z | 2020-04-14T19:32:31.000Z | from flask_babel import gettext
from werkzeug.datastructures import FileStorage
from wtforms import fields, ValidationError
from wtforms.widgets import html_params, HTMLString
from .filemanager import FileManager, ImageManager
try:
from wtforms.fields.core import _unset_value as unset_value
except ImportError:
... | 31.504132 | 90 | 0.59575 | from flask_babel import gettext
from werkzeug.datastructures import FileStorage
from wtforms import fields, ValidationError
from wtforms.widgets import html_params, HTMLString
from .filemanager import FileManager, ImageManager
try:
from wtforms.fields.core import _unset_value as unset_value
except ImportError:
... | true | true |
1c372cbb8dc8e60a038c8382ff9a7f1df34661e3 | 15,918 | py | Python | hdmm/hdmm/templates.py | FumiyukiKato/PrivBTS | d2fae18588b24281d0968b8af09dc9295e73cdda | [
"Apache-2.0"
] | null | null | null | hdmm/hdmm/templates.py | FumiyukiKato/PrivBTS | d2fae18588b24281d0968b8af09dc9295e73cdda | [
"Apache-2.0"
] | null | null | null | hdmm/hdmm/templates.py | FumiyukiKato/PrivBTS | d2fae18588b24281d0968b8af09dc9295e73cdda | [
"Apache-2.0"
] | null | null | null | import numpy as np
from scipy import sparse, optimize
from scipy.sparse.linalg import spsolve_triangular, aslinearoperator
from hdmm import workload, approximation, implicit
import time
from functools import reduce
class TemplateStrategy:
"""
A template strategy is a space of strategies parameterized by some ... | 33.1625 | 174 | 0.572245 | import numpy as np
from scipy import sparse, optimize
from scipy.sparse.linalg import spsolve_triangular, aslinearoperator
from hdmm import workload, approximation, implicit
import time
from functools import reduce
class TemplateStrategy:
def __init__(self, theta0=None):
self.set_params(theta0)
d... | true | true |
1c372de3506f67236b280e392579b58017caeaa1 | 2,872 | py | Python | cnn.py | arupkpatel/HandGestureDetection | 2be7224a53a100c37b71e7a6333ed69f5729032a | [
"Apache-2.0"
] | null | null | null | cnn.py | arupkpatel/HandGestureDetection | 2be7224a53a100c37b71e7a6333ed69f5729032a | [
"Apache-2.0"
] | null | null | null | cnn.py | arupkpatel/HandGestureDetection | 2be7224a53a100c37b71e7a6333ed69f5729032a | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
config.gpu_options.per_process_gpu_memory_fraction = 0.3
set_session(tf.Session(config=config))
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooli... | 26.841121 | 115 | 0.707173 | import tensorflow as tf
from keras.backend.tensorflow_backend import set_session
config = tf.ConfigProto()
config.gpu_options.allow_growth = True
config.gpu_options.per_process_gpu_memory_fraction = 0.3
set_session(tf.Session(config=config))
from keras.models import Sequential
from keras.layers import Conv2D, MaxPooli... | true | true |
1c372e7911af2d48425eb1bb3bd4b30efc1e9ce6 | 536 | py | Python | projectmanager/migrations/0043_auto_20201007_1826.py | leonolan2020/phoenix | b5956a7003e548f01255cbd5d0d76cfd0ac77a81 | [
"MIT"
] | 1 | 2020-09-19T21:56:40.000Z | 2020-09-19T21:56:40.000Z | projectmanager/migrations/0043_auto_20201007_1826.py | leonolan2020/phoenix | b5956a7003e548f01255cbd5d0d76cfd0ac77a81 | [
"MIT"
] | null | null | null | projectmanager/migrations/0043_auto_20201007_1826.py | leonolan2020/phoenix | b5956a7003e548f01255cbd5d0d76cfd0ac77a81 | [
"MIT"
] | 5 | 2020-09-18T18:53:03.000Z | 2020-10-21T14:42:00.000Z | # Generated by Django 3.1 on 2020-10-07 14:56
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('projectmanager', '0042_auto_20201006_0242'),
]
operations = [
migrations.AlterField(
model_name='... | 26.8 | 161 | 0.664179 |
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('projectmanager', '0042_auto_20201006_0242'),
]
operations = [
migrations.AlterField(
model_name='material',
name='brand',
... | true | true |
1c37308f55115990d2a038110d5526d8dc981ec4 | 9,090 | py | Python | paper/scripts/emcee-comp/compare.py | dfm/rvhmc | 03c9aa6a28722989cf3a6da8963a54d1e1faa0cf | [
"Apache-2.0"
] | 1 | 2018-06-19T03:02:08.000Z | 2018-06-19T03:02:08.000Z | paper/scripts/emcee-comp/compare.py | dfm/rvhmc | 03c9aa6a28722989cf3a6da8963a54d1e1faa0cf | [
"Apache-2.0"
] | null | null | null | paper/scripts/emcee-comp/compare.py | dfm/rvhmc | 03c9aa6a28722989cf3a6da8963a54d1e1faa0cf | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function
import os
import sys
if len(sys.argv) > 1:
n_planets = int(sys.argv[1])
else:
n_planets = 1
dirname = "{0:02d}".format(n_planets)
if len(sys.argv) > 2:
version = int(sys.argv[2])
dirname = os.path.join(dirna... | 33.791822 | 79 | 0.579538 |
from __future__ import division, print_function
import os
import sys
if len(sys.argv) > 1:
n_planets = int(sys.argv[1])
else:
n_planets = 1
dirname = "{0:02d}".format(n_planets)
if len(sys.argv) > 2:
version = int(sys.argv[2])
dirname = os.path.join(dirname, "{0:04d}".format(version))
else:
ver... | true | true |
1c3730954f76b804a76e015b8e69d49472ad3f30 | 932 | py | Python | src/migrations/versions/8f63db3ad7a1_added_project_id_and_nanodegree_id_as_.py | Dev-Nebe/student-hub | fe6718aced065dab4bb8d92372bfe098c1a75137 | [
"MIT"
] | 3 | 2020-05-25T19:36:11.000Z | 2021-09-15T09:05:57.000Z | src/migrations/versions/8f63db3ad7a1_added_project_id_and_nanodegree_id_as_.py | Dev-Nebe/student-hub | fe6718aced065dab4bb8d92372bfe098c1a75137 | [
"MIT"
] | 1 | 2021-04-30T21:11:44.000Z | 2021-04-30T21:11:44.000Z | src/migrations/versions/8f63db3ad7a1_added_project_id_and_nanodegree_id_as_.py | Dev-Nebe/student-hub | fe6718aced065dab4bb8d92372bfe098c1a75137 | [
"MIT"
] | null | null | null | """Added project_id and nanodegree_id as indices on the question table
Revision ID: 8f63db3ad7a1
Revises: cbcb7906e58d
Create Date: 2020-05-21 20:45:11.073358
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '8f63db3ad7a1'
down_revision = 'cbcb7906e58d'
branch_l... | 30.064516 | 99 | 0.722103 | from alembic import op
import sqlalchemy as sa
revision = '8f63db3ad7a1'
down_revision = 'cbcb7906e58d'
branch_labels = None
depends_on = None
def upgrade():
unique=False)
| true | true |
1c373256733877a610ee969ef88496c29dd8a58b | 3,865 | py | Python | xcube_server/controllers/features.py | bcdev/xcube-server | d6fc4bef26ae1f6929904bad0f920b50ea6974f7 | [
"MIT"
] | null | null | null | xcube_server/controllers/features.py | bcdev/xcube-server | d6fc4bef26ae1f6929904bad0f920b50ea6974f7 | [
"MIT"
] | null | null | null | xcube_server/controllers/features.py | bcdev/xcube-server | d6fc4bef26ae1f6929904bad0f920b50ea6974f7 | [
"MIT"
] | null | null | null | import logging
from typing import Any, Dict, List
import shapely.geometry
import shapely.wkt
from shapely.errors import WKTReadingError
from ..context import ServiceContext
from ..errors import ServiceBadRequestError
from ..logtime import log_time
from ..utils import get_dataset_geometry, get_box_split_bounds_geometr... | 40.684211 | 102 | 0.627943 | import logging
from typing import Any, Dict, List
import shapely.geometry
import shapely.wkt
from shapely.errors import WKTReadingError
from ..context import ServiceContext
from ..errors import ServiceBadRequestError
from ..logtime import log_time
from ..utils import get_dataset_geometry, get_box_split_bounds_geometr... | true | true |
1c3732819a8a0879b9c05357b24f24810fe6f3b3 | 12,299 | py | Python | tests/models/test_model_core.py | mohammadul/tensorlayer | e17e49f03477d524ef688474fe9ddde044ca5cf5 | [
"Apache-2.0"
] | null | null | null | tests/models/test_model_core.py | mohammadul/tensorlayer | e17e49f03477d524ef688474fe9ddde044ca5cf5 | [
"Apache-2.0"
] | null | null | null | tests/models/test_model_core.py | mohammadul/tensorlayer | e17e49f03477d524ef688474fe9ddde044ca5cf5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import numpy as np
import tensorflow as tf
import tensorlayer as tl
from tensorlayer.layers import *
from tensorlayer.models import *
from tests.utils import CustomTestCase
def basic_static_model():
... | 30.824561 | 109 | 0.58086 |
import os
import unittest
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
import numpy as np
import tensorflow as tf
import tensorlayer as tl
from tensorlayer.layers import *
from tensorlayer.models import *
from tests.utils import CustomTestCase
def basic_static_model():
ni = Input((None, 24, 24, 3))
nn = Conv... | true | true |
1c3733713646a167c06cd428aed5d8d22838b7c9 | 15,437 | py | Python | experiment_variable_number_of_objects/theoritical_model_bag_of_words.py | gaetanmargueritte/ccg2esn | 3745ef23eb409837d20261045fad808af5ab82a8 | [
"CC0-1.0"
] | 3 | 2020-11-24T09:53:26.000Z | 2021-03-24T16:43:28.000Z | experiment_variable_number_of_objects/theoritical_model_bag_of_words.py | gaetanmargueritte/ccg2esn | 3745ef23eb409837d20261045fad808af5ab82a8 | [
"CC0-1.0"
] | null | null | null | experiment_variable_number_of_objects/theoritical_model_bag_of_words.py | gaetanmargueritte/ccg2esn | 3745ef23eb409837d20261045fad808af5ab82a8 | [
"CC0-1.0"
] | 1 | 2020-09-04T14:38:31.000Z | 2020-09-04T14:38:31.000Z |
import os
import sys
sys.path.append(r'..')
from sentence_to_predicate import WordPredicate
import json
import sentence_grounding_test_parameters as param
import numpy as np
from recognized_object import RecognizedObject
from plots import *
import time
import matplotlib.pyplot as plt
import math
... | 31.312373 | 145 | 0.65194 |
import os
import sys
sys.path.append(r'..')
from sentence_to_predicate import WordPredicate
import json
import sentence_grounding_test_parameters as param
import numpy as np
from recognized_object import RecognizedObject
from plots import *
import time
import matplotlib.pyplot as plt
import math
... | true | true |
1c3735ee86de43d9e7b5d9048eaa51889f53405d | 1,074 | py | Python | examples/vl6180x_simpletest.py | caternuson/Adafruit_CircuitPython_VL6180X | 74a7a7feccb6219e0e74dc31679242035743dda1 | [
"MIT"
] | null | null | null | examples/vl6180x_simpletest.py | caternuson/Adafruit_CircuitPython_VL6180X | 74a7a7feccb6219e0e74dc31679242035743dda1 | [
"MIT"
] | null | null | null | examples/vl6180x_simpletest.py | caternuson/Adafruit_CircuitPython_VL6180X | 74a7a7feccb6219e0e74dc31679242035743dda1 | [
"MIT"
] | null | null | null | # Demo of reading the range and lux from the VL6180x distance sensor and
# printing it every second.
# Author: Tony DiCola
import time
import board
import busio
import adafruit_vl6180x
# Create I2C bus.
i2c = busio.I2C(board.SCL, board.SDA)
# Create sensor instance.
sensor = adafruit_vl6180x.VL6180X(i2c)
# Main l... | 29.833333 | 72 | 0.716946 |
import time
import board
import busio
import adafruit_vl6180x
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_vl6180x.VL6180X(i2c)
while True:
range_mm = sensor.range
print('Range: {0}mm'.format(range_mm))
light_lux = sensor.read_lux(adaf... | true | true |
1c3736d3994d409ca62d707988d89ce6ffada63b | 5,915 | py | Python | snnpytorch/test/test_spike_raster.py | BorthakurAyon/snnpytorch | 212eea2d7cd80d9ebc709cc334ca28d165fc2861 | [
"MIT"
] | null | null | null | snnpytorch/test/test_spike_raster.py | BorthakurAyon/snnpytorch | 212eea2d7cd80d9ebc709cc334ca28d165fc2861 | [
"MIT"
] | null | null | null | snnpytorch/test/test_spike_raster.py | BorthakurAyon/snnpytorch | 212eea2d7cd80d9ebc709cc334ca28d165fc2861 | [
"MIT"
] | 1 | 2021-07-15T14:51:58.000Z | 2021-07-15T14:51:58.000Z | """
Test and Plot Spike Raster
===========================
"""
from snnpytorch.network.spiking_neural_network import SNN
from snnpytorch.dataset.spike_raster import SpikeRaster
from time import time as t
from torch.utils import data
from tqdm import tqdm
from pathlib import Path
import matplotlib.pyplot as plt
import... | 32.5 | 80 | 0.617413 |
from snnpytorch.network.spiking_neural_network import SNN
from snnpytorch.dataset.spike_raster import SpikeRaster
from time import time as t
from torch.utils import data
from tqdm import tqdm
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import argparse
import torch
import os
class Pipe... | true | true |
1c373713fc3a5944f43acb2535da70dd94dc5803 | 3,213 | py | Python | pulsar/apps/data/redis/lock.py | goodboy/pulsar | e4b42d94b7e262a165782747d65f8b39fb8d3ba9 | [
"BSD-3-Clause"
] | 1 | 2020-11-30T07:36:57.000Z | 2020-11-30T07:36:57.000Z | pulsar/apps/data/redis/lock.py | goodboy/pulsar | e4b42d94b7e262a165782747d65f8b39fb8d3ba9 | [
"BSD-3-Clause"
] | null | null | null | pulsar/apps/data/redis/lock.py | goodboy/pulsar | e4b42d94b7e262a165782747d65f8b39fb8d3ba9 | [
"BSD-3-Clause"
] | null | null | null | import uuid
from asyncio import sleep
from pulsar import isawaitable, LockError, LockBase
class RedisScript:
'''An executable Lua script object
'''
def __init__(self, script):
self.script = script
self.sha = None
async def __call__(self, client, keys=None, args=None):
'''Exec... | 30.894231 | 79 | 0.563336 | import uuid
from asyncio import sleep
from pulsar import isawaitable, LockError, LockBase
class RedisScript:
def __init__(self, script):
self.script = script
self.sha = None
async def __call__(self, client, keys=None, args=None):
if self.sha not in client.store.loaded_scripts:
... | true | true |
1c3737435236ccf4b4d3a8e05f591029381480cc | 2,534 | py | Python | __init__.py | Andndre/calcul | 3a7d51c0b793169e5efcd397768247d84d2c3c68 | [
"MIT"
] | 1 | 2022-01-03T02:27:58.000Z | 2022-01-03T02:27:58.000Z | __init__.py | Andndre/calcul | 3a7d51c0b793169e5efcd397768247d84d2c3c68 | [
"MIT"
] | null | null | null | __init__.py | Andndre/calcul | 3a7d51c0b793169e5efcd397768247d84d2c3c68 | [
"MIT"
] | null | null | null | import re
def calculate(input : str):
"""
Accepted operators and symbols:
`^` or `**`: power
`)` and `(`: brackets for computation ordering
`+`: add
`-`: subtract
`x` or `*`: multiply
`:` or `/`: divide
`,` or `.`: decimal
Args:
input (str): input
Raises:
SyntaxErr... | 21.474576 | 114 | 0.46764 | import re
def calculate(input : str):
if re.search(r'[^0-9+\-*/:()Xx^.,\s]', input):
raise SyntaxError('Accepts only numbers and symbols + - * x : / ) ( ^ . ,')
input = (
input
.replace('++', '+')
.replace('-+', '-')
.replace('+-', '-')
.replace('--', '+')
.replace('... | true | true |
1c3737f6d24a87545027d263c01427ba4c66fea5 | 6,266 | py | Python | troposphere/blueprints/security-groups-opc.py | pataraco/hart_challenge | 47872a17b5ade54620df92a27d0ece2a8dfa6f07 | [
"MIT"
] | null | null | null | troposphere/blueprints/security-groups-opc.py | pataraco/hart_challenge | 47872a17b5ade54620df92a27d0ece2a8dfa6f07 | [
"MIT"
] | 1 | 2021-05-10T21:34:20.000Z | 2021-05-10T21:34:20.000Z | troposphere/blueprints/security-groups-opc.py | pataraco/iac | 47872a17b5ade54620df92a27d0ece2a8dfa6f07 | [
"MIT"
] | 1 | 2017-05-28T10:45:14.000Z | 2017-05-28T10:45:14.000Z | #!/usr/bin/env python
"""Module with VPC security groups."""
from stacker.blueprints.base import Blueprint
from stacker.blueprints.variables.types import CFNString, EC2VPCId
from troposphere import ec2, Export, Join, Output, Ref, Sub, Tags
from utils import standalone_output, version # pylint: disable=relative-import... | 36.430233 | 79 | 0.437759 |
from stacker.blueprints.base import Blueprint
from stacker.blueprints.variables.types import CFNString, EC2VPCId
from troposphere import ec2, Export, Join, Output, Ref, Sub, Tags
from utils import standalone_output, version
class SecurityGroups(Blueprint):
VARIABLES = {
'CustomerName': {'type': CFNSt... | true | true |
1c3739bd387a9511930bdc26079a66d2550ad7c1 | 5,529 | py | Python | new_package/seed/generate_asdf_normal.py | ziyixi/SeisScripts | a484bc1747eae52b2441f0bfd47ac7e093150f1d | [
"MIT"
] | null | null | null | new_package/seed/generate_asdf_normal.py | ziyixi/SeisScripts | a484bc1747eae52b2441f0bfd47ac7e093150f1d | [
"MIT"
] | null | null | null | new_package/seed/generate_asdf_normal.py | ziyixi/SeisScripts | a484bc1747eae52b2441f0bfd47ac7e093150f1d | [
"MIT"
] | null | null | null | """
since always obspy may have problem in reading seed files, it's better to use rdseed to generate sac files and resp files.
"""
import pyasdf
from glob import glob
import obspy
import tempfile
from os.path import join
import subprocess
from loguru import logger
from obspy.io.xseed import Parser
def generate_asdf_... | 39.776978 | 129 | 0.629589 |
import pyasdf
from glob import glob
import obspy
import tempfile
from os.path import join
import subprocess
from loguru import logger
from obspy.io.xseed import Parser
def generate_asdf_for_single_event(seed_directory, cmt_path, output_path, with_mpi, logfile):
logger.add(logfile, format="{time} {level} {message... | true | true |
1c3739d9aebb85cd18276e43617d0ccfffa6040b | 30,411 | py | Python | pandas/tests/indexes/common.py | tyvich/pandas | 22de58e63f9271d4ddb2bf49d008c5a9550c5cc4 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/indexes/common.py | tyvich/pandas | 22de58e63f9271d4ddb2bf49d008c5a9550c5cc4 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/indexes/common.py | tyvich/pandas | 22de58e63f9271d4ddb2bf49d008c5a9550c5cc4 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | from __future__ import annotations
from datetime import datetime
import gc
import numpy as np
import pytest
from pandas._libs import iNaT
from pandas._libs.tslibs import Timestamp
from pandas.core.dtypes.common import (
is_datetime64tz_dtype,
is_float_dtype,
is_integer_dtype,
is_unsigned_integer_dty... | 34.557955 | 87 | 0.586827 | from __future__ import annotations
from datetime import datetime
import gc
import numpy as np
import pytest
from pandas._libs import iNaT
from pandas._libs.tslibs import Timestamp
from pandas.core.dtypes.common import (
is_datetime64tz_dtype,
is_float_dtype,
is_integer_dtype,
is_unsigned_integer_dty... | true | true |
1c3739e1c8ab202fd3a8ed769921786390cfedfc | 1,735 | py | Python | ingenico/direct/sdk/domain/payment_product130_specific_input.py | Ingenico/direct-sdk-python3 | d2b30b8e8afb307153a1f19ac4c054d5344449ce | [
"Apache-2.0"
] | null | null | null | ingenico/direct/sdk/domain/payment_product130_specific_input.py | Ingenico/direct-sdk-python3 | d2b30b8e8afb307153a1f19ac4c054d5344449ce | [
"Apache-2.0"
] | 1 | 2021-03-30T12:55:39.000Z | 2021-04-08T08:23:27.000Z | ingenico/direct/sdk/domain/payment_product130_specific_input.py | Ingenico/direct-sdk-python3 | d2b30b8e8afb307153a1f19ac4c054d5344449ce | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This class was auto-generated from the API references found at
# https://support.direct.ingenico.com/documentation/api/reference/
#
from ingenico.direct.sdk.data_object import DataObject
from ingenico.direct.sdk.domain.payment_product130_specific_three_d_secure import PaymentProduct130Specif... | 39.431818 | 130 | 0.729107 |
from ingenico.direct.sdk.data_object import DataObject
from ingenico.direct.sdk.domain.payment_product130_specific_three_d_secure import PaymentProduct130SpecificThreeDSecure
class PaymentProduct130SpecificInput(DataObject):
__three_d_secure = None
@property
def three_d_secure(self) -> PaymentProdu... | true | true |
1c373a77661fe261e373800cefead053054ae721 | 1,067 | py | Python | src/peopleapp/admin.py | robertsmoto/sodavault | 200e843be7abe6cc447647bba55c7c1309092e5e | [
"BSD-3-Clause"
] | null | null | null | src/peopleapp/admin.py | robertsmoto/sodavault | 200e843be7abe6cc447647bba55c7c1309092e5e | [
"BSD-3-Clause"
] | null | null | null | src/peopleapp/admin.py | robertsmoto/sodavault | 200e843be7abe6cc447647bba55c7c1309092e5e | [
"BSD-3-Clause"
] | null | null | null | from django.contrib import admin
# from .models import Company, Person
# class PersonInline(admin.StackedInline):
# model = Person
# # fields = [
# # ('gtin', 'isbn'),
# # ('pid_i', 'pid_c')
# # ]
# extra = 0
# verbose_name = "people"
# @admin.register(Person) ... | 21.34 | 81 | 0.451734 | from django.contrib import admin
| true | true |
1c373a83cf29a9784f9977e93c516c30db74deb6 | 4,674 | py | Python | src/linakdeskapp/gui/mpl/position_chart.py | nilp0inter/LinakDeskApp | 0cf287ee96002f5c270c087ba73b72c548baa8c5 | [
"MIT"
] | 121 | 2018-09-19T20:10:21.000Z | 2022-03-31T08:07:33.000Z | src/linakdeskapp/gui/mpl/position_chart.py | nilp0inter/LinakDeskApp | 0cf287ee96002f5c270c087ba73b72c548baa8c5 | [
"MIT"
] | 13 | 2020-02-19T15:58:37.000Z | 2022-03-05T03:20:42.000Z | src/linakdeskapp/gui/mpl/position_chart.py | nilp0inter/LinakDeskApp | 0cf287ee96002f5c270c087ba73b72c548baa8c5 | [
"MIT"
] | 12 | 2020-02-13T23:55:30.000Z | 2022-01-30T15:11:31.000Z | # MIT License
#
# Copyright (c) 2017 Arkadiusz Netczuk <dev.arnet@gmail.com>
#
# 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
# t... | 32.915493 | 93 | 0.624519 |
import logging
try:
import pandas
except ImportError:
")
exit(1)
from .mpl_canvas import matplotlib, DynamicMplCanvas
_LOGGER = logging.getLogger(__name__)
class PositionChart(DynamicMplCanvas):
def __init__(self, parentWidget=None):
super().__init__(parentWidget, ... | true | true |
1c373b8d3ccf35c4f9a5a0b930c514b21d09ee44 | 7,468 | py | Python | tf_impl/train_SANNE.py | daiquocnguyen/Walk-Transformer | dc234811dc61bb4d1df7e2d0960be776e2a2b2ac | [
"Apache-2.0"
] | 22 | 2020-06-08T16:23:00.000Z | 2021-11-10T11:13:18.000Z | tf_impl/train_SANNE.py | daiquocnguyen/Node-Transformer | dc234811dc61bb4d1df7e2d0960be776e2a2b2ac | [
"Apache-2.0"
] | 1 | 2021-01-24T15:11:23.000Z | 2021-01-24T15:11:23.000Z | tf_impl/train_SANNE.py | daiquocnguyen/Node-Transformer | dc234811dc61bb4d1df7e2d0960be776e2a2b2ac | [
"Apache-2.0"
] | 5 | 2020-06-09T08:03:35.000Z | 2021-09-28T11:14:06.000Z | #! /usr/bin/env python
import tensorflow as tf
import numpy as np
import os
import time
import datetime
from model_SANNE_squash import SANNE
import pickle as cPickle
from utils import *
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
np.random.seed(123456789)
tf.set_random_seed(123456789)
# Paramet... | 44.718563 | 129 | 0.63819 |
import tensorflow as tf
import numpy as np
import os
import time
import datetime
from model_SANNE_squash import SANNE
import pickle as cPickle
from utils import *
from argparse import ArgumentParser, ArgumentDefaultsHelpFormatter
np.random.seed(123456789)
tf.set_random_seed(123456789)
parser = ArgumentParser("SAN... | true | true |
1c373bc712a9957c5102c096cfc4e643dc9cdcd9 | 267 | py | Python | options/constants.py | marcosgabarda/django-options | 285744850510610f4e5cbad51eefd2461f6d969c | [
"MIT"
] | 4 | 2018-08-09T13:41:25.000Z | 2021-03-25T15:47:12.000Z | options/constants.py | marcosgabarda/django-options | 285744850510610f4e5cbad51eefd2461f6d969c | [
"MIT"
] | 5 | 2019-06-29T08:19:24.000Z | 2021-03-25T08:51:41.000Z | options/constants.py | marcosgabarda/django-options | 285744850510610f4e5cbad51eefd2461f6d969c | [
"MIT"
] | 2 | 2019-06-27T22:12:48.000Z | 2020-07-10T07:52:24.000Z | from django.utils.translation import gettext_lazy as _
FLOAT, INT, STR, FILE = (0, 1, 2, 3)
TYPE_CHOICES = (
(FLOAT, _("Float")),
(INT, _("Integer")),
(STR, _("String")),
(FILE, _("File")),
)
CONVERTER = {INT: int, FLOAT: float, STR: str, FILE: str}
| 24.272727 | 57 | 0.588015 | from django.utils.translation import gettext_lazy as _
FLOAT, INT, STR, FILE = (0, 1, 2, 3)
TYPE_CHOICES = (
(FLOAT, _("Float")),
(INT, _("Integer")),
(STR, _("String")),
(FILE, _("File")),
)
CONVERTER = {INT: int, FLOAT: float, STR: str, FILE: str}
| true | true |
1c373bd2e2abb5a30aa8d41c0d711e13bd89bebf | 397 | py | Python | djangoDemo/wsgi.py | ttdys108/django-demo | 9a1c18b4bf7d92f1b122222d1777424fac2aba2d | [
"Apache-2.0"
] | 8 | 2020-02-04T11:23:26.000Z | 2021-10-20T05:38:08.000Z | djangoDemo/wsgi.py | DeSireFire/simpleDjango3-adminLTE | 8509b576544b6fe8f0134ae2f5af127a005ab240 | [
"MIT"
] | null | null | null | djangoDemo/wsgi.py | DeSireFire/simpleDjango3-adminLTE | 8509b576544b6fe8f0134ae2f5af127a005ab240 | [
"MIT"
] | null | null | null | """
WSGI config for djangoDemo project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SE... | 23.352941 | 78 | 0.788413 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangoDemo.settings')
application = get_wsgi_application()
| true | true |
1c373cbe1e3abecb9da944ff3fafb3694b4d1522 | 48,431 | py | Python | raiden/api/python.py | BOR4/raiden | d72e32806fe3b73e5fa6a00843f3f5e41be4448b | [
"MIT"
] | null | null | null | raiden/api/python.py | BOR4/raiden | d72e32806fe3b73e5fa6a00843f3f5e41be4448b | [
"MIT"
] | null | null | null | raiden/api/python.py | BOR4/raiden | d72e32806fe3b73e5fa6a00843f3f5e41be4448b | [
"MIT"
] | null | null | null | import gevent
import structlog
from eth_utils import is_binary_address
from raiden import waiting
from raiden.api.exceptions import ChannelNotFound, NonexistingChannel
from raiden.constants import NULL_ADDRESS_BYTES, UINT64_MAX, UINT256_MAX
from raiden.exceptions import (
AlreadyRegisteredTokenAddress,
Deposit... | 40.091887 | 99 | 0.670191 | import gevent
import structlog
from eth_utils import is_binary_address
from raiden import waiting
from raiden.api.exceptions import ChannelNotFound, NonexistingChannel
from raiden.constants import NULL_ADDRESS_BYTES, UINT64_MAX, UINT256_MAX
from raiden.exceptions import (
AlreadyRegisteredTokenAddress,
Deposit... | true | true |
1c373dd0d127a633c7497cc5b0d9eec268b0977d | 4,534 | py | Python | data/train/python/c6121a7ca78a1a55a7232b13b709dce7aac3c5c9intelliRepository.py | harshp8l/deep-learning-lang-detection | 2a54293181c1c2b1a2b840ddee4d4d80177efb33 | [
"MIT"
] | 84 | 2017-10-25T15:49:21.000Z | 2021-11-28T21:25:54.000Z | data/train/python/c6121a7ca78a1a55a7232b13b709dce7aac3c5c9intelliRepository.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 5 | 2018-03-29T11:50:46.000Z | 2021-04-26T13:33:18.000Z | data/train/python/c6121a7ca78a1a55a7232b13b709dce7aac3c5c9intelliRepository.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 24 | 2017-11-22T08:31:00.000Z | 2022-03-27T01:22:31.000Z | '''
Represents a GitHub repository
@since 1.0
@author Oskar Jarczyk
'''
class MyRepository():
element_type = 'Team'
key = None
def __init__(self):
self.data = []
repository_branches = None
repository_commits = None
repository_contributors = None
repository_created_at = None
... | 26.670588 | 101 | 0.701147 |
class MyRepository():
element_type = 'Team'
key = None
def __init__(self):
self.data = []
repository_branches = None
repository_commits = None
repository_contributors = None
repository_created_at = None
repository_description = None
repository_fork = None
repository_... | true | true |
1c373ec95eda5483719d28073d1e4fe47ee6d6e0 | 2,252 | py | Python | openGaussBase/testcase/SQL/DML/set/Opengauss_Function_DML_Set_Case0132.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/SQL/DML/set/Opengauss_Function_DML_Set_Case0132.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/SQL/DML/set/Opengauss_Function_DML_Set_Case0132.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 38.169492 | 115 | 0.6754 | import sys
import unittest
sys.path.append(sys.path[0]+"/../")
from testcase.utils.Logger import Logger
from testcase.utils.Constant import Constant
from testcase.utils.CommonSH import CommonSH
logger = Logger()
commonsh = CommonSH('dbuser')
constant = Constant()
class SYS_Operation(unittest.TestCase):
def setUp... | true | true |
1c373f5fc0448b5ede6756285a99d5e803ce14b2 | 2,169 | py | Python | rbig/_src/model.py | IPL-UV/rb | 092d78a0ea5f9670c5cd4f70ff054ec58ff309af | [
"MIT"
] | 6 | 2020-10-14T08:35:29.000Z | 2022-02-18T23:26:30.000Z | rbig/_src/model.py | IPL-UV/rb | 092d78a0ea5f9670c5cd4f70ff054ec58ff309af | [
"MIT"
] | 11 | 2020-10-08T10:02:38.000Z | 2021-03-26T16:00:41.000Z | rbig/_src/model.py | IPL-UV/rbig | 092d78a0ea5f9670c5cd4f70ff054ec58ff309af | [
"MIT"
] | null | null | null | from typing import Union
import numpy as np
from scipy.stats import multivariate_normal
from rbig._src.total_corr import information_reduction
from rbig._src.training import train_rbig_info_loss
from rbig._src.uniform import MarginalHistogramUniformization
from rbig._src.invcdf import InverseGaussCDF
from rbig._src.rot... | 30.125 | 61 | 0.646842 | from typing import Union
import numpy as np
from scipy.stats import multivariate_normal
from rbig._src.total_corr import information_reduction
from rbig._src.training import train_rbig_info_loss
from rbig._src.uniform import MarginalHistogramUniformization
from rbig._src.invcdf import InverseGaussCDF
from rbig._src.rot... | true | true |
1c373fccd56b7e01a344247d3f3023ebcbaa5996 | 5,989 | py | Python | speech/google/cloud/speech_v1p1beta1/gapic/transports/speech_grpc_transport.py | ryanyuan/google-cloud-python | db481bfdd6816d020d99df0d4caa307358ab1141 | [
"Apache-2.0"
] | 2 | 2021-11-26T07:08:43.000Z | 2022-03-07T20:20:04.000Z | speech/google/cloud/speech_v1p1beta1/gapic/transports/speech_grpc_transport.py | ryanyuan/google-cloud-python | db481bfdd6816d020d99df0d4caa307358ab1141 | [
"Apache-2.0"
] | null | null | null | speech/google/cloud/speech_v1p1beta1/gapic/transports/speech_grpc_transport.py | ryanyuan/google-cloud-python | db481bfdd6816d020d99df0d4caa307358ab1141 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 37.666667 | 86 | 0.648355 |
import google.api_core.grpc_helpers
import google.api_core.operations_v1
from google.cloud.speech_v1p1beta1.proto import cloud_speech_pb2_grpc
class SpeechGrpcTransport(object):
_OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",)
def __init__(
self, channe... | true | true |
1c374061e51e46e86b91f48bd6e4f6110154e3f5 | 661 | py | Python | Basic/DataType.py | samreachyan/programiz-python | cc518e196569918560276369046d755def7957fc | [
"MIT"
] | null | null | null | Basic/DataType.py | samreachyan/programiz-python | cc518e196569918560276369046d755def7957fc | [
"MIT"
] | null | null | null | Basic/DataType.py | samreachyan/programiz-python | cc518e196569918560276369046d755def7957fc | [
"MIT"
] | null | null | null | from fractions import Fraction as F
import math
print(F(1,3) + F(1,3))
print(1 / F(5, 6))
print(F(-3, 10) > 0)
print(F(-3, 10) < 0)
print(math.cos(math.pi * 2))
# list with mixed data types
my_list = [1, "Hello", 3.4]
print(my_list[1])
x = [1, 2, 4, 3, 16, 32, 64, 128, 256, 512]
pow = [2 ** v for v in x] # pow = ... | 19.441176 | 43 | 0.606657 | from fractions import Fraction as F
import math
print(F(1,3) + F(1,3))
print(1 / F(5, 6))
print(F(-3, 10) > 0)
print(F(-3, 10) < 0)
print(math.cos(math.pi * 2))
my_list = [1, "Hello", 3.4]
print(my_list[1])
x = [1, 2, 4, 3, 16, 32, 64, 128, 256, 512]
pow = [2 ** v for v in x]
for i in pow: print(i)
'programiz'... | true | true |
1c37408d1343db5b7eb476dd0f0b7517d4bd1379 | 1,138 | py | Python | djimix/bin/get_uuid.py | carthage-college/django-djimix | 8febd4ba9934f6830b7ff6d2dbfb6c1faec3eed5 | [
"MIT"
] | null | null | null | djimix/bin/get_uuid.py | carthage-college/django-djimix | 8febd4ba9934f6830b7ff6d2dbfb6c1faec3eed5 | [
"MIT"
] | 9 | 2020-03-29T15:01:10.000Z | 2021-12-01T21:23:02.000Z | djimix/bin/get_uuid.py | carthage-college/django-djimix | 8febd4ba9934f6830b7ff6d2dbfb6c1faec3eed5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import argparse
import os
import sys
from django.conf import settings
from djimix.core.database import get_connection
from djimix.core.database import xsql
# set up command-line options
desc = """
Accepts as input an email.
"""
# RawTextHelpFormatter method allows for new lines in help ... | 20.321429 | 71 | 0.665202 |
import argparse
import os
import sys
from django.conf import settings
from djimix.core.database import get_connection
from djimix.core.database import xsql
desc = """
Accepts as input an email.
"""
parser = argparse.ArgumentParser(
description=desc, formatter_class=argparse.RawTextHelpFormatter
)
parse... | true | true |
1c37410ce90da7bcb198a62afb542c9b8a091ca7 | 860 | py | Python | units/prefix/loader/compile.py | hoefkensj/BTRWin | 1432868ad60155f5ae26f33903a890497e089480 | [
"MIT"
] | null | null | null | units/prefix/loader/compile.py | hoefkensj/BTRWin | 1432868ad60155f5ae26f33903a890497e089480 | [
"MIT"
] | null | null | null | units/prefix/loader/compile.py | hoefkensj/BTRWin | 1432868ad60155f5ae26f33903a890497e089480 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import subprocess,argparse
def getargs(): #get arguments from commandline
parser=argparse.ArgumentParser()
parser.add_argument('-i','--follow-imports',action='store_true' ,help='--follow imports')
parser.add_argument('-1', '--onefile', action='store_true' ,help='--onefile')
parser.add_argumen... | 30.714286 | 136 | 0.716279 |
import subprocess,argparse
def getargs():
parser=argparse.ArgumentParser()
parser.add_argument('-i','--follow-imports',action='store_true' ,help='--follow imports')
parser.add_argument('-1', '--onefile', action='store_true' ,help='--onefile')
parser.add_argument('script', help='script.py|SCRIPT.PY')
args = pars... | true | true |
1c3741d9e4e783a4521c779baabc5897b77fcaf9 | 431 | py | Python | workflow/scripts/sample_phrases.py | CambridgeSemiticsLab/BH_time_collocations | 2d1864b6e9cd26624c769ee1e970d69d19da7fbf | [
"CC-BY-4.0"
] | 5 | 2019-06-19T19:42:21.000Z | 2021-04-20T22:43:45.000Z | workflow/scripts/sample_phrases.py | CambridgeSemiticsLab/BHTenseAndAspect | 2d1864b6e9cd26624c769ee1e970d69d19da7fbf | [
"CC-BY-4.0"
] | 2 | 2020-02-25T10:19:40.000Z | 2020-03-13T15:29:01.000Z | workflow/scripts/sample_phrases.py | CambridgeSemiticsLab/BHTenseAndAspect | 2d1864b6e9cd26624c769ee1e970d69d19da7fbf | [
"CC-BY-4.0"
] | null | null | null | """
In this module we generate a sample of
phrases drawn in from the ETCBC's BHSA Hebrew database.
The database is accessed using Text-Fabric.
It is subsequently processed using the scripts and modules indicated below.
"""
from sampling.phrase_sampling import get_phrase_samples
# execute with snakemake arguments
get... | 26.9375 | 75 | 0.793503 |
from sampling.phrase_sampling import get_phrase_samples
get_phrase_samples(
snakemake.input.bhsadata,
snakemake.output.samples,
snakemake.output.nosamples,
)
| true | true |
1c37423dd47e435e0b3d39951736bfdca710e735 | 777 | py | Python | Foresite/foresite/views.py | khoamb/Foresite | 97b155452d92fe1c487e7cbeffbc867604a1e726 | [
"MIT"
] | null | null | null | Foresite/foresite/views.py | khoamb/Foresite | 97b155452d92fe1c487e7cbeffbc867604a1e726 | [
"MIT"
] | 6 | 2018-11-29T23:25:16.000Z | 2018-11-30T01:17:33.000Z | Foresite/foresite/views.py | PricelessAntonio/Foresite | 4eec1ab5bf588b1ef6ec176a612bc62e8d55b424 | [
"MIT"
] | 3 | 2018-09-05T18:57:03.000Z | 2020-03-22T02:19:58.000Z | from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login
from django.views.generic import CreateView, TemplateView, View
from .forms import SignUpForm
# Create your views here.
class IndexView(TemplateView):
template_name = "index.html"
class SignupView(CreateView):
... | 27.75 | 66 | 0.685972 | from django.shortcuts import render, redirect
from django.contrib.auth import authenticate, login
from django.views.generic import CreateView, TemplateView, View
from .forms import SignUpForm
class IndexView(TemplateView):
template_name = "index.html"
class SignupView(CreateView):
form_class = SignUpForm
... | true | true |
1c37426f59607c88ddc2fa145f8df2759ae486dd | 1,935 | py | Python | dizoo/d4rl/config/hopper_cql_default_config.py | lichuminglcm/DI-engine | e9052f195d231a9875afb053ba815c6341857571 | [
"Apache-2.0"
] | null | null | null | dizoo/d4rl/config/hopper_cql_default_config.py | lichuminglcm/DI-engine | e9052f195d231a9875afb053ba815c6341857571 | [
"Apache-2.0"
] | null | null | null | dizoo/d4rl/config/hopper_cql_default_config.py | lichuminglcm/DI-engine | e9052f195d231a9875afb053ba815c6341857571 | [
"Apache-2.0"
] | null | null | null | from easydict import EasyDict
hopper_cql_default_config = dict(
env=dict(
env_id='hopper-expert-v0',
norm_obs=dict(use_norm=False, ),
norm_reward=dict(use_norm=False, ),
collector_env_num=1,
evaluator_env_num=8,
use_act_scale=True,
n_evaluator_episode=8,
... | 28.043478 | 77 | 0.594315 | from easydict import EasyDict
hopper_cql_default_config = dict(
env=dict(
env_id='hopper-expert-v0',
norm_obs=dict(use_norm=False, ),
norm_reward=dict(use_norm=False, ),
collector_env_num=1,
evaluator_env_num=8,
use_act_scale=True,
n_evaluator_episode=8,
... | true | true |
1c3743d9e4589f25e08ba8da50e7690e20a6951b | 836 | py | Python | hyp3lib/__init__.py | washreve/hyp3-lib | 5e7f11f1de9576a519b25fb56ccdb40e72ca9982 | [
"BSD-3-Clause"
] | null | null | null | hyp3lib/__init__.py | washreve/hyp3-lib | 5e7f11f1de9576a519b25fb56ccdb40e72ca9982 | [
"BSD-3-Clause"
] | null | null | null | hyp3lib/__init__.py | washreve/hyp3-lib | 5e7f11f1de9576a519b25fb56ccdb40e72ca9982 | [
"BSD-3-Clause"
] | null | null | null | """Common library for HyP3 plugins"""
from __future__ import print_function, absolute_import, division, unicode_literals
# FIXME: Python 3.8+ this should be `from importlib.metadata...`
from importlib_metadata import PackageNotFoundError, version
from hyp3lib.exceptions import (
DemError,
ExecuteError,
G... | 25.333333 | 82 | 0.680622 |
from __future__ import print_function, absolute_import, division, unicode_literals
from importlib_metadata import PackageNotFoundError, version
from hyp3lib.exceptions import (
DemError,
ExecuteError,
GeometryError,
GranuleError,
OrbitDownloadError,
)
try:
__version__ = version(__name__)
ex... | true | true |
1c3743eedea7ac0acb51912c5bed08e5d3050199 | 47 | py | Python | beaver/__init__.py | nullck/beaver-chef | 85780d45cf5bbec5b609048ca4558e0e8d6d9898 | [
"MIT"
] | null | null | null | beaver/__init__.py | nullck/beaver-chef | 85780d45cf5bbec5b609048ca4558e0e8d6d9898 | [
"MIT"
] | null | null | null | beaver/__init__.py | nullck/beaver-chef | 85780d45cf5bbec5b609048ca4558e0e8d6d9898 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__version__ = '36.1.0'
| 15.666667 | 23 | 0.531915 |
__version__ = '36.1.0'
| true | true |
1c3745ee664cb016dfde8a4e5d56995b890d54fb | 1,900 | py | Python | yoti_python_sdk/tests/doc_scan/session/create/filter/test_document_restrictions_filter.py | getyoti/python | 3df169145d5c818d0e79743768dde78e482eec9b | [
"MIT"
] | 9 | 2017-11-12T05:38:58.000Z | 2021-08-04T16:33:26.000Z | yoti_python_sdk/tests/doc_scan/session/create/filter/test_document_restrictions_filter.py | getyoti/python | 3df169145d5c818d0e79743768dde78e482eec9b | [
"MIT"
] | 237 | 2017-04-26T09:40:44.000Z | 2022-02-24T10:29:43.000Z | yoti_python_sdk/tests/doc_scan/session/create/filter/test_document_restrictions_filter.py | getyoti/python | 3df169145d5c818d0e79743768dde78e482eec9b | [
"MIT"
] | 9 | 2017-05-02T11:41:44.000Z | 2021-04-28T13:49:20.000Z | import json
from mock import Mock
from yoti_python_sdk.doc_scan.session.create.filter import (
DocumentRestrictionsFilterBuilder,
)
from yoti_python_sdk.doc_scan.session.create.filter.document_restrictions_filter import (
DocumentRestriction,
)
from yoti_python_sdk.utils import YotiEncoder
def test_should_s... | 27.941176 | 89 | 0.751053 | import json
from mock import Mock
from yoti_python_sdk.doc_scan.session.create.filter import (
DocumentRestrictionsFilterBuilder,
)
from yoti_python_sdk.doc_scan.session.create.filter.document_restrictions_filter import (
DocumentRestriction,
)
from yoti_python_sdk.utils import YotiEncoder
def test_should_s... | true | true |
1c37465f5578e6657eeac80c5145d09a42acd6c9 | 4,144 | py | Python | poseidon/dags/water_tests/indicator_bacteria_jobs.py | panda-tech/poseidon-airflow | bce5bc02b55f15330635a436056d99acb93488ef | [
"Apache-2.0"
] | null | null | null | poseidon/dags/water_tests/indicator_bacteria_jobs.py | panda-tech/poseidon-airflow | bce5bc02b55f15330635a436056d99acb93488ef | [
"Apache-2.0"
] | null | null | null | poseidon/dags/water_tests/indicator_bacteria_jobs.py | panda-tech/poseidon-airflow | bce5bc02b55f15330635a436056d99acb93488ef | [
"Apache-2.0"
] | null | null | null | import cx_Oracle
import pandas as pd
import os
import string
import logging
import re
from datetime import datetime, timedelta
from trident.util import general
conf = general.config
def get_indicator_bacteria_tests(date_start='01-JAN-2014', date_end='15-JUN-2017', **kwargs):
# For test mode
if kwargs... | 34.247934 | 95 | 0.677847 | import cx_Oracle
import pandas as pd
import os
import string
import logging
import re
from datetime import datetime, timedelta
from trident.util import general
conf = general.config
def get_indicator_bacteria_tests(date_start='01-JAN-2014', date_end='15-JUN-2017', **kwargs):
if kwargs['test_mode'] =... | true | true |
1c3748250a5fdb92f1fd736156c1b95e83caaa8c | 4,544 | py | Python | tests/helpers/test_translation.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 3 | 2020-10-23T14:39:11.000Z | 2021-02-17T14:40:17.000Z | tests/helpers/test_translation.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 39 | 2016-12-16T12:40:34.000Z | 2017-02-13T17:53:42.000Z | tests/helpers/test_translation.py | petewill/home-assistant | 5859dba4344f05fb8774aa1207e47ac28f627a67 | [
"Apache-2.0"
] | 6 | 2020-04-10T06:21:11.000Z | 2021-07-01T08:53:38.000Z | """Test the translation helper."""
# pylint: disable=protected-access
from os import path
from unittest.mock import patch
import pytest
import homeassistant.helpers.translation as translation
from homeassistant.setup import async_setup_component
from homeassistant.generated import config_flows
from tests.common impor... | 34.953846 | 88 | 0.680238 |
from os import path
from unittest.mock import patch
import pytest
import homeassistant.helpers.translation as translation
from homeassistant.setup import async_setup_component
from homeassistant.generated import config_flows
from tests.common import mock_coro
@pytest.fixture
def mock_config_flows():
flows = []... | true | true |
1c374898cda456a3b4514d9c1c42bda9eec6f425 | 16,120 | py | Python | tutorials/3_reinforce/experiments/Solve_BipedalWalker/DDPG.py | wull566/tensorflow_demo | c2c45050867cb056b8193eb53466d26b80b0ec13 | [
"MIT"
] | 2 | 2019-03-24T12:58:17.000Z | 2021-05-18T06:21:21.000Z | tutorials/3_reinforce/experiments/Solve_BipedalWalker/DDPG.py | wull566/tensorflow_demo | c2c45050867cb056b8193eb53466d26b80b0ec13 | [
"MIT"
] | null | null | null | tutorials/3_reinforce/experiments/Solve_BipedalWalker/DDPG.py | wull566/tensorflow_demo | c2c45050867cb056b8193eb53466d26b80b0ec13 | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
import gym
import os
import shutil
np.random.seed(1)
tf.set_random_seed(1)
MAX_EPISODES = 2000
LR_A = 0.0005 # 1_tensorflow_new rate for actor
LR_C = 0.0005 # 1_tensorflow_new rate for critic
GAMMA = 0.999 # reward discount
REPLACE_ITER_A = 1700
REPLACE_ITER_C = 1500
MEMO... | 41.439589 | 191 | 0.611787 | import tensorflow as tf
import numpy as np
import gym
import os
import shutil
np.random.seed(1)
tf.set_random_seed(1)
MAX_EPISODES = 2000
LR_A = 0.0005
LR_C = 0.0005
GAMMA = 0.999
REPLACE_ITER_A = 1700
REPLACE_ITER_C = 1500
MEMORY_CAPACITY = 200000
BATCH_SIZE = 32
DISPLAY_THRESHOLD = 100
DATA_PATH = './data'
... | true | true |
1c3748bdc31f4ffd0824fa09ca24a8aa14103931 | 253 | py | Python | src/sentry/mediators/token_exchange/__init__.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | 4 | 2019-05-27T13:55:07.000Z | 2021-03-30T07:05:09.000Z | src/sentry/mediators/token_exchange/__init__.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | 196 | 2019-06-10T08:34:10.000Z | 2022-02-22T01:26:13.000Z | src/sentry/mediators/token_exchange/__init__.py | pierredup/sentry | 0145e4b3bc0e775bf3482fe65f5e1a689d0dbb80 | [
"BSD-3-Clause"
] | 1 | 2020-08-10T07:55:40.000Z | 2020-08-10T07:55:40.000Z | from __future__ import absolute_import
from .grant_exchanger import GrantExchanger # NOQA
from .refresher import Refresher # NOQA
from .validator import Validator # NOQA
from .util import AUTHORIZATION, REFRESH, GrantTypes, token_expiration # NOQA
| 36.142857 | 78 | 0.814229 | from __future__ import absolute_import
from .grant_exchanger import GrantExchanger
from .refresher import Refresher
from .validator import Validator
from .util import AUTHORIZATION, REFRESH, GrantTypes, token_expiration
| true | true |
1c3748edac428870193dde4d179105c3b3eea934 | 5,905 | py | Python | deepspeed/utils/distributed.py | ConnollyLeon/DeepSpeed | 2d84d1c185ef0345eaf43a7240d61b33eda43497 | [
"MIT"
] | 6,728 | 2020-02-07T23:53:18.000Z | 2022-03-31T20:02:53.000Z | deepspeed/utils/distributed.py | ConnollyLeon/DeepSpeed | 2d84d1c185ef0345eaf43a7240d61b33eda43497 | [
"MIT"
] | 1,104 | 2020-02-08T00:26:15.000Z | 2022-03-31T22:33:56.000Z | deepspeed/utils/distributed.py | ConnollyLeon/DeepSpeed | 2d84d1c185ef0345eaf43a7240d61b33eda43497 | [
"MIT"
] | 801 | 2020-02-10T15:33:42.000Z | 2022-03-29T16:32:33.000Z | '''
Copyright 2020 The Microsoft DeepSpeed Team
'''
import os
import torch
from datetime import timedelta
from .logging import logger
from ..constants import TORCH_DISTRIBUTED_DEFAULT_PORT, default_pg_timeout
def init_distributed(dist_backend="nccl",
auto_mpi_discovery=True,
... | 41.293706 | 171 | 0.656393 | import os
import torch
from datetime import timedelta
from .logging import logger
from ..constants import TORCH_DISTRIBUTED_DEFAULT_PORT, default_pg_timeout
def init_distributed(dist_backend="nccl",
auto_mpi_discovery=True,
distributed_port=TORCH_DISTRIBUTED_DEFAULT_PORT,
... | true | true |
1c374964dab8d3056ee1d1c3367fda275b2446d2 | 11,714 | py | Python | bitcoinscript/shell.py | fungibit/bitcoinscript | ced6fb37dfa40eac7341826c758842e0ed7e7475 | [
"MIT"
] | 1 | 2017-10-25T17:11:44.000Z | 2017-10-25T17:11:44.000Z | bitcoinscript/shell.py | fungibit/bitcoinscript | ced6fb37dfa40eac7341826c758842e0ed7e7475 | [
"MIT"
] | 3 | 2017-03-10T05:27:29.000Z | 2017-04-07T16:06:28.000Z | bitcoinscript/shell.py | fungibit/bitcoinscript | ced6fb37dfa40eac7341826c758842e0ed7e7475 | [
"MIT"
] | null | null | null | """
Definition (and activation) of BitcoinScript ipython-magics, for
interactively composing bitcoin-scripts in a ipython session.
BitcoinScript magics can be activated by invoking ipython like::
ipython -i bitcoinscript.shell
or by importing this module in the ipython session::
import bitcoinscript.she... | 33.278409 | 102 | 0.566331 |
from IPython.core import magic as _MAGIC
from IPython.core.magic import line_magic as _line_magic
from bitcoin.core import _bignum
from bitcoin.core import scripteval as _scripteval
from bitcoinscript import opcode as _OPCODE
import bitcoinscript as _BS
from bitcoinscript.format import parse_formatted_script as _par... | true | true |
1c3749eb83f0630fb0474ab45ab430ad17c0406d | 2,762 | py | Python | contrib/linearize/linearize-hashes.py | broros/CommuterCoin | 3ba6a660fdb96e04058b2b6ddfff6b64862b8736 | [
"MIT"
] | 2 | 2019-11-22T15:47:12.000Z | 2020-06-27T08:20:59.000Z | contrib/linearize/linearize-hashes.py | broros/CommuterCoin | 3ba6a660fdb96e04058b2b6ddfff6b64862b8736 | [
"MIT"
] | null | null | null | contrib/linearize/linearize-hashes.py | broros/CommuterCoin | 3ba6a660fdb96e04058b2b6ddfff6b64862b8736 | [
"MIT"
] | 1 | 2021-03-12T01:18:53.000Z | 2021-03-12T01:18:53.000Z | #!/usr/bin/python
#
# linearize-hashes.py: List blocks in a linear, no-fork version of the chain.
#
# Copyright (c) 2013 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import json
import struct
impor... | 25.813084 | 78 | 0.673787 |
import json
import struct
import re
import base64
import httplib
import sys
settings = {}
class BitcoinRPC:
OBJID = 1
def __init__(self, host, port, username, password):
authpair = "%s:%s" % (username, password)
self.authhdr = "Basic %s" % (base64.b64encode(authpair))
self.conn = httplib.HTTPConnect... | false | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.