hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
628e9f8ac0080ab46d87ed0261cbe4bc729e3273 | 2,003 | py | Python | deewr/variables.py | fromz/deewr-tga | bd913d2b70dd83dc7dfa2f2da9cf19f64122ab0e | [
"MIT"
] | null | null | null | deewr/variables.py | fromz/deewr-tga | bd913d2b70dd83dc7dfa2f2da9cf19f64122ab0e | [
"MIT"
] | 2 | 2021-03-31T19:58:26.000Z | 2021-12-13T20:41:50.000Z | deewr/variables.py | fromz/deewr-tga | bd913d2b70dd83dc7dfa2f2da9cf19f64122ab0e | [
"MIT"
] | null | null | null |
def elem2dict(node):
"""
Convert an lxml.etree node tree into a dict.
"""
d = {}
for e in node.iterchildren():
key = e.tag.split('}')[1] if '}' in e.tag else e.tag
value = e.text if e.text else elem2dict(e)
d[key] = value
return d
| 30.348485 | 92 | 0.624064 | import re
def elem2dict(node):
"""
Convert an lxml.etree node tree into a dict.
"""
d = {}
for e in node.iterchildren():
key = e.tag.split('}')[1] if '}' in e.tag else e.tag
value = e.text if e.text else elem2dict(e)
d[key] = value
return d
class VariableExtractor:
... | 0 | 0 | 0 | 586 | 0 | 1,031 | 0 | -12 | 114 |
e5deb6e08999615678849e1f02b3b0b5770df613 | 4,072 | py | Python | setup.py | AlexBourassa/nspyre | d254af09c7c8377552e85dba6f60b150fbb8da2e | [
"MIT"
] | 8 | 2019-12-06T14:49:34.000Z | 2020-07-03T18:46:45.000Z | setup.py | nspyre-org/nspyre | d254af09c7c8377552e85dba6f60b150fbb8da2e | [
"BSD-3-Clause"
] | 31 | 2020-09-21T21:01:06.000Z | 2021-12-10T03:27:26.000Z | setup.py | NSpyre-Dev/nspyre | d254af09c7c8377552e85dba6f60b150fbb8da2e | [
"BSD-3-Clause"
] | 4 | 2020-10-07T23:58:13.000Z | 2022-03-01T15:22:34.000Z | from setuptools import setup, find_packages
import codecs
import pathlib
import re
here = pathlib.Path(__file__).parent.resolve()
def read(*parts):
"""
Build an absolute path from *parts* and and return the contents of the
resulting file. Assume UTF-8 encoding.
"""
with codecs.open(pathlib.Pure... | 31.083969 | 97 | 0.585953 | from setuptools import setup, find_packages
import codecs
import pathlib
import re
here = pathlib.Path(__file__).parent.resolve()
def read(*parts):
"""
Build an absolute path from *parts* and and return the contents of the
resulting file. Assume UTF-8 encoding.
"""
with codecs.open(pathlib.Pure... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ba08a1c3131298618b80139e7d5cc04315de0e4d | 2,984 | py | Python | code/generate_predictions.py | jpedrocm/jpcm-lista2-codigo | 8c1f867e3cc659cd262f8d9cd3521ccc5f1e8fd8 | [
"MIT"
] | 1 | 2019-03-15T08:54:08.000Z | 2019-03-15T08:54:08.000Z | code/generate_predictions.py | jpedrocm/pool-pruning-experiment | 8c1f867e3cc659cd262f8d9cd3521ccc5f1e8fd8 | [
"MIT"
] | null | null | null | code/generate_predictions.py | jpedrocm/pool-pruning-experiment | 8c1f867e3cc659cd262f8d9cd3521ccc5f1e8fd8 | [
"MIT"
] | null | null | null | ###############################################################################
import numpy as np
import random as rn
#DO NOT CHANGE THIS
np.random.seed(1478)
rn.seed(2264)
###################
from utils import load_datasets_filenames, load_experiment_configuration
from utils import load_dataset, save_predictions
fr... | 33.52809 | 81 | 0.696716 | ###############################################################################
import numpy as np
import random as rn
#DO NOT CHANGE THIS
np.random.seed(1478)
rn.seed(2264)
###################
from utils import load_datasets_filenames, load_experiment_configuration
from utils import load_dataset, save_predictions
fr... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f15b72c2d65ffa81c60de9b17f396cd340613c1e | 4,350 | py | Python | roonremote.py | matteck/roonrest | ce881a0ee89abc40b410f1b88764c4f0983fa3b0 | [
"MIT"
] | 1 | 2017-11-13T04:29:44.000Z | 2017-11-13T04:29:44.000Z | roonremote.py | matteck/roonrest | ce881a0ee89abc40b410f1b88764c4f0983fa3b0 | [
"MIT"
] | null | null | null | roonremote.py | matteck/roonrest | ce881a0ee89abc40b410f1b88764c4f0983fa3b0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import evdev
import select
import requests
import subprocess
import re
from datetime import datetime
roon_base_url = "http://greenspeaker:3000/api/v1"
harmony_base_url = "http://m1:8282/hubs/harmony-hub/devices/schiit-amp/commands"
p = re.compile('"zone_id": "([a-z0-9]+)",\n *"display_name": "... | 42.647059 | 116 | 0.437011 | #!/usr/bin/env python3
import evdev
import select
import requests
import subprocess
import re
from datetime import datetime
roon_base_url = "http://greenspeaker:3000/api/v1"
harmony_base_url = "http://m1:8282/hubs/harmony-hub/devices/schiit-amp/commands"
p = re.compile('"zone_id": "([a-z0-9]+)",\n *"display_name": "... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8e4880e0ebce4707e9d80ed91abc80216cb3e5ab | 15,179 | py | Python | image_manipulation.py | shequin-joshua-9147/cs162-final-project | 0edff7170ca0761b38c30774475bfecac2a18f01 | [
"MIT"
] | null | null | null | image_manipulation.py | shequin-joshua-9147/cs162-final-project | 0edff7170ca0761b38c30774475bfecac2a18f01 | [
"MIT"
] | null | null | null | image_manipulation.py | shequin-joshua-9147/cs162-final-project | 0edff7170ca0761b38c30774475bfecac2a18f01 | [
"MIT"
] | null | null | null | """
Manipulate images in specific ways based on commands used on input.
This module is used in order to manipulate images in a number of ways.
All of this is done through the ImageO object. The ImageO object reads in a file and allows for
manipulations to be done on an image and for that image to be output after the ... | 34.974654 | 97 | 0.564332 | """
Manipulate images in specific ways based on commands used on input.
This module is used in order to manipulate images in a number of ways.
All of this is done through the ImageO object. The ImageO object reads in a file and allows for
manipulations to be done on an image and for that image to be output after the ... | 0 | 0 | 0 | 10,407 | 0 | 0 | 0 | -3 | 67 |
7c3bdfb9f4ce43de33608bfbdf36e0f48a3e90c4 | 1,067 | py | Python | CorePython/Networking/TCP/tsTserv.py | AnatoleZho/Python3 | 3d3d32b5ad0affef76287b89bc87267fc551127d | [
"MIT"
] | null | null | null | CorePython/Networking/TCP/tsTserv.py | AnatoleZho/Python3 | 3d3d32b5ad0affef76287b89bc87267fc551127d | [
"MIT"
] | null | null | null | CorePython/Networking/TCP/tsTserv.py | AnatoleZho/Python3 | 3d3d32b5ad0affef76287b89bc87267fc551127d | [
"MIT"
] | null | null | null |
# time.ctime() socket
from time import ctime
HOST = '' # HOST bind()
PORT = 21567 #
BZUGSIZ = 1024 # 1KB
ADDR = (HOST, PORT)
tcpSerSock = socket(AF_INET, SOCK_STREAM) # TCP
tcpSerSock.bind(ADDR) # TCP
tcpSerSock.listen(5) # listen()
'''
# ()
#
#
#
# close()
'''
while True:
print('wait... | 28.078947 | 76 | 0.716963 |
# 导入了 time.ctime()和 socket 模块的所有属性
from socket import *
from time import ctime
HOST = '' # HOST 变量是空白的,这是对 bind()方法的标识,表示它可以使用任何可用的地址
PORT = 21567 # 选择了一个随机的端口号,并且该端口号似乎没有被使用或被系统保留
BZUGSIZ = 1024 # 对于该 应用程序,将缓冲区大小设置为 1KB。可以根据网络性能和程序需要改变这个容量
ADDR = (HOST, PORT)
tcpSerSock = socket(AF_INET, SOCK_STREAM) # ... | 1,203 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 23 |
232477d1a2e19b60e70bb78d55802171edcce92e | 4,693 | py | Python | members/conferences/models.py | ocwc/ocwc-members | 3ede8e0ff830e2aaff4ae09f9aaefd3eaa83146b | [
"MIT"
] | null | null | null | members/conferences/models.py | ocwc/ocwc-members | 3ede8e0ff830e2aaff4ae09f9aaefd3eaa83146b | [
"MIT"
] | 7 | 2015-11-27T15:59:52.000Z | 2022-01-13T00:38:38.000Z | members/conferences/models.py | ocwc/ocwc-members | 3ede8e0ff830e2aaff4ae09f9aaefd3eaa83146b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
CONFERENCE_REGISTRATION_TYPE = (
("normal", "Normal registration"),
("presenter", "Presenter registration"),
)
| 32.590278 | 126 | 0.698061 | # -*- coding: utf-8 -*-
import uuid
from tinymce import HTMLField
from django.db import models
from django.urls import reverse
from django.core.mail import EmailMessage
from django.conf import settings
from django.contrib.postgres.fields import JSONField
from crm.utils import print_pdf
class ConferenceInterface(mod... | 0 | 0 | 0 | 4,163 | 0 | 0 | 0 | 87 | 293 |
dc8e765a423050be4a0f0acf7bd19d9cf552b8fa | 892 | py | Python | src/jvm/io/fsq/twofishes/scripts/fetch_and_fix_flickr.py | jglesner/fsqio | 436dd3a7667fd23f638bf96bdcd9ec83266a2319 | [
"Apache-2.0"
] | 252 | 2016-01-08T23:12:13.000Z | 2022-01-17T16:31:49.000Z | src/jvm/io/fsq/twofishes/scripts/fetch_and_fix_flickr.py | jglesner/fsqio | 436dd3a7667fd23f638bf96bdcd9ec83266a2319 | [
"Apache-2.0"
] | 67 | 2016-01-13T17:34:12.000Z | 2021-08-04T18:50:24.000Z | src/jvm/io/fsq/twofishes/scripts/fetch_and_fix_flickr.py | jglesner/fsqio | 436dd3a7667fd23f638bf96bdcd9ec83266a2319 | [
"Apache-2.0"
] | 59 | 2016-03-25T20:49:03.000Z | 2021-08-04T05:36:38.000Z | #!/usr/bin/env python
import tarfile
import urllib
import re
import StringIO
import os
basedir = 'src/jvm/io/fsq/twofishes/indexer/data/downloaded'
flickr_shapes_file_name = os.path.join(basedir, 'flickr_shapes_public_dataset_2.0.tar.gz')
try:
open(flickr_shapes_file_name)
except IOError as e:
print 'Downloadin... | 24.777778 | 96 | 0.751121 | #!/usr/bin/env python
import tarfile
import urllib
import re
import StringIO
import os
basedir = 'src/jvm/io/fsq/twofishes/indexer/data/downloaded'
flickr_shapes_file_name = os.path.join(basedir, 'flickr_shapes_public_dataset_2.0.tar.gz')
try:
open(flickr_shapes_file_name)
except IOError as e:
print 'Downloadin... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6ea13b23e201409046ac5f8b79ed0cf75e2bf2f7 | 559 | py | Python | src/db/storage.py | BernarBerdikul/Async_API_part_1 | 0f218f38d099909fad629f6f9443fea4a29be3f8 | [
"BSD-3-Clause"
] | null | null | null | src/db/storage.py | BernarBerdikul/Async_API_part_1 | 0f218f38d099909fad629f6f9443fea4a29be3f8 | [
"BSD-3-Clause"
] | null | null | null | src/db/storage.py | BernarBerdikul/Async_API_part_1 | 0f218f38d099909fad629f6f9443fea4a29be3f8 | [
"BSD-3-Clause"
] | null | null | null | from typing import Optional
storage: Optional[AbstractStorage] = None
#
| 19.964286 | 54 | 0.697674 | from abc import ABC, abstractmethod
from typing import Optional
class AbstractStorage(ABC):
def __init__(self, storage_instance):
self.storage = storage_instance
@abstractmethod
def get(self, index: str, target_id: str):
pass
@abstractmethod
def search(self, index: str, _source, ... | 84 | 144 | 41 | 169 | 0 | 0 | 0 | 14 | 67 |
55c7798fee43dcc97a6cfd5cbe15725d9078c8d0 | 8,714 | py | Python | convnet3d/bin/train.py | yecharlie/convnet3d | 0b2771eec149b196ef59b58d09eef71c9b201d40 | [
"MIT"
] | 6 | 2020-03-12T10:28:41.000Z | 2021-11-18T16:17:20.000Z | convnet3d/bin/train.py | yecharlie/convnet3d | 0b2771eec149b196ef59b58d09eef71c9b201d40 | [
"MIT"
] | null | null | null | convnet3d/bin/train.py | yecharlie/convnet3d | 0b2771eec149b196ef59b58d09eef71c9b201d40 | [
"MIT"
] | 1 | 2019-08-01T02:50:05.000Z | 2019-08-01T02:50:05.000Z | import argparse
import os
import sys
import tensorflow as tf
# print(__name__,'__package__:',__package__)
if __name__ == "__main__" and __package__ is None:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
__package__ = "convnet3d.bin"
from .. import models
from .. import losses
def g... | 34.039063 | 163 | 0.641726 | import argparse
import os
import sys
import keras
import tensorflow as tf
# print(__name__,'__package__:',__package__)
if __name__ == "__main__" and __package__ is None:
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
import convnet3d.bin # noqa: F401
__package__ = "convnet3d.bin"... | 0 | 0 | 0 | 0 | 0 | 6,119 | 0 | 117 | 294 |
373d0db4da6950d1bc8a4dabb4dea5dbcd544cf5 | 1,587 | py | Python | pipeline_win.py | AndresRubianoM/DataScrapping | 2523cd848939992ac4c01534fd0e45ad2ff7f179 | [
"MIT"
] | null | null | null | pipeline_win.py | AndresRubianoM/DataScrapping | 2523cd848939992ac4c01534fd0e45ad2ff7f179 | [
"MIT"
] | null | null | null | pipeline_win.py | AndresRubianoM/DataScrapping | 2523cd848939992ac4c01534fd0e45ad2ff7f179 | [
"MIT"
] | null | null | null | import logging
logging.basicConfig(level = logging.INFO)
logger = logging.getLogger(__name__)
news_sites_uid = ['elpais']
if __name__ == '__main__':
main() | 32.387755 | 142 | 0.676118 | import logging
import subprocess
logging.basicConfig(level = logging.INFO)
logger = logging.getLogger(__name__)
news_sites_uid = ['elpais']
def main():
_extract()
_tranform()
_load()
def _extract():
logger.info('Beginning the extract process')
for new_site_uid in news_sites_uid:
#Comm... | 0 | 0 | 0 | 0 | 0 | 1,308 | 0 | -4 | 114 |
b32bd4bfe56139d124371a82bdf53c931c3b5161 | 15,332 | py | Python | vlc-ios-3.0.3/Tools/update_strings.py | qq644531343/vlc-ios | c12421e1d9842f268e3cb64518dd0e0dca32db3c | [
"Apache-2.0"
] | null | null | null | vlc-ios-3.0.3/Tools/update_strings.py | qq644531343/vlc-ios | c12421e1d9842f268e3cb64518dd0e0dca32db3c | [
"Apache-2.0"
] | null | null | null | vlc-ios-3.0.3/Tools/update_strings.py | qq644531343/vlc-ios | c12421e1d9842f268e3cb64518dd0e0dca32db3c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Update or create an Apple XCode project localization strings file.
TODO: handle localization domains
'''
from __future__ import with_statement
import sys
import os
import os.path
import re
import tempfile
import subprocess
import codecs
import unittest
import optpar... | 29.828794 | 78 | 0.604031 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Update or create an Apple XCode project localization strings file.
TODO: handle localization domains
'''
from __future__ import with_statement
import sys
import os
import os.path
import re
import tempfile
import subprocess
import codecs
import unittest
import optpar... | 0 | 850 | 0 | 2,949 | 0 | 0 | 0 | 0 | 46 |
46f3c5c10009f79e8f58863d6137c6c1d59ef457 | 1,212 | py | Python | examples/hlapi/v3arch/asyncore/sync/agent/ntforg/send-notification-with-additional-varbinds.py | fabriziovanni/pysnmp | eef4cc03b4da199e9c131ddd18ccb7501f1f2c40 | [
"BSD-2-Clause"
] | null | null | null | examples/hlapi/v3arch/asyncore/sync/agent/ntforg/send-notification-with-additional-varbinds.py | fabriziovanni/pysnmp | eef4cc03b4da199e9c131ddd18ccb7501f1f2c40 | [
"BSD-2-Clause"
] | null | null | null | examples/hlapi/v3arch/asyncore/sync/agent/ntforg/send-notification-with-additional-varbinds.py | fabriziovanni/pysnmp | eef4cc03b4da199e9c131ddd18ccb7501f1f2c40 | [
"BSD-2-Clause"
] | null | null | null | """
Sending additional var-binds
++++++++++++++++++++++++++++
Send SNMP notification using the following options:
* SNMPv2c
* with community name 'public'
* over IPv4/UDP
* send INFORM notification
* with TRAP ID 'coldStart' specified as a MIB symbol
* include managed object information specified as a MIB symbol
Fun... | 27.545455 | 105 | 0.632838 | """
Sending additional var-binds
++++++++++++++++++++++++++++
Send SNMP notification using the following options:
* SNMPv2c
* with community name 'public'
* over IPv4/UDP
* send INFORM notification
* with TRAP ID 'coldStart' specified as a MIB symbol
* include managed object information specified as a MIB symbol
Fun... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 | 22 |
8769954b2a2c6814333a757790542af24afd9ca2 | 16,490 | py | Python | smt/surrogate_models/krg_mgp.py | joshuauk1026/smt | ec6aa20643b1e4fa772c6f470281c58df113c3a6 | [
"BSD-3-Clause"
] | 3 | 2017-09-08T21:32:16.000Z | 2021-04-20T20:52:30.000Z | smt/surrogate_models/krg_mgp.py | joshuauk1026/smt | ec6aa20643b1e4fa772c6f470281c58df113c3a6 | [
"BSD-3-Clause"
] | null | null | null | smt/surrogate_models/krg_mgp.py | joshuauk1026/smt | ec6aa20643b1e4fa772c6f470281c58df113c3a6 | [
"BSD-3-Clause"
] | null | null | null | """
Author: Remy Priem (remy.priem@onera.fr)
This package is distributed under New BSD license.
"""
from __future__ import division
"""
The Active kriging class.
"""
| 31.833977 | 93 | 0.546574 | """
Author: Remy Priem (remy.priem@onera.fr)
This package is distributed under New BSD license.
"""
from __future__ import division
import numpy as np
from scipy import linalg
from smt.utils.kriging_utils import differences
from smt.surrogate_models.krg_based import KrgBased
from smt.utils.kriging_utils import compo... | 0 | 0 | 0 | 16,093 | 0 | 0 | 0 | 93 | 134 |
5239e00a83e4cff0b9a0629d3941b9bf6db58e7f | 1,470 | py | Python | L1Trigger/TrackerTFP/python/Producer_cfi.py | Jingyan95/cmssw | f78d843f0837f269ee6811b0e0f4c0432928c190 | [
"Apache-2.0"
] | 5 | 2020-07-02T19:05:26.000Z | 2022-02-25T14:37:09.000Z | L1Trigger/TrackerTFP/python/Producer_cfi.py | Jingyan95/cmssw | f78d843f0837f269ee6811b0e0f4c0432928c190 | [
"Apache-2.0"
] | 61 | 2020-07-14T17:22:52.000Z | 2022-03-16T11:11:12.000Z | L1Trigger/TrackerTFP/python/Producer_cfi.py | dally96/cmssw | c37b9bfa391850cb349c71190b0bbb2d04224cc8 | [
"Apache-2.0"
] | 8 | 2020-06-08T16:28:54.000Z | 2021-11-16T14:40:00.000Z | import FWCore.ParameterSet.Config as cms
TrackerTFPProducer_params = cms.PSet (
LabelDTC = cms.string( "TrackerDTCProducer" ), #
LabelGP = cms.string( "TrackerTFPProducerGP" ), #
LabelHT = cms.string( "TrackerTFPProducerHT" ), #
LabelMHT = cms.string( "TrackerTF... | 63.913043 | 132 | 0.621769 | import FWCore.ParameterSet.Config as cms
TrackerTFPProducer_params = cms.PSet (
LabelDTC = cms.string( "TrackerDTCProducer" ), #
LabelGP = cms.string( "TrackerTFPProducerGP" ), #
LabelHT = cms.string( "TrackerTFPProducerHT" ), #
LabelMHT = cms.string( "TrackerTF... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e85d58a5f33f7110024d64347a8d77eba76faad1 | 1,012 | py | Python | MyMxOnline/apps/organization/urls.py | xgq07/Django | a3bfa4fa0ebfc3cdcbc59bcaa810507889050d3b | [
"MIT"
] | null | null | null | MyMxOnline/apps/organization/urls.py | xgq07/Django | a3bfa4fa0ebfc3cdcbc59bcaa810507889050d3b | [
"MIT"
] | null | null | null | MyMxOnline/apps/organization/urls.py | xgq07/Django | a3bfa4fa0ebfc3cdcbc59bcaa810507889050d3b | [
"MIT"
] | null | null | null | from organization.views import OrgView, AddUserAskView, OrgHomeView, OrgCourseView, OrgDescView, OrgTeacherView, AddFavView, TeacherListView, TeacherDetailView
from django.conf.urls import url
#from django.urls import path,re_path
# app
app_name = "organization"
urlpatterns = [
#
url(r'^list/$', OrgView.as_vi... | 46 | 100 | 0.689723 | from organization.views import OrgView,AddUserAskView,OrgHomeView,OrgCourseView,OrgDescView,\
OrgTeacherView,AddFavView,TeacherListView,TeacherDetailView
from django.conf.urls import url,include
#from django.urls import path,re_path
# 要写上app的名字
app_name = "organization"
urlpatterns = [
#课程机构列表页
url(r'^lis... | 63 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0 |
9f97f311276aac0c7752ed83fb0ee1d286767ec5 | 684 | py | Python | tests/test_wake.py | rotdrop/rhasspy-hermes | ab822ad954da6da90368b65d72ed7e53694f085f | [
"MIT"
] | 1 | 2020-07-11T19:25:32.000Z | 2020-07-11T19:25:32.000Z | tests/test_wake.py | rotdrop/rhasspy-hermes | ab822ad954da6da90368b65d72ed7e53694f085f | [
"MIT"
] | 15 | 2019-12-31T13:19:25.000Z | 2022-01-17T17:40:13.000Z | tests/test_wake.py | rotdrop/rhasspy-hermes | ab822ad954da6da90368b65d72ed7e53694f085f | [
"MIT"
] | 8 | 2019-12-31T10:40:53.000Z | 2020-12-04T18:48:08.000Z | """Tests for rhasspyhermes.wake"""
from rhasspyhermes.wake import HotwordDetected, HotwordToggleOff, HotwordToggleOn
wakeword_id = "testWakeWord"
def test_hotword_detected():
"""Test HotwordDetected."""
assert HotwordDetected.is_topic(HotwordDetected.topic(wakeword_id=wakeword_id))
assert (
Hotwo... | 28.5 | 87 | 0.745614 | """Tests for rhasspyhermes.wake"""
from rhasspyhermes.wake import HotwordDetected, HotwordToggleOff, HotwordToggleOn
wakeword_id = "testWakeWord"
def test_hotword_detected():
"""Test HotwordDetected."""
assert HotwordDetected.is_topic(HotwordDetected.topic(wakeword_id=wakeword_id))
assert (
Hotwo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
11d5c86e0a8bc126cada2f724bb16ebccefa8607 | 1,602 | py | Python | test/models/test_value.py | firstof9/python-openzwave-mqtt | 25f9f90ba586e33fee7b7a444743966371268787 | [
"Apache-2.0"
] | 63 | 2019-11-06T19:30:45.000Z | 2022-02-04T22:19:07.000Z | test/models/test_value.py | firstof9/python-openzwave-mqtt | 25f9f90ba586e33fee7b7a444743966371268787 | [
"Apache-2.0"
] | 66 | 2021-01-18T06:52:17.000Z | 2022-03-28T08:04:22.000Z | test/models/test_value.py | firstof9/python-openzwave-mqtt | 25f9f90ba586e33fee7b7a444743966371268787 | [
"Apache-2.0"
] | 12 | 2020-01-03T13:35:06.000Z | 2020-10-10T20:50:20.000Z | """Provide tests for the node value."""
from openzwavemqtt.const import (EVENT_VALUE_ADDED, EVENT_VALUE_CHANGED, EVENT_VALUE_REMOVED)
def test_value_events(mgr):
"""Test value events."""
events = []
# Fill parent data.
mgr.mock_receive_json("OpenZWave/1/node/2", {})
mgr.mock_receive_json("OpenZWa... | 30.226415 | 83 | 0.65231 | """Provide tests for the node value."""
from openzwavemqtt.const import (
EVENT_VALUE_ADDED,
EVENT_VALUE_CHANGED,
EVENT_VALUE_REMOVED,
)
def test_value_events(mgr):
"""Test value events."""
events = []
# Fill parent data.
mgr.mock_receive_json("OpenZWave/1/node/2", {})
mgr.mock_receiv... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 0 |
7dc0816d12478814ffed3ae145d96cfd99595450 | 5,753 | py | Python | hand_servo/JO_tester.py | JohnOmernik/pimeup | c68f84d699f67af71bb5561eb6c5885ccd8b4ac8 | [
"Apache-2.0"
] | 1 | 2017-10-21T16:52:21.000Z | 2017-10-21T16:52:21.000Z | hand_servo/JO_tester.py | JohnOmernik/pimeup | c68f84d699f67af71bb5561eb6c5885ccd8b4ac8 | [
"Apache-2.0"
] | null | null | null | hand_servo/JO_tester.py | JohnOmernik/pimeup | c68f84d699f67af71bb5561eb6c5885ccd8b4ac8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Import the PCA9685 module.
import Adafruit_PCA9685
# Initialise the PCA9685 using the default address (0x40).
pwm = Adafruit_PCA9685.PCA9685(0x40)
pwm.set_pwm_freq(60)
SRV_OPTIONS = []
ACTIONS = {}
STATUS=""
thingfile = "/home/pi/pimeup/thingbox/thing.json"
thingactionfile = "/home/pi/pimeup/thi... | 26.75814 | 158 | 0.460108 | #!/usr/bin/python
# Import the PCA9685 module.
import Adafruit_PCA9685
import time
import random
import sys
import json
# Initialise the PCA9685 using the default address (0x40).
pwm = Adafruit_PCA9685.PCA9685(0x40)
pwm.set_pwm_freq(60)
SRV_OPTIONS = []
ACTIONS = {}
STATUS=""
thingfile = "/home/pi/pimeup/thingbox/t... | 0 | 0 | 0 | 0 | 0 | 5,147 | 0 | -39 | 249 |
e0ffbfca22a90ed69e2f3f3cd411e0e7e7d7c239 | 13,384 | py | Python | PyFlow/Core/GraphManager.py | luzpaz/PyFlow | e00642794051b1d9b7b2665eee38567e9763558d | [
"Apache-2.0"
] | 1,463 | 2019-07-29T15:45:22.000Z | 2022-03-31T23:32:13.000Z | PyFlow/Core/GraphManager.py | luzpaz/PyFlow | e00642794051b1d9b7b2665eee38567e9763558d | [
"Apache-2.0"
] | 58 | 2019-07-31T07:58:57.000Z | 2022-02-23T05:46:08.000Z | PyFlow/Core/GraphManager.py | luzpaz/PyFlow | e00642794051b1d9b7b2665eee38567e9763558d | [
"Apache-2.0"
] | 169 | 2019-08-03T16:38:57.000Z | 2022-03-31T14:20:12.000Z | ## Copyright 2015-2019 Ilgar Lunin, Pedro Cabrera
## 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... | 32.485437 | 127 | 0.605424 | ## Copyright 2015-2019 Ilgar Lunin, Pedro Cabrera
## 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... | 0 | 363 | 0 | 12,180 | 0 | 0 | 0 | 48 | 135 |
e00d9fd40434cd4d86af85a211851d99b4589f1a | 9,011 | py | Python | rethinkdb/tests/common.py | mchelen-gov/integrations-core | 81281600b3cc7025a7a32148c59620c9592a564f | [
"BSD-3-Clause"
] | 663 | 2016-08-23T05:23:45.000Z | 2022-03-29T00:37:23.000Z | rethinkdb/tests/common.py | mchelen-gov/integrations-core | 81281600b3cc7025a7a32148c59620c9592a564f | [
"BSD-3-Clause"
] | 6,642 | 2016-06-09T16:29:20.000Z | 2022-03-31T22:24:09.000Z | rethinkdb/tests/common.py | mchelen-gov/integrations-core | 81281600b3cc7025a7a32148c59620c9592a564f | [
"BSD-3-Clause"
] | 1,222 | 2017-01-27T15:51:38.000Z | 2022-03-31T18:17:51.000Z | # (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import os
import pytest
from datadog_checks.base.stubs.aggregator import AggregatorStub
from datadog_checks.dev import get_docker_hostname, get_here
HERE = get_here()
IMAGE = os.environ.get('RETHINKDB_... | 40.959091 | 118 | 0.724559 | # (C) Datadog, Inc. 2020-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import os
from typing import Callable, Dict, List, Set, Tuple, Union
import pytest
from datadog_checks.base.stubs.aggregator import AggregatorStub
from datadog_checks.dev import get_docker_hostname, get_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 45 | 45 |
2c0645b579d4039d3fb0936a880573ee5a707aa0 | 396 | py | Python | janitor/package/chef/__init__.py | nilesh-naik/lambda-functions | 5daa2828914d23851538d5c3cb11f36b0f4bac52 | [
"MIT"
] | 77 | 2016-03-15T21:51:11.000Z | 2021-09-15T18:40:25.000Z | janitor/package/chef/__init__.py | nilesh-naik/lambda-functions | 5daa2828914d23851538d5c3cb11f36b0f4bac52 | [
"MIT"
] | 20 | 2016-04-15T18:40:57.000Z | 2021-06-01T18:59:56.000Z | lambda/chef/__init__.py | novu/lambda-chef-node-cleanup | 6659db950a3ab6b88ff608a6324f36a75fecebf2 | [
"Apache-2.0"
] | 53 | 2016-04-07T07:35:04.000Z | 2022-01-25T18:48:10.000Z | # Copyright (c) 2010 Noah Kantrowitz <noah@coderanger.net>
__version__ = (0, 3, 0)
| 28.285714 | 58 | 0.810606 | # Copyright (c) 2010 Noah Kantrowitz <noah@coderanger.net>
__version__ = (0, 3, 0)
from chef.api import ChefAPI, autoconfigure
from chef.client import Client
from chef.data_bag import DataBag, DataBagItem
from chef.exceptions import ChefError
from chef.node import Node
from chef.role import Role
from chef.environment... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 113 | 199 |
ac828b22a576f4b7bb7ccd120bfa1776b6a53295 | 10,290 | py | Python | pyspeckit/spectrum/models/nh2d.py | glangsto/pyspeckit | 346b24fb828d1d33c7891cdde7609723e51af34c | [
"MIT"
] | null | null | null | pyspeckit/spectrum/models/nh2d.py | glangsto/pyspeckit | 346b24fb828d1d33c7891cdde7609723e51af34c | [
"MIT"
] | 1 | 2021-05-14T19:17:41.000Z | 2021-05-14T19:17:41.000Z | pyspeckit/spectrum/models/nh2d.py | glangsto/pyspeckit | 346b24fb828d1d33c7891cdde7609723e51af34c | [
"MIT"
] | 1 | 2020-04-23T17:04:09.000Z | 2020-04-23T17:04:09.000Z | """
===========
NH2D fitter: ortho- and para- in the same file, but not modeled together
===========
Reference for line params:
F. Daniel et al. (2016) line frequencies and line strengths.
It includes HFS due to D
http://adsabs.harvard.edu/abs/2016A%26A...586L...4D
"""
from . import hyperfine
import astropy.units as ... | 35.482759 | 132 | 0.636929 | """
===========
NH2D fitter: ortho- and para- in the same file, but not modeled together
===========
Reference for line params:
F. Daniel et al. (2016) line frequencies and line strengths.
It includes HFS due to D
http://adsabs.harvard.edu/abs/2016A%26A...586L...4D
"""
from . import hyperfine
import astropy.units as ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5f8095707304f334fc478e2b1d6cdfd9581bb80b | 44 | py | Python | parameters_443.py | amonmoce/ElectionsStats | 647fbd5ebc0aa25a027355e0cc851220328fec06 | [
"BSD-3-Clause"
] | null | null | null | parameters_443.py | amonmoce/ElectionsStats | 647fbd5ebc0aa25a027355e0cc851220328fec06 | [
"BSD-3-Clause"
] | null | null | null | parameters_443.py | amonmoce/ElectionsStats | 647fbd5ebc0aa25a027355e0cc851220328fec06 | [
"BSD-3-Clause"
] | null | null | null | password="4bd9270216a6d2e7bc330cf396f7c8f2"
| 22 | 43 | 0.909091 | password="4bd9270216a6d2e7bc330cf396f7c8f2"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5885938e77707f880d8da482e0285130b6697045 | 593 | py | Python | src/utils/train/training_utils.py | chris4540/StudyMaskedLMForQG | 2bf477b7b8cfb5d195c028db6d63aadf06af8fc5 | [
"MIT"
] | 6 | 2020-12-09T11:30:37.000Z | 2022-03-03T12:06:44.000Z | src/utils/train/training_utils.py | chris4540/StudyMaskedLMForQG | 2bf477b7b8cfb5d195c028db6d63aadf06af8fc5 | [
"MIT"
] | null | null | null | src/utils/train/training_utils.py | chris4540/StudyMaskedLMForQG | 2bf477b7b8cfb5d195c028db6d63aadf06af8fc5 | [
"MIT"
] | 3 | 2021-03-23T04:56:48.000Z | 2022-02-02T19:31:46.000Z | # from typing import Optional
| 25.782609 | 66 | 0.627319 | from typing import List
from typing import Dict
from typing import NamedTuple
# from typing import Optional
def build_generated_text(refs: List[str], hyps: List[str]) -> str:
ret = ""
linesep = " \n" # Tensorboard text uses format of markdown
for i, (ref, hyp) in enumerate(zip(refs, hyps)):
ret ... | 0 | 0 | 0 | 100 | 0 | 337 | 0 | 12 | 112 |
6fb14605bf869967b78c62d65e4c34bd50dca9b2 | 884 | py | Python | online/client/char-client.py | jas-dzied/quiz | 39d19c952af8b71c8e407f7a650361ab49653bf3 | [
"MIT"
] | null | null | null | online/client/char-client.py | jas-dzied/quiz | 39d19c952af8b71c8e407f7a650361ab49653bf3 | [
"MIT"
] | null | null | null | online/client/char-client.py | jas-dzied/quiz | 39d19c952af8b71c8e407f7a650361ab49653bf3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import asyncio
asyncio.run(main())
| 24.555556 | 75 | 0.700226 | #!/usr/bin/env python3
import asyncio
import websockets
import threading
import queue
import secrets
async def worker(uid, q):
async with websockets.connect("ws://localhost:8003") as websocket:
await websocket.send(f'0:{uid}')
async def receiver(uid, q):
async with websockets.connect("ws://localhost:... | 0 | 0 | 572 | 0 | 0 | 75 | 0 | -25 | 202 |
30261c9941c84f4da118943a0ab2701b46dde7d5 | 663 | py | Python | ns/demux/flow_demux.py | lunarss/ns.py | 9298c850290fb2ee98b047dfc757f4687763c2f8 | [
"Apache-2.0"
] | null | null | null | ns/demux/flow_demux.py | lunarss/ns.py | 9298c850290fb2ee98b047dfc757f4687763c2f8 | [
"Apache-2.0"
] | 1 | 2021-07-20T02:48:41.000Z | 2021-07-20T02:48:41.000Z | ns/demux/flow_demux.py | JinJinGuang/ns.py | 90415c4c83dd775cc50976c609ecbf551191cdf0 | [
"Apache-2.0"
] | null | null | null | """
A demultiplexing element that splits packet streams by flow_id.
"""
| 26.52 | 63 | 0.603318 | """
A demultiplexing element that splits packet streams by flow_id.
"""
class FlowDemux:
"""
The constructor takes a list of downstream elements for the
corresponding output ports as its input.
"""
def __init__(self, outs=None, default=None):
self.outs = outs
self.default = default... | 0 | 0 | 0 | 567 | 0 | 0 | 0 | 0 | 23 |
fcbf29f197cc47590cb289066bc6f4f0276442d6 | 4,621 | py | Python | python-advanced/chapter1.py | Rokon-Uz-Zaman/thinkdiff_python_django | 5010c5f1dd8a028fb9e5235319bb6bb434831e6c | [
"MIT"
] | 92 | 2018-04-03T20:53:07.000Z | 2022-03-04T05:53:10.000Z | python-language/python-advanced/chapter1.py | mostafijur-rahman299/thinkdiff | b0e0c01fe38c406f4dfa8cc80b2f0c5654017079 | [
"MIT"
] | 11 | 2018-10-01T15:35:33.000Z | 2021-09-01T04:59:56.000Z | python-language/python-advanced/chapter1.py | mostafijur-rahman299/thinkdiff | b0e0c01fe38c406f4dfa8cc80b2f0c5654017079 | [
"MIT"
] | 98 | 2018-03-13T08:03:54.000Z | 2022-03-22T08:11:44.000Z | # author: Mahmud Ahsan
# code: https://github.com/mahmudahsan/thinkdiff
# blog: http://thinkdiff.net
# http://pythonbangla.com
# MIT License
# --------------------------
# Files
# --------------------------
## Reading full contents of a text file
'''
Encouraged way
with keyword close the file automatically
'''
... | 21.79717 | 118 | 0.628003 | # author: Mahmud Ahsan
# code: https://github.com/mahmudahsan/thinkdiff
# blog: http://thinkdiff.net
# http://pythonbangla.com
# MIT License
# --------------------------
# Files
# --------------------------
## Reading full contents of a text file
'''
Encouraged way
with keyword close the file automatically
'''
... | 102 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3e3c54cdb703d3ef42b7087e51bdaa42632a5cbb | 360 | py | Python | src/services/ThresholdController/TestingServices/FakeSchedule.py | IAPark/PITherm | a334cb0843b1961997aa90e45671d556be91380f | [
"MIT"
] | null | null | null | src/services/ThresholdController/TestingServices/FakeSchedule.py | IAPark/PITherm | a334cb0843b1961997aa90e45671d556be91380f | [
"MIT"
] | null | null | null | src/services/ThresholdController/TestingServices/FakeSchedule.py | IAPark/PITherm | a334cb0843b1961997aa90e45671d556be91380f | [
"MIT"
] | null | null | null | from flask import Flask
from multiprocessing import Queue
responses_ = Queue()
port = 4001
app = Flask(__name__)
| 17.142857 | 41 | 0.716667 | from flask import Flask
from flask import json
from multiprocessing import Queue
responses_ = Queue()
port = 4001
app = Flask(__name__)
@app.route("/state/<int:time>")
def state(time: int):
global responses_
return json.jsonify(responses_.get())
def run(responses: Queue,):
global responses_
respon... | 0 | 96 | 0 | 0 | 0 | 78 | 0 | 1 | 68 |
d1fc830663f4626f0851f21db7dea2f0175a03fc | 15,819 | py | Python | portable_spreadsheet/cell_slice.py | david-salac/Portable-spreadsheet-generator | ca31b1e77f26b77ab2ca4d328b12e3cf14c8a029 | [
"MIT"
] | 28 | 2020-05-17T18:42:07.000Z | 2021-06-01T14:58:22.000Z | portable_spreadsheet/cell_slice.py | david-salac/Portable-spreadsheet-generator | ca31b1e77f26b77ab2ca4d328b12e3cf14c8a029 | [
"MIT"
] | 3 | 2020-08-19T21:28:17.000Z | 2021-01-10T20:00:56.000Z | portable_spreadsheet/cell_slice.py | david-salac/Portable-spreadsheet-generator | ca31b1e77f26b77ab2ca4d328b12e3cf14c8a029 | [
"MIT"
] | 4 | 2020-10-10T12:15:40.000Z | 2021-11-08T02:08:34.000Z | from numbers import Number
from typing import Union, List
import numpy as np
from .cell import Cell
# Acceptable values for the slice
T_slice = Union[np.ndarray,
List[Number], List[str], List[Cell],
str, Number, Cell]
| 37.935252 | 79 | 0.554081 | from numbers import Number
from typing import Iterable, Tuple, Union, List, Optional
import copy
import numpy as np
from .cell import Cell
from .cell_indices import CellIndices
from .serialization import Serialization
# Acceptable values for the slice
T_slice = Union[np.ndarray,
List[Number], List[st... | 0 | 1,955 | 0 | 13,469 | 0 | 0 | 0 | 52 | 89 |
03afcc1023649b896ec4f37fc2b3a99fcc1a2bca | 2,546 | py | Python | radiaTest-worker/worker/utils/bash.py | openeuler-mirror/radiaTest | 4a067511d6ab69f76b8dc08667b8a1f8c1c73d23 | [
"MulanPSL-1.0"
] | null | null | null | radiaTest-worker/worker/utils/bash.py | openeuler-mirror/radiaTest | 4a067511d6ab69f76b8dc08667b8a1f8c1c73d23 | [
"MulanPSL-1.0"
] | 1 | 2022-03-23T06:53:25.000Z | 2022-03-23T06:53:25.000Z | radiaTest-worker/worker/utils/bash.py | openeuler-mirror/radiaTest | 4a067511d6ab69f76b8dc08667b8a1f8c1c73d23 | [
"MulanPSL-1.0"
] | null | null | null |
# from flask import current_app
| 31.04878 | 154 | 0.516104 | from shlex import quote
from subprocess import getoutput, getstatusoutput
# from flask import current_app
def install_base(body, storage_pool):
fixed_mac = ""
if body.get("mac"):
fixed_mac = ",mac={}".format(quote(body.get("mac")))
controller = ""
if body.get("frame") == "aarch64":
c... | 0 | 0 | 0 | 0 | 0 | 2,273 | 0 | 30 | 205 |
0eff813d270b63670413294208f76ac98ecc73aa | 2,025 | py | Python | pyutilib/misc/twzzle.py | PyUtilib/PyUtilib | d99406f2af1fb62268c34453a2fbe6bd4a7348f0 | [
"BSD-3-Clause"
] | 24 | 2016-04-02T10:00:02.000Z | 2021-03-02T16:40:18.000Z | pyutilib/misc/twzzle.py | PyUtilib/PyUtilib | d99406f2af1fb62268c34453a2fbe6bd4a7348f0 | [
"BSD-3-Clause"
] | 105 | 2015-10-29T03:29:58.000Z | 2021-12-30T22:00:45.000Z | pyutilib/misc/twzzle.py | PyUtilib/PyUtilib | d99406f2af1fb62268c34453a2fbe6bd4a7348f0 | [
"BSD-3-Clause"
] | 22 | 2016-01-21T15:35:25.000Z | 2021-05-15T20:17:44.000Z | # _________________________________________________________________________
#
# PyUtilib: A Python utility library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the BSD License.
# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
# the U.S. Government retains ... | 26.298701 | 76 | 0.607407 | # _________________________________________________________________________
#
# PyUtilib: A Python utility library.
# Copyright (c) 2008 Sandia Corporation.
# This software is distributed under the BSD License.
# Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
# the U.S. Government retains ... | 0 | 0 | 0 | 1,216 | 0 | 0 | 0 | -21 | 114 |
c59a57fdb4853653342c36c7a372a1ad6827770f | 2,673 | py | Python | fsttest/_test_case.py | eddieantonio/fsttest | 8ff71a9aa41a70a30832fa219b72e7478872c16f | [
"MIT"
] | null | null | null | fsttest/_test_case.py | eddieantonio/fsttest | 8ff71a9aa41a70a30832fa219b72e7478872c16f | [
"MIT"
] | 1 | 2020-01-27T21:43:04.000Z | 2020-01-28T15:57:05.000Z | fsttest/_test_case.py | eddieantonio/fsttest | 8ff71a9aa41a70a30832fa219b72e7478872c16f | [
"MIT"
] | 1 | 2021-04-26T17:46:19.000Z | 2021-04-26T17:46:19.000Z | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
| 33.835443 | 88 | 0.606061 | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
from pathlib import Path
from typing import Any, Dict, List, Optional, Union
from ._fst import FST
from ._results import FailedTestResult, PassedTestResult
from .exceptions import TestCaseDefinitionError
class TestCase:
"""
An executable test case.
"""
... | 0 | 1,330 | 0 | 1,066 | 0 | 0 | 0 | 94 | 135 |
84a25250ddea53d73b4571ee50268f072bd9f331 | 1,073 | py | Python | 2019/d19.py | max-f/advent-of-code | 3c0ee995f7c0691418ecb86cbfa201b3d03131b8 | [
"MIT"
] | null | null | null | 2019/d19.py | max-f/advent-of-code | 3c0ee995f7c0691418ecb86cbfa201b3d03131b8 | [
"MIT"
] | null | null | null | 2019/d19.py | max-f/advent-of-code | 3c0ee995f7c0691418ecb86cbfa201b3d03131b8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
if __name__ == "__main__":
main()
| 21.897959 | 60 | 0.615098 | #!/usr/bin/env python
import copy
from collections import deque, defaultdict
from utils.intcode import Machine
from utils.utils import get_input, ints
def part1(intcode) -> int:
total_affected = 0
for y in range(50):
for x in range(50):
pos_in = position_in_beam(intcode, x, y)
... | 0 | 0 | 0 | 0 | 0 | 784 | 0 | 41 | 182 |
fe04686535636400f725184e167933f807600954 | 13,763 | py | Python | src/core/task.py | gaotuan/Yearning-1.2.0_me | 8b4a1a443abc39a638931907599b9306fc92531c | [
"Apache-2.0"
] | 1 | 2020-06-05T06:17:48.000Z | 2020-06-05T06:17:48.000Z | src/core/task.py | gaotuan/Yearning-1.2.0_me | 8b4a1a443abc39a638931907599b9306fc92531c | [
"Apache-2.0"
] | 5 | 2020-04-17T03:38:08.000Z | 2020-04-17T03:39:26.000Z | src/core/task.py | gaotuan/SQL-Manager | 8b4a1a443abc39a638931907599b9306fc92531c | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, unicode_literals
import logging
from .models import (Account)
CUSTOM_ERROR = logging.getLogger('Yearning.core.views')
def grained_permissions(func):
'''
:argument ,401
'''
return wrapper
| 35.65544 | 152 | 0.525612 | from __future__ import absolute_import, unicode_literals
import logging
import functools
import threading
import time
from django.http import HttpResponse
from libs import send_email, util
from libs import call_inception
from .models import (
Usermessage,
DatabaseList,
Account,
globalpermissions,
Sq... | 1,446 | 794 | 0 | 11,767 | 0 | 0 | 0 | 175 | 294 |
eac6a981fadd003fa43c9af833b6effbf17649fc | 2,000 | py | Python | snapshotcleanup/snapshotcleanup.py | meredith-digops/awsops | d3e4dc3d16866a95550602b924f97dc5c0c77642 | [
"MIT"
] | 4 | 2017-11-29T08:15:45.000Z | 2020-03-23T18:43:10.000Z | snapshotcleanup/snapshotcleanup.py | meredith-digops/awsops | d3e4dc3d16866a95550602b924f97dc5c0c77642 | [
"MIT"
] | 6 | 2016-09-26T21:01:14.000Z | 2021-05-03T13:33:31.000Z | snapshotcleanup/snapshotcleanup.py | meredith-digops/awsops | d3e4dc3d16866a95550602b924f97dc5c0c77642 | [
"MIT"
] | 5 | 2016-09-26T14:26:22.000Z | 2018-01-26T00:38:01.000Z | #!/usr/bin/env python
from __future__ import print_function
from datetime import timedelta
import boto3
from botocore.exceptions import ClientError
DEFAULT_RETENTION_DAYS = None
"""If None, no default retention is applied"""
ZERO = timedelta(0)
def lambda_handler(event, context):
"""
Delete EBS snapsho... | 25.316456 | 86 | 0.595 | #!/usr/bin/env python
from __future__ import print_function
from datetime import datetime, timedelta, tzinfo
import boto3
from botocore.exceptions import ClientError
DEFAULT_RETENTION_DAYS = None
"""If None, no default retention is applied"""
ZERO = timedelta(0)
class UTC(tzinfo):
"""
Implements UTC time... | 0 | 0 | 0 | 207 | 543 | 0 | 0 | 18 | 46 |
1b7a12539a5910e5b2156704a5c7a96622ee4933 | 6,698 | py | Python | lib/threatminer.py | macdaliot/exist | 65244f79c602c5a00c3ea6a7eef512ce9c21e60a | [
"MIT"
] | 159 | 2019-03-15T10:46:19.000Z | 2022-03-12T09:19:31.000Z | lib/threatminer.py | macdaliot/exist | 65244f79c602c5a00c3ea6a7eef512ce9c21e60a | [
"MIT"
] | 6 | 2019-03-16T12:51:24.000Z | 2020-07-09T02:25:42.000Z | lib/threatminer.py | macdaliot/exist | 65244f79c602c5a00c3ea6a7eef512ce9c21e60a | [
"MIT"
] | 36 | 2019-03-16T10:37:14.000Z | 2021-11-14T21:04:18.000Z | #!/usr/bin/env python
try:
import simplejson as json
except ImportError:
import json
version = '%(prog)s 20180912'
if __name__ == '__main__':
if ArgParse().type == 'domain':
print(json.dumps(ThreatMiner().getURIFromDomain(ArgParse().resource)))
print(json.dumps(ThreatMiner().getSamplesFro... | 31.744076 | 115 | 0.615557 | #!/usr/bin/env python
import argparse
import requests
try:
import simplejson as json
except ImportError:
import json
version = '%(prog)s 20180912'
class ThreatMiner():
def __init__(self):
self.__baseURL = "https://api.threatminer.org/v2/"
def sendQuery(self, endpoint, rt, q):
params... | 0 | 0 | 0 | 3,955 | 0 | 480 | 0 | -12 | 91 |
da4b158d8c736ac7723e882f97e8bcedc90b1567 | 3,541 | py | Python | sym_api_client_python/clients/connections_client.py | symphony-thibault/symphony-api-client-python | 628cbf3aa857d3bc66a98a3ec009ce1c82295d05 | [
"MIT"
] | null | null | null | sym_api_client_python/clients/connections_client.py | symphony-thibault/symphony-api-client-python | 628cbf3aa857d3bc66a98a3ec009ce1c82295d05 | [
"MIT"
] | null | null | null | sym_api_client_python/clients/connections_client.py | symphony-thibault/symphony-api-client-python | 628cbf3aa857d3bc66a98a3ec009ce1c82295d05 | [
"MIT"
] | null | null | null |
# child class of APIClient --> Extends error handling functionality
# ConnectionsClient class contains a series of functions corresponding to all
# pod admin endpoints on the REST API.
| 42.154762 | 80 | 0.674386 | import logging
from .api_client import APIClient
# child class of APIClient --> Extends error handling functionality
# ConnectionsClient class contains a series of functions corresponding to all
# pod admin endpoints on the REST API.
class ConnectionsClient(APIClient):
def __init__(self, bot_client):
se... | 3 | 0 | 0 | 3,280 | 0 | 0 | 0 | 5 | 67 |
16b08766cb370edf52b3d39c46180b630ddb5f0e | 1,405 | py | Python | server/services/weather.py | vipul0104/logistics-wizard-controller | bd2470a5847310fe0c7bccadf6179dd7bb866de0 | [
"Apache-2.0"
] | null | null | null | server/services/weather.py | vipul0104/logistics-wizard-controller | bd2470a5847310fe0c7bccadf6179dd7bb866de0 | [
"Apache-2.0"
] | 5 | 2018-06-25T16:12:07.000Z | 2019-11-08T21:47:47.000Z | server/services/weather.py | vipul0104/logistics-wizard-controller | bd2470a5847310fe0c7bccadf6179dd7bb866de0 | [
"Apache-2.0"
] | 1 | 2019-11-03T20:40:02.000Z | 2019-11-03T20:40:02.000Z | """
Handle all actions on the weather resource.
"""
import json
from server.utils import call_openwhisk
from server.exceptions import APIException
def get_recommendations(demoGuid):
"""
Get recommendations
"""
try:
payload = dict()
payload['demoGuid'] = demoGuid
response = call... | 25.545455 | 73 | 0.659786 | """
Handle all actions on the weather resource.
"""
import json
import requests
from server.utils import call_openwhisk
from server.exceptions import ResourceDoesNotExistException, APIException
def get_recommendations(demoGuid):
"""
Get recommendations
"""
try:
payload = dict()
payload... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 25 | 22 |
d351744e79c3ee2c12d9ec03d2736c0dbd0359f3 | 7,788 | py | Python | utils/gdb-printers/csd.py | kjcamann/csd-mirror | e0808cdb084404fc7319c76186c05eba0a56b056 | [
"BSD-2-Clause"
] | null | null | null | utils/gdb-printers/csd.py | kjcamann/csd-mirror | e0808cdb084404fc7319c76186c05eba0a56b056 | [
"BSD-2-Clause"
] | null | null | null | utils/gdb-printers/csd.py | kjcamann/csd-mirror | e0808cdb084404fc7319c76186c05eba0a56b056 | [
"BSD-2-Clause"
] | null | null | null | """GDB pretty-printers for CSD.
"""
import gdb
import gdb.xmethod
_csd_printer_name = 'csd_pretty_printer'
_csd_xmethod_name = 'csd_xmethods'
_nttpIntegralSuffix = {
'long' : 'l',
'long long' : 'll',
'unsigned int' : 'u',
'unsigned long' : 'ul',
'unsigned long long' : 'ull'
}
def _get_entry_extractor_typen... | 35.081081 | 87 | 0.699666 | """GDB pretty-printers for CSD.
"""
import enum
import gdb
import gdb.xmethod
import re
_csd_printer_name = 'csd_pretty_printer'
_csd_xmethod_name = 'csd_xmethods'
def _remove_generics(typename):
if type(typename) is gdb.Type:
typename = typename.name or typename.tag or str(typename)
match = re.match('^([^<]... | 0 | 0 | 0 | 4,208 | 0 | 791 | 0 | -22 | 183 |
4a7bae05fad6d3a7ae3e34b5e332150a92ca6ee7 | 3,744 | py | Python | data-science-not/weeks/m03_sequences/p0/stack.py | nurseiit/comm-unist | e7a122c910bf12eddf5c0ffc2c666995b4989408 | [
"MIT"
] | 4 | 2019-07-03T00:57:01.000Z | 2020-12-11T23:06:11.000Z | data-science-not/weeks/m03_sequences/p0/stack.py | nurseiit/comm-unist | e7a122c910bf12eddf5c0ffc2c666995b4989408 | [
"MIT"
] | 1 | 2019-10-19T17:42:42.000Z | 2019-10-19T17:42:42.000Z | data-science-not/weeks/m03_sequences/p0/stack.py | nurseiit/comm-unist | e7a122c910bf12eddf5c0ffc2c666995b4989408 | [
"MIT"
] | 1 | 2019-11-05T04:14:08.000Z | 2019-11-05T04:14:08.000Z | # Copyright 2013, Michael H. Goldwasser
#
# Developed for use with the book:
#
# Data Structures and Algorithms in Python
# Michael T. Goodrich, Roberto Tamassia, and Michael H. Goldwasser
# John Wiley & Sons, 2013
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... | 39.410526 | 86 | 0.554754 | # Copyright 2013, Michael H. Goldwasser
#
# Developed for use with the book:
#
# Data Structures and Algorithms in Python
# Michael T. Goodrich, Roberto Tamassia, and Michael H. Goldwasser
# John Wiley & Sons, 2013
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... | 0 | 0 | 0 | 1,309 | 0 | 0 | 0 | 0 | 23 |
fefc73a6ccd7110962995b4002d9d6080e706454 | 254 | py | Python | preprocessing/smri/utils/features.py | GalBenZvi/BrainPrint | 8dda22f130f60bac66fe05f0f5163ee3680616f5 | [
"Apache-2.0"
] | null | null | null | preprocessing/smri/utils/features.py | GalBenZvi/BrainPrint | 8dda22f130f60bac66fe05f0f5163ee3680616f5 | [
"Apache-2.0"
] | 1 | 2021-08-12T07:54:37.000Z | 2021-08-12T07:54:37.000Z | preprocessing/dwi/utils/features.py | GalBenZvi/BrainPrint | 8dda22f130f60bac66fe05f0f5163ee3680616f5 | [
"Apache-2.0"
] | 1 | 2021-08-08T11:56:19.000Z | 2021-08-08T11:56:19.000Z | FEATURES = {
"DWI": [
"MD",
"FA",
"AD",
"RD",
"EigenValue",
"EigenVector",
"CS",
"CP",
"CL",
],
"SMRI": [
"Thickness",
"Volume",
"Sulc",
],
}
| 13.368421 | 22 | 0.271654 | FEATURES = {
"DWI": [
"MD",
"FA",
"AD",
"RD",
"EigenValue",
"EigenVector",
"CS",
"CP",
"CL",
],
"SMRI": [
"Thickness",
"Volume",
"Sulc",
],
}
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2159bbd87ad1a044357a5af7ed39b624367234cb | 1,066 | py | Python | m2core/data_schemes/redis_system_scheme.py | mdutkin/m2core | 1e08acbc99e9e6c60a03d63110e2fcec96a35ec0 | [
"MIT"
] | 18 | 2017-11-02T16:06:41.000Z | 2019-04-16T08:11:37.000Z | m2core/data_schemes/redis_system_scheme.py | mdutkin/m2core | 1e08acbc99e9e6c60a03d63110e2fcec96a35ec0 | [
"MIT"
] | 4 | 2018-06-19T08:45:26.000Z | 2019-02-08T04:28:28.000Z | m2core/data_schemes/redis_system_scheme.py | mdutkin/m2core | 1e08acbc99e9e6c60a03d63110e2fcec96a35ec0 | [
"MIT"
] | 2 | 2017-11-10T07:27:22.000Z | 2018-06-27T12:16:27.000Z | # holds mapping between human key prefixes and real Redis prefixes
minute = 60
hour = 60 * minute
day = 24 * hour
week = 7 * day
month = 31 * day
redis_scheme = {
#
# human-readable table name
# |
# | prefix for key in Redis +
# | key placeholder
... | 34.387097 | 87 | 0.366792 | # holds mapping between human key prefixes and real Redis prefixes
minute = 60
hour = 60 * minute
day = 24 * hour
week = 7 * day
month = 31 * day
redis_scheme = {
#
# human-readable table name
# |
# | prefix for key in Redis +
# | key placeholder
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
83fef8c29fe6d4a012071d9b3885e0118d9aecd4 | 4,535 | py | Python | python/paddle/fluid/tests/unittests/test_allclose_op.py | Steffy-zxf/Paddle | 82b23b8fcf6f171ad72e1453c8a2b337e95ee8a9 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_allclose_op.py | Steffy-zxf/Paddle | 82b23b8fcf6f171ad72e1453c8a2b337e95ee8a9 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/test_allclose_op.py | Steffy-zxf/Paddle | 82b23b8fcf6f171ad72e1453c8a2b337e95ee8a9 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 33.592593 | 80 | 0.592944 | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 0 | 0 | 0 | 3,653 | 0 | 0 | 0 | -6 | 204 |
bbe11f64ed969361559c9c408832f964831eb078 | 174 | py | Python | flask_swag/extractor/__init__.py | Hardtack/Flask-Swag | 84555d1b88434ed8813a7045f08a98398197e90a | [
"MIT"
] | 10 | 2016-02-08T14:08:20.000Z | 2019-07-21T02:25:02.000Z | flask_swag/extractor/__init__.py | Hardtack/Flask-Swag | 84555d1b88434ed8813a7045f08a98398197e90a | [
"MIT"
] | 2 | 2016-02-11T08:59:00.000Z | 2017-05-08T06:49:28.000Z | flask_swag/extractor/__init__.py | Hardtack/Flask-Swag | 84555d1b88434ed8813a7045f08a98398197e90a | [
"MIT"
] | null | null | null | """
extractor
=========
Extract path info from flask application.
"""
from .base import Extractor
from .mark import MarkExtractor
__all__ = ['Extractor', 'MarkExtractor']
| 14.5 | 41 | 0.706897 | """
extractor
=========
Extract path info from flask application.
"""
from .base import Extractor
from .mark import MarkExtractor
__all__ = ['Extractor', 'MarkExtractor']
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ab256a8a46bd4d6a36a50cb2513e20b4a1200245 | 1,676 | py | Python | lib/process_util.py | hustwei/chromite | 10eb79abeb64e859362546214b7e039096ac9830 | [
"BSD-3-Clause"
] | null | null | null | lib/process_util.py | hustwei/chromite | 10eb79abeb64e859362546214b7e039096ac9830 | [
"BSD-3-Clause"
] | null | null | null | lib/process_util.py | hustwei/chromite | 10eb79abeb64e859362546214b7e039096ac9830 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Process related utilities."""
from __future__ import print_function
import errno
import os
import signal
import sys
import time
def GetExitStatus(s... | 25.014925 | 75 | 0.693914 | # Copyright 2014 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Process related utilities."""
from __future__ import print_function
import errno
import os
import signal
import sys
import time
def GetExitStatus(s... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b6f9b268179e914aa4660fb6210f0fd47b82d044 | 7,204 | py | Python | function_testing/test_pointcorr.py | simonsobs/soaculib | db829e74f9feba06b3b90e2b0fc997a4c86ae683 | [
"BSD-2-Clause"
] | 1 | 2022-02-16T22:33:46.000Z | 2022-02-16T22:33:46.000Z | function_testing/test_pointcorr.py | simonsobs/soaculib | db829e74f9feba06b3b90e2b0fc997a4c86ae683 | [
"BSD-2-Clause"
] | null | null | null | function_testing/test_pointcorr.py | simonsobs/soaculib | db829e74f9feba06b3b90e2b0fc997a4c86ae683 | [
"BSD-2-Clause"
] | null | null | null | import soaculib
import test_helpers as th
import time
import numpy as np
import pickle
# Locals.
import spem_model
import util
parser = util.get_parser()
parser.add_argument('mode', default='passive', nargs='?')
args = parser.parse_args()
SPEM_KEYS = [
'IA', 'IE',
'TF', 'TFS',
'TFC',
'AN', 'AW',
# ... | 27.601533 | 92 | 0.575236 | import soaculib
import test_helpers as th
import time
import numpy as np
import pickle
# Locals.
import spem_model
import util
parser = util.get_parser()
parser.add_argument('mode', default='passive', nargs='?')
args = parser.parse_args()
SPEM_KEYS = [
'IA', 'IE',
'TF', 'TFS',
'TFC',
'AN', 'AW',
# ... | 0 | 0 | 0 | 1,481 | 0 | 123 | 0 | 0 | 68 |
61379b4f083f9f81ebc303758aee285ce2476135 | 13,529 | py | Python | tests/test_of_mangle.py | cloudysunny14/faucet | 7e4414028f7696e67385b811518ae41d01fc830c | [
"Apache-2.0"
] | 1 | 2016-12-28T15:14:51.000Z | 2016-12-28T15:14:51.000Z | tests/test_of_mangle.py | cloudysunny14/of_mangle | 78fbf4ca897da2995a6ecba6330519b8680ebadb | [
"Apache-2.0"
] | null | null | null | tests/test_of_mangle.py | cloudysunny14/of_mangle | 78fbf4ca897da2995a6ecba6330519b8680ebadb | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2014 cloudysunny14.
#
# 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... | 35.69657 | 83 | 0.572326 | #!/usr/bin/env python
#
# Copyright 2014 cloudysunny14.
#
# 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... | 0 | 578 | 0 | 8,301 | 0 | 1,415 | 0 | 210 | 405 |
e644729f9f477affc4780f5fb80a7494502e4463 | 1,708 | py | Python | orchestra/contrib/domains/utils.py | RubenPX/django-orchestra | 5ab4779e1ae12ec99569d682601b7810587ed381 | [
"Unlicense"
] | 68 | 2015-02-09T10:28:44.000Z | 2022-03-12T11:08:36.000Z | orchestra/contrib/domains/utils.py | RubenPX/django-orchestra | 5ab4779e1ae12ec99569d682601b7810587ed381 | [
"Unlicense"
] | 17 | 2015-05-01T18:10:03.000Z | 2021-03-19T21:52:55.000Z | orchestra/contrib/domains/utils.py | RubenPX/django-orchestra | 5ab4779e1ae12ec99569d682601b7810587ed381 | [
"Unlicense"
] | 29 | 2015-03-31T04:51:03.000Z | 2022-02-17T02:58:50.000Z |
def format_hostmaster(hostmaster):
"""
The DNS encodes the <local-part> as a single label, and encodes the
<mail-domain> as a domain name. The single label from the <local-part>
is prefaced to the domain name from <mail-domain> to form the domain
name corresponding to the mailbox. Thus the mai... | 32.226415 | 76 | 0.659251 | from collections import defaultdict
from django.utils import timezone
class RecordStorage(object):
"""
list-dict implementation for fast lookups of record types
"""
def __init__(self, *args):
self.records = list(*args)
self.type = defaultdict(list)
def __iter__(self):
... | 0 | 0 | 0 | 574 | 0 | 110 | 0 | 26 | 91 |
edae5c03b18bc54c2307cfc6aff9c4173371eb1c | 5,398 | py | Python | dbinit/dump.py | mrdepth/libdgmpp | 2721f7f905a2c015383868db5043c382fe682ab0 | [
"MIT"
] | 13 | 2016-04-30T17:14:59.000Z | 2021-08-19T01:52:38.000Z | dbinit/dump.py | mrdepth/eufe | 2721f7f905a2c015383868db5043c382fe682ab0 | [
"MIT"
] | 7 | 2017-12-19T23:13:35.000Z | 2018-08-02T14:14:15.000Z | dbinit/dump.py | mrdepth/eufe | 2721f7f905a2c015383868db5043c382fe682ab0 | [
"MIT"
] | 8 | 2016-01-26T16:52:37.000Z | 2021-10-15T08:29:48.000Z |
import yaml
import json
import sqlite3
f=open('./tmp/sde/typeIDs.json', 'r', encoding='utf-8')
j=json.load(f)
#y=load("./tmp/sde/fsd/typeIDs.yaml")
#f=open('./tmp/sde/typeIDs.json', 'w', encoding='utf-8')
#json.dump(y, f)
#f.write(json.dump(y))
#f.close()
#db = sqlite3.connect(':memory:')
db = sqlite3.connect("./t... | 27.682051 | 173 | 0.667469 |
import yaml
import json
import sqlite3
from functools import reduce
import operator
import time
def f():
return None
def load(path):
t0 = time.time()
s=open(path, "r", encoding="utf-8").read()
result = yaml.load(s, yaml.CLoader)
if isinstance(result, dict):
result = result#.items()
t... | 0 | 0 | 0 | 0 | 0 | 570 | 0 | -9 | 157 |
35dca39e0121540a436f6da96d93d03e4d00edc2 | 689 | py | Python | tests/theano/__init__.py | brandonwillard/symbolic-pymc | 84e8d612c714f502f8d188c1766498f4ff7beecf | [
"Apache-2.0"
] | 59 | 2019-02-16T21:07:48.000Z | 2022-03-09T01:01:45.000Z | tests/theano/__init__.py | brandonwillard/symbolic-pymc | 84e8d612c714f502f8d188c1766498f4ff7beecf | [
"Apache-2.0"
] | 56 | 2019-02-20T09:06:04.000Z | 2021-01-08T21:22:23.000Z | tests/theano/__init__.py | brandonwillard/symbolic-pymc | 84e8d612c714f502f8d188c1766498f4ff7beecf | [
"Apache-2.0"
] | 9 | 2019-02-22T06:22:31.000Z | 2021-07-05T10:05:35.000Z | import warnings
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
import theano
theano.config.compute_test_value = "ignore"
theano.config.on_opt_error = "raise"
theano.config.mode = "FAST_COMPILE"
theano.config.cxx = ""
| 19.685714 | 66 | 0.676343 | import warnings
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=DeprecationWarning)
import theano
import pymc3 as pm
from functools import wraps
theano.config.compute_test_value = "ignore"
theano.config.on_opt_error = "raise"
theano.config.mode = "FAST_COMPILE"
theano.config.cxx ... | 0 | 292 | 0 | 0 | 0 | 48 | 0 | 3 | 69 |
70778d96d5999b4ef52cb4dde6e9df7135bb617c | 13,904 | py | Python | Segmentation/eval_performance.py | atomized1/MRI_Segmentation_Radiomics | 3998dd26b60972f41d3b397cecdad16563df4189 | [
"Apache-2.0"
] | 12 | 2020-02-14T05:33:24.000Z | 2022-01-13T16:37:44.000Z | Segmentation/eval_performance.py | atomized1/MRI_Segmentation_Radiomics | 3998dd26b60972f41d3b397cecdad16563df4189 | [
"Apache-2.0"
] | 3 | 2020-01-28T22:20:08.000Z | 2022-02-09T23:33:30.000Z | Segmentation/eval_performance.py | atomized1/MRI_Segmentation_Radiomics | 3998dd26b60972f41d3b397cecdad16563df4189 | [
"Apache-2.0"
] | 4 | 2020-06-12T02:59:55.000Z | 2021-08-20T05:42:34.000Z | import os
import keras
from sklearn.metrics import precision_recall_fscore_support, jaccard_similarity_score, accuracy_score
import pandas as pd
from pylab import rcParams
import seaborn as sns
# Set up plotting properties
sns.set(style='ticks', palette='Spectral', font_scale=1.5)
rcParams['figure.figsize'] = 6, 4
R... | 30.897778 | 133 | 0.562572 | import os
from MachineLearning.load_datasets import load_filenames_2nd, load_data, keep_t2
from glob2 import glob
import nibabel as nib
import numpy as np
import keras
from Segmentation.model_keras import *
from sklearn.metrics import precision_recall_curve, precision_score, \
recall_score, roc_auc_score, f1_score,... | 0 | 0 | 0 | 0 | 1,070 | 3,152 | 0 | 185 | 294 |
e465039836c2865c9891dbb3920bc30d8a2a4018 | 2,178 | py | Python | Algo/004 (Contest)/F_test.py | abel1502/mipt_1s | f97974075ad82b4f1df4df1beee6ad895c363691 | [
"MIT"
] | 3 | 2020-10-01T17:21:49.000Z | 2020-10-16T10:57:53.000Z | Algo/004 (Contest)/F_test.py | abel1502/mipt_1s | f97974075ad82b4f1df4df1beee6ad895c363691 | [
"MIT"
] | 2 | 2020-10-07T15:53:14.000Z | 2020-10-07T16:26:02.000Z | Algo/004 (Contest)/F_test.py | abel1502/mipt_1s | f97974075ad82b4f1df4df1beee6ad895c363691 | [
"MIT"
] | null | null | null |
INF = 10 ** 20
stress(100)
exit()
data = (16, 8, [8, 10, 15, 16, 4, 11])
"""
16 6 8
8 10 15 16 4 11
"""
ans = solve(*data)
print(test(*data, ans))
print(data, ans)
"""
[Error] (18, 3, [18, 8, 11, 2, 17, 10, 15, 5, 16]) (0, 1, 6)
[Error] (80, 5, [61, 2]) (0, 1, 16)
[Error] (9, 3, [9, 1]) (0, 1... | 20.942308 | 101 | 0.495868 | import subprocess
import io
import random
INF = 10 ** 20
def test(l, k, cells, ans):
inData = "{l} {n} {k}\n{cells}\n".format(n=len(cells), l=l, k=k, cells=' '.join(map(str, cells)))
result = subprocess.run("F.exe", input=inData.encode(), stdout=subprocess.PIPE)
d, c, s = map(int, result.stdout.decode().s... | 0 | 0 | 0 | 0 | 0 | 1,580 | 0 | -24 | 158 |
0c88c092702f2372af93159b4d7525bfd1fe0502 | 2,820 | py | Python | meta_policy_search/envs/mujoco_envs/half_cheetah_rand_direc.py | Zhiwei-Z/SeqPromp | d973b8564d500d95477624cfb992fb5a96e096ca | [
"MIT"
] | null | null | null | meta_policy_search/envs/mujoco_envs/half_cheetah_rand_direc.py | Zhiwei-Z/SeqPromp | d973b8564d500d95477624cfb992fb5a96e096ca | [
"MIT"
] | null | null | null | meta_policy_search/envs/mujoco_envs/half_cheetah_rand_direc.py | Zhiwei-Z/SeqPromp | d973b8564d500d95477624cfb992fb5a96e096ca | [
"MIT"
] | null | null | null |
IterationBound1 = 200
IterationBound2 = 600 | 37.105263 | 92 | 0.634752 | import numpy as np
from meta_policy_search.envs.base import MetaEnv
from meta_policy_search.utils import logger
import gym
from gym.envs.mujoco.mujoco_env import MujocoEnv
IterationBound1 = 200
IterationBound2 = 600
class HalfCheetahRandDirecEnv(MetaEnv, MujocoEnv, gym.utils.EzPickle):
def __init__(self, goal_dir... | 0 | 0 | 0 | 2,581 | 0 | 0 | 0 | 62 | 133 |
d9c30762e931c64e2c9bdf14b9468c8796124944 | 42,572 | py | Python | pydia/cuda_functions_dp.py | koconnor4/pyDIA | 7c0c2c21f039ae28bcda4af821f16dbafb27ceb5 | [
"MIT"
] | 2 | 2019-04-18T09:58:12.000Z | 2020-03-03T09:27:25.000Z | pydia/cuda_functions_dp.py | koconnor4/pyDIA | 7c0c2c21f039ae28bcda4af821f16dbafb27ceb5 | [
"MIT"
] | null | null | null | pydia/cuda_functions_dp.py | koconnor4/pyDIA | 7c0c2c21f039ae28bcda4af821f16dbafb27ceb5 | [
"MIT"
] | 1 | 2019-03-13T02:09:29.000Z | 2019-03-13T02:09:29.000Z | from pycuda.compiler import SourceModule
cu_matrix_kernel = SourceModule("""
#include <math.h>
#include <stdio.h>
#include "texture_fetch_functions.h"
#include "texture_types.h"
#define THREADS_PER_BLOCK 256
#define FIT_RADIUS 6
texture<float, cudaTextureType2DLayered, cudaReadModeElementType> tex;
__device__ vo... | 25.895377 | 219 | 0.485272 | import pycuda.autoinit
from pycuda.compiler import SourceModule
cu_matrix_kernel = SourceModule("""
#include <math.h>
#include <stdio.h>
#include "texture_fetch_functions.h"
#include "texture_types.h"
#define THREADS_PER_BLOCK 256
#define FIT_RADIUS 6
texture<float, cudaTextureType2DLayered, cudaReadModeElementTyp... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 22 |
127f75e4af1c5b7ee4fe6000ac7878906b35420f | 5,466 | py | Python | taro/jobs/job.py | taro-suite/taro | baa76e75706bc824a799928d9b7548431b898338 | [
"MIT"
] | null | null | null | taro/jobs/job.py | taro-suite/taro | baa76e75706bc824a799928d9b7548431b898338 | [
"MIT"
] | 26 | 2021-04-05T12:32:21.000Z | 2022-03-22T12:53:44.000Z | taro/jobs/job.py | taro-suite/taro | baa76e75706bc824a799928d9b7548431b898338 | [
"MIT"
] | 1 | 2021-04-16T21:04:53.000Z | 2021-04-16T21:04:53.000Z | """
Job framework defines components used for job submission and management.
It is built upon :mod:`execution` framework.
It provides constructs for:
1. Creating of job definition
2. Implementing of job instance
3. Implementing of job observer
There are two type of clients of the framework:
1. Job users
2. J... | 24.079295 | 115 | 0.643981 | """
Job framework defines components used for job submission and management.
It is built upon :mod:`execution` framework.
It provides constructs for:
1. Creating of job definition
2. Implementing of job instance
3. Implementing of job observer
There are two type of clients of the framework:
1. Job users
2. J... | 0 | 3,036 | 0 | 1,103 | 0 | 0 | 0 | 20 | 746 |
258df39239a3f809e93d6348ebe51ed653b9433d | 285 | py | Python | test/api/test_nvgli.py | lonagi/pynvg | a7b28952960184509eba8060e10ddd824913b08e | [
"MIT"
] | null | null | null | test/api/test_nvgli.py | lonagi/pynvg | a7b28952960184509eba8060e10ddd824913b08e | [
"MIT"
] | null | null | null | test/api/test_nvgli.py | lonagi/pynvg | a7b28952960184509eba8060e10ddd824913b08e | [
"MIT"
] | null | null | null | import unittest
if(__name__=="main"):
unittest.main() | 20.357143 | 39 | 0.642105 | import unittest
from pynvg.api import nvgli
class NVGLiTestCase(unittest.TestCase):
def test_nvgli(self):
url = "nvg-grou.com";
result="https://nvg.li/nvg";
test=nvgli(url);
self.assertEqual(test,result)
if(__name__=="main"):
unittest.main() | 0 | 0 | 0 | 176 | 0 | 0 | 0 | 6 | 45 |
2a6533ef8ebb5fa457b07048f4ff5f7a4f159684 | 400 | py | Python | hlwtadmin/migrations/0024_concertannouncement_seen_count.py | Kunstenpunt/havelovewilltravel | 6a27824b4d3d8b1bf19e0bc0d0648f0f4e8abc83 | [
"Apache-2.0"
] | 1 | 2020-10-16T16:29:01.000Z | 2020-10-16T16:29:01.000Z | hlwtadmin/migrations/0024_concertannouncement_seen_count.py | Kunstenpunt/havelovewilltravel | 6a27824b4d3d8b1bf19e0bc0d0648f0f4e8abc83 | [
"Apache-2.0"
] | 365 | 2020-02-03T12:46:53.000Z | 2022-02-27T17:20:46.000Z | hlwtadmin/migrations/0024_concertannouncement_seen_count.py | Kunstenpunt/havelovewilltravel | 6a27824b4d3d8b1bf19e0bc0d0648f0f4e8abc83 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0 on 2020-03-25 09:09
| 21.052632 | 49 | 0.615 | # Generated by Django 3.0 on 2020-03-25 09:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hlwtadmin', '0023_auto_20200323_1239'),
]
operations = [
migrations.AddField(
model_name='concertannouncement',
name='... | 0 | 0 | 0 | 288 | 0 | 0 | 0 | 19 | 46 |
a7dbb1c47342dbe9ec25e6f02175caff451286c8 | 910 | py | Python | oop/class_ipaddress.py | levs72/pyneng-examples | d6288292dcf9d1ebc5a9db4a0d620bd11b4a2df9 | [
"MIT"
] | 11 | 2021-04-05T09:30:23.000Z | 2022-03-09T13:27:56.000Z | oop/class_ipaddress.py | levs72/pyneng-examples | d6288292dcf9d1ebc5a9db4a0d620bd11b4a2df9 | [
"MIT"
] | null | null | null | oop/class_ipaddress.py | levs72/pyneng-examples | d6288292dcf9d1ebc5a9db4a0d620bd11b4a2df9 | [
"MIT"
] | 11 | 2021-04-06T03:44:35.000Z | 2022-03-04T21:20:40.000Z |
if __name__ == "__main__":
ip1 = IPAddress("10.1.1.1/25")
print(ip1 + 5)
print(5 + ip1)
print(ip1.__radd__(5))
| 26 | 62 | 0.579121 | import ipaddress
class IPAddress:
def __init__(self, ip):
address, mask = ip.split("/")
self.address = address
self.mask = int(mask)
def __str__(self):
return f"{self.address}/{self.mask}"
def __repr__(self):
return f"IPAddress('{self.address}/{self.mask}')"
... | 0 | 0 | 0 | 740 | 0 | 0 | 0 | -5 | 45 |
401baae6945a8dbb1239753759d3f6342dfaab25 | 5,894 | py | Python | addons/openacademy/tests/test_openacademy.py | radchapoom1009/openacademy | 7516da7697906a405d0d67a9bf8373860d1518d4 | [
"MIT"
] | null | null | null | addons/openacademy/tests/test_openacademy.py | radchapoom1009/openacademy | 7516da7697906a405d0d67a9bf8373860d1518d4 | [
"MIT"
] | null | null | null | addons/openacademy/tests/test_openacademy.py | radchapoom1009/openacademy | 7516da7697906a405d0d67a9bf8373860d1518d4 | [
"MIT"
] | null | null | null |
'''
openacademy.openacademy
'''
'''
openacademy.session
'''
| 33.68 | 78 | 0.60112 | import pytest
from odoo import exceptions
from pytest_tr_odoo.fixtures import env
from pytest_tr_odoo import utils
@pytest.fixture
def openacademy_model(env):
return env['openacademy.openacademy']
@pytest.fixture
def session_model(env):
return env['openacademy.session']
@pytest.fixture
def session(session... | 0 | 5,452 | 0 | 0 | 0 | 0 | 0 | 27 | 341 |
6ad9628195a450b435a1a3d6b4dd609311782467 | 1,132 | py | Python | applications/migrations/0005_tshirtorder.py | hoohacks/HackX | 9d05268b4b075211048a8c727037e7807d476376 | [
"MIT"
] | 5 | 2019-09-05T05:18:39.000Z | 2021-12-29T08:47:27.000Z | applications/migrations/0005_tshirtorder.py | hoohacks/HackX | 9d05268b4b075211048a8c727037e7807d476376 | [
"MIT"
] | 18 | 2019-10-30T05:04:27.000Z | 2022-02-10T11:18:01.000Z | applications/migrations/0005_tshirtorder.py | hoohacks/HackX | 9d05268b4b075211048a8c727037e7807d476376 | [
"MIT"
] | 4 | 2019-11-09T02:52:53.000Z | 2020-05-04T08:04:32.000Z | # Generated by Django 2.2.8 on 2020-04-13 03:44
| 37.733333 | 156 | 0.607774 | # Generated by Django 2.2.8 on 2020-04-13 03:44
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('users', '0014_ticket_slack_ts'),
('applications', '0004_application_mlh_consent'),
... | 0 | 0 | 0 | 952 | 0 | 0 | 0 | 41 | 90 |
c88568a63008aa9674f9b8dc544cb2e6da6606af | 122 | py | Python | old/fundamentus/__init__.py | mv/fundamentus-api | 3d12be9613b8310afb48771a22d5b494e1817e28 | [
"MIT"
] | 12 | 2021-01-20T12:02:05.000Z | 2022-03-24T14:22:48.000Z | old/fundamentus/__init__.py | mv/fundamentus | 43d345dc3c461101e6899fb0b6e28e7615286a9f | [
"MIT"
] | 62 | 2021-01-16T21:44:44.000Z | 2022-03-18T08:10:24.000Z | old/fundamentus/__init__.py | mv/fundamentus | 43d345dc3c461101e6899fb0b6e28e7615286a9f | [
"MIT"
] | 6 | 2021-04-29T19:45:31.000Z | 2022-03-16T14:27:52.000Z |
__all__ = ['get_fundamentus','print_csv']
from fundamentus import get_fundamentus
from fundamentus import print_csv
| 15.25 | 41 | 0.795082 |
__all__ = ['get_fundamentus','print_csv']
from fundamentus import get_fundamentus
from fundamentus import print_csv
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 0 |
9168cc8b8ae166eb1d9652010df1d2ff5b5e78ad | 4,308 | py | Python | cibyl/sources/zuul/api.py | amolkahat/cibyl | 586c3c0a6b21a8f1b71db0c5b29e7d60f9cf0def | [
"Apache-2.0"
] | null | null | null | cibyl/sources/zuul/api.py | amolkahat/cibyl | 586c3c0a6b21a8f1b71db0c5b29e7d60f9cf0def | [
"Apache-2.0"
] | null | null | null | cibyl/sources/zuul/api.py | amolkahat/cibyl | 586c3c0a6b21a8f1b71db0c5b29e7d60f9cf0def | [
"Apache-2.0"
] | null | null | null | """
# Copyright 2022 Red Hat
#
# 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 agr... | 29.108108 | 79 | 0.627205 | """
# Copyright 2022 Red Hat
#
# 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 agr... | 0 | 2,169 | 0 | 1,397 | 0 | 0 | 0 | 14 | 114 |
7c2fea003b45be32d55da3d4eb17d104b5ac3b18 | 3,264 | py | Python | main.py | alexander-g/Root-Detector | cc7af00d204a294ed967bbaab55c03e6a9a15bcc | [
"MIT"
] | 1 | 2022-02-17T16:18:00.000Z | 2022-02-17T16:18:00.000Z | main.py | ExPlEcoGreifswald/Root-Detector | cc7af00d204a294ed967bbaab55c03e6a9a15bcc | [
"MIT"
] | null | null | null | main.py | ExPlEcoGreifswald/Root-Detector | cc7af00d204a294ed967bbaab55c03e6a9a15bcc | [
"MIT"
] | null | null | null | import webbrowser, os, tempfile, sys
import glob, shutil
import warnings
warnings.simplefilter('ignore')
from flask import Flask
import processing
#need to import all the packages here in the main file because of dill-ed ipython model
import tensorflow.keras as keras
import numpy as np
arange = np.arange... | 30.792453 | 97 | 0.672794 | import webbrowser, os, tempfile, io, sys, time
import glob, shutil
import warnings
warnings.simplefilter('ignore')
import flask
from flask import Flask, escape, request
import processing
#need to import all the packages here in the main file because of dill-ed ipython model
import tensorflow as tf
import... | 0 | 1,519 | 0 | 0 | 0 | 0 | 0 | 20 | 248 |
c3c4e160f8c3532ab54b6f59cad341eff94860f9 | 33,385 | py | Python | vilya/models/project.py | ochukai/code | 4865a7e5ee6b42f26fd29c350a2e50d7636a6462 | [
"BSD-3-Clause"
] | null | null | null | vilya/models/project.py | ochukai/code | 4865a7e5ee6b42f26fd29c350a2e50d7636a6462 | [
"BSD-3-Clause"
] | null | null | null | vilya/models/project.py | ochukai/code | 4865a7e5ee6b42f26fd29c350a2e50d7636a6462 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
MCKEY_PROJECT = 'code:project:%s:v2'
MCKEY_PROJECT_ID_BY_NAME = 'code:project_id:name:%s'
MCKEY_PROJECT_IDS_BY_OWNER_SORTBY_SUMUP = 'code:project_ids:sumup:%s'
PROPS_LANGUAGE_KEY = 'language'
PROPS_LANGUAGES_KEY = 'languages'
| 34.170931 | 79 | 0.587479 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import shutil
import logging
import re
from datetime import datetime
from vilya.config import DOMAIN, DEVELOP_MODE
from vilya.libs import gyt
from vilya.libs.permdir import get_repo_root
from vilya.libs.text import format_md_or_rst
from vilya.lib... | 24 | 16,926 | 0 | 14,776 | 0 | 0 | 0 | 721 | 662 |
fc26a6143130ea089dd5fa566469d93b221e0392 | 1,410 | py | Python | release/scripts/addons_contrib/data_overrides/__init__.py | noorbeast/BlenderSource | 65ebecc5108388965678b04b43463b85f6c69c1d | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 3 | 2019-09-16T10:29:19.000Z | 2022-02-11T14:43:18.000Z | engine/2.80/scripts/addons_contrib/data_overrides/__init__.py | byteinc/Phasor | f7d23a489c2b4bcc3c1961ac955926484ff8b8d9 | [
"Unlicense"
] | null | null | null | engine/2.80/scripts/addons_contrib/data_overrides/__init__.py | byteinc/Phasor | f7d23a489c2b4bcc3c1961ac955926484ff8b8d9 | [
"Unlicense"
] | null | null | null | ### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed... | 30 | 79 | 0.685106 | ### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed... | 0 | 0 | 0 | 0 | 0 | 78 | 0 | 7 | 91 |
c2a74c3d75b83ae19c04de00181ae230c6ab67e9 | 7,725 | py | Python | lab2/zad4.py | vedrankolka/DU | 531cf53b030bd9ef750bfcaea697535042249fe3 | [
"Apache-2.0"
] | null | null | null | lab2/zad4.py | vedrankolka/DU | 531cf53b030bd9ef750bfcaea697535042249fe3 | [
"Apache-2.0"
] | null | null | null | lab2/zad4.py | vedrankolka/DU | 531cf53b030bd9ef750bfcaea697535042249fe3 | [
"Apache-2.0"
] | null | null | null | import torch
import numpy as np
import matplotlib.pyplot as plt
import os
from pathlib import Path
import convolutional_model as cm
DATA_DIR = default_data_dir = Path(__file__).parent / 'data' / 'cifar-10-batches-py'
img_height = 32
img_width = 32
num_channels = 3
num_classes = 10
train_x = np.ndarray((0, img_... | 34.486607 | 115 | 0.659029 | import torch
from torch.utils import data
import numpy as np
import matplotlib.pyplot as plt
import os
import pickle
from pathlib import Path
import argparse
import convolutional_model as cm
import skimage as ski
import math
def shuffle_data(data_x, data_y):
indices = np.arange(data_x.shape[0])
np.random.shuffle(... | 0 | 0 | 0 | 0 | 0 | 4,154 | 0 | -17 | 248 |
d004abc9f0360b5abe7791995600ba3e14457e3f | 670 | py | Python | schoolport/app_core/migrations/0007_tb_param_fees.py | yotink522/schoolport | c6cfd0230ca05fb44f77c2f27c7e200828547bd5 | [
"MIT"
] | null | null | null | schoolport/app_core/migrations/0007_tb_param_fees.py | yotink522/schoolport | c6cfd0230ca05fb44f77c2f27c7e200828547bd5 | [
"MIT"
] | null | null | null | schoolport/app_core/migrations/0007_tb_param_fees.py | yotink522/schoolport | c6cfd0230ca05fb44f77c2f27c7e200828547bd5 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-05-07 11:20
| 29.130435 | 114 | 0.589552 | # Generated by Django 3.1.7 on 2021-05-07 11:20
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app_core', '0006_tb_param_items_price_unit'),
]
operations = [
migrations.CreateModel(
name='TB_Param_Fees',
fields=... | 0 | 0 | 0 | 556 | 0 | 0 | 0 | 19 | 46 |
75bb9561ab5c5fa328176c32ed78531d0f721459 | 535 | py | Python | stackEx1.py | JaeGyu/PythonEx_1 | e67053db6ca7431c3dd66351c190c53229e3f141 | [
"MIT"
] | null | null | null | stackEx1.py | JaeGyu/PythonEx_1 | e67053db6ca7431c3dd66351c190c53229e3f141 | [
"MIT"
] | null | null | null | stackEx1.py | JaeGyu/PythonEx_1 | e67053db6ca7431c3dd66351c190c53229e3f141 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
s = Stack()
s.push(1)
s.push(2)
print(s.top())
s.push(5)
print(s.size())
print(s.toString())
s.pop()
print(s.toString())
print(s.size())
| 16.71875 | 31 | 0.527103 |
class Stack():
def __init__(self):
self.store = []
def push(self, num):
self.store.append(num)
def pop(self):
return self.store.pop()
def size(self):
return len(self.store)
def toString(self):
return self.store
def top(self):
return self.... | 0 | 0 | 0 | 307 | 0 | 0 | 0 | 0 | 23 |
5c8fb708a31f92aa30ed34d57058f849faa1abff | 488 | py | Python | S4/S4 Decompiler/Old Libraries/xdis/opcodes/opcode_23.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | 1 | 2021-05-20T19:33:37.000Z | 2021-05-20T19:33:37.000Z | S4/S4 Decompiler/Old Libraries/xdis/opcodes/opcode_23.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | null | null | null | S4/S4 Decompiler/Old Libraries/xdis/opcodes/opcode_23.py | NeonOcean/Environment | ca658cf66e8fd6866c22a4a0136d415705b36d26 | [
"CC-BY-4.0"
] | null | null | null | # (C) Copyright 2017, 2019 by Rocky Bernstein
"""
CPython 2.3 bytecode opcodes
This is a like Python 2.3's opcode.py with some classification
of stack usage.
"""
import xdis.opcodes.opcode_2x as opcode_2x
from xdis.opcodes.base import (finalize_opcodes, format_extended_arg, init_opdata, update_pj2)
version = 2.3
l ... | 18.074074 | 62 | 0.741803 | # (C) Copyright 2017, 2019 by Rocky Bernstein
"""
CPython 2.3 bytecode opcodes
This is a like Python 2.3's opcode.py with some classification
of stack usage.
"""
import xdis.opcodes.opcode_2x as opcode_2x
from xdis.opcodes.base import (
finalize_opcodes,
format_extended_arg,
init_opdata,
update_pj2,
)... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 19 | 0 |
022100c5e98ea3d365d83de2b43fbb825efddb21 | 309 | py | Python | write_a_function.py | athena15/hackerrank | 4ddb6f0c80369c125c5c2016fad6f790c37027e5 | [
"MIT"
] | null | null | null | write_a_function.py | athena15/hackerrank | 4ddb6f0c80369c125c5c2016fad6f790c37027e5 | [
"MIT"
] | null | null | null | write_a_function.py | athena15/hackerrank | 4ddb6f0c80369c125c5c2016fad6f790c37027e5 | [
"MIT"
] | null | null | null | # HackerRank "Write a function" Leap Year challenge
# https://www.hackerrank.com/challenges/write-a-function/problem
is_leap(1990)
| 16.263158 | 64 | 0.669903 | # HackerRank "Write a function" Leap Year challenge
# https://www.hackerrank.com/challenges/write-a-function/problem
def is_leap(year):
leap = False
if year % 4 == 0:
if year % 400 == 0:
return True
elif year % 100 == 0:
return False
else:
return True
else:
return False
is_leap(1990)
| 0 | 0 | 0 | 0 | 0 | 152 | 0 | 0 | 23 |
c12bdbbecf9f179a4230f51b1650c5787bf123f9 | 2,609 | py | Python | base/utils.py | muzzley/manager-sdk-python | 479a0108b9a3b691c96090b2594bf6e733fe221a | [
"MIT"
] | 1 | 2018-10-29T09:39:42.000Z | 2018-10-29T09:39:42.000Z | base/utils.py | habitio/manager-sdk-python | 479a0108b9a3b691c96090b2594bf6e733fe221a | [
"MIT"
] | null | null | null | base/utils.py | habitio/manager-sdk-python | 479a0108b9a3b691c96090b2594bf6e733fe221a | [
"MIT"
] | null | null | null | import json
import threading
def format_response(resp):
"""
Returns a str formatted response
:param resp: Requests response
:return: response text as a string, formatted as a json if valid
"""
try:
error_msg = format_str(resp.json(), is_json=True)
except ValueError: # requests ret... | 25.831683 | 90 | 0.620544 | import json
import threading
import time
from functools import wraps
from uuid import UUID
from typing import AnyStr
def format_response(resp):
"""
Returns a str formatted response
:param resp: Requests response
:return: response text as a string, formatted as a json if valid
"""
try:
... | 0 | 479 | 0 | 0 | 0 | 536 | 0 | 0 | 211 |
efd02f13492a4df018a2eb15c0a965653b246934 | 548 | py | Python | Tree/104. Maximum depth of Binary tree.py | Rage-ops/Leetcode-Solutions | 48d4ecbb92a0bb7a7bb74a1445b593a67357ac02 | [
"MIT"
] | 1 | 2020-11-23T13:52:11.000Z | 2020-11-23T13:52:11.000Z | Tree/104. Maximum depth of Binary tree.py | harsha-sam/Leetcode-Solutions | 48d4ecbb92a0bb7a7bb74a1445b593a67357ac02 | [
"MIT"
] | null | null | null | Tree/104. Maximum depth of Binary tree.py | harsha-sam/Leetcode-Solutions | 48d4ecbb92a0bb7a7bb74a1445b593a67357ac02 | [
"MIT"
] | null | null | null | # Easy
# https://leetcode.com/problems/maximum-depth-of-binary-tree/
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
# Time Complexity : O(N)
# Space Complexity : O(N) | 27.4 | 73 | 0.609489 | # Easy
# https://leetcode.com/problems/maximum-depth-of-binary-tree/
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, val=0, left=None, right=None):
# self.val = val
# self.left = left
# self.right = right
# Time Complexity : O(N)
# Space Complexity : O(N)
class ... | 0 | 0 | 0 | 213 | 0 | 0 | 0 | 0 | 22 |
673222d869417d5b734e3bde5eaffe06ab13ba5d | 5,156 | py | Python | sportsipy/fb/fb_utils.py | roclark/sports-reference-scraper | fffb7c8170454720622089cf794ebcb106245e4d | [
"MIT"
] | null | null | null | sportsipy/fb/fb_utils.py | roclark/sports-reference-scraper | fffb7c8170454720622089cf794ebcb106245e4d | [
"MIT"
] | null | null | null | sportsipy/fb/fb_utils.py | roclark/sports-reference-scraper | fffb7c8170454720622089cf794ebcb106245e4d | [
"MIT"
] | null | null | null | from difflib import get_close_matches
from .squad_ids import SQUAD_IDS
def _parse_squad_name(team_id):
"""
Parse and clean the team's name.
To try and match requested team names with the master squad ID list, passed
names should be parsed to remove the common 'FC' and 'CF' tags, as well as
force ... | 40.28125 | 79 | 0.683088 | from difflib import get_close_matches
from .squad_ids import SQUAD_IDS
def _parse_squad_name(team_id):
"""
Parse and clean the team's name.
To try and match requested team names with the master squad ID list, passed
names should be parsed to remove the common 'FC' and 'CF' tags, as well as
force ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f36e476ffd668a1e530e1173c209b99e50531202 | 3,621 | py | Python | test/web_runner.py | hhucn/webvulnscan | efb812fd5483157528f37794acecafa35ed0d878 | [
"MIT"
] | 40 | 2015-01-15T14:52:51.000Z | 2022-03-25T08:52:48.000Z | test/web_runner.py | RaviRaaja/webvulnscan | efb812fd5483157528f37794acecafa35ed0d878 | [
"MIT"
] | 1 | 2016-07-21T09:51:15.000Z | 2016-10-02T17:45:37.000Z | test/web_runner.py | RaviRaaja/webvulnscan | efb812fd5483157528f37794acecafa35ed0d878 | [
"MIT"
] | 22 | 2015-01-23T04:21:21.000Z | 2021-08-22T03:36:21.000Z | #!/usr/bin/env python3
from __future__ import unicode_literals
import os
import sys
try:
from http.server import BaseHTTPRequestHandler, HTTPServer
except ImportError:
try:
from urllib.parse import urlparse, parse_qs
except ImportError:
_WVS_ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__... | 28.289063 | 78 | 0.567799 | #!/usr/bin/env python3
from __future__ import unicode_literals
import cgi
import io
import os
import socket
import unittest
import sys
try:
from http.server import BaseHTTPRequestHandler, HTTPServer
except ImportError:
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
try:
from urllib.parse i... | 0 | 0 | 0 | 2,416 | 407 | 136 | 0 | 18 | 232 |
888016f43395b30f5bb42509b2cf824b817a2f5c | 2,203 | py | Python | extract-airbnb-properties.py | townofchapelhill/hospitality-python | f6b0712a7ba0e9fd0164a55f271f163ebce41b6b | [
"WTFPL"
] | 1 | 2022-03-18T14:00:14.000Z | 2022-03-18T14:00:14.000Z | extract-airbnb-properties.py | townofchapelhill/hospitality-python | f6b0712a7ba0e9fd0164a55f271f163ebce41b6b | [
"WTFPL"
] | null | null | null | extract-airbnb-properties.py | townofchapelhill/hospitality-python | f6b0712a7ba0e9fd0164a55f271f163ebce41b6b | [
"WTFPL"
] | null | null | null | import airbnb
import airbnb_secrets
import csv
items=1
output_filename="airbnb_chapelhill.csv"
# Set CSV Header & line format
csv_header = ['City','Latitude','Longitude','Type','Bathrooms','Bedrooms','Public Address','Localized City','Source']
api = airbnb.Api()
# api = airbnb.Api(airbnb_secrets.login, airbnb_secrets... | 43.196078 | 123 | 0.67635 | import airbnb
import airbnb_secrets
import csv
items=1
output_filename="airbnb_chapelhill.csv"
# Set CSV Header & line format
csv_header = ['City','Latitude','Longitude','Type','Bathrooms','Bedrooms','Public Address','Localized City','Source']
api = airbnb.Api()
# api = airbnb.Api(airbnb_secrets.login, airbnb_secrets... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
042888c821315f9ac9268da7b68e21e264d574b7 | 452 | py | Python | Narcissistic Number/is_narcissistic_number.py | rayvantsahni/Let-us-Math | 571ee70452feae0b15f37d46de658b0c0251bd3d | [
"MIT"
] | 2 | 2020-08-06T07:09:38.000Z | 2020-09-12T02:32:23.000Z | Narcissistic Number/is_narcissistic_number.py | rayvantsahni/Math-is-Fun | 571ee70452feae0b15f37d46de658b0c0251bd3d | [
"MIT"
] | null | null | null | Narcissistic Number/is_narcissistic_number.py | rayvantsahni/Math-is-Fun | 571ee70452feae0b15f37d46de658b0c0251bd3d | [
"MIT"
] | 1 | 2021-08-30T14:17:28.000Z | 2021-08-30T14:17:28.000Z |
if __name__ == "__main__":
n = int(input("Enter number: "))
print("Is a Narcissistic Number" if is_narcissistic_number(n) else "Is NOT a Narcissistic Number")
| 22.6 | 102 | 0.64823 | def is_narcissistic_number(n):
original_number = n
number_of_digits = get_number_of_digits(n)
sum = 0
while n != 0:
sum += (n % 10) ** number_of_digits
n //= 10
return original_number == sum
def get_number_of_digits(n):
return len(str(n))
if __name__ == "__main__":
n = ... | 0 | 0 | 0 | 0 | 0 | 237 | 0 | 0 | 45 |
0758861400523877891511807ac1ca1e6d3c171c | 962 | py | Python | dataset.py | dddzg/MoCo | 94125b06235032cf74768709bac36e3ffbeb3f7c | [
"MIT"
] | 41 | 2019-12-04T09:56:22.000Z | 2022-02-10T13:07:37.000Z | dataset.py | dddzg/MoCo | 94125b06235032cf74768709bac36e3ffbeb3f7c | [
"MIT"
] | 5 | 2020-03-17T06:53:33.000Z | 2021-01-16T20:15:14.000Z | dataset.py | dddzg/MoCo | 94125b06235032cf74768709bac36e3ffbeb3f7c | [
"MIT"
] | 6 | 2019-12-21T06:50:58.000Z | 2021-12-04T20:48:16.000Z |
# import torchvision.models as models
#
# print(type(models.__dict__['resnet18']))
| 29.151515 | 68 | 0.602911 | from PIL import Image
def custom_dataset(base_dataset):
# name: str = base_dataset.__class__.__name__
# print(name)
class CustomDataSet(base_dataset):
def __init__(self, *args, **kwargs):
super(CustomDataSet, self).__init__(*args, **kwargs)
def __getitem__(self, index):
... | 0 | 0 | 0 | 699 | 0 | 133 | 0 | 0 | 45 |
f6688c453ab5e94f6089e06c70117a6382a4358e | 436 | py | Python | colossus/apps/templates/migrations/0002_auto_20200423_1850.py | gcallah/colossus | ee5319091cd19c96987825258a57e6d6f9d8fc51 | [
"MIT"
] | 3 | 2020-03-30T14:21:44.000Z | 2020-11-23T06:51:55.000Z | colossus/apps/templates/migrations/0002_auto_20200423_1850.py | gcallah/colossus | ee5319091cd19c96987825258a57e6d6f9d8fc51 | [
"MIT"
] | null | null | null | colossus/apps/templates/migrations/0002_auto_20200423_1850.py | gcallah/colossus | ee5319091cd19c96987825258a57e6d6f9d8fc51 | [
"MIT"
] | 2 | 2019-10-25T20:50:20.000Z | 2019-11-05T02:40:23.000Z | # Generated by Django 2.1.5 on 2020-04-23 22:50
| 21.8 | 87 | 0.623853 | # Generated by Django 2.1.5 on 2020-04-23 22:50
from django.db import migrations
import tinymce.models
class Migration(migrations.Migration):
dependencies = [
('templates', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='emailtemplate',
name=... | 0 | 0 | 0 | 308 | 0 | 0 | 0 | 11 | 68 |
c092d69cc0b597d29e2bed17b7fa24641102e301 | 1,183 | py | Python | api/compliance/enums.py | django-doctor/lite-api | 1ba278ba22ebcbb977dd7c31dd3701151cd036bf | [
"MIT"
] | 3 | 2019-05-15T09:30:39.000Z | 2020-04-22T16:14:23.000Z | api/compliance/enums.py | django-doctor/lite-api | 1ba278ba22ebcbb977dd7c31dd3701151cd036bf | [
"MIT"
] | 85 | 2019-04-24T10:39:35.000Z | 2022-03-21T14:52:12.000Z | api/compliance/enums.py | django-doctor/lite-api | 1ba278ba22ebcbb977dd7c31dd3701151cd036bf | [
"MIT"
] | 1 | 2021-01-17T11:12:19.000Z | 2021-01-17T11:12:19.000Z | # SIEL type compliance cases require a specific control code prefixes. currently: (0 to 9)D, (0 to 9)E, ML21, ML22.
COMPLIANCE_CASE_ACCEPTABLE_GOOD_CONTROL_CODES = "(^[0-9][DE].*$)|(^ML21.*$)|(^ML22.*$)"
| 26.886364 | 115 | 0.598478 | # SIEL type compliance cases require a specific control code prefixes. currently: (0 to 9)D, (0 to 9)E, ML21, ML22.
COMPLIANCE_CASE_ACCEPTABLE_GOOD_CONTROL_CODES = "(^[0-9][DE].*$)|(^ML21.*$)|(^ML22.*$)"
class ComplianceVisitTypes:
FIRST_CONTACT = "first_contact"
FIRST_VISIT = "first_visit"
ROUTINE_VISIT ... | 0 | 256 | 0 | 675 | 0 | 0 | 0 | 0 | 46 |
643f6b318ee0f9a13486c41eea32974757ea7055 | 488 | py | Python | config/jupyter_notebook_config.py | brunocampos01/home-sweet-home | f22533569b9ab913c8d047f0f4989c3682dd2326 | [
"MIT"
] | 3 | 2020-06-05T15:49:39.000Z | 2020-10-26T19:46:12.000Z | config/jupyter_notebook_config.py | brunocampos01/personal_configuration | 115846bedaf82a6de9bb9f6c160a2b84781a4668 | [
"MIT"
] | null | null | null | config/jupyter_notebook_config.py | brunocampos01/personal_configuration | 115846bedaf82a6de9bb9f6c160a2b84781a4668 | [
"MIT"
] | 1 | 2019-12-25T19:46:48.000Z | 2019-12-25T19:46:48.000Z |
c = get_config()
c.NotebookApp.ip = '0.0.0.0'
# The port the notebook server will listen on
c.NotebookApp.port = 8888
# Whether to open in a browser after starting
c.NotebookApp.open_browser = False
# Set the Access-Control-Allow-Credentials: true header
c.NotebookApp.allow_password_change = False
# https://githu... | 24.4 | 55 | 0.797131 | from jupyter_core.paths import jupyter_data_dir
import subprocess
import os
import stat
c = get_config()
c.NotebookApp.ip = '0.0.0.0'
# The port the notebook server will listen on
c.NotebookApp.port = 8888
# Whether to open in a browser after starting
c.NotebookApp.open_browser = False
# Set the Access-Control-All... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 88 |
f8cebbbb7f8f94295106aa3f7279ac6bef1b5ece | 558 | py | Python | apps/admin/serializers/menu_serializer.py | thebesteric/bright | 4cd8173e7e53115395fcf25bd4db72990fdb6b3f | [
"MIT"
] | null | null | null | apps/admin/serializers/menu_serializer.py | thebesteric/bright | 4cd8173e7e53115395fcf25bd4db72990fdb6b3f | [
"MIT"
] | null | null | null | apps/admin/serializers/menu_serializer.py | thebesteric/bright | 4cd8173e7e53115395fcf25bd4db72990fdb6b3f | [
"MIT"
] | null | null | null | """
@project: bright
@file: .py
@ide: PyCharm
@auth: Eric Joe
@email: whatisjava@hotmail.com
@build: 2019-09-16 10:12
@info:
"""
| 15.942857 | 54 | 0.646953 | """
菜单序列化
@project: bright
@file: .py
@ide: PyCharm
@auth: Eric Joe
@email: whatisjava@hotmail.com
@build: 2019-09-16 10:12
@info:
"""
from apps.admin.api.common import serializers
from apps.admin.models import Menu
class MenuSerializer(serializers.ModelSerializer):
"""
菜单
"""
class Meta:
mo... | 30 | 0 | 0 | 288 | 0 | 0 | 0 | 37 | 90 |
395c442ab8a1ecd4b1923873a2d8b649baab6ee0 | 4,669 | py | Python | tests/test_summary.py | cnschema/cdata | 893e2e1e27b61c8551c8b5f5f9bf05ec61490e23 | [
"Apache-2.0"
] | 16 | 2017-06-20T07:59:27.000Z | 2020-12-26T10:47:31.000Z | tests/test_summary.py | cnschema/cdata | 893e2e1e27b61c8551c8b5f5f9bf05ec61490e23 | [
"Apache-2.0"
] | 3 | 2017-07-12T07:15:42.000Z | 2017-08-17T00:38:32.000Z | tests/test_summary.py | cnschema/cdata | 893e2e1e27b61c8551c8b5f5f9bf05ec61490e23 | [
"Apache-2.0"
] | 9 | 2017-06-23T11:04:36.000Z | 2019-09-17T09:30:44.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Path hack
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
try:
import unittest2 as unittest
except ImportError:
import unittest
if __name__ == '__main__':
unittest.main()
| 39.567797 | 548 | 0.611694 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Path hack
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
from cdata.summary import * # noqa
try:
import unittest2 as unittest
except ImportError:
import unittest
class SummaryTestCase(unittest.TestCase):
def setUp(self):
pass
... | 2,973 | 0 | 0 | 3,365 | 0 | 0 | 0 | 6 | 54 |
29aa7f44b2cf1fea1e5b88977bb02bbc80803903 | 3,495 | py | Python | main.py | jmonsalverodilla/heroku_deploy_iris | 133d609f6fc553763027ed533485a5dfd7f7791e | [
"MIT"
] | null | null | null | main.py | jmonsalverodilla/heroku_deploy_iris | 133d609f6fc553763027ed533485a5dfd7f7791e | [
"MIT"
] | null | null | null | main.py | jmonsalverodilla/heroku_deploy_iris | 133d609f6fc553763027ed533485a5dfd7f7791e | [
"MIT"
] | null | null | null | #imports
import joblib
from flask import Flask
from flask_bootstrap import Bootstrap
import os
#Production server
#from waitress import serve
#Form validator
###############CODE#####################
loaded_model = joblib.load("./obj/knn_model.pkl")
#Let's open the file that contains the plotly div
pl... | 37.580645 | 146 | 0.640343 | #imports
import pandas as pd
import joblib
from flask import Flask, render_template, session,Markup, redirect, url_for
from flask_bootstrap import Bootstrap
import os
#Production server
#from waitress import serve
#Form validator
from flask_wtf import FlaskForm
from wtforms import FloatField, SubmitField
... | 2 | 1,287 | 0 | 912 | 0 | 0 | 0 | 117 | 190 |
c08c0d3462978b99bc09178299bce17ee7f56f79 | 978 | py | Python | 7.functions/challenge1_rouillonh.py | rouillonh/ChallengePython | 7e7d9b69f60394fd1f00a6a4aa32f97de95b1b92 | [
"MIT"
] | null | null | null | 7.functions/challenge1_rouillonh.py | rouillonh/ChallengePython | 7e7d9b69f60394fd1f00a6a4aa32f97de95b1b92 | [
"MIT"
] | null | null | null | 7.functions/challenge1_rouillonh.py | rouillonh/ChallengePython | 7e7d9b69f60394fd1f00a6a4aa32f97de95b1b92 | [
"MIT"
] | null | null | null | print("\tWelcome to the Python Dice App")
flag = True
while flag:
a = dice_sides()
b = dice_number()
c = roll_dice(b,a)
sum_dice(c)
flag = roll_again()
| 25.076923 | 70 | 0.580777 | import random
def dice_sides():
lados = int(input("How many sides would you like on your dice: "))
return lados
def dice_number():
rol = int(input("How many dice would you like to roll: "))
return rol
def roll_dice(a,b):
dados = []
print("You rolled ",a," ",b ," sided dice.")
for i in range(... | 0 | 0 | 0 | 0 | 0 | 680 | 0 | -8 | 132 |
304fddc7a883fd0b9750d92b36e2eae733ea7c41 | 749 | py | Python | gas-dispersion/gas-dispersion-v3.py | j-rheinheimer/Problems-in-Computational-Physics | 3bf8d618a1837fd39524dce23f2d60ede1d1971f | [
"MIT"
] | null | null | null | gas-dispersion/gas-dispersion-v3.py | j-rheinheimer/Problems-in-Computational-Physics | 3bf8d618a1837fd39524dce23f2d60ede1d1971f | [
"MIT"
] | null | null | null | gas-dispersion/gas-dispersion-v3.py | j-rheinheimer/Problems-in-Computational-Physics | 3bf8d618a1837fd39524dce23f2d60ede1d1971f | [
"MIT"
] | null | null | null |
constant = (3/2)*1.38*10**(-23)
particles_number = [0 for x in range(4)]
temperature = [0 for x in range(4)]
# X = rows, Y = columns
energy = ([[0 for y in range(4)] for x in range(4)])
for x in range(1, 4): # row
particles_number[x] = x
for y in range(1, 4): # column
temperature[y] = y
int... | 24.966667 | 69 | 0.672897 | from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
constant = (3/2)*1.38*10**(-23)
particles_number = [0 for x in range(4)]
temperature = [0 for x in range(4)]
# X = rows, Y = columns
energy = ([[0 for y in range(4)] for x in range(4)])
for x in range(1, 4): # row
particles_number[x] = x
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 28 | 44 |
6fa2c0f1f5245c6c17d6203b1c06c94d8000d974 | 25,138 | py | Python | components/scream/cime_config/eamxx_buildnml_impl.py | ambrad/scream | 52da60f65e870b8a3994bdbf4a6022fdcac7cab5 | [
"BSD-3-Clause"
] | null | null | null | components/scream/cime_config/eamxx_buildnml_impl.py | ambrad/scream | 52da60f65e870b8a3994bdbf4a6022fdcac7cab5 | [
"BSD-3-Clause"
] | null | null | null | components/scream/cime_config/eamxx_buildnml_impl.py | ambrad/scream | 52da60f65e870b8a3994bdbf4a6022fdcac7cab5 | [
"BSD-3-Clause"
] | null | null | null | import os, sys, copy, re
import xml.etree.ElementTree as ET
_CIMEROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..","..","..","cime")
sys.path.append(_CIMEROOT)
from CIME.utils import expect
###############################################################################
###########################... | 35.256662 | 122 | 0.499244 | import os, sys, copy, re
import xml.etree.ElementTree as ET
_CIMEROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), "..","..","..","cime")
sys.path.append(_CIMEROOT)
from CIME.utils import expect
###############################################################################
class MockCase(object):
####... | 0 | 0 | 0 | 407 | 0 | 0 | 0 | 0 | 49 |
9e7330c45553e9e1428db4adff74c500854c66f0 | 827 | py | Python | SmartContactManager/smart_contact_manager.py | alexcamargos/Learning_Python_Programming | f1cce9f85a672468b6ed1eb98dea9f7c09443722 | [
"MIT"
] | 2 | 2021-06-04T23:39:14.000Z | 2021-09-15T05:36:35.000Z | SmartContactManager/smart_contact_manager.py | alexcamargos/Learning_Python_Programming | f1cce9f85a672468b6ed1eb98dea9f7c09443722 | [
"MIT"
] | null | null | null | SmartContactManager/smart_contact_manager.py | alexcamargos/Learning_Python_Programming | f1cce9f85a672468b6ed1eb98dea9f7c09443722 | [
"MIT"
] | null | null | null | # #!/usr/bin/env python
# encoding: utf-8
#
# --------------------------------------------------------------------------------------------------------------------
# Name: smart_contact_manager.py
# Version: 0.0.1
# Summary: Smart Contact Manager a contact book GUI application with Python, SQLite, and PyQt.
#
# A... | 33.08 | 119 | 0.516324 | # #!/usr/bin/env python
# encoding: utf-8
#
# --------------------------------------------------------------------------------------------------------------------
# Name: smart_contact_manager.py
# Version: 0.0.1
# Summary: Smart Contact Manager a contact book GUI application with Python, SQLite, and PyQt.
#
# A... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
dfb0d107bb3528b5f2998439c3afbd1da82d7fdb | 2,245 | py | Python | statsmodels/distributions/tests/test_copula.py | NolanMP/statsmodels | ca6b652188be2422061052f7e61dd7bf2da03d52 | [
"BSD-3-Clause"
] | 1 | 2022-02-24T16:54:07.000Z | 2022-02-24T16:54:07.000Z | statsmodels/distributions/tests/test_copula.py | NolanMP/statsmodels | ca6b652188be2422061052f7e61dd7bf2da03d52 | [
"BSD-3-Clause"
] | null | null | null | statsmodels/distributions/tests/test_copula.py | NolanMP/statsmodels | ca6b652188be2422061052f7e61dd7bf2da03d52 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 14 23:32:57 2021
Author: Josef Perktold
License: BSD-3
"""
# import numpy as np
import statsmodels.sandbox.distributions.copula as cop
ev_list = [
[cop.transform_bilogistic, 0.5, 0.9, (0.25, 0.05), 0.5],
[cop.transform_tawn, 0.5, 0.9, (0.5, 0.5, 0.5), 0.47245... | 35.078125 | 79 | 0.644989 | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 14 23:32:57 2021
Author: Josef Perktold
License: BSD-3
"""
# import numpy as np
from numpy.testing import assert_allclose
import pytest
import statsmodels.sandbox.distributions.copula as cop
ev_list = [
[cop.transform_bilogistic, 0.5, 0.9, (0.25, 0.05), 0.5],
... | 0 | 610 | 0 | 0 | 0 | 0 | 0 | 12 | 90 |
dfc0b83160ee292356e7e19855d85e59ddfa121b | 11,235 | py | Python | P2/sde_solvers.py | Ocete/mcd-pe-continuo | ec8c6e39453e3089786396252ea4dc83ad4825c1 | [
"MIT"
] | null | null | null | P2/sde_solvers.py | Ocete/mcd-pe-continuo | ec8c6e39453e3089786396252ea4dc83ad4825c1 | [
"MIT"
] | null | null | null | P2/sde_solvers.py | Ocete/mcd-pe-continuo | ec8c6e39453e3089786396252ea4dc83ad4825c1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 27 17:29:26 2020
@author: Alberto Surez
"""
# Load packages
import numpy as np
import matplotlib.pyplot as plt
def generate_regular_grid(t0, delta_t, N):
"""Generates a regular grid of times.
Parameters
----------
t0 : float
Initial time for the ... | 33.239645 | 96 | 0.608367 | # -*- coding: utf-8 -*-
"""
Created on Sun Sep 27 17:29:26 2020
@author: Alberto Suárez
"""
# Load packages
import numpy as np
import sys
import matplotlib.pyplot as plt
from numpy.core.shape_base import _accumulate
def generate_regular_grid(t0, delta_t, N):
"""Generates a regular grid of times.
Parameters
... | 8 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 44 |
11acd7128accc76ea793f88fdc32b2cdbf2df5af | 239 | py | Python | tudo/ex026.py | Ramon-Erik/Exercicios-Python | 158a7f1846dd3d486aa0517fa337d46d73aab649 | [
"MIT"
] | 1 | 2021-07-08T00:35:57.000Z | 2021-07-08T00:35:57.000Z | tudo/ex026.py | Ramon-Erik/Exercicios-Python | 158a7f1846dd3d486aa0517fa337d46d73aab649 | [
"MIT"
] | null | null | null | tudo/ex026.py | Ramon-Erik/Exercicios-Python | 158a7f1846dd3d486aa0517fa337d46d73aab649 | [
"MIT"
] | null | null | null | nome = str(input('>>Seu nome completo:\n')).strip()
print('>>No seu nome h ', nome.upper().count('A'), 'letra(s) A.')
print('>>Aparece na posio ', nome.upper().find('A')+1)
print('>>A ltima apario na ', nome.upper().rfind('A') + 1) | 59.75 | 66 | 0.610879 | nome = str(input('>>Seu nome completo:\n')).strip()
print('>>No seu nome há ', nome.upper().count('A'), 'letra(s) A.')
print('>>Aparece na posição ', nome.upper().find('A')+1)
print('>>A última aparição é na ', nome.upper().rfind('A') + 1) | 14 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d89154d9d48506bf0641a0e03e468bd570763d0c | 639 | py | Python | mapper/mid_level/encoder.py | umerhasan17/deep-robust-robotnav | 765e586dc897b26286af8f13d6ecdf212e78bccf | [
"Apache-2.0"
] | null | null | null | mapper/mid_level/encoder.py | umerhasan17/deep-robust-robotnav | 765e586dc897b26286af8f13d6ecdf212e78bccf | [
"Apache-2.0"
] | null | null | null | mapper/mid_level/encoder.py | umerhasan17/deep-robust-robotnav | 765e586dc897b26286af8f13d6ecdf212e78bccf | [
"Apache-2.0"
] | null | null | null | import visualpriors
import torch
from config.config import device
def mid_level_representations(input_image_tensor, representation_names):
"""
:param input_image_tensor: (batch_size, 3, 256, 256)
:param representation_names: list
:return: concatted image tensor to pass into FCN (batch_size, 8*len(re... | 37.588235 | 110 | 0.733959 | import visualpriors
import torch
from config.config import device
def mid_level_representations(input_image_tensor, representation_names):
"""
:param input_image_tensor: (batch_size, 3, 256, 256)
:param representation_names: list
:return: concatted image tensor to pass into FCN (batch_size, 8*len(re... | 6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
09fb8e8aa27e2b40173fc4065e41b574b8f437f2 | 1,334 | py | Python | pmutt/tests/statmech/test_pmutt_statmech_nucl.py | wittregr/pMuTT | 1678fd3d3a10d8ef5389c02970a7ebaa92fc7344 | [
"MIT"
] | 28 | 2018-10-29T17:44:30.000Z | 2022-03-23T14:20:16.000Z | pmutt/tests/statmech/test_pmutt_statmech_nucl.py | wittregr/pMuTT | 1678fd3d3a10d8ef5389c02970a7ebaa92fc7344 | [
"MIT"
] | 101 | 2018-10-18T19:49:30.000Z | 2022-01-19T10:59:57.000Z | pmutt/tests/statmech/test_pmutt_statmech_nucl.py | wittregr/pMuTT | 1678fd3d3a10d8ef5389c02970a7ebaa92fc7344 | [
"MIT"
] | 16 | 2018-12-15T17:01:21.000Z | 2022-01-03T17:42:23.000Z | # -*- coding: utf-8 -*-
"""
pmutt.test_pmutt_model_statmech_nucl
Tests for pmutt module
"""
import unittest
if __name__ == '__main__':
unittest.main()
| 25.653846 | 69 | 0.649925 | # -*- coding: utf-8 -*-
"""
pmutt.test_pmutt_model_statmech_nucl
Tests for pmutt module
"""
import unittest
from pmutt.statmech import nucl
class TestEmptyNucl(unittest.TestCase):
def setUp(self):
unittest.TestCase.setUp(self)
self.nuclear = nucl.EmptyNucl()
self.nuclear_dict = {
... | 0 | 0 | 0 | 1,121 | 0 | 0 | 0 | 10 | 45 |
dffaaaba64307dc711352793913b40a2616734eb | 5,049 | py | Python | python_examples/control_mapping_framework/utils.py | kirank0220/api-examples | 9d6c51eeb2d4e38d95b0b7d88fd30fe96ef28d20 | [
"MIT"
] | 1 | 2021-12-20T16:49:00.000Z | 2021-12-20T16:49:00.000Z | python_examples/control_mapping_framework/utils.py | kirank0220/api-examples | 9d6c51eeb2d4e38d95b0b7d88fd30fe96ef28d20 | [
"MIT"
] | 2 | 2020-11-20T04:51:16.000Z | 2021-06-16T17:02:35.000Z | python_examples/control_mapping_framework/utils.py | kirank0220/api-examples | 9d6c51eeb2d4e38d95b0b7d88fd30fe96ef28d20 | [
"MIT"
] | 1 | 2020-11-20T04:46:17.000Z | 2020-11-20T04:46:17.000Z | #########################################################################
# _________ ___. ______________________ ___
# \_ ___ \___.__.\_ |__ ___________ / _____/\______ \ \/ /
# / \ \< | | | __ \_/ __ \_ __ \/ \ ___ | _/\ /
# \ \___\___ | | \_\... | 35.556338 | 114 | 0.520895 | #########################################################################
# _________ ___. ______________________ ___
# \_ ___ \___.__.\_ |__ ___________ / _____/\______ \ \/ /
# / \ \< | | | __ \_/ __ \_ __ \/ \ ___ | _/\ /
# \ \___\___ | | \_\... | 0 | 0 | 0 | 0 | 0 | 4,072 | 0 | 113 | 225 |
12b82684a12db7b841b1d175e77609b1454d82f8 | 8,378 | py | Python | delphi/translators/for2py/measure-coverage.py | mikiec84/delphi | 2e517f21e76e334c7dfb14325d25879ddf26d10d | [
"Apache-2.0"
] | 25 | 2018-03-03T11:57:57.000Z | 2022-01-16T21:19:54.000Z | delphi/translators/for2py/measure-coverage.py | mikiec84/delphi | 2e517f21e76e334c7dfb14325d25879ddf26d10d | [
"Apache-2.0"
] | 385 | 2018-02-21T16:52:06.000Z | 2022-02-17T07:44:56.000Z | delphi/translators/for2py/measure-coverage.py | mikiec84/delphi | 2e517f21e76e334c7dfb14325d25879ddf26d10d | [
"Apache-2.0"
] | 19 | 2018-03-20T01:08:11.000Z | 2021-09-29T01:04:49.000Z | #!/usr/bin/env python3.7
""" This file contains code to carry out a simple estimate of the amount of
Fortran code 'handled' by for2py.
COMMAND-LINE INVOCATION:
python3.7 measure-coverage.py <directory with Fortran code files>
ADDING HANDLED LANGUAGE CONSTRUCTS:
As the set of language featur... | 29.814947 | 94 | 0.579852 | #!/usr/bin/env python3.7
""" This file contains code to carry out a simple estimate of the amount of
Fortran code 'handled' by for2py.
COMMAND-LINE INVOCATION:
python3.7 measure-coverage.py <directory with Fortran code files>
ADDING HANDLED LANGUAGE CONSTRUCTS:
As the set of language featur... | 0 | 0 | 0 | 0 | 0 | 3,580 | 0 | 1 | 296 |
9c124f5233a7bd69a4c61ad530b4d9b53345808c | 1,222 | py | Python | examples/save_data_to_file_example.py | eugtsa/led_wabbit | 04c56b438518d65a385788fa9a118adbe74a1771 | [
"Apache-2.0"
] | null | null | null | examples/save_data_to_file_example.py | eugtsa/led_wabbit | 04c56b438518d65a385788fa9a118adbe74a1771 | [
"Apache-2.0"
] | null | null | null | examples/save_data_to_file_example.py | eugtsa/led_wabbit | 04c56b438518d65a385788fa9a118adbe74a1771 | [
"Apache-2.0"
] | null | null | null | from sklearn.model_selection import train_test_split
from sklearn.utils import shuffle
from itertools import chain
import numpy as np
from led_wabbit.models import LogisticRegressionBinary
if __name__ == '__main__':
X1 = [[0, 1, 1] for i in range(40)]
X2 = [[0, 2, 0] for i in range(40)]
X3 = [[1, 0, 1] fo... | 33.027027 | 101 | 0.587561 | from sklearn.model_selection import train_test_split
from sklearn.utils import shuffle
from itertools import chain
import numpy as np
from led_wabbit.models import LogisticRegressionBinary
if __name__ == '__main__':
X1 = [[0, 1, 1] for i in range(40)]
X2 = [[0, 2, 0] for i in range(40)]
X3 = [[1, 0, 1] fo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
22fbc1339414b2f40f360e4ea79f9e4a128ac3f5 | 1,382 | py | Python | tests/bugs/issue_58/issue_58_1_categorical_exogenous.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 377 | 2016-10-13T20:52:44.000Z | 2022-03-29T18:04:14.000Z | tests/bugs/issue_58/issue_58_1_categorical_exogenous.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 160 | 2016-10-13T16:11:53.000Z | 2022-03-28T04:21:34.000Z | tests/bugs/issue_58/issue_58_1_categorical_exogenous.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 63 | 2017-03-09T14:51:18.000Z | 2022-03-27T20:52:57.000Z |
import pyaf.ForecastEngine as autof
import pyaf.Bench.TS_datasets as tsds
b1 = tsds.load_ozone_exogenous_categorical()
df = b1.mPastData
print(b1.mExogenousDataFrame.Exog2.cat.categories)
print(b1.mExogenousDataFrame.Exog3.cat.categories)
print(b1.mExogenousDataFrame.Exog4.cat.categories)
lEngine = autof.cForecast... | 28.791667 | 83 | 0.7822 | import pandas as pd
import numpy as np
import pyaf.ForecastEngine as autof
import pyaf.Bench.TS_datasets as tsds
b1 = tsds.load_ozone_exogenous_categorical()
df = b1.mPastData
print(b1.mExogenousDataFrame.Exog2.cat.categories)
print(b1.mExogenousDataFrame.Exog3.cat.categories)
print(b1.mExogenousDataFrame.Exog4.cat.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -5 | 44 |
2004b70e249cdbb83d33599179518dd3cc5c4574 | 7,164 | py | Python | urbanterror.py | zephrax/sopel-module-urbanterror | 4bc38fffc3f2128f35fe5864cabfc83302e1e498 | [
"MIT"
] | null | null | null | urbanterror.py | zephrax/sopel-module-urbanterror | 4bc38fffc3f2128f35fe5864cabfc83302e1e498 | [
"MIT"
] | null | null | null | urbanterror.py | zephrax/sopel-module-urbanterror | 4bc38fffc3f2128f35fe5864cabfc83302e1e498 | [
"MIT"
] | null | null | null | # coding=utf-8
"""UrbanTerror server info"""
# Author: zephrax http://kernelpanic.com.ar
from __future__ import unicode_literals, absolute_import, print_function, division
from sopel.logger import get_logger
LOGGER = get_logger(__name__)
| 29.004049 | 120 | 0.561697 | # coding=utf-8
"""UrbanTerror server info"""
# Author: zephrax http://kernelpanic.com.ar
from __future__ import unicode_literals, absolute_import, print_function, division
from sopel import web
from sopel.module import commands
from sopel.logger import get_logger
from sopel.config.types import StaticSection, Validated... | 0 | 579 | 0 | 5,584 | 0 | 456 | 0 | 50 | 250 |
3f642ae81cbb6c2d0f605ddea6efce124c74a74f | 3,477 | py | Python | fpga_template_low_level.py | KilometersG/Python-API-for-VeriStand-FPGA | 2607bae5582aa2872d31c05bc0135ed1d7dd9e34 | [
"BSD-2-Clause"
] | 2 | 2018-07-24T18:14:14.000Z | 2019-08-26T06:29:36.000Z | fpga_template_low_level.py | KilometersG/Python-API-for-VeriStand-FPGA | 2607bae5582aa2872d31c05bc0135ed1d7dd9e34 | [
"BSD-2-Clause"
] | 8 | 2018-07-24T18:11:32.000Z | 2018-11-13T16:24:45.000Z | fpga_template_low_level.py | KilometersG/Python-API-for-VeriStand-FPGA | 2607bae5582aa2872d31c05bc0135ed1d7dd9e34 | [
"BSD-2-Clause"
] | null | null | null | import fpga_config
from nifpga import Session
import ntpath
configpath = input('Please enter the full filepath of your .fpgaconfig file: ')
vsfpga = fpga_config.VeriStandFPGA(configpath)
folder = ntpath.split(configpath)
read_count = vsfpga.read_packets + 1
write_count = vsfpga.write_packets + 1
read_packets = {}
writ... | 41.891566 | 119 | 0.681047 | import fpga_config
from nifpga import Session
import ntpath
configpath = input('Please enter the full filepath of your .fpgaconfig file: ')
vsfpga = fpga_config.VeriStandFPGA(configpath)
folder = ntpath.split(configpath)
read_count = vsfpga.read_packets + 1
write_count = vsfpga.write_packets + 1
read_packets = {}
writ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a7241d0c0ee6c2db2de1ddde13add40050d749a8 | 29,611 | py | Python | intel_pytorch_extension_py/launch.py | CaoE/intel-extension-for-pytorch | 2a31cef7592207a7d08e346542218b5a79df8df9 | [
"Apache-2.0"
] | null | null | null | intel_pytorch_extension_py/launch.py | CaoE/intel-extension-for-pytorch | 2a31cef7592207a7d08e346542218b5a79df8df9 | [
"Apache-2.0"
] | 1 | 2021-03-30T04:54:24.000Z | 2021-03-30T04:54:24.000Z | intel_pytorch_extension_py/launch.py | CaoE/intel-extension-for-pytorch | 2a31cef7592207a7d08e346542218b5a79df8df9 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, division, print_function, unicode_literals
import sys
import subprocess
import os
from os.path import expanduser
import re
import glob
from argparse import ArgumentParser, REMAINDER
from argparse import RawTextHelpFormatter
import logging
import psutil
logging.basicConfig(level ... | 45.485407 | 141 | 0.624667 | from __future__ import absolute_import, division, print_function, unicode_literals
import sys
import platform
import subprocess
import os
from os.path import expanduser
import re
import glob
import numpy as np
from argparse import ArgumentParser, REMAINDER
from argparse import RawTextHelpFormatter
import logging
import... | 0 | 0 | 0 | 2,418 | 0 | 8,669 | 0 | -9 | 248 |