hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7112440105b7f7dbd74bf0e92d94f8666cfac68 | 5,020 | py | Python | third_party/blink/tools/blinkpy/style/checkers/jsonchecker_unittest.py | zipated/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | third_party/blink/tools/blinkpy/style/checkers/jsonchecker_unittest.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | third_party/blink/tools/blinkpy/style/checkers/jsonchecker_unittest.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | # Copyright (C) 2010 Apple Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | 44.424779 | 133 | 0.684462 |
import unittest
from blinkpy.style.checkers import jsonchecker
class MockErrorHandler(object):
def __init__(self, handle_style_error):
self.turned_off_filtering = False
self._handle_style_error = handle_style_error
def turn_off_line_filtering(self):
self.turne... | true | true |
f711250e17869c60f5d238e81eb16be393f3d0db | 8,373 | py | Python | oc_config_validate/oc_config_validate/__main__.py | wenovus/gnxi | 6b0be2d26413d2467ed2ab803df61450035431b1 | [
"Apache-2.0"
] | 1 | 2019-08-06T09:25:43.000Z | 2019-08-06T09:25:43.000Z | oc_config_validate/oc_config_validate/__main__.py | jihaix/gnxi | a4392bf8ac8d207c8368c69387ecc4efb29c22cb | [
"Apache-2.0"
] | null | null | null | oc_config_validate/oc_config_validate/__main__.py | jihaix/gnxi | a4392bf8ac8d207c8368c69387ecc4efb29c22cb | [
"Apache-2.0"
] | null | null | null | """Copyright 2021 Google LLC.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... | 30.67033 | 79 | 0.601696 | import argparse
import logging
import os
import sys
import time
from typing import Any, Dict
import yaml
from oc_config_validate import (context, formatter, runner, schema, target,
testbase)
__version__ = "2.0.0"
LOGGING_FORMAT = "%(levelname)s(%(filename)s:%(lineno)d):%(message)s"
... | true | true |
f7112541ccf3fa57a52b0d8b4db34cff4b6eeffa | 3,607 | py | Python | samples/basic/crud/models/openconfig/openconfig-mpls/nc-create-oc-mpls-54-ydk.py | maccioni/ydk-py-samples | d1758694bef97327c5477e65649326c7595ce499 | [
"Apache-2.0"
] | 1 | 2021-07-08T14:02:12.000Z | 2021-07-08T14:02:12.000Z | samples/basic/crud/models/openconfig/openconfig-mpls/nc-create-oc-mpls-54-ydk.py | maccioni/ydk-py-samples | d1758694bef97327c5477e65649326c7595ce499 | [
"Apache-2.0"
] | null | null | null | samples/basic/crud/models/openconfig/openconfig-mpls/nc-create-oc-mpls-54-ydk.py | maccioni/ydk-py-samples | d1758694bef97327c5477e65649326c7595ce499 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2016 Cisco Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 35.712871 | 86 | 0.689215 |
from argparse import ArgumentParser
from urlparse import urlparse
from ydk.services import CRUDService
from ydk.providers import NetconfServiceProvider
from ydk.models.openconfig import openconfig_mpls \
as oc_mpls
from ydk.models.openconfig import openconfig_mpls_types as oc_mpls_types
import lo... | true | true |
f71126725faac245baf3d0b86e42241cb62b491f | 3,155 | py | Python | startupmoney/startupmoney/settings.py | RanjithaRao22/TestWebApp | 581edcec8fb39001917d9132b7f371aabc506e51 | [
"MIT"
] | 1 | 2020-04-13T06:33:15.000Z | 2020-04-13T06:33:15.000Z | startupmoney/startupmoney/settings.py | vatsamail/TestWebApp | 581edcec8fb39001917d9132b7f371aabc506e51 | [
"MIT"
] | 7 | 2020-04-12T23:26:42.000Z | 2022-02-10T12:18:08.000Z | startupmoney/startupmoney/settings.py | vatsamail/TestWebApp | 581edcec8fb39001917d9132b7f371aabc506e51 | [
"MIT"
] | null | null | null | """
Django settings for startupmoney project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os... | 25.650407 | 91 | 0.696672 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '7_bcd_om-v=oud6403zs5#snm5(&_&d(l38#&qc2=(xb77g)^j'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f711269d3ecd4d7485d60302c52b1eb2a9b6db66 | 6,178 | py | Python | cfgov/data_research/tests/test_forms.py | thephillipsequation/cfgov-refresh | 1412dd4215fce5597c0ec704b0d480cf00aeb82c | [
"CC0-1.0"
] | 37 | 2020-08-18T19:52:39.000Z | 2022-03-23T08:08:41.000Z | cfgov/data_research/tests/test_forms.py | thephillipsequation/cfgov-refresh | 1412dd4215fce5597c0ec704b0d480cf00aeb82c | [
"CC0-1.0"
] | 338 | 2020-08-14T20:46:36.000Z | 2022-03-31T20:49:32.000Z | cfgov/data_research/tests/test_forms.py | raft-tech/cfgov-refresh | 7c63c31fd6bb95ed4f7d368f1e1252175f0c71ca | [
"CC0-1.0"
] | 14 | 2020-10-21T15:27:03.000Z | 2022-03-17T03:16:36.000Z | from django.test import TestCase
from core.govdelivery import MockGovDelivery
from data_research.forms import ConferenceRegistrationForm
from data_research.models import ConferenceRegistration
class ConferenceRegistrationFormTests(TestCase):
capacity = 100
govdelivery_code = 'TEST-CODE'
govdelivery_quest... | 34.132597 | 76 | 0.621075 | from django.test import TestCase
from core.govdelivery import MockGovDelivery
from data_research.forms import ConferenceRegistrationForm
from data_research.models import ConferenceRegistration
class ConferenceRegistrationFormTests(TestCase):
capacity = 100
govdelivery_code = 'TEST-CODE'
govdelivery_quest... | true | true |
f711279795ac54742a452b547b1f96fda8fcd72e | 1,218 | py | Python | venv/lib/python3.6/site-packages/sqlalchemy/dialects/mysql/__init__.py | tchengatcincoai/cryptocoin-prices-compare | f295fecc7213a877bf717af0eb98414e9137b554 | [
"MIT"
] | 78 | 2017-08-19T03:46:13.000Z | 2020-02-19T04:29:45.000Z | desktop/core/ext-py/SQLAlchemy-1.2.0b3/lib/sqlalchemy/dialects/mysql/__init__.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 5 | 2017-08-21T16:33:08.000Z | 2018-06-21T18:37:18.000Z | desktop/core/ext-py/SQLAlchemy-1.2.0b3/lib/sqlalchemy/dialects/mysql/__init__.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 43 | 2018-02-05T23:23:46.000Z | 2021-07-28T22:51:42.000Z | # mysql/__init__.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
from . import base, mysqldb, oursql, \
pyodbc, zxjdbc, mysqlconnector, pymysql... | 35.823529 | 78 | 0.668309 |
from . import base, mysqldb, oursql, \
pyodbc, zxjdbc, mysqlconnector, pymysql,\
gaerdbms, cymysql
base.dialect = mysqldb.dialect
from .base import \
BIGINT, BINARY, BIT, BLOB, BOOLEAN, CHAR, DATE, DATETIME, \
DECIMAL, DOUBLE, ENUM, DECIMAL,\
FLOAT, INTEGER, INTEGER, JSON, LONGBLOB, LONGTE... | true | true |
f7112864b35d42a4077973fcef95554472aa1dad | 2,769 | py | Python | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/ModifyFlowProjectClusterSettingRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/ModifyFlowProjectClusterSettingRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/ModifyFlowProjectClusterSettingRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may ... | 35.050633 | 90 | 0.737811 |
from aliyunsdkcore.request import RpcRequest
from aliyunsdkemr.endpoint import endpoint_data
class ModifyFlowProjectClusterSettingRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'Emr', '2016-04-08', 'ModifyFlowProjectClusterSetting','emr')
if hasattr(self, "endpoint_m... | true | true |
f71128db7d81033360ad6c8a01962fa528633b2b | 822 | py | Python | Chapter 10/Chap10_Example10.38.py | Anancha/Programming-Techniques-using-Python | e80c329d2a27383909d358741a5cab03cb22fd8b | [
"MIT"
] | null | null | null | Chapter 10/Chap10_Example10.38.py | Anancha/Programming-Techniques-using-Python | e80c329d2a27383909d358741a5cab03cb22fd8b | [
"MIT"
] | null | null | null | Chapter 10/Chap10_Example10.38.py | Anancha/Programming-Techniques-using-Python | e80c329d2a27383909d358741a5cab03cb22fd8b | [
"MIT"
] | null | null | null | from threading import Thread, Event
from time import sleep
def func1():
sleep(2) # Initially sleep for 2 secs
myeventobj.set() # E2
print("func1 sleeping for 3 secs....")
sleep(3) # E3
myeventobj.clear() # E4
def func2():
print("Initially myeventobj is: ", myeventobj.isSet()) # E1
m... | 25.6875 | 95 | 0.653285 | from threading import Thread, Event
from time import sleep
def func1():
sleep(2)
myeventobj.set()
print("func1 sleeping for 3 secs....")
sleep(3)
myeventobj.clear()
def func2():
print("Initially myeventobj is: ", myeventobj.isSet())
myeventobj.wait()
if myeventobj.isSet(): ... | true | true |
f71129c57862d43432ef1e52df9e6edb6a786838 | 2,181 | py | Python | package/spack-r-phantompeakqualtools/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | 1 | 2018-07-17T07:45:09.000Z | 2018-07-17T07:45:09.000Z | package/spack-r-phantompeakqualtools/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | null | null | null | package/spack-r-phantompeakqualtools/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | null | null | null | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 43.62 | 94 | 0.674461 | true | true | |
f7112b1cfcd98e70b9d0057ad3b84f430dded29a | 868 | py | Python | tests/test_tasks/test_supervised_task.py | hp2500/openml-python | 62cc534cd18e6e011a88a83816fec95a90399a9b | [
"BSD-3-Clause"
] | 1 | 2019-09-02T00:28:26.000Z | 2019-09-02T00:28:26.000Z | tests/test_tasks/test_supervised_task.py | hp2500/openml-python | 62cc534cd18e6e011a88a83816fec95a90399a9b | [
"BSD-3-Clause"
] | 8 | 2019-05-23T08:03:24.000Z | 2019-09-20T10:14:43.000Z | tests/test_tasks/test_supervised_task.py | hp2500/openml-python | 62cc534cd18e6e011a88a83816fec95a90399a9b | [
"BSD-3-Clause"
] | 2 | 2019-06-19T11:10:47.000Z | 2019-07-08T10:31:01.000Z | from typing import Tuple
import unittest
import numpy as np
from openml.tasks import get_task
from .test_task import OpenMLTaskTest
class OpenMLSupervisedTaskTest(OpenMLTaskTest):
"""
A helper class. The methods of the test case
are only executed in subclasses of the test case.
"""
__test__ = F... | 24.111111 | 64 | 0.652074 | from typing import Tuple
import unittest
import numpy as np
from openml.tasks import get_task
from .test_task import OpenMLTaskTest
class OpenMLSupervisedTaskTest(OpenMLTaskTest):
__test__ = False
@classmethod
def setUpClass(cls):
if cls is OpenMLSupervisedTaskTest:
raise unittest.... | true | true |
f7112c22edd7f1c3e79cb1392172dface9da9a6f | 40,707 | py | Python | tensorflow/python/distribute/collective_all_reduce_strategy.py | neochristou/tensorflow | 50b55bfc5c9132c3bd82505181380bffbb47a5ff | [
"Apache-2.0"
] | 4 | 2021-06-30T10:53:39.000Z | 2021-09-19T16:52:00.000Z | tensorflow/python/distribute/collective_all_reduce_strategy.py | donny-stacks/tensorflow | 1fb338b1c42930c0eef4d0b4d8d5fdf24a678654 | [
"Apache-2.0"
] | 1 | 2020-08-28T18:17:58.000Z | 2020-08-28T18:17:58.000Z | tensorflow/python/distribute/collective_all_reduce_strategy.py | donny-stacks/tensorflow | 1fb338b1c42930c0eef4d0b4d8d5fdf24a678654 | [
"Apache-2.0"
] | 4 | 2022-01-13T11:23:44.000Z | 2022-03-02T11:11:42.000Z | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 42.271028 | 134 | 0.714717 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import threading
import time
import weakref
from tensorflow.core.protobuf import rewriter_config_pb2
from tensorflow.core.protobuf import tensorflow_server_pb2
from tensorflow.python... | true | true |
f7112ca75afc4d177c66e264175abe37bea02fdb | 1,299 | py | Python | instastalk/constants.py | jjkoh95/instastalk | e16662d8b0eb22f4d80a2a760674538601f8bb00 | [
"MIT"
] | 4 | 2019-12-19T03:06:24.000Z | 2020-12-08T01:59:52.000Z | instastalk/constants.py | jjkoh95/instastalk | e16662d8b0eb22f4d80a2a760674538601f8bb00 | [
"MIT"
] | null | null | null | instastalk/constants.py | jjkoh95/instastalk | e16662d8b0eb22f4d80a2a760674538601f8bb00 | [
"MIT"
] | 2 | 2019-12-31T02:01:24.000Z | 2020-03-13T07:41:44.000Z | QUERY_HASH = '42323d64886122307be10013ad2dcc44'
STORIES_QUERY_HASH = '45246d3fe16ccc6577e0bd297a5db1ab'
SHORTCODE_QUERY_HASH = 'fead941d698dc1160a298ba7bec277ac'
BASE_URL = "https://www.instagram.com"
LOGIN_REFERER = f'{BASE_URL}/accounts/login'
LOGIN_URL = f'{BASE_URL}/accounts/login/ajax/'
LOGOUT_URL = f'{BASE_URL}/... | 39.363636 | 247 | 0.722864 | QUERY_HASH = '42323d64886122307be10013ad2dcc44'
STORIES_QUERY_HASH = '45246d3fe16ccc6577e0bd297a5db1ab'
SHORTCODE_QUERY_HASH = 'fead941d698dc1160a298ba7bec277ac'
BASE_URL = "https://www.instagram.com"
LOGIN_REFERER = f'{BASE_URL}/accounts/login'
LOGIN_URL = f'{BASE_URL}/accounts/login/ajax/'
LOGOUT_URL = f'{BASE_URL}/... | true | true |
f7112ccc230534981bbe0dd4d71f57e20b5aabfa | 4,913 | py | Python | haas_lib_bundles/python/docs/examples/smart_fan/esp32/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/docs/examples/smart_fan/esp32/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/docs/examples/smart_fan/esp32/code/main.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
'''
@File : main.py
@Author : guoliang.wgl
@version : 1.0
@Description: smart_fan案例 - 智能控制小风扇
board.json - 硬件资源配置文件
'''
from fan import Fan
from aht21b import AHT21B
from driver import PWM, I2C
import time
from aliyunIoT import ... | 27.446927 | 81 | 0.630572 |
from fan import Fan
from aht21b import AHT21B
from driver import PWM, I2C
import time
from aliyunIoT import Device
import json
iot_connected = False
wlan = None
productKey = "产品密钥"
deviceName = "设备名称"
deviceSecret = "设备密钥"
device = None
wifiSsid = "请输入您的路由器名称"
wifiPassword = "请输入您的路由器密码"
gear1_temp = 22
gear... | true | true |
f7112d60b47eb6fb4ad1be2a0ffbcd3b4d41a3f4 | 21,283 | py | Python | reclor_trainer_base_v2.py | SparkJiao/MERIt | e887dd11bd2969345a5fb07c47d49bd0245e41e6 | [
"MIT"
] | 8 | 2022-03-01T09:02:44.000Z | 2022-03-18T14:41:56.000Z | reclor_trainer_base_v2.py | SparkJiao/MERIt | e887dd11bd2969345a5fb07c47d49bd0245e41e6 | [
"MIT"
] | 1 | 2022-03-09T12:12:22.000Z | 2022-03-10T09:08:42.000Z | reclor_trainer_base_v2.py | SparkJiao/MERIt | e887dd11bd2969345a5fb07c47d49bd0245e41e6 | [
"MIT"
] | 2 | 2022-03-02T01:46:52.000Z | 2022-03-02T13:51:53.000Z | # coding=utf-8
#
# Copyright 2020 Heinrich Heine University Duesseldorf
#
# Part of this code is based on the source code of BERT-DST
# (arXiv:1907.03040)
# Part of this code is based on the source code of Transformers
# (arXiv:1910.03771)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may no... | 45.091102 | 137 | 0.644881 |
import glob
import json
import logging
import os
import sys
from typing import Dict, Union
import hydra
import numpy as np
import torch
import transformers
from fairscale.nn.data_parallel.fully_sharded_data_parallel import FullyShardedDataParallel as FullyShardedDDP
from fairscale.nn.wrap.auto_wra... | true | true |
f7112f4e2a985351fa67abafbc227e54c3565741 | 1,599 | py | Python | xlsxwriter/test/comparison/test_chart_axis17.py | shareablee/XlsxWriter | 3cfcbe18fbc4526158ffbb5e7bb5227f78e3f5f9 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/comparison/test_chart_axis17.py | shareablee/XlsxWriter | 3cfcbe18fbc4526158ffbb5e7bb5227f78e3f5f9 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/comparison/test_chart_axis17.py | shareablee/XlsxWriter | 3cfcbe18fbc4526158ffbb5e7bb5227f78e3f5f9 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | 25.790323 | 79 | 0.565353 | true | true | |
f711301c61a91d397fabaa9789e2c1cc33e29329 | 20,549 | py | Python | log_complete_bcl2/model_17.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete_bcl2/model_17.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_complete_bcl2/model_17.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', '... | 95.134259 | 798 | 0.804127 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', ... | true | true |
f7113193431e64e1b2be0b5b98c20cb05d9b30f6 | 5,751 | py | Python | deblurring_celeba_algorithm_1.py | ChandreyeeB/Blind-Image-Deconvolution-using-Deep-Generative-Priors | 4198bd2d325a32ffc4e714c486540e63440ab110 | [
"MIT"
] | 24 | 2019-01-10T14:18:57.000Z | 2021-12-07T13:56:23.000Z | deblurring_celeba_algorithm_1.py | ChandreyeeB/Blind-Image-Deconvolution-using-Deep-Generative-Priors | 4198bd2d325a32ffc4e714c486540e63440ab110 | [
"MIT"
] | 4 | 2019-02-01T22:21:05.000Z | 2021-06-09T13:00:10.000Z | deblurring_celeba_algorithm_1.py | ChandreyeeB/Blind-Image-Deconvolution-using-Deep-Generative-Priors | 4198bd2d325a32ffc4e714c486540e63440ab110 | [
"MIT"
] | 13 | 2019-01-28T12:23:51.000Z | 2022-03-23T04:38:47.000Z | import tensorflow as tf
import keras.backend as K
import numpy as np
from Utils import *
from generators.MotionBlurGenerator import *
from generators.CelebAGenerator import *
K.set_learning_phase(0)
from glob import glob
import os
# paths
Orig_Path = './results/CelebA/Original Images/*.png'
Range_Path = '.... | 40.216783 | 158 | 0.636933 | import tensorflow as tf
import keras.backend as K
import numpy as np
from Utils import *
from generators.MotionBlurGenerator import *
from generators.CelebAGenerator import *
K.set_learning_phase(0)
from glob import glob
import os
Orig_Path = './results/CelebA/Original Images/*.png'
Range_Path = './result... | true | true |
f71132d4c7e735b30abb14add36214b3cc1d70d4 | 23,887 | py | Python | ironic/drivers/modules/pxe_base.py | calsoft-internal/ironic | 6222d57a74368264b132885b6140b204f429911f | [
"Apache-2.0"
] | null | null | null | ironic/drivers/modules/pxe_base.py | calsoft-internal/ironic | 6222d57a74368264b132885b6140b204f429911f | [
"Apache-2.0"
] | null | null | null | ironic/drivers/modules/pxe_base.py | calsoft-internal/ironic | 6222d57a74368264b132885b6140b204f429911f | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 45.155009 | 79 | 0.618495 |
from futurist import periodics
from ironic_lib import metrics_utils
from oslo_config import cfg
from oslo_log import log as logging
from ironic.common import boot_devices
from ironic.common import dhcp_factory
from ironic.common import exception
from ironic.common.glance_service import service_utils
from i... | true | true |
f7113319ab5a3109c6a12ffd7309beed2c6268f7 | 4,269 | py | Python | source/functions/encryption.py | GucciHsuan/CampusCyberInspectionTool2021 | 86636f777192e492f4342519e30a975a6a58b8ab | [
"MIT"
] | null | null | null | source/functions/encryption.py | GucciHsuan/CampusCyberInspectionTool2021 | 86636f777192e492f4342519e30a975a6a58b8ab | [
"MIT"
] | null | null | null | source/functions/encryption.py | GucciHsuan/CampusCyberInspectionTool2021 | 86636f777192e492f4342519e30a975a6a58b8ab | [
"MIT"
] | null | null | null | class cryto:
def decryp_Vige() :
cyphertext=input("cyphertext=")
key=input("key=")
print("plaintext=",end='')
j=0
for i in cyphertext :
c=ord(key[j])
if c < 97 :
c=c+32
c=c-97
x=ord(i)+26
if x < 123... | 27.018987 | 89 | 0.35465 | class cryto:
def decryp_Vige() :
cyphertext=input("cyphertext=")
key=input("key=")
print("plaintext=",end='')
j=0
for i in cyphertext :
c=ord(key[j])
if c < 97 :
c=c+32
c=c-97
x=ord(i)+26
if x < 123... | true | true |
f71133f3b8e1efb4829caeb82d8460761e5bcacc | 2,828 | py | Python | crpm/pvalue.py | dmontemayor/CRPM | e896831fad7bed42d17574b137e600fc5adbf6b0 | [
"MIT"
] | null | null | null | crpm/pvalue.py | dmontemayor/CRPM | e896831fad7bed42d17574b137e600fc5adbf6b0 | [
"MIT"
] | null | null | null | crpm/pvalue.py | dmontemayor/CRPM | e896831fad7bed42d17574b137e600fc5adbf6b0 | [
"MIT"
] | null | null | null | """ Calcualte p-values, ROC, AUC, and proportion of significant observations for
a set of observations given the null hypothesis distribution
Args:
variable: array of observed values
hypothesis: optional null hypotheis distribution (beta distribution by default)
alpha: optional significance... | 28.857143 | 94 | 0.640382 |
import numpy as np
def pvalue(variable=None, hypothesis=None, alpha=.05):
if variable is None:
variable = np.random.beta(a=3, b=5, size=5000)
else:
variable = np.array(variable)
if hypothesis is None:
hypothesis = np.random.beta(a=5, b=5, size=1000)
else:
hy... | true | true |
f71133f82623f384ba4feeea0b52c7871bf3ea83 | 3,948 | py | Python | book/linreg_poly_vs_degree.py | tywang89/pyprobml | 82cfdcb8daea653cda8f77e8737e585418476ca7 | [
"MIT"
] | 1 | 2019-05-07T12:40:01.000Z | 2019-05-07T12:40:01.000Z | book/linreg_poly_vs_degree.py | tywang89/pyprobml | 82cfdcb8daea653cda8f77e8737e585418476ca7 | [
"MIT"
] | null | null | null | book/linreg_poly_vs_degree.py | tywang89/pyprobml | 82cfdcb8daea653cda8f77e8737e585418476ca7 | [
"MIT"
] | null | null | null | # Plot polynomial regression on 1d problem
# Based on https://github.com/probml/pmtk3/blob/master/demos/linregPolyVsDegree.m
import numpy as np
import matplotlib.pyplot as plt
from pyprobml_utils import save_fig
from sklearn.preprocessing import PolynomialFeatures
from sklearn.linear_model import LinearRegression
fr... | 34.938053 | 140 | 0.678318 |
import numpy as np
import matplotlib.pyplot as plt
from pyprobml_utils import save_fig
from sklearn.preprocessing import PolynomialFeatures
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import MinMaxScaler
import sklearn.metrics
from sklearn.metrics import mean_squared_error as mse... | true | true |
f71134778da67a8817b7931130ea8e8dcc0520e7 | 13,724 | py | Python | logicmonitor_sdk/models/widget.py | JeremyTangCD/lm-sdk-python | 2a15e055e5a3f72d2f2e4fb43bdbed203c5a9983 | [
"Apache-2.0"
] | null | null | null | logicmonitor_sdk/models/widget.py | JeremyTangCD/lm-sdk-python | 2a15e055e5a3f72d2f2e4fb43bdbed203c5a9983 | [
"Apache-2.0"
] | null | null | null | logicmonitor_sdk/models/widget.py | JeremyTangCD/lm-sdk-python | 2a15e055e5a3f72d2f2e4fb43bdbed203c5a9983 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
LogicMonitor REST API
LogicMonitor is a SaaS-based performance monitoring platform that provides full visibility into complex, hybrid infrastructures, offering granular performance monitoring and actionable data and insights. logicmonitor_sdk enables you to manage your LogicMonitor account... | 31.405034 | 336 | 0.600627 |
import pprint
import re
import six
class Widget(object):
swagger_types = {
'last_updated_by': 'str',
'user_permission': 'str',
'dashboard_id': 'int',
'name': 'str',
'description': 'str',
'last_updated_on': 'int',
'theme': 'str',
'interval': '... | true | true |
f71134a742f050558c8c7b7b88a6923832e58fdb | 2,461 | py | Python | msgflow/service/webapi_service.py | colorfulscoop/msgflow | b275748afcdf3aa5aec1f80436cb7e0bd03fc69f | [
"MIT"
] | 5 | 2021-01-01T12:34:23.000Z | 2022-03-08T13:02:11.000Z | msgflow/service/webapi_service.py | colorfulscoop/msgflow | b275748afcdf3aa5aec1f80436cb7e0bd03fc69f | [
"MIT"
] | null | null | null | msgflow/service/webapi_service.py | colorfulscoop/msgflow | b275748afcdf3aa5aec1f80436cb7e0bd03fc69f | [
"MIT"
] | 1 | 2021-01-01T12:34:27.000Z | 2021-01-01T12:34:27.000Z | from pydantic import BaseModel
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import uvicorn
import pkg_resources
from typing import Any
def build_api(handler, endpoint):
def get_version():
pkg_name = "msgflow"
try:
version = pkg_resources.get_distributi... | 22.577982 | 76 | 0.611946 | from pydantic import BaseModel
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import uvicorn
import pkg_resources
from typing import Any
def build_api(handler, endpoint):
def get_version():
pkg_name = "msgflow"
try:
version = pkg_resources.get_distributi... | true | true |
f71134f7f0b02eb570f36f87275fe61904ada617 | 1,339 | py | Python | tests/test_gui.py | prosodylab/Montreal-Forced-Aligner | 58e95c941924d7cb4db5672e28fb0dbbcf9c42f3 | [
"MIT"
] | null | null | null | tests/test_gui.py | prosodylab/Montreal-Forced-Aligner | 58e95c941924d7cb4db5672e28fb0dbbcf9c42f3 | [
"MIT"
] | null | null | null | tests/test_gui.py | prosodylab/Montreal-Forced-Aligner | 58e95c941924d7cb4db5672e28fb0dbbcf9c42f3 | [
"MIT"
] | null | null | null | import os
from montreal_forced_aligner.corpus.acoustic_corpus import AcousticCorpus
def test_save_text_lab(
basic_corpus_dir,
generated_dir,
):
output_directory = os.path.join(generated_dir, "gui_tests")
corpus = AcousticCorpus(
corpus_directory=basic_corpus_dir,
use_mp=True,
... | 27.895833 | 73 | 0.716953 | import os
from montreal_forced_aligner.corpus.acoustic_corpus import AcousticCorpus
def test_save_text_lab(
basic_corpus_dir,
generated_dir,
):
output_directory = os.path.join(generated_dir, "gui_tests")
corpus = AcousticCorpus(
corpus_directory=basic_corpus_dir,
use_mp=True,
... | true | true |
f711359dc17042272390f6f50314b5f2c746d6b9 | 934 | py | Python | CHAP06/wrapper/azdo.py | dotcs/Terraform-Cookbook | 16938bf044353b1552f3ffb676153f922e147700 | [
"MIT"
] | 86 | 2020-02-05T15:00:16.000Z | 2022-03-28T12:06:14.000Z | CHAP06/wrapper/azdo.py | dotcs/Terraform-Cookbook | 16938bf044353b1552f3ffb676153f922e147700 | [
"MIT"
] | 1 | 2021-01-14T16:49:50.000Z | 2021-01-14T16:49:50.000Z | CHAP06/wrapper/azdo.py | dotcs/Terraform-Cookbook | 16938bf044353b1552f3ffb676153f922e147700 | [
"MIT"
] | 113 | 2020-02-09T12:34:19.000Z | 2022-03-22T18:42:59.000Z | import os
def tfoutputtoAzdo(outputlist, jsonObject):
"""
This function convert a dict to Azure DevOps pipelines variable
outputlist : dict { terraform_output : azure devpops variable}
jsonOject : the terraform output in Json format (terraform output -json)
"""
if(len(outputlist) > 0):
... | 37.36 | 96 | 0.541756 | import os
def tfoutputtoAzdo(outputlist, jsonObject):
if(len(outputlist) > 0):
for k, v in outputlist.items():
tfoutput_name = k
azdovar = str(v)
if tfoutput_name in jsonObject.keys():
var_value = jsonObject[tfoutput_name]["value"]
... | true | true |
f71135d130be1b16ed52e91265050b1eeb02e001 | 2,702 | py | Python | baseline/utils/mainFunctions.py | haymrpig/Pytorch_template | 9a0eda43b2da27807461b305ed42e1bd7c1341dd | [
"MIT"
] | null | null | null | baseline/utils/mainFunctions.py | haymrpig/Pytorch_template | 9a0eda43b2da27807461b305ed42e1bd7c1341dd | [
"MIT"
] | null | null | null | baseline/utils/mainFunctions.py | haymrpig/Pytorch_template | 9a0eda43b2da27807461b305ed42e1bd7c1341dd | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
from torch.nn import functional as F
from tqdm import tqdm
class _BaseWrapper():
def __init__(self, model):
super().__init__()
self.model = model
self.handlers = []
def forward(self, images):
self.image_shape = images.shape[... | 33.775 | 98 | 0.631384 | import numpy as np
import torch
import torch.nn as nn
from torch.nn import functional as F
from tqdm import tqdm
class _BaseWrapper():
def __init__(self, model):
super().__init__()
self.model = model
self.handlers = []
def forward(self, images):
self.image_shape = images.shape[... | true | true |
f71135dc8e414cd1dc043aa36791209c2ac417ba | 3,026 | py | Python | hmc/tests/test_cox_poisson.py | JamesBrofos/Thresholds-in-Hamiltonian-Monte-Carlo | 7ee1b530db0eb536666dbc872fbf8200e53dd49b | [
"MIT"
] | 1 | 2021-11-23T15:40:07.000Z | 2021-11-23T15:40:07.000Z | hmc/tests/test_cox_poisson.py | JamesBrofos/Thresholds-in-Hamiltonian-Monte-Carlo | 7ee1b530db0eb536666dbc872fbf8200e53dd49b | [
"MIT"
] | null | null | null | hmc/tests/test_cox_poisson.py | JamesBrofos/Thresholds-in-Hamiltonian-Monte-Carlo | 7ee1b530db0eb536666dbc872fbf8200e53dd49b | [
"MIT"
] | null | null | null | import unittest
import numpy as np
from hmc.applications.cox_poisson import forward_transform, inverse_transform, generate_data, gaussian_posterior_factory, hyperparameter_posterior_factory
from hmc.applications.cox_poisson.prior import log_prior, grad_log_prior, hess_log_prior, grad_hess_log_prior
class TestCoxPoi... | 41.452055 | 154 | 0.663913 | import unittest
import numpy as np
from hmc.applications.cox_poisson import forward_transform, inverse_transform, generate_data, gaussian_posterior_factory, hyperparameter_posterior_factory
from hmc.applications.cox_poisson.prior import log_prior, grad_log_prior, hess_log_prior, grad_hess_log_prior
class TestCoxPoi... | true | true |
f711370932f8b4c113c4541c13a5de315eff195e | 1,653 | py | Python | Object detection and depth estimation/catkin_ws/src/f110-fall2018-skeltons/labs/wall_following/scripts/utils/other.py | UF-f1tenth/F1tenth-UFL | 93b0a822c67b2b425664642955342138e65974f4 | [
"Apache-2.0"
] | null | null | null | Object detection and depth estimation/catkin_ws/src/f110-fall2018-skeltons/labs/wall_following/scripts/utils/other.py | UF-f1tenth/F1tenth-UFL | 93b0a822c67b2b425664642955342138e65974f4 | [
"Apache-2.0"
] | null | null | null | Object detection and depth estimation/catkin_ws/src/f110-fall2018-skeltons/labs/wall_following/scripts/utils/other.py | UF-f1tenth/F1tenth-UFL | 93b0a822c67b2b425664642955342138e65974f4 | [
"Apache-2.0"
] | null | null | null | """
Created on Fri Oct 29 18:54:18 2021
@author: Krishna Nuthalapati
"""
import numpy as np
def iou(boxA, boxB):
# determine the (x, y)-coordinates of the intersection rectangle
xA = max(boxA[0], boxB[0])
yA = max(boxA[1], boxB[1])
xB = min(boxA[2], boxB[2])
yB = min(boxA[3], boxB[3])
# compute the area of int... | 30.611111 | 65 | 0.566243 |
import numpy as np
def iou(boxA, boxB):
xA = max(boxA[0], boxB[0])
yA = max(boxA[1], boxB[1])
xB = min(boxA[2], boxB[2])
yB = min(boxA[3], boxB[3])
interArea = max(0, xB - xA + 1) * max(0, yB - yA + 1)
boxAArea = (boxA[2] - boxA[0] + 1) * (boxA[3] - boxA[1] + 1)
boxBArea = (boxB[2] - boxB[0] + 1) * (bo... | true | true |
f711371b1ee98e180d6a5e26233698cd11df382f | 3,458 | py | Python | dedupe/blocking.py | daherman/dedupe | 053d373aaed47201f720c5b6d1a568fc49742cc3 | [
"MIT"
] | null | null | null | dedupe/blocking.py | daherman/dedupe | 053d373aaed47201f720c5b6d1a568fc49742cc3 | [
"MIT"
] | null | null | null | dedupe/blocking.py | daherman/dedupe | 053d373aaed47201f720c5b6d1a568fc49742cc3 | [
"MIT"
] | 1 | 2020-03-12T11:14:37.000Z | 2020-03-12T11:14:37.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
from future.utils import viewvalues
from collections import defaultdict
import logging
import time
logger = logging.getLogger(__name__)
def index_list():
return defaultdict(list)
class Blocker:
'''Takes in a record and returns all blocks that record belongs to'''... | 30.333333 | 78 | 0.571139 |
from future.utils import viewvalues
from collections import defaultdict
import logging
import time
logger = logging.getLogger(__name__)
def index_list():
return defaultdict(list)
class Blocker:
def __init__(self, predicates):
self.predicates = predicates
self.index_fields = defaultdi... | true | true |
f71137f8453b7453a7288e056250a0b4f1b5adfe | 688 | py | Python | openapi_documentor/users/models.py | codeasashu/openapi-documentor | dde825edaac85bb117d06adf0a4eabf1f5da44f5 | [
"MIT"
] | null | null | null | openapi_documentor/users/models.py | codeasashu/openapi-documentor | dde825edaac85bb117d06adf0a4eabf1f5da44f5 | [
"MIT"
] | 5 | 2021-04-06T07:46:47.000Z | 2022-03-02T13:12:20.000Z | openapi_documentor/users/models.py | codeasashu/openapi-documentor | dde825edaac85bb117d06adf0a4eabf1f5da44f5 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import AbstractUser
from django.db.models import CharField
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
class User(AbstractUser):
"""Default user for Openapi Documentor."""
#: First and last name do not cover name patterns around the g... | 29.913043 | 74 | 0.686047 | from django.contrib.auth.models import AbstractUser
from django.db.models import CharField
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
class User(AbstractUser):
name = CharField(_("Name of User"), blank=True, max_length=255)
first_name = None
last_name = ... | true | true |
f7113827be9d6a1cee1e09d156ea82251b27fde6 | 6,164 | py | Python | fgh_gnn/data/graph_builder.py | alstonlo/fgh-gnn | 099aee925a3c5077070803d31b6e45793972239c | [
"MIT"
] | null | null | null | fgh_gnn/data/graph_builder.py | alstonlo/fgh-gnn | 099aee925a3c5077070803d31b6e45793972239c | [
"MIT"
] | null | null | null | fgh_gnn/data/graph_builder.py | alstonlo/fgh-gnn | 099aee925a3c5077070803d31b6e45793972239c | [
"MIT"
] | null | null | null | import itertools
import dgl
import torch
from rdkit import Chem
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import minimum_spanning_tree
from fgh_gnn.utils import FGROUP_MOLS, get_ring_fragments, ogb_graph_to_mol
class FGroupHetGraphBuilder:
def __init__(self, vocab):
self.vocab = voc... | 32.613757 | 79 | 0.602531 | import itertools
import dgl
import torch
from rdkit import Chem
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import minimum_spanning_tree
from fgh_gnn.utils import FGROUP_MOLS, get_ring_fragments, ogb_graph_to_mol
class FGroupHetGraphBuilder:
def __init__(self, vocab):
self.vocab = voc... | true | true |
f71138b533e46adf6dde35d54e02d04a62c01bd9 | 1,408 | py | Python | translate/cloud-client/translate_v3_get_supported_languages_with_target.py | summersab/python-docs-samples | 7c1e9685fe190f7789d8e1dbcfe8c01a20e3dc66 | [
"Apache-2.0"
] | 2 | 2020-09-19T04:22:52.000Z | 2020-09-23T14:04:17.000Z | translate/cloud-client/translate_v3_get_supported_languages_with_target.py | summersab/python-docs-samples | 7c1e9685fe190f7789d8e1dbcfe8c01a20e3dc66 | [
"Apache-2.0"
] | 1 | 2020-07-23T10:47:32.000Z | 2020-07-23T10:47:32.000Z | translate/cloud-client/translate_v3_get_supported_languages_with_target.py | summersab/python-docs-samples | 7c1e9685fe190f7789d8e1dbcfe8c01a20e3dc66 | [
"Apache-2.0"
] | 2 | 2020-09-13T03:47:22.000Z | 2020-09-23T14:04:19.000Z | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 39.111111 | 81 | 0.758523 |
from google.cloud import translate
def get_supported_languages_with_target(project_id="YOUR_PROJECT_ID"):
client = translate.TranslationServiceClient()
parent = client.location_path(project_id, "global")
response = client.get_supported_languages(
display_language_code="is", ... | true | true |
f711396a297eb7913d70fb420d60db3044534bfe | 209 | py | Python | src/clikit/__init__.py | abn/clikit | c9f96ee7a39a0d59d6cf7b5888589a030f36f051 | [
"MIT"
] | null | null | null | src/clikit/__init__.py | abn/clikit | c9f96ee7a39a0d59d6cf7b5888589a030f36f051 | [
"MIT"
] | null | null | null | src/clikit/__init__.py | abn/clikit | c9f96ee7a39a0d59d6cf7b5888589a030f36f051 | [
"MIT"
] | null | null | null | from .api.config.application_config import ApplicationConfig
from .console_application import ConsoleApplication
from .config.default_application_config import DefaultApplicationConfig
__version__ = "0.2.4"
| 29.857143 | 71 | 0.866029 | from .api.config.application_config import ApplicationConfig
from .console_application import ConsoleApplication
from .config.default_application_config import DefaultApplicationConfig
__version__ = "0.2.4"
| true | true |
f7113a0b6eae6c1acd7f596dd110305a0730d168 | 10,904 | py | Python | mdparser.py | galeo/pagedown-editor-only | e053bb61a48e257011a76f82bd0c546d6f044042 | [
"MIT"
] | 2 | 2015-03-02T10:52:52.000Z | 2016-03-13T11:44:01.000Z | mdparser.py | galeo/pagedown-editor-only | e053bb61a48e257011a76f82bd0c546d6f044042 | [
"MIT"
] | null | null | null | mdparser.py | galeo/pagedown-editor-only | e053bb61a48e257011a76f82bd0c546d6f044042 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Markdown parsers.
#
#
# Author: Moogen Tian <http://blog.galeo.me>
#
# Legal:
#
# This file is published under BSD License.
#
# And the code structure references:
#
# * pagewise (by ainm <ainm at gmx.com>, with personal public license)
#
# * mynt (by Andrew Fricke, the autho... | 30.543417 | 95 | 0.573184 |
from __future__ import unicode_literals
import re
import sys
class MDParserException(Exception):
pass
def error(message, *args):
raise MDParserException(message % args)
def warning(message, *args):
sys.stderr.write("WARNING: " + message % args)
def halt(message, *args):
... | true | true |
f7113a19ca443354c370f38ad63f77db03ae42db | 5,269 | py | Python | moment/test/test_isSameOrBefore.py | KrixTam/pymoment | b938cafc4c772df55feb3daa41286eade6f3e310 | [
"MIT"
] | 1 | 2021-04-24T17:51:08.000Z | 2021-04-24T17:51:08.000Z | moment/test/test_isSameOrBefore.py | KrixTam/pymoment | b938cafc4c772df55feb3daa41286eade6f3e310 | [
"MIT"
] | null | null | null | moment/test/test_isSameOrBefore.py | KrixTam/pymoment | b938cafc4c772df55feb3daa41286eade6f3e310 | [
"MIT"
] | null | null | null | import unittest
from moment import moment
class TestIsSameOrBefore(unittest.TestCase):
def test_default(self):
a = moment('2021-04-22 04:02:09.957000 +0800')
b = moment('2021-2-2 13:02:09.957000 +0800')
self.assertTrue(a.isSameOrBefore([2021, 5, 1]))
self.assertFalse(a.isSameOrBef... | 43.908333 | 77 | 0.605808 | import unittest
from moment import moment
class TestIsSameOrBefore(unittest.TestCase):
def test_default(self):
a = moment('2021-04-22 04:02:09.957000 +0800')
b = moment('2021-2-2 13:02:09.957000 +0800')
self.assertTrue(a.isSameOrBefore([2021, 5, 1]))
self.assertFalse(a.isSameOrBef... | true | true |
f7113a7ec84a5912d102e4fdfaf67e71bdf1c10e | 59 | py | Python | dev/ideal.py | baltiloka/fisica | 96e8bb1d4eec9963afa4732e19fb474b3ead1b31 | [
"MIT"
] | null | null | null | dev/ideal.py | baltiloka/fisica | 96e8bb1d4eec9963afa4732e19fb474b3ead1b31 | [
"MIT"
] | null | null | null | dev/ideal.py | baltiloka/fisica | 96e8bb1d4eec9963afa4732e19fb474b3ead1b31 | [
"MIT"
] | null | null | null | """
Version Sofware: 0.0.0
Version Python: 3.7
"""
| 11.8 | 26 | 0.542373 | true | true | |
f7113ad4dce58e0ca6134660c1d3384f46c82957 | 2,323 | py | Python | g_CNN/Optimizers.py | wangjiangtao-NJPI/MachineLearning | 78124b56a26ec68efb3c517a4a2420860b6e4a75 | [
"MIT"
] | null | null | null | g_CNN/Optimizers.py | wangjiangtao-NJPI/MachineLearning | 78124b56a26ec68efb3c517a4a2420860b6e4a75 | [
"MIT"
] | null | null | null | g_CNN/Optimizers.py | wangjiangtao-NJPI/MachineLearning | 78124b56a26ec68efb3c517a4a2420860b6e4a75 | [
"MIT"
] | null | null | null | import os
import sys
root_path = os.path.abspath("../")
if root_path not in sys.path:
sys.path.append(root_path)
import tensorflow as tf
class Optimizer:
def __init__(self, lr=1e-3):
self._lr = lr
self._opt = None
@property
def name(self):
return str(self)
def minimize(s... | 26.701149 | 85 | 0.643134 | import os
import sys
root_path = os.path.abspath("../")
if root_path not in sys.path:
sys.path.append(root_path)
import tensorflow as tf
class Optimizer:
def __init__(self, lr=1e-3):
self._lr = lr
self._opt = None
@property
def name(self):
return str(self)
def minimize(s... | true | true |
f7113ae3426f27603355965e27500b97e47f2abe | 1,296 | py | Python | setup.py | dxxxm/opencv_wrapper | 4838185cf37b8d93190b5761dcc815ba285ff0cf | [
"MIT"
] | 16 | 2019-04-03T18:34:57.000Z | 2021-11-24T09:24:10.000Z | setup.py | anbergem/cvhelper | 4838185cf37b8d93190b5761dcc815ba285ff0cf | [
"MIT"
] | 7 | 2019-04-04T10:31:48.000Z | 2020-06-21T10:16:18.000Z | setup.py | anbergem/cvhelper | 4838185cf37b8d93190b5761dcc815ba285ff0cf | [
"MIT"
] | 3 | 2019-12-20T13:42:19.000Z | 2021-08-13T08:37:14.000Z | import os.path
import sys
from setuptools import setup
with open("README.md", encoding="utf-8") as fh:
long_description = fh.read()
requirements = ["numpy"]
if sys.version_info[1] == 6:
requirements.append("dataclasses")
here = os.path.abspath(os.path.dirname(__file__))
about = {}
with open(os.path.join(h... | 27.574468 | 76 | 0.652778 | import os.path
import sys
from setuptools import setup
with open("README.md", encoding="utf-8") as fh:
long_description = fh.read()
requirements = ["numpy"]
if sys.version_info[1] == 6:
requirements.append("dataclasses")
here = os.path.abspath(os.path.dirname(__file__))
about = {}
with open(os.path.join(h... | true | true |
f7113b355a34d5cbd98cf0956b535f8beac0f567 | 26,950 | py | Python | integration-tests/run-intg-test.py | wso2-incubator/sp-test-integration | 7460ab98df55945e0a2c7351571bb765529a5f45 | [
"Apache-2.0"
] | null | null | null | integration-tests/run-intg-test.py | wso2-incubator/sp-test-integration | 7460ab98df55945e0a2c7351571bb765529a5f45 | [
"Apache-2.0"
] | null | null | null | integration-tests/run-intg-test.py | wso2-incubator/sp-test-integration | 7460ab98df55945e0a2c7351571bb765529a5f45 | [
"Apache-2.0"
] | 2 | 2018-09-05T04:52:17.000Z | 2018-09-05T06:16:53.000Z | # Copyright (c) 2018, WSO2 Inc. (http://wso2.com) 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 ap... | 39.985163 | 178 | 0.648646 |
import sys
from xml.etree import ElementTree as ET
import subprocess
import wget
import logging
import inspect
import os
import shutil
import pymysql
import sqlparse
import glob
import ast
import stat
import re
from pathlib import Path
import urllib.request as urllib2
from xml.dom import minidom
import ... | true | true |
f7113c4e2ecd8677cdceb6cc10f2089325dd123b | 7,683 | py | Python | BNN/forget.py | fshp971/mcmc-unlearning | 3113dedca6de33bcaf316b804cb9c1e636db7fd5 | [
"MIT"
] | 5 | 2022-03-16T02:28:27.000Z | 2022-03-29T08:36:57.000Z | BNN/forget.py | fshp971/mcmc-unlearning | 3113dedca6de33bcaf316b804cb9c1e636db7fd5 | [
"MIT"
] | null | null | null | BNN/forget.py | fshp971/mcmc-unlearning | 3113dedca6de33bcaf316b804cb9c1e636db7fd5 | [
"MIT"
] | null | null | null | from datetime import datetime
import os
import pickle
import argparse
import numpy as np
import torch
import torch.nn.functional as F
from mcmc_unlearner import sgmcmcUnlearner
import utils
import models
class myUnlearner(sgmcmcUnlearner):
def _apply_sample(self, z):
x, y = z
if not self.cpu: x, ... | 31.879668 | 116 | 0.63647 | from datetime import datetime
import os
import pickle
import argparse
import numpy as np
import torch
import torch.nn.functional as F
from mcmc_unlearner import sgmcmcUnlearner
import utils
import models
class myUnlearner(sgmcmcUnlearner):
def _apply_sample(self, z):
x, y = z
if not self.cpu: x, ... | true | true |
f7113d3eadd9f0bc689a14dfac6d67b4d3b2ca7f | 2,323 | py | Python | src/timessquare/worker/main.py | lsst-sqre/times-square | 4a8d6183d9ae073d7e6968506e29c671d196446a | [
"MIT"
] | null | null | null | src/timessquare/worker/main.py | lsst-sqre/times-square | 4a8d6183d9ae073d7e6968506e29c671d196446a | [
"MIT"
] | 6 | 2021-12-13T20:19:41.000Z | 2022-03-28T20:09:01.000Z | src/timessquare/worker/main.py | lsst-sqre/times-square | 4a8d6183d9ae073d7e6968506e29c671d196446a | [
"MIT"
] | null | null | null | """Arq-based queue worker lifecycle configuration."""
from __future__ import annotations
import uuid
from typing import Any, Dict
import httpx
import structlog
from safir.dependencies.db_session import db_session_dependency
from safir.logging import configure_logging
from timessquare.config import config
from times... | 26.701149 | 78 | 0.713732 |
from __future__ import annotations
import uuid
from typing import Any, Dict
import httpx
import structlog
from safir.dependencies.db_session import db_session_dependency
from safir.logging import configure_logging
from timessquare.config import config
from timessquare.dependencies.redis import redis_dependency
fro... | true | true |
f7113d8051dae56c9c2db4dc6bfcbafa078a0893 | 2,015 | py | Python | pymongo_opentracing/tracing.py | khvn26/python-pymongo | d878249b6e1cb11007ab00fe44bdd858f6a78724 | [
"Apache-2.0"
] | null | null | null | pymongo_opentracing/tracing.py | khvn26/python-pymongo | d878249b6e1cb11007ab00fe44bdd858f6a78724 | [
"Apache-2.0"
] | null | null | null | pymongo_opentracing/tracing.py | khvn26/python-pymongo | d878249b6e1cb11007ab00fe44bdd858f6a78724 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2018 SignalFx, Inc. All rights reserved.
from bson import json_util as json
from opentracing.ext import tags
import pymongo.monitoring
from six import text_type
import opentracing
class CommandTracing(pymongo.monitoring.CommandListener):
_scopes = {}
def __init__(self, tracer=None, span_tags... | 33.583333 | 78 | 0.653598 |
from bson import json_util as json
from opentracing.ext import tags
import pymongo.monitoring
from six import text_type
import opentracing
class CommandTracing(pymongo.monitoring.CommandListener):
_scopes = {}
def __init__(self, tracer=None, span_tags=None):
try:
global_tracer = opentra... | true | true |
f7113ddd020fdfec1185ec67da4041271d3b1e1d | 3,183 | py | Python | files/regressao_linear/regressaolinear1.py | Nina-pinheiro/Data-Science-Python | b6b2bc28f2f8f925e1b43408330641bd72388232 | [
"MIT"
] | 9 | 2021-01-29T14:01:57.000Z | 2022-03-26T00:46:00.000Z | files/regressao_linear/regressaolinear1.py | Nina-pinheiro/machine_learning_statistic_python | b6b2bc28f2f8f925e1b43408330641bd72388232 | [
"MIT"
] | null | null | null | files/regressao_linear/regressaolinear1.py | Nina-pinheiro/machine_learning_statistic_python | b6b2bc28f2f8f925e1b43408330641bd72388232 | [
"MIT"
] | 2 | 2020-07-28T11:25:55.000Z | 2020-08-03T20:04:11.000Z | # Importar as bibliotecas necessárias
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error
import seaborn as sns
from sklearn.linear_model import LinearRegression
# Leitura do dataset
... | 28.168142 | 138 | 0.733585 |
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error
import seaborn as sns
from sklearn.linear_model import LinearRegression
df = pd.read_csv("dataset/consumo.csv")
df['Temperatu... | true | true |
f7113fc325ff8b58e82cf2a55f7200040cf6703c | 9,272 | py | Python | generate_xfoil/naca4.py | nasa/airfoil-learning | a76dabc0474485d1e573471e70ec4826aeae0517 | [
"NASA-1.3"
] | null | null | null | generate_xfoil/naca4.py | nasa/airfoil-learning | a76dabc0474485d1e573471e70ec4826aeae0517 | [
"NASA-1.3"
] | null | null | null | generate_xfoil/naca4.py | nasa/airfoil-learning | a76dabc0474485d1e573471e70ec4826aeae0517 | [
"NASA-1.3"
] | null | null | null | """
Python 2 and 3 code to generate 4 and 5 digit NACA profiles
The NACA airfoils are airfoil shapes for aircraft wings developed
by the National Advisory Committee for Aeronautics (NACA).
The shape of the NACA airfoils is described using a series of
digits following the word "NACA". The parameters in the numerical
co... | 31.972414 | 120 | 0.586928 |
from math import cos, sin, tan
from math import atan
from math import pi
from math import pow
from math import sqrt
def linspace(start,stop,np):
return [start+(stop-start)*i/(np-1) for i in range(np)]
def interpolate(xa,ya,queryPoints):
n = len(xa)
u, y2 = [0]*n, [0]*n
for... | true | true |
f71140f71757f91e0819a2fc215c3a2331a74823 | 2,033 | py | Python | Experimental setup/Window size test/data6.py | alancsouza/chip_clas | e6df8713ae7dd70a5719af83b3b6cb5686f87e29 | [
"MIT"
] | null | null | null | Experimental setup/Window size test/data6.py | alancsouza/chip_clas | e6df8713ae7dd70a5719af83b3b6cb5686f87e29 | [
"MIT"
] | null | null | null | Experimental setup/Window size test/data6.py | alancsouza/chip_clas | e6df8713ae7dd70a5719af83b3b6cb5686f87e29 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
data6 = Breast cancer
"""
from chip_clas_new import chip_clas_new
import statistics
from functions import remove_noise
from sklearn.model_selection import train_test_split, KFold
from sklearn.preprocessing import MinMaxScaler
import numpy as np
import pandas as pd
da... | 32.269841 | 166 | 0.666503 |
from chip_clas_new import chip_clas_new
import statistics
from functions import remove_noise
from sklearn.model_selection import train_test_split, KFold
from sklearn.preprocessing import MinMaxScaler
import numpy as np
import pandas as pd
data_name = "Breast cancer"
print(data_name)
url = 'https://archive.ics.uci.e... | true | true |
f7114124785a5e85f61ee49af63f4110720e5cb2 | 2,254 | py | Python | bufu/bufu.py | indigo13love/bufu | de005ec465b3ae0688aaf1821a64573ca014e56a | [
"Apache-2.0"
] | null | null | null | bufu/bufu.py | indigo13love/bufu | de005ec465b3ae0688aaf1821a64573ca014e56a | [
"Apache-2.0"
] | null | null | null | bufu/bufu.py | indigo13love/bufu | de005ec465b3ae0688aaf1821a64573ca014e56a | [
"Apache-2.0"
] | null | null | null | import fire
import snowflake.connector
import configparser
import secrets
import pathlib
class Bufu():
def connect(self):
cp = configparser.ConfigParser()
path = pathlib.Path('~/.snowsql/config')
cp.read(path.expanduser())
conn = snowflake.connector.connect(
user = cp['c... | 29.657895 | 78 | 0.5 | import fire
import snowflake.connector
import configparser
import secrets
import pathlib
class Bufu():
def connect(self):
cp = configparser.ConfigParser()
path = pathlib.Path('~/.snowsql/config')
cp.read(path.expanduser())
conn = snowflake.connector.connect(
user = cp['c... | true | true |
f71142d1bd2737e13ea6097fca600ac378ba836b | 16,033 | py | Python | sfa/data_process/transformation.py | lhcezx/Deteciton_3D | e98b9bb0dd96dfa112e196ec93129caf1ffef39e | [
"MIT"
] | null | null | null | sfa/data_process/transformation.py | lhcezx/Deteciton_3D | e98b9bb0dd96dfa112e196ec93129caf1ffef39e | [
"MIT"
] | null | null | null | sfa/data_process/transformation.py | lhcezx/Deteciton_3D | e98b9bb0dd96dfa112e196ec93129caf1ffef39e | [
"MIT"
] | null | null | null | import os
import sys
import math
import numpy as np
import torch
src_dir = os.path.dirname(os.path.realpath(__file__))
while not src_dir.endswith("sfa"):
src_dir = os.path.dirname(src_dir)
if src_dir not in sys.path:
sys.path.append(src_dir)
from config import kitti_config as cnf
def angle_in_limit(angle):... | 36.11036 | 122 | 0.51132 | import os
import sys
import math
import numpy as np
import torch
src_dir = os.path.dirname(os.path.realpath(__file__))
while not src_dir.endswith("sfa"):
src_dir = os.path.dirname(src_dir)
if src_dir not in sys.path:
sys.path.append(src_dir)
from config import kitti_config as cnf
def angle_in_limit(angle):... | true | true |
f71142dc21ca7466db972f45836c427d9d863a33 | 9,539 | py | Python | src/neuro_comma/dataset.py | art-vish/neuro-comma | 148ff7150e92d734d926a576c50bcabf1ae0ec0a | [
"MIT"
] | 1 | 2021-11-12T21:05:33.000Z | 2021-11-12T21:05:33.000Z | src/neuro_comma/dataset.py | art-vish/neuro-comma | 148ff7150e92d734d926a576c50bcabf1ae0ec0a | [
"MIT"
] | null | null | null | src/neuro_comma/dataset.py | art-vish/neuro-comma | 148ff7150e92d734d926a576c50bcabf1ae0ec0a | [
"MIT"
] | null | null | null | from typing import Dict, List, Optional, Tuple, Union
from typing_extensions import TypedDict
import numpy as np
import torch
from torch import Tensor
from tqdm import tqdm
from transformers import PreTrainedTokenizer
from neuro_comma.augmentation import AUGMENTATIONS
from neuro_comma.pretrained import TOKEN_IDX
cl... | 38.156 | 163 | 0.528672 | from typing import Dict, List, Optional, Tuple, Union
from typing_extensions import TypedDict
import numpy as np
import torch
from torch import Tensor
from tqdm import tqdm
from transformers import PreTrainedTokenizer
from neuro_comma.augmentation import AUGMENTATIONS
from neuro_comma.pretrained import TOKEN_IDX
cl... | true | true |
f71143dd842b9d129c24fafa0c0a8b516d2a0087 | 418 | py | Python | 01-logica-de-programacao-e-algoritmos/Aula 05/5 Recursos avancados com funcoes/5.1 excecoes e erros/ex05.py | rafaelbarretomg/Uninter | 1f84b0103263177122663e991db3a8aeb106a959 | [
"MIT"
] | null | null | null | 01-logica-de-programacao-e-algoritmos/Aula 05/5 Recursos avancados com funcoes/5.1 excecoes e erros/ex05.py | rafaelbarretomg/Uninter | 1f84b0103263177122663e991db3a8aeb106a959 | [
"MIT"
] | null | null | null | 01-logica-de-programacao-e-algoritmos/Aula 05/5 Recursos avancados com funcoes/5.1 excecoes e erros/ex05.py | rafaelbarretomg/Uninter | 1f84b0103263177122663e991db3a8aeb106a959 | [
"MIT"
] | null | null | null | i = 0
while True:
try:
nome = input('Por favor digite o seu nome: ')
ind = int(input('Digite um indice do nome digitado: '))
print(nome[ind])
break
except ValueError:
print('Oops! Nome invalido. Tente novamente...')
except IndexError:
print('Oops! Indice inval... | 27.866667 | 63 | 0.564593 | i = 0
while True:
try:
nome = input('Por favor digite o seu nome: ')
ind = int(input('Digite um indice do nome digitado: '))
print(nome[ind])
break
except ValueError:
print('Oops! Nome invalido. Tente novamente...')
except IndexError:
print('Oops! Indice inval... | true | true |
f71144d3fcf748c12ca08f30fa4fdb097ffc23d5 | 9,496 | py | Python | mutagen/_vorbis.py | lucienimmink/scanner.py | cecaa0a570ba8058321dea1c8efa9f77868effb3 | [
"MIT"
] | 2 | 2020-09-16T07:00:41.000Z | 2020-12-20T19:56:03.000Z | mutagen/_vorbis.py | lucienimmink/scanner.py | cecaa0a570ba8058321dea1c8efa9f77868effb3 | [
"MIT"
] | null | null | null | mutagen/_vorbis.py | lucienimmink/scanner.py | cecaa0a570ba8058321dea1c8efa9f77868effb3 | [
"MIT"
] | 2 | 2020-09-17T08:27:12.000Z | 2021-08-23T11:13:52.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2005-2006 Joe Wreschnig
# 2013 Christoph Reiter
#
# 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... | 30.731392 | 77 | 0.574031 |
import sys
from io import BytesIO
import mutagen
from mutagen._util import DictMixin, cdata, MutagenError, reraise
def is_valid_key(key):
if isinstance(key, bytes):
raise TypeError("needs to be str not bytes")
for c in key:
if c < " " or c > "}" or c == "=":
return Fal... | true | true |
f7114556d4b105fe47f72182510cb3fda36299a6 | 2,416 | py | Python | sdn-lab/2 - hub/hub2.py | chenyongzhouking/qqq | 19d0d80d8c8897ed198d9ac7f02eae3dd114635c | [
"Apache-2.0"
] | null | null | null | sdn-lab/2 - hub/hub2.py | chenyongzhouking/qqq | 19d0d80d8c8897ed198d9ac7f02eae3dd114635c | [
"Apache-2.0"
] | null | null | null | sdn-lab/2 - hub/hub2.py | chenyongzhouking/qqq | 19d0d80d8c8897ed198d9ac7f02eae3dd114635c | [
"Apache-2.0"
] | null | null | null | # Implementazione openflow di un hub tramite controller
#
# In ogni switch viene caricata un'unica regola
# di default (table miss) con azione di invio al controller
# dell'intero pacchetto. Il controller risponde con una
# packet out con azione flood
#
# NOTA: OpenVSwitch ignora l'opzione OFPCML_NO_BUFFER
# nelle rego... | 30.974359 | 69 | 0.637003 |
# di default (table miss) con azione di invio al controller
# dell'intero pacchetto. Il controller risponde con una
# nelle regole table miss (priorita' 0); pertanto,
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER
from ... | true | true |
f71145a2da3e9433195622624a9601d75fc97862 | 2,895 | py | Python | grouper/fe/handlers/service_account_create.py | bonniech3n/merou | 47d9de906686fd5b930a49299d3ffbcc0673ae8a | [
"Apache-2.0"
] | null | null | null | grouper/fe/handlers/service_account_create.py | bonniech3n/merou | 47d9de906686fd5b930a49299d3ffbcc0673ae8a | [
"Apache-2.0"
] | null | null | null | grouper/fe/handlers/service_account_create.py | bonniech3n/merou | 47d9de906686fd5b930a49299d3ffbcc0673ae8a | [
"Apache-2.0"
] | null | null | null | from grouper.fe.forms import ServiceAccountCreateForm
from grouper.fe.settings import settings
from grouper.fe.util import GrouperHandler
from grouper.models.group import Group
from grouper.service_account import (
BadMachineSet,
can_create_service_account,
create_service_account,
DuplicateServiceAccoun... | 35.304878 | 99 | 0.591019 | from grouper.fe.forms import ServiceAccountCreateForm
from grouper.fe.settings import settings
from grouper.fe.util import GrouperHandler
from grouper.models.group import Group
from grouper.service_account import (
BadMachineSet,
can_create_service_account,
create_service_account,
DuplicateServiceAccoun... | true | true |
f71145a80fcf271f5514d8ace4aea5cef26e4d8b | 394 | py | Python | generate_params_cont_bath.py | patryk-kubiczek/learning-GF | 779250d139307cb72e5b4e467f46825c984c87ec | [
"MIT"
] | 8 | 2019-08-13T22:20:53.000Z | 2020-07-22T01:48:41.000Z | generate_params_cont_bath.py | patryk-kubiczek/learning-GF | 779250d139307cb72e5b4e467f46825c984c87ec | [
"MIT"
] | null | null | null | generate_params_cont_bath.py | patryk-kubiczek/learning-GF | 779250d139307cb72e5b4e467f46825c984c87ec | [
"MIT"
] | null | null | null | from generate_params import *
n_params = 50
for _ in range(n_params):
random_params_cont_bath(beta=beta,
U_range=[1., 8.],
eps_range=[-1., 1.],
D_range=[2. , 8.],
filename=name("params_cont_bath", beta,... | 30.307692 | 70 | 0.423858 | from generate_params import *
n_params = 50
for _ in range(n_params):
random_params_cont_bath(beta=beta,
U_range=[1., 8.],
eps_range=[-1., 1.],
D_range=[2. , 8.],
filename=name("params_cont_bath", beta,... | true | true |
f71145cadf3e23956ba90f5e44b628c0b29a20a3 | 484 | py | Python | cmsplugin_seocheck/cms_toolbar.py | creimers/cmsplugin_seocheck | b97f38e55dec516ebf0c049cd26b74347e49b86e | [
"BSD-2-Clause"
] | 3 | 2015-05-11T19:46:59.000Z | 2016-07-26T00:20:00.000Z | cmsplugin_seocheck/cms_toolbar.py | creimers/cmsplugin_seocheck | b97f38e55dec516ebf0c049cd26b74347e49b86e | [
"BSD-2-Clause"
] | 2 | 2015-05-09T16:21:26.000Z | 2016-10-29T13:23:35.000Z | cmsplugin_seocheck/cms_toolbar.py | creimers/cmsplugin_seocheck | b97f38e55dec516ebf0c049cd26b74347e49b86e | [
"BSD-2-Clause"
] | 1 | 2018-03-03T16:18:59.000Z | 2018-03-03T16:18:59.000Z | # -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from cms.toolbar_base import CMSToolbar
from cms.toolbar_pool import toolbar_pool
@toolbar_pool.register
class SeoCheckToolbar(CMSToolbar):
def populate(self):
seo_check_menu = self.toolbar.get_or_create_menu(
'seo_check... | 28.470588 | 64 | 0.673554 |
from django.core.urlresolvers import reverse
from cms.toolbar_base import CMSToolbar
from cms.toolbar_pool import toolbar_pool
@toolbar_pool.register
class SeoCheckToolbar(CMSToolbar):
def populate(self):
seo_check_menu = self.toolbar.get_or_create_menu(
'seo_check',
'SEO... | true | true |
f7114642c746c750ee68257580dadca691feecd7 | 737 | py | Python | pele_platform/gpcr/main.py | esguerra/pele_platform | c78a049d5e4000b42688f6ba240cf97b67739770 | [
"Apache-2.0"
] | 5 | 2020-03-06T17:26:42.000Z | 2020-10-28T16:24:39.000Z | pele_platform/gpcr/main.py | esguerra/pele_platform | c78a049d5e4000b42688f6ba240cf97b67739770 | [
"Apache-2.0"
] | 37 | 2019-11-28T11:07:47.000Z | 2020-11-23T16:22:50.000Z | pele_platform/gpcr/main.py | esguerra/pele_platform | c78a049d5e4000b42688f6ba240cf97b67739770 | [
"Apache-2.0"
] | 8 | 2019-11-27T15:16:30.000Z | 2020-10-27T10:29:52.000Z | from dataclasses import dataclass
import pele_platform.Adaptive.simulation as si
import pele_platform.Utilities.Parameters.parameters as pv
@dataclass
class GpcrLauncher:
args: pv.ParametersBuilder
def run_gpcr_simulation(self) -> pv.ParametersBuilder:
# Set parameters for GPCR and launch simulation... | 32.043478 | 58 | 0.739484 | from dataclasses import dataclass
import pele_platform.Adaptive.simulation as si
import pele_platform.Utilities.Parameters.parameters as pv
@dataclass
class GpcrLauncher:
args: pv.ParametersBuilder
def run_gpcr_simulation(self) -> pv.ParametersBuilder:
self._set_parameters()
simulat... | true | true |
f71146bbe42ce1d7a3023d062762ef23004c106b | 463 | py | Python | Python3/172.factorial-trailing-zeroes.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | Python3/172.factorial-trailing-zeroes.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | Python3/172.factorial-trailing-zeroes.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=172 lang=python3
#
# [172] Factorial Trailing Zeroes
#
# @lc code=start
class Solution:
def trailingZeroes(self, n):
# zero generated by 2 and 5
if n < 5:
return 0
ans = 0
base = 5
while n >= base:
ans += n//base
ba... | 16.535714 | 38 | 0.5054 |
class Solution:
def trailingZeroes(self, n):
if n < 5:
return 0
ans = 0
base = 5
while n >= base:
ans += n//base
base *= 5
return ans
if __name__ == '__main__':
a = Solution()
b = a.trailingZeroes(200)
p... | true | true |
f71146e12c601123c8c8e79c664e15a620ce0608 | 184 | py | Python | GPGO/__init__.py | FNTwin/Bayesian-Optimization | 2f89699648601d4499dcab285a1d7376f0e1ef4b | [
"MIT"
] | 3 | 2020-06-07T19:16:40.000Z | 2020-07-18T21:56:13.000Z | GPGO/__init__.py | FNTwin/Bayesian-Optimization | 2f89699648601d4499dcab285a1d7376f0e1ef4b | [
"MIT"
] | null | null | null | GPGO/__init__.py | FNTwin/Bayesian-Optimization | 2f89699648601d4499dcab285a1d7376f0e1ef4b | [
"MIT"
] | 2 | 2021-01-03T19:09:42.000Z | 2021-01-03T19:09:42.000Z | #from .Opt import BayesianOptimization
from .GaussianProcess import GP
from .GaussianProcess.Kernel import RBF
from .Opt import BayesianOptimization
from .Acquisition import Acquistion | 36.8 | 39 | 0.858696 |
from .GaussianProcess import GP
from .GaussianProcess.Kernel import RBF
from .Opt import BayesianOptimization
from .Acquisition import Acquistion | true | true |
f711480da10ac2397dde2ba6ad95be010af52580 | 5,095 | py | Python | submissions/Thompson/mySearches.py | CDeas9/aima-python | 91c89d898f46a8c472277c9b85c9a282af378937 | [
"MIT"
] | null | null | null | submissions/Thompson/mySearches.py | CDeas9/aima-python | 91c89d898f46a8c472277c9b85c9a282af378937 | [
"MIT"
] | null | null | null | submissions/Thompson/mySearches.py | CDeas9/aima-python | 91c89d898f46a8c472277c9b85c9a282af378937 | [
"MIT"
] | null | null | null | import search
import string
from math import(cos, pi)
# A sample map problem
# sumner_map = search.UndirectedGraph(dict(
# Portland=dict(Mitchellville=7, Fairfield=17, Cottontown=18),
# Cottontown=dict(Portland=18),
# Fairfield=dict(Mitchellville=21, Portland=17),
# Mitchellville=dict(Portland=7, Fairfield... | 29.970588 | 92 | 0.556035 | import search
import string
from math import(cos, pi)
# An abbreviated map of Sumner County, TN.
# This map is unique, to the best of my knowledge.
# '''
norfolk_map = search.UndirectedGraph(dict(
Norfolk=dict(Suffolk=50,Chesapeake=15,VirginiaBeach=35),
Suffolk=dict(Norfolk=50,Chesapeake=35,Hamp... | true | true |
f71148786432618607fcb5a1bef3949e8303ec9a | 12,558 | py | Python | venv/Lib/site-packages/streamlit/caching/hashing.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 19,099 | 2019-08-25T14:00:15.000Z | 2022-03-31T21:00:28.000Z | venv/Lib/site-packages/streamlit/caching/hashing.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 3,078 | 2019-08-25T19:50:14.000Z | 2022-03-31T23:26:14.000Z | venv/Lib/site-packages/streamlit/caching/hashing.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 1,892 | 2019-08-26T04:44:24.000Z | 2022-03-30T16:11:51.000Z | # Copyright 2018-2021 Streamlit Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 32.2 | 89 | 0.608218 |
import collections
import functools
import hashlib
import inspect
import io
import os
import pickle
import sys
import tempfile
import threading
import unittest.mock
import weakref
from typing import Any, Pattern, Optional, Dict, List
from streamlit import type_util
from streamlit import util
from streaml... | true | true |
f711488f270af532051f4ab5dbf2bb0e3eb47a6a | 24 | py | Python | src/test.py | nsde/latinum | c9c58e65b1ab6554f9e2d6bc540b2436aa6270a6 | [
"MIT"
] | null | null | null | src/test.py | nsde/latinum | c9c58e65b1ab6554f9e2d6bc540b2436aa6270a6 | [
"MIT"
] | null | null | null | src/test.py | nsde/latinum | c9c58e65b1ab6554f9e2d6bc540b2436aa6270a6 | [
"MIT"
] | null | null | null | print('a b'.split('.s')) | 24 | 24 | 0.541667 | print('a b'.split('.s')) | true | true |
f711491beb33a98ded1b75da64a40b5c95ce8390 | 934 | py | Python | BipHelp/urls.py | Fenn-CS/BipHelp | a343a1b6f4a1374f54a59d12b07ddbe46b4b0225 | [
"Apache-2.0"
] | null | null | null | BipHelp/urls.py | Fenn-CS/BipHelp | a343a1b6f4a1374f54a59d12b07ddbe46b4b0225 | [
"Apache-2.0"
] | null | null | null | BipHelp/urls.py | Fenn-CS/BipHelp | a343a1b6f4a1374f54a59d12b07ddbe46b4b0225 | [
"Apache-2.0"
] | 1 | 2018-10-30T21:51:10.000Z | 2018-10-30T21:51:10.000Z | """BipHelp URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | 35.923077 | 79 | 0.705567 | from django.conf.urls import url, include
from django.contrib import admin
from rest_framework import routers
router = routers.DefaultRouter()
urlpatterns = [
url(r'^', include(router.urls)),
url(r'^admin/', admin.site.urls),
url(r'^api-auth/', include('rest_framework.urls')),
]
| true | true |
f711491c5c5fc5ac07e56331455fd692c0815d01 | 370 | py | Python | web-frameworks/django/iWillTestEachApps/django_filter/models.py | suroegin-learning/learn-python | be5bda86add0dcd6f2fd3db737bb7d0d3ec5f853 | [
"MIT"
] | null | null | null | web-frameworks/django/iWillTestEachApps/django_filter/models.py | suroegin-learning/learn-python | be5bda86add0dcd6f2fd3db737bb7d0d3ec5f853 | [
"MIT"
] | null | null | null | web-frameworks/django/iWillTestEachApps/django_filter/models.py | suroegin-learning/learn-python | be5bda86add0dcd6f2fd3db737bb7d0d3ec5f853 | [
"MIT"
] | null | null | null | from django.db import models
class Manufacturer(models.Model):
name = models.CharField(max_length=255)
class Product(models.Model):
name = models.CharField(max_length=255)
price = models.DecimalField()
description = models.TextField()
release_date = models.DateField()
manufacturer = models.F... | 26.428571 | 76 | 0.748649 | from django.db import models
class Manufacturer(models.Model):
name = models.CharField(max_length=255)
class Product(models.Model):
name = models.CharField(max_length=255)
price = models.DecimalField()
description = models.TextField()
release_date = models.DateField()
manufacturer = models.F... | true | true |
f7114b1798d03f32f8126bb57de8a94ecc904af6 | 4,302 | py | Python | classification_ModelNet40/test.py | DeVriesMatt/pointMLP-pytorch | e9c09a2038551e83b072353f3fd7e3294463e892 | [
"Apache-2.0"
] | null | null | null | classification_ModelNet40/test.py | DeVriesMatt/pointMLP-pytorch | e9c09a2038551e83b072353f3fd7e3294463e892 | [
"Apache-2.0"
] | null | null | null | classification_ModelNet40/test.py | DeVriesMatt/pointMLP-pytorch | e9c09a2038551e83b072353f3fd7e3294463e892 | [
"Apache-2.0"
] | null | null | null | """
python test.py --model pointMLP --msg 20220209053148-404
"""
import argparse
import os
import datetime
import torch
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
from torch.utils.data import DataLoader
import models as mo... | 30.083916 | 86 | 0.600418 | import argparse
import os
import datetime
import torch
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
from torch.utils.data import DataLoader
import models as models
from utils import progress_bar, IOStream
from data import Mo... | true | true |
f7114b855ef654c33ec2aa02a726cbcb0a885758 | 720 | py | Python | pydualsense/hidguardian.py | TheComputerDan/pydualsense | c1c10e4eacf37818e31b09f83c0e5aba7001fbad | [
"MIT"
] | null | null | null | pydualsense/hidguardian.py | TheComputerDan/pydualsense | c1c10e4eacf37818e31b09f83c0e5aba7001fbad | [
"MIT"
] | null | null | null | pydualsense/hidguardian.py | TheComputerDan/pydualsense | c1c10e4eacf37818e31b09f83c0e5aba7001fbad | [
"MIT"
] | null | null | null | import winreg
import sys
def check_hide() -> bool:
"""check if hidguardian is used and controller is hidden
"""
if sys.platform.startswith('win32'):
try:
access_reg = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE)
access_key = winreg.OpenKey(... | 37.894737 | 135 | 0.605556 | import winreg
import sys
def check_hide() -> bool:
if sys.platform.startswith('win32'):
try:
access_reg = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE)
access_key = winreg.OpenKey(access_reg, 'SYSTEM\CurrentControlSet\Services\HidGuardian\Parameters', 0, wi... | true | true |
f7114ceafa6e4c5af4457ca817ffc5d52ca75a2f | 4,600 | py | Python | util/rule_ctl/tests/rule_ctl_test.py | linuxgemini/coreruleset | 0873cbeae35c85de72b0292f0d17a26308026c83 | [
"Apache-2.0"
] | 930 | 2020-05-13T17:07:34.000Z | 2022-03-30T02:56:06.000Z | util/rule_ctl/tests/rule_ctl_test.py | linuxgemini/coreruleset | 0873cbeae35c85de72b0292f0d17a26308026c83 | [
"Apache-2.0"
] | 675 | 2020-05-13T20:32:11.000Z | 2022-03-31T22:07:20.000Z | util/rule_ctl/tests/rule_ctl_test.py | linuxgemini/coreruleset | 0873cbeae35c85de72b0292f0d17a26308026c83 | [
"Apache-2.0"
] | 216 | 2020-05-13T16:58:08.000Z | 2022-03-30T20:50:40.000Z | from .helpers import *
class TestFilterRuleId:
def test_filter_rule_id_exact_match(self):
arguments = [
"--filter-rule-id", "12",
"--append-tag", "foo"
]
rule_string = """
SecRule ARGS|ARGS:foo|!ARGS:bar "@rx foo" "id:12"
"""
expected = """
SecRule ARGS|ARGS:... | 23.469388 | 64 | 0.553913 | from .helpers import *
class TestFilterRuleId:
def test_filter_rule_id_exact_match(self):
arguments = [
"--filter-rule-id", "12",
"--append-tag", "foo"
]
rule_string = """
SecRule ARGS|ARGS:foo|!ARGS:bar "@rx foo" "id:12"
"""
expected = """
SecRule ARGS|ARGS:... | true | true |
f7114d567227d1df1f9cb9f60ad3422ee6a8dcd9 | 1,784 | py | Python | backend/models/advices.py | jimbunny/AdminSystem | d9a42e2d8608cb0d9bc88f4c1945da48fb8cc925 | [
"MIT"
] | null | null | null | backend/models/advices.py | jimbunny/AdminSystem | d9a42e2d8608cb0d9bc88f4c1945da48fb8cc925 | [
"MIT"
] | null | null | null | backend/models/advices.py | jimbunny/AdminSystem | d9a42e2d8608cb0d9bc88f4c1945da48fb8cc925 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# author:jingtongyu
# datetime:2020/6/7 10:14 下午
# software: PyCharm
from flask import current_app
from . import db
from .base import BaseModel
from sqlalchemy.exc import SQLAlchemyError
from werkzeug.security import generate_password_hash, check_password_hash
import time
... | 28.31746 | 81 | 0.661996 |
from flask import current_app
from . import db
from .base import BaseModel
from sqlalchemy.exc import SQLAlchemyError
from werkzeug.security import generate_password_hash, check_password_hash
import time
class AdvicesModel(db.Model, BaseModel):
__tablename__ = 'advices'
id = db.Column(db.Integer, primar... | true | true |
f7114e75083e7594277297c3936a74615d8ca5a1 | 7,187 | py | Python | tests/toranj/test-038-clear-address-cache-for-sed.py | ctan-g/openthread | 376f35a49e5c0a5b8170c117d7a930e3a8b3b210 | [
"BSD-3-Clause"
] | 1 | 2020-08-12T06:15:53.000Z | 2020-08-12T06:15:53.000Z | tests/toranj/test-038-clear-address-cache-for-sed.py | ctan-g/openthread | 376f35a49e5c0a5b8170c117d7a930e3a8b3b210 | [
"BSD-3-Clause"
] | null | null | null | tests/toranj/test-038-clear-address-cache-for-sed.py | ctan-g/openthread | 376f35a49e5c0a5b8170c117d7a930e3a8b3b210 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) 2019, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | 34.552885 | 121 | 0.681647 |
import wpan
from wpan import verify
test_name = __file__[:-3] if __file__.endswith('.py') else __file__
print('-' * 120)
print('Starting \'{}\''.format(test_name))
speedup = 4
wpan.Node.set_time_speedup_factor(speedup)
r1 = wpan.Node()
r2 = wpan.Node()
r3 = wpan.Node()
c = wpan.... | true | true |
f7114f0b8e6cff50b6be4c21a07fc5c0f023fd01 | 864 | py | Python | env/lib/python3.8/site-packages/plotly/validators/volume/_lightposition.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/lib/python3.8/site-packages/plotly/validators/volume/_lightposition.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/lib/python3.8/site-packages/plotly/validators/volume/_lightposition.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class LightpositionValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="lightposition", parent_name="volume", **kwargs):
super(LightpositionValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pare... | 33.230769 | 84 | 0.568287 | import _plotly_utils.basevalidators
class LightpositionValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="lightposition", parent_name="volume", **kwargs):
super(LightpositionValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pare... | true | true |
f7114f44e7d867f1454daedb6c4471877ffab72f | 5,380 | py | Python | scripts_hico/HICO_eval/bbox_utils.py | roy881020/VSGNet | a9ba741871d1d7ff401cecf23659f0b75576e7c3 | [
"MIT"
] | 111 | 2020-02-27T16:00:27.000Z | 2022-03-22T08:09:56.000Z | scripts_hico/HICO_eval/bbox_utils.py | roy881020/VSGNet | a9ba741871d1d7ff401cecf23659f0b75576e7c3 | [
"MIT"
] | 21 | 2020-04-24T11:37:59.000Z | 2022-02-28T03:10:08.000Z | scripts_hico/HICO_eval/bbox_utils.py | roy881020/VSGNet | a9ba741871d1d7ff401cecf23659f0b75576e7c3 | [
"MIT"
] | 23 | 2020-03-18T10:50:07.000Z | 2022-02-09T12:35:57.000Z | import numpy as np
#import skimage.draw as skdraw
def add_bbox(img,bbox,color=[0,0,0],fill=False,alpha=1):
x1,y1,x2,y2 = bbox
# Clockwise starting from top left
r = [y1,y1,y2,y2]
c = [x1,x2,x2,x1]
if fill:
coords = skdraw.polygon(r,c,shape=img.shape[0:2])
skdraw.set_color... | 23.189655 | 75 | 0.554461 | import numpy as np
def add_bbox(img,bbox,color=[0,0,0],fill=False,alpha=1):
x1,y1,x2,y2 = bbox
r = [y1,y1,y2,y2]
c = [x1,x2,x2,x1]
if fill:
coords = skdraw.polygon(r,c,shape=img.shape[0:2])
skdraw.set_color(img,coords,color,alpha=alpha)
return
peri_coords =... | true | true |
f7114fba470e1fb01f21f644c0cf7c1507d1186c | 4,585 | py | Python | load_neo4j.py | newmanrs/cloudburst-graph | 6e3a6878b1ae04f07fa35f2c689243a906bd026e | [
"MIT"
] | 1 | 2021-05-30T17:35:20.000Z | 2021-05-30T17:35:20.000Z | load_neo4j.py | newmanrs/cloudburst-graph | 6e3a6878b1ae04f07fa35f2c689243a906bd026e | [
"MIT"
] | 14 | 2021-05-30T03:51:39.000Z | 2021-11-13T03:18:19.000Z | load_neo4j.py | newmanrs/cloudburst-graph | 6e3a6878b1ae04f07fa35f2c689243a906bd026e | [
"MIT"
] | null | null | null | from neo4j import GraphDatabase
import json
import os
def create_beers(tx):
""" Load from the results of cloudburst site scraper """
with open('data/beers.json', 'r') as f:
beer_hops = json.load(f)
beers = beer_hops['beers']
query = """
UNWIND $beers as beer
MERGE (b:Bee... | 26.50289 | 76 | 0.577317 | from neo4j import GraphDatabase
import json
import os
def create_beers(tx):
with open('data/beers.json', 'r') as f:
beer_hops = json.load(f)
beers = beer_hops['beers']
query = """
UNWIND $beers as beer
MERGE (b:Beer {name : beer.beer_name,
abv : beer.abv,
... | true | true |
f7115016c89676f8c77084533e51e99ca21fe5e2 | 517 | py | Python | sort_dict.py | taijiji/python-memo | 627c887cf318a56824c51fef3c486bd8160c340d | [
"MIT"
] | null | null | null | sort_dict.py | taijiji/python-memo | 627c887cf318a56824c51fef3c486bd8160c340d | [
"MIT"
] | null | null | null | sort_dict.py | taijiji/python-memo | 627c887cf318a56824c51fef3c486bd8160c340d | [
"MIT"
] | null | null | null | from pprint import pprint
d = {
'A' : 10,
'B' : 50,
'C' : 40,
}
print(sorted(d)) # ['A', 'B', 'C']
print(sorted(d, key=d.get)) # ['A', 'C', 'B']
print(sorted(d, key=d.get, reverse=True)) # ['B', 'C', 'A']
l = [
{
'id' : 'A',
'keyword' : 10,
},
{
'id' : 'B',
'keyword' : 50,
},
{... | 15.666667 | 59 | 0.419729 | from pprint import pprint
d = {
'A' : 10,
'B' : 50,
'C' : 40,
}
print(sorted(d))
print(sorted(d, key=d.get))
print(sorted(d, key=d.get, reverse=True))
l = [
{
'id' : 'A',
'keyword' : 10,
},
{
'id' : 'B',
'keyword' : 50,
},
{
'id' : 'C',
'keyword' : 40,
},
]
pprint(s... | true | true |
f71151ed9546386e8ded0a2cd7402796a6e469b3 | 978 | py | Python | scripts/strelka-2.9.2.centos6_x86_64/lib/python/configBuildTimeInfo.py | dongxuemin666/RNA-combine | 13e178aae585e16a9a8eda8151d0f34316de0475 | [
"Apache-2.0"
] | 7 | 2021-09-03T09:11:00.000Z | 2022-02-14T15:02:12.000Z | scripts/strelka-2.9.2.centos6_x86_64/lib/python/configBuildTimeInfo.py | dongxuemin666/RNA-combine | 13e178aae585e16a9a8eda8151d0f34316de0475 | [
"Apache-2.0"
] | null | null | null | scripts/strelka-2.9.2.centos6_x86_64/lib/python/configBuildTimeInfo.py | dongxuemin666/RNA-combine | 13e178aae585e16a9a8eda8151d0f34316de0475 | [
"Apache-2.0"
] | 2 | 2022-01-10T13:07:29.000Z | 2022-01-11T22:14:11.000Z | #
# Strelka - Small Variant Caller
# Copyright (c) 2009-2018 Illumina, Inc.
#
# 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 3 of the License, or
# at your option) any later vers... | 34.928571 | 71 | 0.762781 |
workflowVersion="2.9.2"
buildTime="2018-03-02T22:08:15.960987Z"
| true | true |
f7115465b95c95820af6207e54e3ffcd9ec5c3fc | 3,812 | py | Python | Section_07_code/speech_recognizer.py | PacktPublishing/Python-Machine-Learning-Solutions-V- | 8bb80a43a7c64032c25c1023faaa29bbfbd39d45 | [
"MIT"
] | 1 | 2022-03-16T02:10:30.000Z | 2022-03-16T02:10:30.000Z | Section_07_code/speech_recognizer.py | wensincai/Python-Machine-Learning-Solutions-V- | 130c9881757fa90bbb124d48ddd0c6c1136fa20c | [
"MIT"
] | null | null | null | Section_07_code/speech_recognizer.py | wensincai/Python-Machine-Learning-Solutions-V- | 130c9881757fa90bbb124d48ddd0c6c1136fa20c | [
"MIT"
] | 2 | 2019-05-28T11:58:59.000Z | 2020-09-23T17:21:19.000Z | import os
import argparse
import warnings
import numpy as np
from scipy.io import wavfile
from hmmlearn import hmm
from python_speech_features import mfcc
# Function to parse input arguments
def build_arg_parser():
parser = argparse.ArgumentParser(description='Trains the HMM classifier')
parser.add_argument("-... | 31.766667 | 95 | 0.612802 | import os
import argparse
import warnings
import numpy as np
from scipy.io import wavfile
from hmmlearn import hmm
from python_speech_features import mfcc
def build_arg_parser():
parser = argparse.ArgumentParser(description='Trains the HMM classifier')
parser.add_argument("--input-folder", dest="input_folder"... | true | true |
f71157014d09fab40e49d12085e7b79c88f79c03 | 4,010 | py | Python | src/third_party/beaengine/tests/0fd3.py | CrackerCat/rp | 5fe693c26d76b514efaedb4084f6e37d820db023 | [
"MIT"
] | 1 | 2022-01-17T17:40:29.000Z | 2022-01-17T17:40:29.000Z | src/third_party/beaengine/tests/0fd3.py | CrackerCat/rp | 5fe693c26d76b514efaedb4084f6e37d820db023 | [
"MIT"
] | null | null | null | src/third_party/beaengine/tests/0fd3.py | CrackerCat/rp | 5fe693c26d76b514efaedb4084f6e37d820db023 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# 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 3 of the License, or
# (at your option) any later version.
#
# This progra... | 45.05618 | 80 | 0.669327 |
from headers.BeaEnginePython import *
from nose.tools import *
class TestSuite:
def test(self):
Buffer = bytes.fromhex('660fd39011223344')
myDisasm = Disasm(Buffer)
myDisasm.read()
assert_equal(hex(myDisasm.infos.Instruction.Opcode), '0xfd3')
... | true | true |
f711577e3e237a8ca848394b36f174ba9d6b998e | 4,645 | py | Python | PageBotNano-005-TextBox/MyTypeSpecimen.py | juandelperal/PageBotNano | 7f0d82755d6eb6962f206e5dd0d08c40c0947bde | [
"MIT"
] | null | null | null | PageBotNano-005-TextBox/MyTypeSpecimen.py | juandelperal/PageBotNano | 7f0d82755d6eb6962f206e5dd0d08c40c0947bde | [
"MIT"
] | null | null | null | PageBotNano-005-TextBox/MyTypeSpecimen.py | juandelperal/PageBotNano | 7f0d82755d6eb6962f206e5dd0d08c40c0947bde | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
#
# P A G E B O T N A N O
#
# Copyright (c) 2020+ Buro Petr van Blokland + Claudia Mens
# www.pagebot.io
# Licensed under MIT conditions
#
# Supporting DrawBot, www.drawbot.com
# ---... | 41.106195 | 97 | 0.685038 |
from random import random
from pagebotnano_005.document import Document
from pagebotnano_005.elements import Rect, Text, TextBox
from pagebotnano_005.toolbox.loremipsum import loremipsum
class TypeSpecimen(Document):
pass
typeSpecimen = TypeSp... | true | true |
f7115956f5a17031f875ed574bd2db94bd8aaa40 | 142 | py | Python | hcfg/exceptions.py | hyper1923/hcfg | ad37e2bf4a5cc78c4f93331321611d642e52d7d3 | [
"MIT"
] | 4 | 2021-07-25T21:01:33.000Z | 2021-12-17T12:35:16.000Z | hcfg/exceptions.py | hyper1923/hcfg | ad37e2bf4a5cc78c4f93331321611d642e52d7d3 | [
"MIT"
] | null | null | null | hcfg/exceptions.py | hyper1923/hcfg | ad37e2bf4a5cc78c4f93331321611d642e52d7d3 | [
"MIT"
] | 1 | 2021-07-25T21:01:35.000Z | 2021-07-25T21:01:35.000Z |
class hypSyntaxError(Exception):
pass
class hypFileError(Exception):
pass
class hypObjectError(Exception):
pass | 10.923077 | 33 | 0.661972 |
class hypSyntaxError(Exception):
pass
class hypFileError(Exception):
pass
class hypObjectError(Exception):
pass | true | true |
f7115ab9b4c5b56cdf3c82610fb39000f9062f83 | 3,873 | py | Python | Tests/benchmarks/bench_nbody.py | AlexWaygood/Pyjion | 974bd3cf434fad23fbfa1ea9acf43e3387a5c21f | [
"MIT"
] | null | null | null | Tests/benchmarks/bench_nbody.py | AlexWaygood/Pyjion | 974bd3cf434fad23fbfa1ea9acf43e3387a5c21f | [
"MIT"
] | null | null | null | Tests/benchmarks/bench_nbody.py | AlexWaygood/Pyjion | 974bd3cf434fad23fbfa1ea9acf43e3387a5c21f | [
"MIT"
] | null | null | null | # The Computer Language Benchmarks Game
# http://benchmarksgame.alioth.debian.org/
#
# originally by Kevin Carson
# modified by Tupteq, Fredrik Johansson, and Daniel Nanz
# modified by Maciej Fijalkowski
# 2to3
import pyjion
import timeit
import gc
def combinations(l):
result = []
for x in range(len(l) - 1):
... | 29.564885 | 91 | 0.528014 |
import pyjion
import timeit
import gc
def combinations(l):
result = []
for x in range(len(l) - 1):
ls = l[x+1:]
for y in ls:
result.append((l[x],y))
return result
PI = 3.14159265358979323
SOLAR_MASS = 4 * PI * PI
DAYS_PER_YEAR = 365.24
BODIES = {
'sun': ([0.0, 0.0... | true | true |
f7115adab6ff8f96dbe31caef921ac48511b27db | 46,233 | py | Python | tests/unit/test_swift_store.py | citrix-openstack-build/glance_store | 475d144cfe2a3fb5fc49dd0ad0a95fa90790f5b7 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_swift_store.py | citrix-openstack-build/glance_store | 475d144cfe2a3fb5fc49dd0ad0a95fa90790f5b7 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_swift_store.py | citrix-openstack-build/glance_store | 475d144cfe2a3fb5fc49dd0ad0a95fa90790f5b7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 OpenStack Foundation
# 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 requ... | 40.272648 | 79 | 0.624165 |
import copy
import fixtures
import hashlib
import httplib
import mock
import tempfile
import uuid
from oslo.config import cfg
from oslotest import moxstubout
import six
import stubout
import swiftclient
from glance_store._drivers.swift import store as swift
from glance_store._drivers.swift import util... | true | true |
f7115afd92f601168a3271828bcd6583a3f27954 | 8,006 | py | Python | magiclink/views.py | lmccartney/django-magiclink | 62b37ee8ed07fd41b259501fc0aba8deaec4bc5f | [
"MIT"
] | 34 | 2020-08-16T05:47:13.000Z | 2022-03-01T18:19:06.000Z | magiclink/views.py | lmccartney/django-magiclink | 62b37ee8ed07fd41b259501fc0aba8deaec4bc5f | [
"MIT"
] | 11 | 2021-01-04T23:51:50.000Z | 2021-09-19T14:21:44.000Z | magiclink/views.py | lmccartney/django-magiclink | 62b37ee8ed07fd41b259501fc0aba8deaec4bc5f | [
"MIT"
] | 5 | 2021-03-19T04:01:23.000Z | 2022-03-01T14:20:21.000Z | import logging
from django.conf import settings as django_settings
from django.contrib.auth import authenticate, get_user_model, login, logout
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.utils.decorators import method_decorator
from django.views.decorators.cache import never_cache
f... | 36.894009 | 91 | 0.66725 | import logging
from django.conf import settings as django_settings
from django.contrib.auth import authenticate, get_user_model, login, logout
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.utils.decorators import method_decorator
from django.views.decorators.cache import never_cache
f... | true | true |
f7115b5e8ed27896b0e81e52df3d7ff166edfb54 | 23,257 | py | Python | archiv/urls.py | acdh-oeaw/4dpuzzle | 7856bbd82c7dfa8da1d5f1ad40593219a35b3cfe | [
"MIT"
] | null | null | null | archiv/urls.py | acdh-oeaw/4dpuzzle | 7856bbd82c7dfa8da1d5f1ad40593219a35b3cfe | [
"MIT"
] | 6 | 2020-06-05T18:32:02.000Z | 2022-02-10T07:22:24.000Z | archiv/urls.py | acdh-oeaw/4dpuzzle | 7856bbd82c7dfa8da1d5f1ad40593219a35b3cfe | [
"MIT"
] | 1 | 2020-06-30T13:52:41.000Z | 2020-06-30T13:52:41.000Z | # generated by appcreator
from django.conf.urls import url
from . import views
from . import stats_views
app_name = 'archiv'
urlpatterns = [
url(
r'^match-binary/$',
stats_views.MatchBinaryView.as_view(),
name='match-binary'
),
url(
r'^actor/$',
views.ActorListView.a... | 29.740409 | 66 | 0.588812 |
from django.conf.urls import url
from . import views
from . import stats_views
app_name = 'archiv'
urlpatterns = [
url(
r'^match-binary/$',
stats_views.MatchBinaryView.as_view(),
name='match-binary'
),
url(
r'^actor/$',
views.ActorListView.as_view(),
name='a... | true | true |
f7115b80054333e64fee1293b4991149a2084c6b | 1,073 | py | Python | google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/services/conversion_upload_service/transports/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/services/conversion_upload_service/transports/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/services/conversion_upload_service/transports/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 33.53125 | 94 | 0.78192 |
from collections import OrderedDict
from typing import Dict, Type
from .base import ConversionUploadServiceTransport
from .grpc import ConversionUploadServiceGrpcTransport
_transport_registry = OrderedDict()
_transport_registry['grpc'] = ConversionUploadServiceGrpcTransport
__all__ = (
'Conve... | true | true |
f7115bc1b282ac71f3a3870ed4dc29099eb9633b | 963 | py | Python | djangofiles/BlogProject/blog/forms.py | manvith263/tricalidee | 69cf66a416be7917eb8cbb3562cff7d5a66df088 | [
"BSD-3-Clause"
] | 1 | 2021-05-11T01:52:35.000Z | 2021-05-11T01:52:35.000Z | djangofiles/BlogProject/blog/forms.py | manvith263/tricalidee | 69cf66a416be7917eb8cbb3562cff7d5a66df088 | [
"BSD-3-Clause"
] | null | null | null | djangofiles/BlogProject/blog/forms.py | manvith263/tricalidee | 69cf66a416be7917eb8cbb3562cff7d5a66df088 | [
"BSD-3-Clause"
] | null | null | null | from django import forms
from .models import Comment, Answer
class CommentForm(forms.ModelForm):
class Meta:
model = Comment
fields = ('text',)
widgets = {
#'author':forms.TextInput(attrs={'class':'textinputclass'}),
'text':forms.Textarea(attrs={'class':'editable m... | 33.206897 | 162 | 0.632399 | from django import forms
from .models import Comment, Answer
class CommentForm(forms.ModelForm):
class Meta:
model = Comment
fields = ('text',)
widgets = {
'text':forms.Textarea(attrs={'class':'editable medium-editor-textarea'}),
}
class AnonymousCommentFo... | true | true |
f7115cb7531270e4ff2173d2d1820592f1d4257b | 3,224 | py | Python | Strip.py | brandonskerritt51/Everything | c77141309f48d7cf4791bd73c574a8985d86cdc9 | [
"MIT"
] | 3 | 2020-12-26T18:54:12.000Z | 2021-12-22T16:10:01.000Z | Strip.py | brandonskerritt51/Everything | c77141309f48d7cf4791bd73c574a8985d86cdc9 | [
"MIT"
] | null | null | null | Strip.py | brandonskerritt51/Everything | c77141309f48d7cf4791bd73c574a8985d86cdc9 | [
"MIT"
] | 1 | 2020-02-28T10:58:11.000Z | 2020-02-28T10:58:11.000Z | # strip puncuation custom module
# 12 / 03 / 2015
# Brandon
# https://www.facebook.com/AiiYourBaseRBel0ngToUs
"""
This program was designed to strip puncuation
from a string
This program was made by Brandon in February 2015
and was finished in February 2015
If you have any suggestions or want to help
co... | 23.881481 | 63 | 0.631514 |
import sys
def main():
message = str(input("enter message here to strip "))
message1 = strip(message)
message2 = stripWithSpace(message)
message3 = stripSpaceOnly(message)
print(message1)
print(message2)
print(message3)
close()
def strip(messag... | true | true |
f7115d7c70566ed892299ff982e39d43adecf586 | 2,486 | py | Python | tests/test_reader_table.py | baklanovp/pystella | 47a8b9c3dcd343bf80fba80c8468b803f0f842ce | [
"MIT"
] | 1 | 2019-08-08T13:11:57.000Z | 2019-08-08T13:11:57.000Z | tests/test_reader_table.py | cradesto/pystella | f6f44ed12d9648585a52a09e15d494daa4c70c59 | [
"MIT"
] | 9 | 2015-07-11T16:39:57.000Z | 2021-11-23T07:31:49.000Z | tests/test_reader_table.py | cradesto/pystella | f6f44ed12d9648585a52a09e15d494daa4c70c59 | [
"MIT"
] | 1 | 2019-08-08T13:08:55.000Z | 2019-08-08T13:08:55.000Z | # coding=utf-8
import numpy as np
import unittest
import pystella as ps
# from pystella.rf import band
# from pystella.rf.lc import LightCurve
# from pystella.util.reader_table import read_table_header_float, table2curves, read_obs_table_header, curves2table
__author__ = 'bakl'
def lc_create(b, m=-19, dt=0.):
n... | 41.433333 | 115 | 0.641191 |
import numpy as np
import unittest
import pystella as ps
__author__ = 'bakl'
def lc_create(b, m=-19, dt=0.):
n = 10
time = np.linspace(0. + dt, 200. + dt, n)
mags = m * np.ones(n)
return ps.LightCurve(b, time, mags)
class TestReaderTable(unittest.TestCase):
def test_read_table_header_float... | true | true |
f7115da64a528c5832fc24488f6a9968dd730194 | 33,409 | py | Python | python/tvm/relay/op/nn/_nn.py | CaramelFc/tvm | 0b95de439499122c98857e9006331b53f3578dbc | [
"Apache-2.0"
] | 1 | 2020-09-02T11:58:01.000Z | 2020-09-02T11:58:01.000Z | python/tvm/relay/op/nn/_nn.py | CaramelFc/tvm | 0b95de439499122c98857e9006331b53f3578dbc | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/op/nn/_nn.py | CaramelFc/tvm | 0b95de439499122c98857e9006331b53f3578dbc | [
"Apache-2.0"
] | 2 | 2020-11-26T00:35:02.000Z | 2020-12-07T03:15:56.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 31.458569 | 102 | 0.728097 |
from __future__ import absolute_import
from tvm import topi
from tvm.topi.utils import get_const_tuple
from tvm.runtime import convert
from tvm.te.hybrid import script
from .. import op as reg
from .. import strategy
from ..op import OpPattern
from .._tensor import elemwise_shape_func
from ..strategy... | true | true |
f7115dacfbfb5e34e0212cad048528683fc48da9 | 77 | py | Python | tests/test_tensorflow_v2_examples.py | awerdich/TensorFlow_v2_examples | ca8fb57728a821fe53ae01248fc1d8b4a45a0074 | [
"MIT"
] | null | null | null | tests/test_tensorflow_v2_examples.py | awerdich/TensorFlow_v2_examples | ca8fb57728a821fe53ae01248fc1d8b4a45a0074 | [
"MIT"
] | null | null | null | tests/test_tensorflow_v2_examples.py | awerdich/TensorFlow_v2_examples | ca8fb57728a821fe53ae01248fc1d8b4a45a0074 | [
"MIT"
] | null | null | null |
from tensorflow_v2_examples.cli import main
def test_main():
main([])
| 11 | 43 | 0.714286 |
from tensorflow_v2_examples.cli import main
def test_main():
main([])
| true | true |
f7115de338f1de8c6d119b74bc44f2877d482c1c | 15,511 | py | Python | ibis/backends/clickhouse/tests/test_functions.py | jreback/ibis | fdcca59b085416b1311eb268be3886abad1db230 | [
"Apache-2.0"
] | 1 | 2020-08-19T03:36:26.000Z | 2020-08-19T03:36:26.000Z | ibis/backends/clickhouse/tests/test_functions.py | jreback/ibis | fdcca59b085416b1311eb268be3886abad1db230 | [
"Apache-2.0"
] | null | null | null | ibis/backends/clickhouse/tests/test_functions.py | jreback/ibis | fdcca59b085416b1311eb268be3886abad1db230 | [
"Apache-2.0"
] | 2 | 2020-11-27T22:21:50.000Z | 2021-04-03T09:36:25.000Z | import math
import operator
from datetime import date, datetime
from operator import methodcaller
import pandas as pd
import pandas.testing as tm
import pytest
from pytest import param
import ibis
import ibis.expr.datatypes as dt
import ibis.expr.types as ir
from ibis import literal as L
clickhouse_driver = pytest.i... | 28.938433 | 76 | 0.597318 | import math
import operator
from datetime import date, datetime
from operator import methodcaller
import pandas as pd
import pandas.testing as tm
import pytest
from pytest import param
import ibis
import ibis.expr.datatypes as dt
import ibis.expr.types as ir
from ibis import literal as L
clickhouse_driver = pytest.i... | true | true |
f7115e3d4ccc57f2d750c77603f31e4073f99d90 | 13,084 | py | Python | psutil/tests/test_unicode.py | ulisesh/psutil | f7e898b0987f97352c7551bdd9b29b594e1236f6 | [
"BSD-3-Clause"
] | 2 | 2019-12-04T16:24:44.000Z | 2020-04-06T21:49:34.000Z | psutil/tests/test_unicode.py | vsajip/psutil | 2597253a31bc9f49772242cd249f30331d58fd7c | [
"BSD-3-Clause"
] | 7 | 2020-02-12T03:06:52.000Z | 2021-06-10T19:33:14.000Z | psutil/tests/test_unicode.py | vsajip/psutil | 2597253a31bc9f49772242cd249f30331d58fd7c | [
"BSD-3-Clause"
] | 2 | 2018-05-27T00:13:34.000Z | 2018-05-27T00:18:32.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Notes about unicode handling in psutil
======================================
In psutil these are the A... | 35.266846 | 79 | 0.626567 |
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import traceback
import warnings
from contextlib import closing
from psutil import BSD
from psutil import MACOS
from psutil import OPENBSD
from psutil import POSIX
from psutil import WINDOWS
from psuti... | true | true |
f7115ed0be73dd5f07ae66313df67de5eb1bd650 | 23,190 | py | Python | mittab/apps/tab/outround_pairing_views.py | DanielS6/mit-tab | f2b5bb609546514582697b998b8b50a66bc8a396 | [
"MIT"
] | 9 | 2015-01-22T01:19:15.000Z | 2017-11-01T20:09:47.000Z | mittab/apps/tab/outround_pairing_views.py | DanielS6/mit-tab | f2b5bb609546514582697b998b8b50a66bc8a396 | [
"MIT"
] | 152 | 2018-04-06T14:32:51.000Z | 2022-02-11T22:12:53.000Z | mittab/apps/tab/outround_pairing_views.py | DanielS6/mit-tab | f2b5bb609546514582697b998b8b50a66bc8a396 | [
"MIT"
] | 13 | 2015-09-14T00:40:06.000Z | 2018-01-24T04:05:32.000Z | import random
import math
from django.shortcuts import render, get_object_or_404
from django.http import JsonResponse
from django.contrib.auth.decorators import permission_required
from django.db.models import Q
from django.shortcuts import redirect, reverse
from django.utils import timezone
from mittab.apps.tab.help... | 34.924699 | 88 | 0.617119 | import random
import math
from django.shortcuts import render, get_object_or_404
from django.http import JsonResponse
from django.contrib.auth.decorators import permission_required
from django.db.models import Q
from django.shortcuts import redirect, reverse
from django.utils import timezone
from mittab.apps.tab.help... | true | true |
f7115f0749cb5df9d54526ef059c6eea994ea859 | 44,980 | py | Python | appdaemon/app_management.py | chadmccune/appdaemon | 73b49575a72fabf66a5186fe0c603fd041a22ee5 | [
"Apache-2.0"
] | null | null | null | appdaemon/app_management.py | chadmccune/appdaemon | 73b49575a72fabf66a5186fe0c603fd041a22ee5 | [
"Apache-2.0"
] | null | null | null | appdaemon/app_management.py | chadmccune/appdaemon | 73b49575a72fabf66a5186fe0c603fd041a22ee5 | [
"Apache-2.0"
] | null | null | null | import sys
import traceback
import uuid
import os
import importlib
import yaml
import subprocess
import cProfile
import io
import pstats
import logging
import asyncio
import appdaemon.utils as utils
from appdaemon.appdaemon import AppDaemon
class AppManagement:
def __init__(self, ad: AppDaemon, config):
... | 40.595668 | 126 | 0.507915 | import sys
import traceback
import uuid
import os
import importlib
import yaml
import subprocess
import cProfile
import io
import pstats
import logging
import asyncio
import appdaemon.utils as utils
from appdaemon.appdaemon import AppDaemon
class AppManagement:
def __init__(self, ad: AppDaemon, config):
... | true | true |
f7115f40fe58ad8b96583fd0dc9e13f70437a634 | 39,208 | py | Python | venv/Lib/site-packages/statsmodels/tsa/filters/tests/test_filters.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 2 | 2020-11-30T14:04:26.000Z | 2021-11-08T11:29:06.000Z | venv/Lib/site-packages/statsmodels/tsa/filters/tests/test_filters.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 7 | 2020-12-04T04:10:42.000Z | 2021-03-16T00:53:09.000Z | venv/Lib/site-packages/statsmodels/tsa/filters/tests/test_filters.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 1 | 2021-11-16T19:06:53.000Z | 2021-11-16T19:06:53.000Z | from statsmodels.compat.pandas import assert_frame_equal, make_dataframe
from datetime import datetime
import numpy as np
from numpy.testing import (assert_almost_equal, assert_equal, assert_allclose,
assert_raises, assert_)
from numpy import array, column_stack
from statsmodels.tsa.filters... | 50.590968 | 79 | 0.641221 | from statsmodels.compat.pandas import assert_frame_equal, make_dataframe
from datetime import datetime
import numpy as np
from numpy.testing import (assert_almost_equal, assert_equal, assert_allclose,
assert_raises, assert_)
from numpy import array, column_stack
from statsmodels.tsa.filters... | true | true |
f7116008166549e265c58b52b8fbdb0e9ec43e52 | 2,549 | py | Python | templates/template.py | ss005/PyRival | ce94312d429f368b724cdd8d3192935e34b7ba66 | [
"Apache-2.0"
] | null | null | null | templates/template.py | ss005/PyRival | ce94312d429f368b724cdd8d3192935e34b7ba66 | [
"Apache-2.0"
] | null | null | null | templates/template.py | ss005/PyRival | ce94312d429f368b724cdd8d3192935e34b7ba66 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
from __builtin__ import xrange as range
from future_builtins import ascii, filter, hex, map, oct, zip
def main():
pass
# region fastio
BUFSIZE = 8192
... | 27.706522 | 79 | 0.604943 |
from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
from __builtin__ import xrange as range
from future_builtins import ascii, filter, hex, map, oct, zip
def main():
pass
BUFSIZE = 8192
class FastIO(IOBase):
newlines ... | true | true |
f71161ca17d38c1dd04659c07978db4f1cf365c2 | 7,909 | py | Python | xmlrpc_client.py | y11en/tknk_scanner | c6c1b2b9142a3df4d86a1d44d677896d2623ac1e | [
"MIT"
] | 78 | 2018-09-29T19:07:54.000Z | 2022-03-27T20:21:08.000Z | xmlrpc_client.py | y11en/tknk_scanner | c6c1b2b9142a3df4d86a1d44d677896d2623ac1e | [
"MIT"
] | 11 | 2019-06-08T03:20:43.000Z | 2022-01-22T04:15:22.000Z | xmlrpc_client.py | y11en/tknk_scanner | c6c1b2b9142a3df4d86a1d44d677896d2623ac1e | [
"MIT"
] | 23 | 2018-10-01T07:00:49.000Z | 2021-06-10T07:07:19.000Z | #!/usr/bin/env python3
import xmlrpc.client
import os, sys, shutil, json, subprocess, time, yara, hashlib, datetime, requests, magic, redis, socket, pefile
from pathlib import Path
from pymongo import MongoClient
from rq import get_current_job, Queue
from read_avclass_report import run_avclass
from redis import Redis
... | 32.547325 | 207 | 0.580857 |
import xmlrpc.client
import os, sys, shutil, json, subprocess, time, yara, hashlib, datetime, requests, magic, redis, socket, pefile
from pathlib import Path
from pymongo import MongoClient
from rq import get_current_job, Queue
from read_avclass_report import run_avclass
from redis import Redis
with open("tknk.conf"... | true | true |
f71161ef83923d1440360d9a5499009046ba7494 | 1,127 | py | Python | userbot/modules/aeshtetic.py | Wiki28/WikixCilik | a7e8d684e34174001af3e69d1f00de4e98243abe | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/aeshtetic.py | Wiki28/WikixCilik | a7e8d684e34174001af3e69d1f00de4e98243abe | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/aeshtetic.py | Wiki28/WikixCilik | a7e8d684e34174001af3e69d1f00de4e98243abe | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
# Ported for Lord-Userbot By liualvinas/Alvin
from telethon import events
from userbot import CMD_HANDLER as cmd
from... | 25.044444 | 78 | 0.640639 |
from telethon import events
from userbot import CMD_HANDLER as cmd
from userbot import CMD_HELP
from userbot.utils import edit_or_reply, cilik_cmd
PRINTABLE_ASCII = range(0x21, 0x7F)
def aesthetify(string):
for c in string:
c = ord(c)
if c in PRINTABLE_ASCII:
c += 0xFF00 - 0x2... | true | true |
f71162543479e13ba7a83e8e598676ad16885311 | 6,609 | py | Python | gamification/core/models.py | stephenrjones/django-gamification | d22882f148375102ec351cb2bc75275083468d73 | [
"Unlicense",
"MIT"
] | 15 | 2015-02-21T09:28:55.000Z | 2021-07-31T17:17:06.000Z | gamification/core/models.py | stephenrjones/django-gamification | d22882f148375102ec351cb2bc75275083468d73 | [
"Unlicense",
"MIT"
] | null | null | null | gamification/core/models.py | stephenrjones/django-gamification | d22882f148375102ec351cb2bc75275083468d73 | [
"Unlicense",
"MIT"
] | 1 | 2017-01-22T09:12:44.000Z | 2017-01-22T09:12:44.000Z | # -*- coding: utf-8 -*-
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sub... | 46.216783 | 214 | 0.739144 |
# is provided to the public as a courtesy of the National
# Geospatial-Intelligence Agency.
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMP... | true | true |
f71163d1f61c4563c96be498ede707c910a8f26d | 441 | py | Python | virtual/lib/python3.6/site-packages/pylint/test/functional/exception_is_binary_op.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 463 | 2015-01-15T08:17:42.000Z | 2022-03-28T15:10:20.000Z | virtual/lib/python3.6/site-packages/pylint/test/functional/exception_is_binary_op.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 52 | 2015-01-06T02:43:59.000Z | 2022-03-14T11:15:21.000Z | virtual/lib/python3.6/site-packages/pylint/test/functional/exception_is_binary_op.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 249 | 2015-01-07T22:49:49.000Z | 2022-03-18T02:32:06.000Z | """Warn about binary operations used as exceptions."""
from __future__ import print_function
try:
pass
except Exception or BaseException: # [binary-op-exception]
print("caught1")
except Exception and BaseException: # [binary-op-exception]
print("caught2")
except Exception or BaseException: # [binary-op-e... | 33.923077 | 68 | 0.734694 | from __future__ import print_function
try:
pass
except Exception or BaseException:
print("caught1")
except Exception and BaseException:
print("caught2")
except Exception or BaseException:
print("caught3")
except (Exception or BaseException) as exc:
print("caught4")
| true | true |
f71163e8df50a1a54f85265542eac2fe7669ebfe | 1,601 | py | Python | djangox/lib/python3.8/site-packages/allauth/socialaccount/providers/__init__.py | DemarcusL/django_wiki_lab | 3b7cf18af7e0f89c94d10eb953ca018a150a2f55 | [
"MIT"
] | 6,342 | 2015-01-01T07:40:30.000Z | 2022-03-31T04:18:30.000Z | djangox/lib/python3.8/site-packages/allauth/socialaccount/providers/__init__.py | DemarcusL/django_wiki_lab | 3b7cf18af7e0f89c94d10eb953ca018a150a2f55 | [
"MIT"
] | 2,198 | 2015-01-02T15:17:45.000Z | 2022-03-28T10:20:43.000Z | djangox/lib/python3.8/site-packages/allauth/socialaccount/providers/__init__.py | DemarcusL/django_wiki_lab | 3b7cf18af7e0f89c94d10eb953ca018a150a2f55 | [
"MIT"
] | 2,928 | 2015-01-01T10:44:13.000Z | 2022-03-31T03:20:16.000Z | import importlib
from collections import OrderedDict
from django.conf import settings
class ProviderRegistry(object):
def __init__(self):
self.provider_map = OrderedDict()
self.loaded = False
def get_list(self, request=None):
self.load()
return [provider_cls(request) for prov... | 33.354167 | 85 | 0.621487 | import importlib
from collections import OrderedDict
from django.conf import settings
class ProviderRegistry(object):
def __init__(self):
self.provider_map = OrderedDict()
self.loaded = False
def get_list(self, request=None):
self.load()
return [provider_cls(request) for prov... | true | true |
f711648b9fb21bbdd671889d8ae822a03e116ae0 | 11,176 | py | Python | pyrats/halos.py | HugoPfister/Pyrats | fc2cab0d1e14b8dd19b3eba361d47f053187ab47 | [
"MIT"
] | null | null | null | pyrats/halos.py | HugoPfister/Pyrats | fc2cab0d1e14b8dd19b3eba361d47f053187ab47 | [
"MIT"
] | null | null | null | pyrats/halos.py | HugoPfister/Pyrats | fc2cab0d1e14b8dd19b3eba361d47f053187ab47 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Module to deal with halos, to be used with HaloMaker.
This module is heavily inspired by the set of IDL routines originally
found in the Ramses Analysis ToolSuite (RATS).
TODO: Some more documentation
"""
import numpy as np
import pandas as pd
import yt
from yt.utilities.logger import ytLo... | 39.631206 | 98 | 0.480494 |
import numpy as np
import pandas as pd
import yt
from yt.utilities.logger import ytLogger as mylog
import yt.utilities.fortran_utils as fpu
from yt.funcs import get_pbar
import os
import pandas as pd
class HaloList(object):
def __init__(self, ds, folder='.', contam=False):
self.folder = folder
... | true | true |
f71166891b5da8b0c4158d35a906f11005268be1 | 6,324 | py | Python | server/devices/views.py | vahidzee/pi-surveillance | 63996d8abc998d0a777d588231ecbc6d484b6451 | [
"MIT"
] | null | null | null | server/devices/views.py | vahidzee/pi-surveillance | 63996d8abc998d0a777d588231ecbc6d484b6451 | [
"MIT"
] | null | null | null | server/devices/views.py | vahidzee/pi-surveillance | 63996d8abc998d0a777d588231ecbc6d484b6451 | [
"MIT"
] | null | null | null | from PIL import Image
from django.conf import settings
from . import forms, recognition
from . import utils
from . import models
from django.shortcuts import render, redirect
from django.contrib import admin
from django.core.mail import send_mail
from django.http import JsonResponse
from django.views.decorators.csrf im... | 42.16 | 116 | 0.638046 | from PIL import Image
from django.conf import settings
from . import forms, recognition
from . import utils
from . import models
from django.shortcuts import render, redirect
from django.contrib import admin
from django.core.mail import send_mail
from django.http import JsonResponse
from django.views.decorators.csrf im... | true | true |
f711678dac36327210c7a3f075c080ff99a8e948 | 1,499 | py | Python | setup.py | candh/totp-cli | 191c46caab3b1a6863336189521b460d45e1223c | [
"MIT"
] | 1 | 2022-01-01T15:53:09.000Z | 2022-01-01T15:53:09.000Z | setup.py | candh/totp-cli | 191c46caab3b1a6863336189521b460d45e1223c | [
"MIT"
] | null | null | null | setup.py | candh/totp-cli | 191c46caab3b1a6863336189521b460d45e1223c | [
"MIT"
] | null | null | null | from setuptools import setup
import sys
import os
if sys.version_info.major < 3:
raise Exception("python3 is required to run this script")
# also cleanup the info.json file before building
if os.path.exists('totpauth/database/info.json'):
os.remove('totpauth/database/info.json')
open('totpauth/database/info.json'... | 31.229167 | 83 | 0.667779 | from setuptools import setup
import sys
import os
if sys.version_info.major < 3:
raise Exception("python3 is required to run this script")
if os.path.exists('totpauth/database/info.json'):
os.remove('totpauth/database/info.json')
open('totpauth/database/info.json', 'w')
setup(
name='totp-cli',
version='1.0'... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.