hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
fc69ce6d623b77a015473dc1511a0eaa7d774ef4 | 22,044 | py | Python | corehq/form_processor/interfaces/dbaccessors.py | caktus/commcare-hq | fae9c0f792b4889b768252d3895d9d1884ce0d3b | [
"BSD-3-Clause"
] | null | null | null | corehq/form_processor/interfaces/dbaccessors.py | caktus/commcare-hq | fae9c0f792b4889b768252d3895d9d1884ce0d3b | [
"BSD-3-Clause"
] | 40 | 2021-07-20T15:55:08.000Z | 2022-03-25T17:21:36.000Z | corehq/form_processor/interfaces/dbaccessors.py | caktus/commcare-hq | fae9c0f792b4889b768252d3895d9d1884ce0d3b | [
"BSD-3-Clause"
] | null | null | null | from abc import ABCMeta, abstractmethod
from collections import namedtuple
from contextlib import contextmanager
from io import BytesIO
from corehq.form_processor.exceptions import CaseNotFound
from corehq.form_processor.submission_process_tracker import unfinished_archive
from couchforms.signals import xform_archive... | 34.990476 | 118 | 0.713981 |
3d087e258c0482ba5259f3565a9edc7039d0b8b0 | 232 | py | Python | coda/coda_validate/admin.py | unt-libraries/coda | 959abc220f49bb9f5b19e13b61714b8be0615412 | [
"BSD-3-Clause"
] | 2 | 2015-06-30T04:20:47.000Z | 2021-03-31T16:35:35.000Z | coda/coda_validate/admin.py | unt-libraries/coda | 959abc220f49bb9f5b19e13b61714b8be0615412 | [
"BSD-3-Clause"
] | 141 | 2015-06-16T20:33:49.000Z | 2021-07-12T16:35:06.000Z | coda/coda_validate/admin.py | unt-libraries/coda | 959abc220f49bb9f5b19e13b61714b8be0615412 | [
"BSD-3-Clause"
] | 1 | 2017-01-23T19:17:29.000Z | 2017-01-23T19:17:29.000Z | from coda_validate.models import Validate
from django.contrib import admin
class ValidateAdmin(admin.ModelAdmin):
date_hierarchy = 'last_verified'
fields = ('last_verified',)
admin.site.register(Validate, ValidateAdmin)
| 21.090909 | 44 | 0.784483 |
b67079e2ac3feec76d936dbe7ca642b5e28acb0d | 2,623 | py | Python | mysite/urls.py | CodeByLine/dj4e-tutorial | 8cb592658a18777220eb297e63d42f2a7d53733c | [
"CC-BY-3.0"
] | null | null | null | mysite/urls.py | CodeByLine/dj4e-tutorial | 8cb592658a18777220eb297e63d42f2a7d53733c | [
"CC-BY-3.0"
] | 3 | 2021-04-12T16:18:58.000Z | 2021-06-10T20:40:08.000Z | mysite/urls.py | CodeByLine/dj4e-tutorial | 8cb592658a18777220eb297e63d42f2a7d53733c | [
"CC-BY-3.0"
] | null | null | null | """samples URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... | 36.430556 | 122 | 0.662219 |
6a9a08c7f175005a4361684165c44d6ef482a68d | 189 | py | Python | Tirico_Server/code_python/yolov4-deepsort/run_debug.py | VincentBernet/Tirici-ShopCameraAnalitics | 4a64283e181e32ea1e4b6d71a5dfb0e33e5f4753 | [
"MIT"
] | 3 | 2021-01-09T15:13:47.000Z | 2021-07-11T17:00:59.000Z | Tirico_Server/code_python/yolov4-deepsort/run_debug.py | VincentBernet/Tirici-ShopCameraAnalitics | 4a64283e181e32ea1e4b6d71a5dfb0e33e5f4753 | [
"MIT"
] | 25 | 2021-01-15T21:24:05.000Z | 2021-03-10T10:28:35.000Z | Tirico_Server/code_python/yolov4-deepsort/run_debug.py | VincentBernet/Tirico-ShopCameraAnalytics | 075e69428d17f550f43f3b1238180eb407e6e0f2 | [
"MIT"
] | 2 | 2021-01-27T21:38:36.000Z | 2021-02-09T22:04:41.000Z | import os
print('Start tracking')
os.system('python ./code_python/yolov4-deepsort/object_tracker.py --video 0 --output ./outputs/webcam.avi --model yolov4 --info')
print('End of tracking')
| 37.8 | 129 | 0.751323 |
f1fd77ac2b46284f4590cd5ec672c8bef8429b1c | 5,449 | py | Python | ding/policy/command_mode_policy_instance.py | LikeJulia/DI-engine | dbf432cd0e305b8863014fa902d14399a1cb6027 | [
"Apache-2.0"
] | null | null | null | ding/policy/command_mode_policy_instance.py | LikeJulia/DI-engine | dbf432cd0e305b8863014fa902d14399a1cb6027 | [
"Apache-2.0"
] | null | null | null | ding/policy/command_mode_policy_instance.py | LikeJulia/DI-engine | dbf432cd0e305b8863014fa902d14399a1cb6027 | [
"Apache-2.0"
] | null | null | null | from ding.utils import POLICY_REGISTRY
from ding.rl_utils import get_epsilon_greedy_fn
from .base_policy import CommandModePolicy
from .dqn import DQNPolicy
from .c51 import C51Policy
from .qrdqn import QRDQNPolicy
from .iqn import IQNPolicy
from .rainbow import RainbowDQNPolicy
from .r2d2 import R2D2Policy
from .sqn ... | 26.323671 | 108 | 0.771334 |
9b2040863b739230c0755805283babc9406b5274 | 4,062 | py | Python | pyecodevices_rt2/const.py | pcourbin/pyecodevices_rt2 | 5f9e49dddde01bef933a1825230bd90759d3f41c | [
"MIT"
] | null | null | null | pyecodevices_rt2/const.py | pcourbin/pyecodevices_rt2 | 5f9e49dddde01bef933a1825230bd90759d3f41c | [
"MIT"
] | 2 | 2021-04-12T22:48:48.000Z | 2021-05-15T10:56:27.000Z | pyecodevices_rt2/const.py | pcourbin/pyecodevices_rt2 | 5f9e49dddde01bef933a1825230bd90759d3f41c | [
"MIT"
] | null | null | null | PRODUCT_ENTRY = "product"
PRODUCT_VALUE = "EcoDevices_RT"
INDEX_GET_LINK = "Index=All"
RESPONSE_ENTRY = "status"
RESPONSE_SUCCESS_VALUE = "Success"
RT2_API_GET_LINK_CACHED = {
"Get=D": {},
"Get=R": {},
"Get=S": {},
"Get=VO": {},
"Get=FP": {},
"Get=XENO": {},
"Get=XTHL": {},
"Index=All"... | 32.238095 | 88 | 0.405711 |
eda0dfff1dde4c2483c75d4ca5a109e249eace0a | 1,437 | py | Python | emanuel/admin.py | Alexandre1313/Desafio | 03f6ba5228b0654be002cbf4ff22bbf8e2ea8fd1 | [
"MIT"
] | null | null | null | emanuel/admin.py | Alexandre1313/Desafio | 03f6ba5228b0654be002cbf4ff22bbf8e2ea8fd1 | [
"MIT"
] | null | null | null | emanuel/admin.py | Alexandre1313/Desafio | 03f6ba5228b0654be002cbf4ff22bbf8e2ea8fd1 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Gabarito, Prova, Aluno, Situacao
@admin.register(Gabarito)
class GabaritoAdmin(admin.ModelAdmin):
list_display = ('id',
'gabarito',
'questao_1', 'opcao_1_1', 'opcao_1_2', 'opcao_1_3', 'resposta_da_questao_1',
... | 32.659091 | 96 | 0.56437 |
6ff75f7ea6939527d32993d6769fddee056ac9ee | 1,458 | py | Python | setup.py | robbat2/manuale | a3159f05a31b2d62a01da739295c638e4a5629ed | [
"MIT"
] | null | null | null | setup.py | robbat2/manuale | a3159f05a31b2d62a01da739295c638e4a5629ed | [
"MIT"
] | null | null | null | setup.py | robbat2/manuale | a3159f05a31b2d62a01da739295c638e4a5629ed | [
"MIT"
] | null | null | null | import subprocess
from setuptools import setup
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
readme = path.join(here, 'README.md')
# Convert the README to reStructuredText for PyPI if pandoc is available.
# Otherwise, just read it.
try:
readme = subprocess.check_output(['... | 28.038462 | 103 | 0.611111 |
f4ece8fa817b1613ed1d1da8f001ebdc5c07681b | 8,461 | py | Python | a2p2v/executor.py | Narin-Ch/pentest-a2p2v-core | a11bc60293a8ba4097c6e532a29b4b85cfdbb2a5 | [
"Apache-2.0"
] | 1 | 2021-08-12T09:18:40.000Z | 2021-08-12T09:18:40.000Z | a2p2v/executor.py | Narin-Ch/pentest-a2p2v-core | a11bc60293a8ba4097c6e532a29b4b85cfdbb2a5 | [
"Apache-2.0"
] | null | null | null | a2p2v/executor.py | Narin-Ch/pentest-a2p2v-core | a11bc60293a8ba4097c6e532a29b4b85cfdbb2a5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (C) 2018-2021 Toshiba Corporation and Perspecta Labs, 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... | 32.922179 | 75 | 0.60182 |
0c349be0a932f3a7fa29acd775056ce39c4b5ad3 | 1,399 | py | Python | automlkiller/models/classification/gaussianNB_classifier.py | toandaominh1997/automlkiller | c5f451cfb05d8287bec0d26a9b14e2c1b452861c | [
"Apache-2.0"
] | null | null | null | automlkiller/models/classification/gaussianNB_classifier.py | toandaominh1997/automlkiller | c5f451cfb05d8287bec0d26a9b14e2c1b452861c | [
"Apache-2.0"
] | null | null | null | automlkiller/models/classification/gaussianNB_classifier.py | toandaominh1997/automlkiller | c5f451cfb05d8287bec0d26a9b14e2c1b452861c | [
"Apache-2.0"
] | null | null | null | from sklearn.naive_bayes import GaussianNB
from automlkiller.models.model_factory import ModelFactory
from automlkiller.utils.distributions import np_list_arange, UniformDistribution, IntUniformDistribution
@ModelFactory.register('classification-gaussiannb')
class GaussianNBContainer():
def __init__(self, **kwargs)... | 28.55102 | 104 | 0.461044 |
4eafc1ac8ee406e3d84be995be0ad1f1c6113d26 | 1,942 | py | Python | survol/sources_types/odbc/dsn/odbc_dsn_tables.py | rchateauneu/survol | ba66d3ec453b2d9dd3a8dabc6d53f71aa9ba8c78 | [
"BSD-3-Clause"
] | 9 | 2017-10-05T23:36:23.000Z | 2021-08-09T15:40:03.000Z | survol/sources_types/odbc/dsn/odbc_dsn_tables.py | rchateauneu/survol | ba66d3ec453b2d9dd3a8dabc6d53f71aa9ba8c78 | [
"BSD-3-Clause"
] | 21 | 2018-01-02T09:33:03.000Z | 2018-08-27T11:09:52.000Z | survol/sources_types/odbc/dsn/odbc_dsn_tables.py | rchateauneu/survol | ba66d3ec453b2d9dd3a8dabc6d53f71aa9ba8c78 | [
"BSD-3-Clause"
] | 4 | 2018-06-23T09:05:45.000Z | 2021-01-22T15:36:50.000Z | #!/usr/bin/env python
"""
Tables for ODBC DSN
"""
import sys
import logging
import pyodbc
import lib_util
import lib_common
from lib_properties import pc
from sources_types.odbc import dsn as survol_odbc_dsn
from sources_types.odbc import table as survol_odbc_table
def Main():
cgiEnv = lib_common.ScriptEnviro... | 28.144928 | 101 | 0.664779 |
0ba5d62327d267f97b41cfea499ce353497259f4 | 3,534 | py | Python | src/third-party/ipc-3.9.1/test/module2.py | taless474/plexil1 | 0da24f0330404c41a695ea367bb760fb9c7ee8dd | [
"BSD-3-Clause"
] | 2 | 2016-12-24T20:11:30.000Z | 2019-11-13T04:53:49.000Z | src/third-party/ipc-3.9.1/test/module2.py | taless474/plexil1 | 0da24f0330404c41a695ea367bb760fb9c7ee8dd | [
"BSD-3-Clause"
] | null | null | null | src/third-party/ipc-3.9.1/test/module2.py | taless474/plexil1 | 0da24f0330404c41a695ea367bb760fb9c7ee8dd | [
"BSD-3-Clause"
] | 2 | 2016-06-23T17:45:20.000Z | 2021-07-27T12:17:19.000Z | ###########################################################################
# PROJECT: IPC (Interprocess Communication) Package
#
# (c) Copyright 2011 Reid Simmons. All rights reserved.
#
# FILE: module2.py
#
# ABSTRACT: Test program for Python version of IPC.
# Publishes: MSG2
# Subscribes to: MSG... | 32.127273 | 75 | 0.645161 |
14be82a0336f5a36d0eaa1923af0535fd9c8908c | 1,159 | py | Python | tests/test_marks_edit.py | tokarzmaciej/school-register_TDD | aa0cda4bc1d78b31025278ec416372a33414b505 | [
"MIT"
] | null | null | null | tests/test_marks_edit.py | tokarzmaciej/school-register_TDD | aa0cda4bc1d78b31025278ec416372a33414b505 | [
"MIT"
] | null | null | null | tests/test_marks_edit.py | tokarzmaciej/school-register_TDD | aa0cda4bc1d78b31025278ec416372a33414b505 | [
"MIT"
] | null | null | null | import unittest
from assertpy import assert_that
from src.marks import Marks
from src.exampleData import Data
class MarksEditAssertPyTest(unittest.TestCase):
def setUp(self):
self.temp = Marks(Data().example)
def test_edit_mark_positive(self):
assert_that(self.temp.editMark(7, "Ewelina", "Sw... | 34.088235 | 98 | 0.663503 |
736cbaedd9647f8bd161d19a0ae91b74d7a2f61a | 3,151 | py | Python | freshmaker/handlers/koji/rebuild_images_on_odcs_compose_done.py | mvalik/freshmaker | 5d0642348b2605b951e1df1b1d0f887ea2d9d1fe | [
"MIT"
] | null | null | null | freshmaker/handlers/koji/rebuild_images_on_odcs_compose_done.py | mvalik/freshmaker | 5d0642348b2605b951e1df1b1d0f887ea2d9d1fe | [
"MIT"
] | null | null | null | freshmaker/handlers/koji/rebuild_images_on_odcs_compose_done.py | mvalik/freshmaker | 5d0642348b2605b951e1df1b1d0f887ea2d9d1fe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2017 Red Hat, Inc.
#
# 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, modi... | 44.380282 | 80 | 0.725484 |
28dc71c493d75e62be60217c7dd10b945ed243f4 | 6,112 | py | Python | packages/w3af/w3af/core/data/constants/tests/test_vulns.py | ZooAtmosphereGroup/HelloPackages | 0ccffd33bf927b13d28c8f715ed35004c33465d9 | [
"Apache-2.0"
] | 3 | 2019-04-09T22:59:33.000Z | 2019-06-14T09:23:24.000Z | tools/w3af/w3af/core/data/constants/tests/test_vulns.py | sravani-m/Web-Application-Security-Framework | d9f71538f5cba6fe1d8eabcb26c557565472f6a6 | [
"MIT"
] | null | null | null | tools/w3af/w3af/core/data/constants/tests/test_vulns.py | sravani-m/Web-Application-Security-Framework | d9f71538f5cba6fe1d8eabcb26c557565472f6a6 | [
"MIT"
] | null | null | null | """
test_vulns.py
Copyright 2006 Andres Riancho
This file is part of w3af, http://w3af.org/ .
w3af 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 version 2 of the License.
w3af is distributed in the hope that ... | 32.168421 | 80 | 0.59195 |
09eef74758518c67cf104f1f63687ba2bd5e1b9f | 373 | py | Python | iteration_ex.py | Abhiforcs/mypythonworkspace | ac5014160fc9b29d1a8d835441e6360f470fae59 | [
"MIT"
] | 1 | 2020-05-12T20:19:53.000Z | 2020-05-12T20:19:53.000Z | iteration_ex.py | Abhiforcs/mypythonworkspace | ac5014160fc9b29d1a8d835441e6360f470fae59 | [
"MIT"
] | null | null | null | iteration_ex.py | Abhiforcs/mypythonworkspace | ac5014160fc9b29d1a8d835441e6360f470fae59 | [
"MIT"
] | null | null | null | count = 0
sum = 0
number = 0
number = input("Enter a number or done : ")
while number!='done':
try:
int(number)
count = count + 1
sum = sum + int(number)
except:
print('Enter only number or \'done\' keyword')
number = input("Enter a number or done : ")
print('Total = ',sum)
p... | 23.3125 | 54 | 0.576408 |
f6792e2c1bb610f7c4907f4db17e5448caed41cf | 3,703 | py | Python | homeassistant/components/bond/fan.py | fti7/core | a76285daad6c8b9cdbe93192ff8b1025b8175784 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/bond/fan.py | fti7/core | a76285daad6c8b9cdbe93192ff8b1025b8175784 | [
"Apache-2.0"
] | 38 | 2020-07-23T07:13:12.000Z | 2022-03-31T06:01:47.000Z | homeassistant/components/bond/fan.py | fti7/core | a76285daad6c8b9cdbe93192ff8b1025b8175784 | [
"Apache-2.0"
] | null | null | null | """Support for Bond fans."""
from typing import Any, Callable, List, Optional
from bond import DeviceTypes, Directions
from homeassistant.components.fan import (
DIRECTION_FORWARD,
DIRECTION_REVERSE,
SPEED_HIGH,
SPEED_LOW,
SPEED_MEDIUM,
SPEED_OFF,
SUPPORT_DIRECTION,
SUPPORT_SET_SPEED,
... | 30.603306 | 88 | 0.652174 |
b3edd95e3511f6fd4f27f8f2a6b42c4f1e1f8eca | 3,907 | py | Python | templateme/templates/python3-consoleapp/%MODULE%/console.py | rafyco/templateme | 78f6a56c2d8c49e10ec4238e3a31680410fb5e79 | [
"MIT"
] | 2 | 2019-09-17T17:19:49.000Z | 2019-12-03T08:34:54.000Z | templateme/templates/python3-consoleapp/%MODULE%/console.py | rafyco/templateme | 78f6a56c2d8c49e10ec4238e3a31680410fb5e79 | [
"MIT"
] | 14 | 2019-04-10T08:18:27.000Z | 2019-07-04T22:14:34.000Z | templateme/templates/python3-consoleapp/%MODULE%/console.py | rafyco/templateme | 78f6a56c2d8c49e10ec4238e3a31680410fb5e79 | [
"MIT"
] | 1 | 2019-09-17T17:19:54.000Z | 2019-09-17T17:19:54.000Z | #!/usr/bin/env python3
"""
Create new project in defined place..
Example usage
=============
To invoke program type in your console::
templateme -t <template_name> -p <your_project_name>
or::
python3 -m templateme -t <template_name> -p <your_project_name>
for more option call program with flag C{--help}
"... | 33.973913 | 83 | 0.591758 |
25dd6213572e8e27476a8ced37fb3b9fa152ed22 | 434 | py | Python | B 2018-2019/week4_oct18th.py | bnajafi/Python4ScientificComputing_Fundamentals | 7c943404654d9c44920ea9a7fdee28bc99ad8d05 | [
"MIT"
] | 65 | 2017-01-19T08:03:38.000Z | 2021-04-02T17:41:43.000Z | B 2018-2019/week4_oct18th.py | bnajafi/Python4ScientificComputing_Fundamentals | 7c943404654d9c44920ea9a7fdee28bc99ad8d05 | [
"MIT"
] | null | null | null | B 2018-2019/week4_oct18th.py | bnajafi/Python4ScientificComputing_Fundamentals | 7c943404654d9c44920ea9a7fdee28bc99ad8d05 | [
"MIT"
] | 110 | 2017-01-19T08:04:14.000Z | 2020-07-23T13:44:52.000Z | # -*- coding: utf-8 -*-
"""
Created on Thu Oct 18 07:31:52 2018
@author: behzad
"""
import os
import sys
ThisFileDirectory=os.path.dirname(sys.argv[0])
os.chdir(ThisFileDirectory)
print os.getcwd()
import os
os.chdir(r"C:\Users\behzad\Dropbox\2 Teaching Activities\0 EETBS 2018\forked_repos\Python4ScientificComputi... | 21.7 | 136 | 0.78341 |
cd2346a61a868a6ea55204f64bcec85e74745393 | 5,063 | py | Python | scripts/TestHarness/testers/RavenErrors.py | milljm/raven | 5f29fe81b75e2ffbeb54a55aa63647e7b2f6457b | [
"Apache-2.0"
] | null | null | null | scripts/TestHarness/testers/RavenErrors.py | milljm/raven | 5f29fe81b75e2ffbeb54a55aa63647e7b2f6457b | [
"Apache-2.0"
] | null | null | null | scripts/TestHarness/testers/RavenErrors.py | milljm/raven | 5f29fe81b75e2ffbeb54a55aa63647e7b2f6457b | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Battelle Energy Alliance, 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 t... | 44.412281 | 127 | 0.676871 |
7ebbfa2672f4a8b805a02c4f45efeddb791a6107 | 39 | py | Python | backend/garpix_utils/paginator/__init__.py | garpixcms/garpix_utils | b1694c29ea7ca72fd2347aa5e830d1991535153b | [
"MIT"
] | 4 | 2021-07-21T09:15:48.000Z | 2021-09-27T07:20:40.000Z | backend/garpix_utils/paginator/__init__.py | garpixcms/garpix_utils | b1694c29ea7ca72fd2347aa5e830d1991535153b | [
"MIT"
] | null | null | null | backend/garpix_utils/paginator/__init__.py | garpixcms/garpix_utils | b1694c29ea7ca72fd2347aa5e830d1991535153b | [
"MIT"
] | 2 | 2021-09-08T09:08:57.000Z | 2021-09-08T09:37:46.000Z | from .paginator import GarpixPaginator
| 19.5 | 38 | 0.871795 |
d8c799592b2db3fcdd9ea5fede75c109a6949c2b | 1,371 | py | Python | zentral/contrib/simplemdm/forms.py | gwhitehawk/zentral | 156134aed3d7ff8a7cb40ab6f2269a763c316459 | [
"Apache-2.0"
] | 634 | 2015-10-30T00:55:40.000Z | 2022-03-31T02:59:00.000Z | zentral/contrib/simplemdm/forms.py | gwhitehawk/zentral | 156134aed3d7ff8a7cb40ab6f2269a763c316459 | [
"Apache-2.0"
] | 145 | 2015-11-06T00:17:33.000Z | 2022-03-16T13:30:31.000Z | zentral/contrib/simplemdm/forms.py | gwhitehawk/zentral | 156134aed3d7ff8a7cb40ab6f2269a763c316459 | [
"Apache-2.0"
] | 103 | 2015-11-07T07:08:49.000Z | 2022-03-18T17:34:36.000Z | from django import forms
from zentral.contrib.inventory.models import BusinessUnit
from .models import SimpleMDMInstance
from .api_client import APIClient, APIClientError
class SimpleMDMInstanceForm(forms.ModelForm):
class Meta:
model = SimpleMDMInstance
fields = ("business_unit", "api_key")
... | 34.275 | 83 | 0.603939 |
3174b617a18f7ccd74e07aad00b9539e9d96c35b | 247 | py | Python | smtools/torch/handlers/remove.py | hrsma2i/smtools | d52394b17fa2870dd4a48f7d14db9bbbbb25b9f2 | [
"MIT"
] | null | null | null | smtools/torch/handlers/remove.py | hrsma2i/smtools | d52394b17fa2870dd4a48f7d14db9bbbbb25b9f2 | [
"MIT"
] | null | null | null | smtools/torch/handlers/remove.py | hrsma2i/smtools | d52394b17fa2870dd4a48f7d14db9bbbbb25b9f2 | [
"MIT"
] | null | null | null | from typing import List
from pathlib import Path
from ignite.engine import Engine
def remove(trainer: Engine, patterns: List[str]):
for pattern in patterns:
for path in Path("/").glob(pattern.lstrip("/")):
path.unlink()
| 22.454545 | 56 | 0.672065 |
073467364d907e36a5466572d1cce90a5870fd40 | 9,967 | py | Python | IEXTools/IEXparser.py | MurattuW/IEXTools | 4f9b7a2c59cf654d68c90fc1b77ece858ced4eaa | [
"Apache-2.0"
] | null | null | null | IEXTools/IEXparser.py | MurattuW/IEXTools | 4f9b7a2c59cf654d68c90fc1b77ece858ced4eaa | [
"Apache-2.0"
] | null | null | null | IEXTools/IEXparser.py | MurattuW/IEXTools | 4f9b7a2c59cf654d68c90fc1b77ece858ced4eaa | [
"Apache-2.0"
] | null | null | null | """
IEXparser.py
Purpose:
This module contains the 'Parser' class which scans the IEX pcap file,
identifies messages and decodes them using the struct module.
Usage:
To create a Parser object simply supply the file path as an argument
> iex_parser = Parser('c:\\example.pcap')
This instantiates a Parser object with ... | 33.901361 | 85 | 0.606501 |
76bf4d899b86307d591a07ecccec30000e66e06d | 903 | py | Python | ShuffleNet_QAT/Timer.py | FromSystem/Swift-On-Device-Leanring | 515beb92e90a73e15eb88e1e8610c9487ae4061b | [
"Apache-2.0"
] | null | null | null | ShuffleNet_QAT/Timer.py | FromSystem/Swift-On-Device-Leanring | 515beb92e90a73e15eb88e1e8610c9487ae4061b | [
"Apache-2.0"
] | null | null | null | ShuffleNet_QAT/Timer.py | FromSystem/Swift-On-Device-Leanring | 515beb92e90a73e15eb88e1e8610c9487ae4061b | [
"Apache-2.0"
] | 1 | 2020-08-12T08:03:45.000Z | 2020-08-12T08:03:45.000Z | import time
import logging
from config import cfg
class Timer_logger:
def __init__(self):
self.start_time = 0
logging.basicConfig(filename=cfg.logger_path+time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime())+'.log',
datefmt='%Y/%m/%d %H:%M:%S',
... | 28.21875 | 113 | 0.601329 |
f26e1ceb2ce64f3b90dd68e1712e112ce557ddc9 | 8,033 | py | Python | brownies/bin/get-spec.py | brown170/fudge | 4f818b0e0b0de52bc127dd77285b20ce3568c97a | [
"BSD-3-Clause"
] | 14 | 2019-08-29T23:46:24.000Z | 2022-03-21T10:16:25.000Z | brownies/bin/get-spec.py | brown170/fudge | 4f818b0e0b0de52bc127dd77285b20ce3568c97a | [
"BSD-3-Clause"
] | 1 | 2020-08-04T16:14:45.000Z | 2021-12-01T01:54:34.000Z | brownies/bin/get-spec.py | brown170/fudge | 4f818b0e0b0de52bc127dd77285b20ce3568c97a | [
"BSD-3-Clause"
] | 2 | 2022-03-03T22:41:41.000Z | 2022-03-03T22:54:43.000Z | #!/usr/bin/env python
# <<BEGIN-copyright>>
# Copyright 2021, Lawrence Livermore National Security, LLC.
# See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
# <<END-copyright>>
import argparse
import sys
import os
import matplotlib.pyplot as plt
sys.path.append(os.path.split(__... | 43.896175 | 119 | 0.588697 |
ba80197c1dfe5027530f82e1fdcdaa5082ad826f | 2,316 | py | Python | unit_tests/postgresqlext_test.py | ral99/superdome | 0fda74876a6b3fce699545391e186037a4db9356 | [
"BSD-3-Clause"
] | null | null | null | unit_tests/postgresqlext_test.py | ral99/superdome | 0fda74876a6b3fce699545391e186037a4db9356 | [
"BSD-3-Clause"
] | null | null | null | unit_tests/postgresqlext_test.py | ral99/superdome | 0fda74876a6b3fce699545391e186037a4db9356 | [
"BSD-3-Clause"
] | null | null | null | import unittest
from superdome.postgresqlext import PostgreSQLExtension
from whodat.handler import *
from whodat.http import *
from whodat.wsgi import *
### Settings ###
POSTGRESQL_CONNECTIONS = {
'db': {
'master': {
'database': 'testing',
'host': 'localhost',
'port': ... | 30.473684 | 112 | 0.558722 |
83fecb08116ff1698ff0f90ed1dcc52008ec1e41 | 37,159 | py | Python | lib/rucio/web/rest/webpy/v1/rse.py | justincc/rucio | 95d81403c835d9f43fc30d328a8e2e388617a369 | [
"Apache-2.0"
] | null | null | null | lib/rucio/web/rest/webpy/v1/rse.py | justincc/rucio | 95d81403c835d9f43fc30d328a8e2e388617a369 | [
"Apache-2.0"
] | null | null | null | lib/rucio/web/rest/webpy/v1/rse.py | justincc/rucio | 95d81403c835d9f43fc30d328a8e2e388617a369 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2012-2020 CERN
#
# 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... | 36.645957 | 146 | 0.597352 |
fedf8fe9f7dd2ebcdcbfa15827325b66704cdc05 | 303 | py | Python | demac/src/utils/os_utils.py | ericyangyu/DeMAC | 25e0520e5b4ab3514992fd5b505af283504a80b2 | [
"MIT"
] | 1 | 2021-11-22T17:30:33.000Z | 2021-11-22T17:30:33.000Z | demac/src/utils/os_utils.py | ericyangyu/DeMAC | 25e0520e5b4ab3514992fd5b505af283504a80b2 | [
"MIT"
] | null | null | null | demac/src/utils/os_utils.py | ericyangyu/DeMAC | 25e0520e5b4ab3514992fd5b505af283504a80b2 | [
"MIT"
] | null | null | null | """
Helper function library that deal with the OS.
"""
import shutil
import os
def init_dir(path):
"""
Hard initializes a directory given a path.
Parameters:
path - a directory path to initialize
Return:
"""
shutil.rmtree(path, ignore_errors=True)
os.mkdir(path)
| 15.947368 | 46 | 0.653465 |
43e040901b151d5caed25929109158b680f21861 | 11,321 | py | Python | beta/old_src/vmfpropagate.py | addschile/pymctdh | 20a93ce543526de1919757defceef16f9005f423 | [
"MIT"
] | null | null | null | beta/old_src/vmfpropagate.py | addschile/pymctdh | 20a93ce543526de1919757defceef16f9005f423 | [
"MIT"
] | null | null | null | beta/old_src/vmfpropagate.py | addschile/pymctdh | 20a93ce543526de1919757defceef16f9005f423 | [
"MIT"
] | null | null | null | import sys
from time import time
import numpy as np
import scipy.integrate
from eom import vmfeom
def vmfpropagate(times, ham, pbfs, wf, filename):
"""Propagate MCTDH wavefunction based on Dirac-Frenkel variational
principle. Uses the variable mean field scheme in which
Inputs
------
Outputs
... | 36.169329 | 133 | 0.513471 |
3d866aaeea10872669ae844d0d1c486b348054e8 | 577 | py | Python | tests/tools/__init__.py | s3rvac/retdec-python | 6360ecba75fae5420de2bf2ba63cf8a8c0e0c7cc | [
"MIT"
] | 102 | 2015-02-08T20:00:43.000Z | 2022-02-06T20:34:24.000Z | tests/tools/__init__.py | s3rvac/retdec-python | 6360ecba75fae5420de2bf2ba63cf8a8c0e0c7cc | [
"MIT"
] | 5 | 2016-08-02T04:46:29.000Z | 2018-10-11T06:08:32.000Z | tests/tools/__init__.py | s3rvac/retdec-python | 6360ecba75fae5420de2bf2ba63cf8a8c0e0c7cc | [
"MIT"
] | 24 | 2015-04-08T13:27:54.000Z | 2020-12-07T21:22:23.000Z | #
# Project: retdec-python
# Copyright: (c) 2015 by Petr Zemek <s3rvac@gmail.com> and contributors
# License: MIT, see the LICENSE file for more details
#
"""Tests for the :mod:`retdec.tools` package."""
import io
import unittest
from tests import WithPatching
class ToolTestsBase(unittest.TestCase, WithPatchin... | 22.192308 | 71 | 0.663778 |
388e796754623592e03c4d7c132452ccd9d50e0b | 121 | py | Python | src/application/system/job_status.py | mehsoy/jaws | b79723c1fc549741494ebf5d948e94a44e971f2a | [
"MIT"
] | 1 | 2019-06-17T17:01:17.000Z | 2019-06-17T17:01:17.000Z | src/application/system/job_status.py | mehsoy/jaws | b79723c1fc549741494ebf5d948e94a44e971f2a | [
"MIT"
] | 7 | 2021-02-08T20:46:15.000Z | 2021-09-08T02:12:59.000Z | src/application/system/job_status.py | mehsoy/jaws | b79723c1fc549741494ebf5d948e94a44e971f2a | [
"MIT"
] | null | null | null | from enum import Enum
class JobStatus(Enum):
QUEUED = 1
ACTIVE = 2
PAUSED = 3
CANCELED = 4
DONE = 5 | 13.444444 | 22 | 0.586777 |
10f65ce6f57876b9822fc8b4bab4691322ade93f | 1,478 | py | Python | sqs_client.py | anderssonw/kirc-cli | ddc3e91a32ac8677cd5e816ebeed6c851b6ff1b1 | [
"Apache-2.0"
] | null | null | null | sqs_client.py | anderssonw/kirc-cli | ddc3e91a32ac8677cd5e816ebeed6c851b6ff1b1 | [
"Apache-2.0"
] | 3 | 2021-04-05T17:11:20.000Z | 2021-04-08T16:28:55.000Z | sqs_client.py | anderssonw/kirc-cli | ddc3e91a32ac8677cd5e816ebeed6c851b6ff1b1 | [
"Apache-2.0"
] | 10 | 2021-04-08T15:34:00.000Z | 2021-04-08T16:29:33.000Z | import boto3
from consts import REGION, QUEUE_NAME, MESSAGE_GROUP_ID
from datetime import datetime, timezone
import uuid
import json
def send_queue_message(message: str):
client = boto3.client('sqs', REGION)
qurl = client.get_queue_url(QueueName=QUEUE_NAME)["QueueUrl"]
response = client.send_messa... | 34.372093 | 135 | 0.595399 |
181fbb010f1a8a8f3189aa24249a11fc94213386 | 17,817 | py | Python | pysnmp/AUDIOCODES-TYPES-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/AUDIOCODES-TYPES-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/AUDIOCODES-TYPES-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module AUDIOCODES-TYPES-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/AUDIOCODES-TYPES-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 16:54:29 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (defau... | 114.948387 | 5,672 | 0.731436 |
dd878d06200e476070bd0527c24163dc0d62defd | 1,297 | py | Python | oreo_backend/thesite/urls.py | TaipeiTechIAEWorkplace/Website | fc962d5f8163c08f901fe4d97af14b8e7b3cfc9c | [
"MIT"
] | 1 | 2022-02-06T07:08:13.000Z | 2022-02-06T07:08:13.000Z | oreo_backend/thesite/urls.py | TaipeiTechIAEWorkplace/Website | fc962d5f8163c08f901fe4d97af14b8e7b3cfc9c | [
"MIT"
] | null | null | null | oreo_backend/thesite/urls.py | TaipeiTechIAEWorkplace/Website | fc962d5f8163c08f901fe4d97af14b8e7b3cfc9c | [
"MIT"
] | null | null | null | """thesite URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... | 37.057143 | 81 | 0.720894 |
53de4fefe3175004c7643543bc25ea83414b301b | 6,792 | py | Python | src/qrl/main.py | Neurone/QRL | 0c74b5cddb72f995a6c5677c8cb6066c4d85c425 | [
"MIT"
] | 1 | 2020-07-12T23:40:48.000Z | 2020-07-12T23:40:48.000Z | src/qrl/main.py | Neurone/QRL | 0c74b5cddb72f995a6c5677c8cb6066c4d85c425 | [
"MIT"
] | null | null | null | src/qrl/main.py | Neurone/QRL | 0c74b5cddb72f995a6c5677c8cb6066c4d85c425 | [
"MIT"
] | null | null | null | # coding=utf-8
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
import argparse
import faulthandler
import logging
import threading
from os.path import expanduser
from mock import MagicMock
from twisted.internet import reactor
from... | 40.915663 | 134 | 0.689782 |
bfff08863195480fe23642878e0c5a72d35d75c9 | 16,626 | py | Python | tests/test_ntfl_rbdamping.py | twmacro/pyye | c4febd44be836bd87368da13c1fb0cf82838b687 | [
"BSD-3-Clause"
] | 17 | 2016-03-02T18:29:13.000Z | 2022-03-18T08:41:56.000Z | tests/test_ntfl_rbdamping.py | twmacro/pyye | c4febd44be836bd87368da13c1fb0cf82838b687 | [
"BSD-3-Clause"
] | 2 | 2021-04-15T02:11:10.000Z | 2021-12-06T12:49:57.000Z | tests/test_ntfl_rbdamping.py | twmacro/pyye | c4febd44be836bd87368da13c1fb0cf82838b687 | [
"BSD-3-Clause"
] | 6 | 2020-06-11T17:09:50.000Z | 2022-02-07T19:15:07.000Z | import numpy as np
import scipy.linalg as la
from types import SimpleNamespace
import pandas as pd
from pyyeti import ode, frclim
class FEM_2D:
"""
Documentation
"""
def __init__(self, nodes, elements):
self.nodes = nodes
self.elements = elements
# convert the nodes and elem... | 33.318637 | 86 | 0.488452 |
b7ae656b549530638d9f5a4948ee57a447b4456e | 16,056 | py | Python | src/yass/phy/run.py | jaib1/yass | 9899c7d63c522a26b160ac7a223c794dfd3e23c6 | [
"Apache-2.0"
] | null | null | null | src/yass/phy/run.py | jaib1/yass | 9899c7d63c522a26b160ac7a223c794dfd3e23c6 | [
"Apache-2.0"
] | null | null | null | src/yass/phy/run.py | jaib1/yass | 9899c7d63c522a26b160ac7a223c794dfd3e23c6 | [
"Apache-2.0"
] | null | null | null | import os
import logging
import numpy as np
import parmap
import scipy
import datetime as dt
from tqdm import tqdm
from sklearn.metrics.pairwise import cosine_similarity
from yass import read_config
from yass.visual.util import binary_reader_waveforms
#from yass.deconvolve.soft_assignment import get_soft_assignment... | 39.256724 | 113 | 0.597222 |
08a09338bf27be71ea5f352ae749edb05c765746 | 2,827 | py | Python | python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_yolo_box_head.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 11 | 2016-08-29T07:43:26.000Z | 2016-08-29T07:51:24.000Z | python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_yolo_box_head.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/ir/inference/test_trt_convert_yolo_box_head.py | L-Net-1992/Paddle | 4d0ca02ba56760b456f3d4b42a538555b9b6c307 | [
"Apache-2.0"
] | 1 | 2021-12-09T08:59:17.000Z | 2021-12-09T08:59:17.000Z | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 36.24359 | 79 | 0.573399 |
387c953d2ca9769fdda765b1f84267df970950ff | 49,725 | py | Python | tests/jobs/test_backfill_job.py | JimCircadian/airflow | bf4d231c7402d61a3e9cd796e23fa61d24883357 | [
"Apache-2.0"
] | 1 | 2021-02-19T13:06:44.000Z | 2021-02-19T13:06:44.000Z | tests/jobs/test_backfill_job.py | JimCircadian/airflow | bf4d231c7402d61a3e9cd796e23fa61d24883357 | [
"Apache-2.0"
] | 8 | 2021-02-08T20:40:47.000Z | 2022-03-29T22:27:53.000Z | tests/jobs/test_backfill_job.py | JimCircadian/airflow | bf4d231c7402d61a3e9cd796e23fa61d24883357 | [
"Apache-2.0"
] | 1 | 2021-05-12T11:37:59.000Z | 2021-05-12T11:37:59.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... | 34.724162 | 107 | 0.586043 |
1e318f9c9b05b871383494d6b9bb1582008d88e5 | 982 | py | Python | publishing/books/models.py | laukiet78/django-nested-inline-formets | 057b57cda4ae2017393e8acbeca0485396d94676 | [
"MIT"
] | 95 | 2018-04-11T01:59:40.000Z | 2022-03-09T10:16:56.000Z | publishing/books/models.py | laukiet78/django-nested-inline-formets | 057b57cda4ae2017393e8acbeca0485396d94676 | [
"MIT"
] | 6 | 2018-05-30T18:03:41.000Z | 2022-03-24T10:31:47.000Z | publishing/books/models.py | laukiet78/django-nested-inline-formets | 057b57cda4ae2017393e8acbeca0485396d94676 | [
"MIT"
] | 26 | 2018-04-11T02:00:01.000Z | 2022-02-05T00:29:12.000Z | from django.db import models
from django.urls import reverse
class Publisher(models.Model):
name = models.CharField(null=False, blank=False, max_length=255)
def __str__(self):
return self.name
def get_absolute_url(self):
return reverse('books:publisher_detail', kwargs={'pk': self.pk})
... | 27.277778 | 76 | 0.675153 |
fcabc11b54cf084e07a980e4633fe9135c6f910e | 1,255 | py | Python | pynyzo/tests/test_hashutils.py | iyomisc/pynyzo | fb324a8fe7c91a4f2c0f155b7170eb005b1c88ca | [
"MIT"
] | 6 | 2019-02-09T02:46:18.000Z | 2021-03-29T04:15:15.000Z | pynyzo/tests/test_hashutils.py | iyomisc/pynyzo | fb324a8fe7c91a4f2c0f155b7170eb005b1c88ca | [
"MIT"
] | 1 | 2020-05-17T18:29:20.000Z | 2020-05-18T08:31:33.000Z | pynyzo/tests/test_hashutils.py | iyomisc/pynyzo | fb324a8fe7c91a4f2c0f155b7170eb005b1c88ca | [
"MIT"
] | 5 | 2019-02-09T02:46:19.000Z | 2021-01-08T06:49:50.000Z | import pytest
import sys
import ed25519
import hashlib
sys.path.append('../')
from pynyzo.hashutil import HashUtil
# See https://github.com/n-y-z-o/nyzoVerifier/blob/master/src/main/java/co/nyzo/verifier/HashUtil.java
def test_single_1(verbose=False):
hello = b"hello"
hex = HashUtil.single_sha256(hello).hex... | 25.612245 | 102 | 0.720319 |
4f86c24fde28b3961078708d89714ca0af291b8c | 1,828 | py | Python | src/nypower/cmd/archive.py | hongjsk/ny-power | d892f194f621555d65df4ba3dcd3ccaabb64b72d | [
"Apache-2.0"
] | 3 | 2019-09-22T17:35:16.000Z | 2021-09-22T10:36:00.000Z | src/nypower/cmd/archive.py | hongjsk/ny-power | d892f194f621555d65df4ba3dcd3ccaabb64b72d | [
"Apache-2.0"
] | null | null | null | src/nypower/cmd/archive.py | hongjsk/ny-power | d892f194f621555d65df4ba3dcd3ccaabb64b72d | [
"Apache-2.0"
] | 1 | 2021-04-09T18:01:49.000Z | 2021-04-09T18:01:49.000Z | import json
import logging
import os
import click
import paho.mqtt.client as mqtt
from nypower.archive import Archiver
from nypower.mqtt import get_pass
_LOGGER = logging.getLogger(__name__)
logging.basicConfig(
format='%(asctime)s %(levelname)s %(message)s',
level=logging.DEBUG)
INFLUXDB_HOST = os.environ... | 28.123077 | 77 | 0.66302 |
b80ce057a6dfbf04451b8e8e983999a61cf3c2f6 | 4,463 | py | Python | backend/views.py | SteBry/mycroft | 918d90aa6cc8a82f26cc18cab4c70e9a8590f7f1 | [
"MIT"
] | null | null | null | backend/views.py | SteBry/mycroft | 918d90aa6cc8a82f26cc18cab4c70e9a8590f7f1 | [
"MIT"
] | null | null | null | backend/views.py | SteBry/mycroft | 918d90aa6cc8a82f26cc18cab4c70e9a8590f7f1 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from rest_framework.decorators import api_view
from rest_framework.response import Response
# Module imports
import backend.filter_module as filter_module
import backend.project_manager as project_manager
import backend.exporter as exporter
import backend.video_manager as video_mana... | 27.213415 | 66 | 0.695496 |
e7709dd848b8b7f3d03b88a4b2b062743419db95 | 4,431 | py | Python | Python/4sum.py | RideGreg/LeetCode | b70818b1e6947bf29519a24f78816e022ebab59e | [
"MIT"
] | 1 | 2022-01-30T06:55:28.000Z | 2022-01-30T06:55:28.000Z | Python/4sum.py | RideGreg/LeetCode | b70818b1e6947bf29519a24f78816e022ebab59e | [
"MIT"
] | null | null | null | Python/4sum.py | RideGreg/LeetCode | b70818b1e6947bf29519a24f78816e022ebab59e | [
"MIT"
] | 1 | 2021-12-31T03:56:39.000Z | 2021-12-31T03:56:39.000Z | # Time: O(n^3)
# Space: O(1)
# http://www.sigmainfy.com/blog/summary-of-ksum-problems.html
#
# Given an array S of n integers,
# are there elements a, b, c, and d in S such that a + b + c + d = target?
# Find all unique quadruplets in the array which gives the sum of target.
#
# Given an array S of n integers,
try:... | 39.5625 | 145 | 0.463552 |
9e0ec35d6fe425e8f1e13767539d44505f1d31b5 | 1,365 | py | Python | autodynatrace/wrappers/subprocess/wrapper.py | gcasgo/OneAgent-SDK-Python-AutoInstrumentation | b1abe7b9993fda094ba96f56affc776d7cd0ffed | [
"Apache-2.0"
] | 22 | 2020-08-11T13:26:11.000Z | 2022-02-13T12:06:01.000Z | autodynatrace/wrappers/subprocess/wrapper.py | gcasgo/OneAgent-SDK-Python-AutoInstrumentation | b1abe7b9993fda094ba96f56affc776d7cd0ffed | [
"Apache-2.0"
] | 29 | 2019-10-28T12:12:30.000Z | 2020-08-05T16:16:16.000Z | autodynatrace/wrappers/subprocess/wrapper.py | gcasgo/OneAgent-SDK-Python-AutoInstrumentation | b1abe7b9993fda094ba96f56affc776d7cd0ffed | [
"Apache-2.0"
] | 11 | 2020-09-15T03:20:56.000Z | 2022-02-11T13:06:01.000Z | import six
import wrapt
from ...log import logger
from ...sdk import sdk
def instrument():
def dynatrace_trace(wrapped, instance, args, kwargs):
method = wrapped.__name__
with sdk.trace_custom_service(method, "Subprocess"):
logger.debug("Tracing subprocess.{}".format(method))
... | 36.891892 | 67 | 0.702564 |
d7bcf77e5b31b077ea45d3f8b13bfc2464533e79 | 6,148 | py | Python | Lib/site-packages/flup/server/threadedserver.py | Mememasta/flaskfornikita | bc6b67e5acc1c32869168fb9643cc2d2ab626a0f | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/flup/server/threadedserver.py | Mememasta/flaskfornikita | bc6b67e5acc1c32869168fb9643cc2d2ab626a0f | [
"bzip2-1.0.6"
] | 2 | 2019-12-26T17:34:20.000Z | 2020-01-06T19:47:34.000Z | Lib/site-packages/flup/server/threadedserver.py | Mememasta/flaskfornikita | bc6b67e5acc1c32869168fb9643cc2d2ab626a0f | [
"bzip2-1.0.6"
] | null | null | null | # Copyright (c) 2005 Allan Saddi <allan@saddi.com>
# 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 c... | 33.966851 | 79 | 0.619388 |
69c009885831debbbb39e4d0f338bc7b9a459aca | 936 | py | Python | src/shell/command/memvisu.py | Frky/scat | 551c3a155dd3804d78d6efb96ecdace430bd6473 | [
"MIT"
] | 77 | 2015-10-10T19:59:47.000Z | 2021-12-10T06:59:35.000Z | src/shell/command/memvisu.py | Frky/scat | 551c3a155dd3804d78d6efb96ecdace430bd6473 | [
"MIT"
] | 19 | 2017-02-23T15:59:01.000Z | 2017-06-14T11:41:36.000Z | src/shell/command/memvisu.py | Frky/scat | 551c3a155dd3804d78d6efb96ecdace430bd6473 | [
"MIT"
] | 12 | 2015-12-08T17:57:49.000Z | 2021-04-16T07:42:31.000Z | #-*- coding: utf-8 -*-
import json
import bottle
from src.shell.command.i_command import ICommand
class MemVisu(ICommand):
"""
Retrieve couples
"""
def __init__(self, config, json_path):
super(MemVisu, self).__init__()
self.__port = config["port"]
self.__path = config["... | 26.742857 | 93 | 0.620726 |
ad3ebbe3cc1baf205fcca5aba7a5d2bb7c8a9482 | 601 | py | Python | breadpool/__init__.py | obradovic/breadpool | 0ee62d0fd9c74a4395154f05bb4741febcbe81ad | [
"Apache-2.0"
] | 3 | 2015-12-10T17:37:58.000Z | 2021-07-08T17:55:39.000Z | breadpool/__init__.py | obradovic/breadpool | 0ee62d0fd9c74a4395154f05bb4741febcbe81ad | [
"Apache-2.0"
] | 5 | 2015-12-09T20:31:25.000Z | 2019-11-25T23:59:28.000Z | breadpool/__init__.py | obradovic/breadpool | 0ee62d0fd9c74a4395154f05bb4741febcbe81ad | [
"Apache-2.0"
] | 2 | 2017-03-09T19:37:27.000Z | 2019-11-07T00:06:53.000Z | # Copyright 2015 Chamila de Alwis
#
# 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,... | 37.5625 | 74 | 0.767055 |
e7b119a29db2dac5c2b18ea5691b6875b886917f | 591 | py | Python | src/pyinterp/tests/core/storage/test_marshaller.py | CNES/pangeo-pyinterp | 5f75f62a6c681db89c5aa8c74e43fc04a77418c3 | [
"BSD-3-Clause"
] | 67 | 2019-07-09T09:10:22.000Z | 2022-03-01T09:46:35.000Z | src/pyinterp/tests/core/storage/test_marshaller.py | CNES/pangeo-pyinterp | 5f75f62a6c681db89c5aa8c74e43fc04a77418c3 | [
"BSD-3-Clause"
] | 8 | 2019-07-15T13:54:31.000Z | 2021-06-28T05:06:34.000Z | src/pyinterp/tests/core/storage/test_marshaller.py | CNES/pangeo-pyinterp | 5f75f62a6c681db89c5aa8c74e43fc04a77418c3 | [
"BSD-3-Clause"
] | 7 | 2019-07-15T17:28:16.000Z | 2022-01-19T19:43:47.000Z | # Copyright (c) 2021 CNES
#
# All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import pickle
from pyinterp.core import storage
def test_pickle():
p = storage.Marshaller()
s = "#" * 256
d1 = p.dumps(s)
d2 = pickle.dumps(s, protocol... | 22.730769 | 63 | 0.595601 |
5121bfffca1a10a1bb642ae1dd4ec43525b22ca5 | 38,246 | py | Python | pepys_import/resolvers/command_line_resolver.py | tahirs95/pepys-import | 05f070e97dd2f3f84b71faa3578e03398e28ca15 | [
"Apache-2.0"
] | null | null | null | pepys_import/resolvers/command_line_resolver.py | tahirs95/pepys-import | 05f070e97dd2f3f84b71faa3578e03398e28ca15 | [
"Apache-2.0"
] | null | null | null | pepys_import/resolvers/command_line_resolver.py | tahirs95/pepys-import | 05f070e97dd2f3f84b71faa3578e03398e28ca15 | [
"Apache-2.0"
] | null | null | null | import sys
from prompt_toolkit import prompt
from prompt_toolkit.completion import FuzzyWordCompleter
from sqlalchemy import or_
from pepys_import.resolvers.data_resolver import DataResolver
from pepys_import.resolvers.command_line_input import create_menu, is_valid
from pepys_import.core.store import constants
cla... | 40.730564 | 88 | 0.581708 |
0f1a0875b723cb4d8cc2a6aa8c8b5d08ad16d502 | 453 | py | Python | ref/send_email.py | mayukhpankaj/Vaccinater | 073da916f39cd7653fb989029096e852d32aa805 | [
"MIT"
] | 6 | 2021-08-11T10:51:49.000Z | 2021-11-14T13:35:48.000Z | ref/send_email.py | mayukhpankaj/Vaccinater | 073da916f39cd7653fb989029096e852d32aa805 | [
"MIT"
] | null | null | null | ref/send_email.py | mayukhpankaj/Vaccinater | 073da916f39cd7653fb989029096e852d32aa805 | [
"MIT"
] | 1 | 2021-08-20T07:05:08.000Z | 2021-08-20T07:05:08.000Z | from email import message
import smtplib, ssl
port = 465
sender_email = "fmipapp@gmail.com"
password = "xyz"
message_body = """
\n
Hello Mayukh
\n
welcome to vaccine tracker.
"""
#secure ssl connection
context = ssl.create_default_context()
#login
with smtplib.SMTP_SSL("smtp.gmail.com",port,context=co... | 14.15625 | 73 | 0.739514 |
80acb9c7b5064f55246f4c382b5d4d261726299a | 7,907 | py | Python | Code/Evolutionary Algorithm/get_testing_results.py | MauroSilvaPinto/A-personalized-and-evolutionary-algorithm-for-interpretable-EEG-epilepsy-seizure-prediction | 3bec2f06cfe0e2aff13e63c83ebc97135c079408 | [
"CC0-1.0"
] | null | null | null | Code/Evolutionary Algorithm/get_testing_results.py | MauroSilvaPinto/A-personalized-and-evolutionary-algorithm-for-interpretable-EEG-epilepsy-seizure-prediction | 3bec2f06cfe0e2aff13e63c83ebc97135c079408 | [
"CC0-1.0"
] | null | null | null | Code/Evolutionary Algorithm/get_testing_results.py | MauroSilvaPinto/A-personalized-and-evolutionary-algorithm-for-interpretable-EEG-epilepsy-seizure-prediction | 3bec2f06cfe0e2aff13e63c83ebc97135c079408 | [
"CC0-1.0"
] | null | null | null | '''
A code to get the testing information (new seizures) from
the evolutionary training execution, from a given patient,
and performs statistical validation with the random predictor.
'''
# %% Imports
import os
from Database import Database
from Population import Population
import warnings
import numpy as np
impor... | 34.378261 | 117 | 0.591122 |
c134bde101606cf6d74b1099d43a6989b4991c2e | 3,369 | py | Python | service.py | glaslos/u-pot | 4802f3ec48ab7bddbc897aa2d51aa1ffaa2ec939 | [
"MIT"
] | null | null | null | service.py | glaslos/u-pot | 4802f3ec48ab7bddbc897aa2d51aa1ffaa2ec939 | [
"MIT"
] | null | null | null | service.py | glaslos/u-pot | 4802f3ec48ab7bddbc897aa2d51aa1ffaa2ec939 | [
"MIT"
] | null | null | null | from xmlreader import XmlReader
from action import Action
import xml.etree.ElementTree as ET
import requests
class Service(object):
def __init__(self, host, service):
self.host = host
self.serviceType = service.find("./serviceType").text
self.serviceId = service.find("./serviceId").text
... | 43.192308 | 286 | 0.574651 |
3a4676c7059c3dcd774e75571c675dc8e9bda0d1 | 17,006 | py | Python | dbt/main.py | boxysean/dbt | 01382283092e27a2c2f87bdab9ff9e731518aead | [
"Apache-2.0"
] | null | null | null | dbt/main.py | boxysean/dbt | 01382283092e27a2c2f87bdab9ff9e731518aead | [
"Apache-2.0"
] | null | null | null | dbt/main.py | boxysean/dbt | 01382283092e27a2c2f87bdab9ff9e731518aead | [
"Apache-2.0"
] | null | null | null | from dbt.logger import initialize_logger, GLOBAL_LOGGER as logger, \
logger_initialized
import argparse
import os.path
import sys
import traceback
import dbt.version
import dbt.flags as flags
import dbt.task.run as run_task
import dbt.task.compile as compile_task
import dbt.task.debug as debug_task
import dbt.tas... | 29.835088 | 79 | 0.616488 |
92f75a2c33b6fd57efed3e5a90d98580751bbea5 | 3,448 | py | Python | testmile-setu/setu/core/guiauto/base/element_container.py | test-mile/setu | b273a11e7f9462e64a370bda16f1952ecdbfb5a5 | [
"Apache-2.0"
] | null | null | null | testmile-setu/setu/core/guiauto/base/element_container.py | test-mile/setu | b273a11e7f9462e64a370bda16f1952ecdbfb5a5 | [
"Apache-2.0"
] | null | null | null | testmile-setu/setu/core/guiauto/base/element_container.py | test-mile/setu | b273a11e7f9462e64a370bda16f1952ecdbfb5a5 | [
"Apache-2.0"
] | null | null | null | import abc
from setu.core.lib.setu_types import SetuConfiguredObject
from setu.core.guiauto.locator.emd import SimpleGuiElementMetaData
from .container_conditions import GuiElementContainerConditions
class ElementContainer(SetuConfiguredObject, metaclass=abc.ABCMeta):
def __init__(self, config):
super()... | 39.632184 | 129 | 0.728828 |
8d668a2753e151754923a894956c98b95e2d54f8 | 18,205 | py | Python | models/answer_extraction_cut.py | yy2111/iSPY | 454ed4ec6a18b9e2dd3e13114b1263760054401e | [
"MIT"
] | 3 | 2022-03-05T22:12:41.000Z | 2022-03-09T08:45:53.000Z | models/answer_extraction_cut.py | yy2111/iSPY | 454ed4ec6a18b9e2dd3e13114b1263760054401e | [
"MIT"
] | null | null | null | models/answer_extraction_cut.py | yy2111/iSPY | 454ed4ec6a18b9e2dd3e13114b1263760054401e | [
"MIT"
] | 2 | 2021-09-22T09:32:15.000Z | 2022-03-04T02:45:09.000Z |
# coding: utf-8
# In[1]:
from __future__ import print_function
import os
os.environ["PATH"] += os.pathsep + 'E:/Graphviz2.38/bin'
import tensorflow as tf
# import keras.backend.tensorflow_backend as KTF
# 指定第一块GPU可用
os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID"
os.environ["CUDA_VISIBLE_DEVICES"] = "0"# config = tf... | 34.284369 | 177 | 0.638341 |
2cfcfdc0744c4c6ffaafe0c569acf1a9ea57b012 | 901 | py | Python | tokenify.py | edalquist/token_extract | 4437d2ef85d562ae717f8f12f4b10c8466103d3f | [
"Apache-2.0"
] | null | null | null | tokenify.py | edalquist/token_extract | 4437d2ef85d562ae717f8f12f4b10c8466103d3f | [
"Apache-2.0"
] | null | null | null | tokenify.py | edalquist/token_extract | 4437d2ef85d562ae717f8f12f4b10c8466103d3f | [
"Apache-2.0"
] | null | null | null | #!/opt/local/bin/python
from optparse import OptionParser
import subprocess
import token_util
import glob
import os
import re
import math
import locale
from wand.image import Image
from wand.display import display
encoding = locale.getdefaultlocale()[1]
parser = OptionParser()
parser.add_option("-f", "--file",
... | 23.102564 | 63 | 0.73141 |
657d7f8f4c425fb414c7d52a43b2e7d8c948c93d | 5,852 | py | Python | etl_e2e/census_etl/dfxml/python/ireport.py | thinkmoore/das | d9faabf3de987b890a5079b914f5aba597215b14 | [
"CC0-1.0"
] | 35 | 2019-04-16T19:37:01.000Z | 2022-02-14T20:33:41.000Z | etl_e2e/census_etl/dfxml/python/ireport.py | thinkmoore/das | d9faabf3de987b890a5079b914f5aba597215b14 | [
"CC0-1.0"
] | 6 | 2019-06-05T19:41:15.000Z | 2020-08-19T19:04:59.000Z | etl_e2e/census_etl/dfxml/python/ireport.py | thinkmoore/das | d9faabf3de987b890a5079b914f5aba597215b14 | [
"CC0-1.0"
] | 12 | 2019-05-02T19:38:06.000Z | 2021-09-11T22:02:03.000Z | #!/usr/bin/env python
#
# Print the stats from a DFXML file
import sys,os,shelve
sys.path.append(os.getenv("HOME")+"/slg/src/python")
sys.path.append(os.getenv("DOMEX_HOME")+"/src/lib")
from histogram2d import histogram2d
from histogram import histogram
from statbag import statbag
from ttable import ttable
import r... | 31.804348 | 94 | 0.589371 |
cc2eb4395674f4281a01d3d01f28742404287597 | 3,461 | py | Python | cart/models.py | Paul-Cheeseman/Stream3-Project | 174fa1d6bbf9ed75748513af366629ed01dddfee | [
"BSD-3-Clause"
] | null | null | null | cart/models.py | Paul-Cheeseman/Stream3-Project | 174fa1d6bbf9ed75748513af366629ed01dddfee | [
"BSD-3-Clause"
] | 8 | 2020-02-12T00:52:56.000Z | 2022-03-11T23:23:20.000Z | cart/models.py | Paul-Cheeseman/Stream3-Project | 174fa1d6bbf9ed75748513af366629ed01dddfee | [
"BSD-3-Clause"
] | 1 | 2018-02-22T11:15:48.000Z | 2018-02-22T11:15:48.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from accounts.models import User
from products.models import Product
# Create your models here.
class Cart(models.Model):
name = models.CharField(max_length=100)
#To get applicable cart object out of database
@classmet... | 26.623077 | 102 | 0.735626 |
272cfdb7d553adac826bc42507ccaf8309a3529e | 512 | py | Python | playground.py | VinceMu/semantic-segmentation-pytorch | 25e6d07b0e7cc4b039f5eeb6ecc51c400efadc49 | [
"BSD-3-Clause"
] | 1 | 2021-05-25T13:28:28.000Z | 2021-05-25T13:28:28.000Z | playground.py | VinceMu/semantic-segmentation-pytorch | 25e6d07b0e7cc4b039f5eeb6ecc51c400efadc49 | [
"BSD-3-Clause"
] | null | null | null | playground.py | VinceMu/semantic-segmentation-pytorch | 25e6d07b0e7cc4b039f5eeb6ecc51c400efadc49 | [
"BSD-3-Clause"
] | null | null | null | import torch
import cv2
import numpy as np
im = cv2.imread("./data/ADEChallengeData2016/annotations/training/ADE_train_00000001.png")
im2 = cv2.imread("./data/ADEChallengeData2016_remasked/annotations/training/ADE_train_00000001.png")
sliced = im2[:,:,:1]
reshaped = np.reshape(sliced, (sliced.shape[0],sliced.shape[1])... | 28.444444 | 100 | 0.751953 |
a6155a63a12c7167904669479288b08b41961665 | 5,498 | py | Python | anyway/views/schools/api.py | userdev0/anyway | cfdf305a681931f4ba7909f36c0c1e61b680ddc6 | [
"BSD-3-Clause"
] | null | null | null | anyway/views/schools/api.py | userdev0/anyway | cfdf305a681931f4ba7909f36c0c1e61b680ddc6 | [
"BSD-3-Clause"
] | null | null | null | anyway/views/schools/api.py | userdev0/anyway | cfdf305a681931f4ba7909f36c0c1e61b680ddc6 | [
"BSD-3-Clause"
] | null | null | null | # pylint: disable=no-member
import json
import logging
import pandas as pd
from flask import Response, request
from sqlalchemy import and_, not_
from anyway.base import db, user_optional
from anyway.models import (
School,
SchoolWithDescription2020
)
@user_optional
def schools_api():
logging.debug("get... | 36.171053 | 109 | 0.684249 |
da7097968589d0655b02ea40019014316e090538 | 1,196 | py | Python | nipype/interfaces/cmtk/tests/test_auto_ROIGen.py | PAmcconnell/nipype | 39fbd5411a844ce7c023964d3295eb7643b95af5 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/cmtk/tests/test_auto_ROIGen.py | PAmcconnell/nipype | 39fbd5411a844ce7c023964d3295eb7643b95af5 | [
"Apache-2.0"
] | 2 | 2018-04-26T12:09:32.000Z | 2018-04-27T06:36:49.000Z | nipype/interfaces/cmtk/tests/test_auto_ROIGen.py | PAmcconnell/nipype | 39fbd5411a844ce7c023964d3295eb7643b95af5 | [
"Apache-2.0"
] | 1 | 2019-11-14T14:16:57.000Z | 2019-11-14T14:16:57.000Z | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from ..cmtk import ROIGen
def test_ROIGen_inputs():
input_map = dict(
LUT_file=dict(
extensions=None,
xor=['use_freesurfer_LUT'],
),
aparc_aseg_file=dict(
extensions=None,
mandatory=True,
... | 29.170732 | 67 | 0.58612 |
49ac845d9513aafd619e8a45387b68314c2d2ede | 743 | py | Python | test/loss/test_oim.py | Tianyu97/Person-Re-identification-Research-Based-on-Deep-Learning | 51d667ad7a2870597d998fd03dab8884e37626dd | [
"MIT"
] | 1,341 | 2017-03-29T19:39:24.000Z | 2022-03-25T20:25:16.000Z | test/loss/test_oim.py | Tianyu97/Person-Re-identification-Research-Based-on-Deep-Learning | 51d667ad7a2870597d998fd03dab8884e37626dd | [
"MIT"
] | 91 | 2017-04-19T13:37:15.000Z | 2022-03-30T08:44:41.000Z | test/loss/test_oim.py | Tianyu97/Person-Re-identification-Research-Based-on-Deep-Learning | 51d667ad7a2870597d998fd03dab8884e37626dd | [
"MIT"
] | 405 | 2017-03-29T17:08:57.000Z | 2022-02-27T07:12:16.000Z | from unittest import TestCase
class TestOIMLoss(TestCase):
def test_forward_backward(self):
import torch
import torch.nn.functional as F
from torch.autograd import Variable
from reid.loss import OIMLoss
criterion = OIMLoss(3, 3, scalar=1.0, size_average=False)
crite... | 35.380952 | 65 | 0.625841 |
9825c21716b8fff75b5335a4873094e0692a96ef | 15,098 | py | Python | machine/qemu/sources/u-boot/test/py/tests/vboot_evil.py | muddessir/framework | 5b802b2dd7ec9778794b078e748dd1f989547265 | [
"MIT"
] | 1 | 2021-11-21T19:56:29.000Z | 2021-11-21T19:56:29.000Z | machine/qemu/sources/u-boot/test/py/tests/vboot_evil.py | muddessir/framework | 5b802b2dd7ec9778794b078e748dd1f989547265 | [
"MIT"
] | null | null | null | machine/qemu/sources/u-boot/test/py/tests/vboot_evil.py | muddessir/framework | 5b802b2dd7ec9778794b078e748dd1f989547265 | [
"MIT"
] | null | null | null | # SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2020, Intel Corporation
"""Modifies a devicetree to add a fake root node, for testing purposes"""
import hashlib
import struct
import sys
FDT_PROP = 0x3
FDT_BEGIN_NODE = 0x1
FDT_END_NODE = 0x2
FDT_END = 0x9
FAKE_ROOT_ATTACK = 0
KERNEL_AT = 1
MAGIC = 0xd00dfeed
EV... | 31.065844 | 92 | 0.646112 |
62083187fd43f833af750de6edf16910f5bd3de4 | 12,295 | py | Python | grid_search.py | James-chen-ha/python | 193d68a2919cdd8324b3982d670eae1c0f145dd1 | [
"MIT"
] | null | null | null | grid_search.py | James-chen-ha/python | 193d68a2919cdd8324b3982d670eae1c0f145dd1 | [
"MIT"
] | null | null | null | grid_search.py | James-chen-ha/python | 193d68a2919cdd8324b3982d670eae1c0f145dd1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Mar 17 12:53:56 2020
@author: Lab408
"""
#123
#########################KFOLD_Lightgbm#######################################
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import lightgbm as lgb
from sklearn.preprocessing import LabelEncoder
from sklea... | 40.847176 | 149 | 0.659048 |
765ff25570c0a67ff67036df62d0bcf4ce96080b | 2,265 | py | Python | kits/cpp/simple-transpiled/main.py | nathantgray/Lux-Design-2021 | 23188ee82a94a2a0ac2a3f3333f95a262e1b4d0d | [
"Apache-2.0"
] | 824 | 2021-07-01T01:29:07.000Z | 2022-03-18T21:20:03.000Z | kits/cpp/simple-transpiled/main.py | nathantgray/Lux-Design-2021 | 23188ee82a94a2a0ac2a3f3333f95a262e1b4d0d | [
"Apache-2.0"
] | 106 | 2021-07-01T07:53:35.000Z | 2022-01-28T21:30:10.000Z | kits/cpp/simple-transpiled/main.py | nathantgray/Lux-Design-2021 | 23188ee82a94a2a0ac2a3f3333f95a262e1b4d0d | [
"Apache-2.0"
] | 174 | 2021-07-01T04:13:45.000Z | 2022-03-26T07:21:58.000Z | from subprocess import Popen, PIPE
from threading import Thread
from queue import Queue, Empty
import atexit
import os
import sys
agent_processes = [None, None]
t = None
q = None
def cleanup_process():
global agent_processes
for proc in agent_processes:
if proc is not None:
proc.kill()
def... | 33.308824 | 126 | 0.638411 |
ef37dcafd1ae1662c623c1ffbac5b8d14ec666eb | 18,141 | py | Python | provisioning_service_client/provisioningserviceclient/models.py | Sahithkallakunta/azure-iot-sdk-python | 40f8c790aa243cec68bb615380da0b72e6d408a6 | [
"MIT"
] | null | null | null | provisioning_service_client/provisioningserviceclient/models.py | Sahithkallakunta/azure-iot-sdk-python | 40f8c790aa243cec68bb615380da0b72e6d408a6 | [
"MIT"
] | null | null | null | provisioning_service_client/provisioningserviceclient/models.py | Sahithkallakunta/azure-iot-sdk-python | 40f8c790aa243cec68bb615380da0b72e6d408a6 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for
# full license information.
from .serviceswagger import models as genmodels
class IndividualEnrollment(object):
"""
Individual Enrollment model. To instantiate please use the "create" cl... | 35.570588 | 100 | 0.707458 |
c119f31bfe8b8bd4fef936208ae755379825571f | 4,312 | py | Python | pipeline/tests/core/flow/test_flow_collection.py | sdgdsffdsfff/bk-sops-tencent | e8aff91f822e79031e12b0f66943830f44ced506 | [
"Apache-2.0"
] | 1 | 2020-09-24T07:39:16.000Z | 2020-09-24T07:39:16.000Z | pipeline/tests/core/flow/test_flow_collection.py | sdgdsffdsfff/bk-sops-tencent | e8aff91f822e79031e12b0f66943830f44ced506 | [
"Apache-2.0"
] | 5 | 2021-02-08T20:46:54.000Z | 2021-06-10T22:54:45.000Z | pipeline/tests/core/flow/test_flow_collection.py | sdgdsffdsfff/bk-sops-tencent | e8aff91f822e79031e12b0f66943830f44ced506 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 41.864078 | 115 | 0.651438 |
53a42dd3203b2692769542b70df23ba192b9e0f6 | 667 | py | Python | TestProject/manage.py | tngsk/vscode-remote-try-python | 98391f7910a0addcac73a153a6aae4797eb31bf8 | [
"MIT"
] | null | null | null | TestProject/manage.py | tngsk/vscode-remote-try-python | 98391f7910a0addcac73a153a6aae4797eb31bf8 | [
"MIT"
] | null | null | null | TestProject/manage.py | tngsk/vscode-remote-try-python | 98391f7910a0addcac73a153a6aae4797eb31bf8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'TestProject.settings')
try:
from django.core.management import execute_from_command_line
except ... | 29 | 75 | 0.68066 |
405840c529f4459514dc3d00e222948b341c3419 | 3,972 | py | Python | loadbalanceRL/lib/algorithm/Qlearning/controller.py | fqzhou/LoadBalanceControl-RL | 689eec3b3b27e121aa45d2793e411f1863f6fc0b | [
"MIT"
] | 11 | 2018-10-29T06:50:43.000Z | 2022-03-28T14:26:09.000Z | loadbalanceRL/lib/algorithm/Qlearning/controller.py | fqzhou/LoadBalanceControl-RL | 689eec3b3b27e121aa45d2793e411f1863f6fc0b | [
"MIT"
] | 1 | 2022-03-01T13:46:25.000Z | 2022-03-01T13:46:25.000Z | loadbalanceRL/lib/algorithm/Qlearning/controller.py | fqzhou/LoadBalanceControl-RL | 689eec3b3b27e121aa45d2793e411f1863f6fc0b | [
"MIT"
] | 6 | 2019-02-05T20:01:53.000Z | 2020-09-04T12:30:00.000Z | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
""" Controller to dispatch respective Qlearning instance """
import logging
from collections import namedtuple
from loadbalanceRL.utils import exceptions
from loadbalanceRL.lib.algorithm import algorithm_template
from loadbalanceRL.lib.algorithm.Qlearning.agents import ... | 32.292683 | 79 | 0.647784 |
2a3b5d900dafc19015aaca4d257244b70bdbc9b1 | 78,258 | py | Python | pytests/dcp_new/dcp_tests.py | ashwin2002/TAF | 4223787a1f4c0fe9fa841543020b48ada9ade9e3 | [
"Apache-2.0"
] | null | null | null | pytests/dcp_new/dcp_tests.py | ashwin2002/TAF | 4223787a1f4c0fe9fa841543020b48ada9ade9e3 | [
"Apache-2.0"
] | null | null | null | pytests/dcp_new/dcp_tests.py | ashwin2002/TAF | 4223787a1f4c0fe9fa841543020b48ada9ade9e3 | [
"Apache-2.0"
] | null | null | null | from dcp_base import DCPBase
from dcp_new.constants import *
from dcp_bin_client import *
from mc_bin_client import MemcachedClient as McdClient
from memcached.helper.data_helper import MemcachedClientHelper
import unittest
from memcacheConstants import *
from threading import Thread
from remote.remote_util import Remo... | 35.314982 | 137 | 0.615758 |
5bbc522027a9313c2aebaca93b2997bb2338fa1c | 1,718 | py | Python | bdn/profiles/migrations/0006_auto_20181008_1201.py | OpenSourceUniversity/bdn | 8e8d5b4d63ff4cb9bdf7c5f23d07aa3ad3dd0121 | [
"MIT"
] | 1 | 2019-01-18T19:57:25.000Z | 2019-01-18T19:57:25.000Z | bdn/profiles/migrations/0006_auto_20181008_1201.py | OpenSourceUniversity/bdn | 8e8d5b4d63ff4cb9bdf7c5f23d07aa3ad3dd0121 | [
"MIT"
] | 3 | 2019-06-23T17:26:24.000Z | 2022-02-11T03:40:54.000Z | bdn/profiles/migrations/0006_auto_20181008_1201.py | OpenSourceUniversity/bdn | 8e8d5b4d63ff4cb9bdf7c5f23d07aa3ad3dd0121 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.2 on 2018-10-08 12:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0005_auto_20181008_1057'),
]
operations = [
migrations.AlterField(
model_name='profile',
name='academy_a... | 31.814815 | 75 | 0.576251 |
84c8df82e552b65a037ab2ac93499beb7d3f4ce6 | 17 | py | Python | tests/unit/test_modulegraph/testpkg-packages/pkg/__init__.py | hawkhai/pyinstaller | 016a24479b34de161792c72dde455a81ad4c78ae | [
"Apache-2.0"
] | 9,267 | 2015-01-01T04:08:45.000Z | 2022-03-31T11:42:38.000Z | tests/unit/test_modulegraph/testpkg-packages/pkg/__init__.py | jeremysanders/pyinstaller | 321b24f9a9a5978337735816b36ca6b4a90a2fb4 | [
"Apache-2.0"
] | 5,150 | 2015-01-01T12:09:56.000Z | 2022-03-31T18:06:12.000Z | tests/unit/test_modulegraph/testpkg-packages/pkg/__init__.py | jeremysanders/pyinstaller | 321b24f9a9a5978337735816b36ca6b4a90a2fb4 | [
"Apache-2.0"
] | 2,101 | 2015-01-03T10:25:27.000Z | 2022-03-30T11:04:42.000Z | """ pkg.init """
| 8.5 | 16 | 0.411765 |
cc60f1aced750e55205d9512c2f94b2d15a7d30e | 8,738 | py | Python | image_classification/MLP-Mixer/mlp_mixer.py | RangeKing/PaddleViT | 0e25958686e04ed8872cf67fba0dfd6918e9b4dd | [
"Apache-2.0"
] | null | null | null | image_classification/MLP-Mixer/mlp_mixer.py | RangeKing/PaddleViT | 0e25958686e04ed8872cf67fba0dfd6918e9b4dd | [
"Apache-2.0"
] | null | null | null | image_classification/MLP-Mixer/mlp_mixer.py | RangeKing/PaddleViT | 0e25958686e04ed8872cf67fba0dfd6918e9b4dd | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PPViT Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 34.812749 | 99 | 0.605058 |
22ae8d16f2a93cd40a7f7b9c282633584d05fcbc | 5,517 | py | Python | tests/eth2/beacon/state_machines/forks/test_serenity_block_attester_slashing_validation.py | mhchia/trinity | e40e475064ca4605887706e9b0e4f8e2349b10cd | [
"MIT"
] | 2 | 2020-01-30T21:51:00.000Z | 2020-07-22T14:51:05.000Z | tests/eth2/beacon/state_machines/forks/test_serenity_block_attester_slashing_validation.py | mhchia/trinity | e40e475064ca4605887706e9b0e4f8e2349b10cd | [
"MIT"
] | null | null | null | tests/eth2/beacon/state_machines/forks/test_serenity_block_attester_slashing_validation.py | mhchia/trinity | e40e475064ca4605887706e9b0e4f8e2349b10cd | [
"MIT"
] | null | null | null | import pytest
from eth_utils import (
ValidationError,
)
from eth2.beacon.helpers import (
is_double_vote,
is_surround_vote,
)
from eth2.beacon.state_machines.forks.serenity.block_validation import (
validate_attester_slashing,
validate_attester_slashing_different_data,
validate_attester_slash... | 25.541667 | 97 | 0.670654 |
b99a1db238904879d741eb039f6328e2b25e705c | 4,014 | py | Python | pyrasatest/tests/test_mock_db_session.py | paulosjd/pyrasatest | 452f14f521445142a5755c280e7e8082a11d2e27 | [
"MIT"
] | null | null | null | pyrasatest/tests/test_mock_db_session.py | paulosjd/pyrasatest | 452f14f521445142a5755c280e7e8082a11d2e27 | [
"MIT"
] | null | null | null | pyrasatest/tests/test_mock_db_session.py | paulosjd/pyrasatest | 452f14f521445142a5755c280e7e8082a11d2e27 | [
"MIT"
] | null | null | null | import unittest
from collections import namedtuple
from unittest.mock import patch
from sqlalchemy import Column, Integer
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.ext.declarative import as_declarative
from pyrasatest.mock_db_session import MockDbSession, PartialMockDbSession
from pyrasatest.mock_que... | 40.545455 | 80 | 0.706029 |
237c515a6e832e783cbde43c05ae53dc50d12f8c | 6,658 | py | Python | sims/SIM_mass_overflow/int_tests/TestOverflow31.py | nasa/gunns | 248323939a476abe5178538cd7a3512b5f42675c | [
"NASA-1.3"
] | 18 | 2020-01-23T12:14:09.000Z | 2022-02-27T22:11:35.000Z | sims/SIM_mass_overflow/int_tests/TestOverflow31.py | nasa/gunns | 248323939a476abe5178538cd7a3512b5f42675c | [
"NASA-1.3"
] | 39 | 2020-11-20T12:19:35.000Z | 2022-02-22T18:45:55.000Z | sims/SIM_mass_overflow/int_tests/TestOverflow31.py | nasa/gunns | 248323939a476abe5178538cd7a3512b5f42675c | [
"NASA-1.3"
] | 7 | 2020-02-10T19:25:43.000Z | 2022-03-16T01:10:00.000Z | # @copyright Copyright 2019 United States Government as represented by the Administrator of the
# National Aeronautics and Space Administration. All Rights Reserved. */
#
import socket
import datetime
from trick.unit_test import *
#==========================================================================... | 52.84127 | 177 | 0.641484 |
028f5306fb0fa0ca29fe51782841da6fc1658dc7 | 71 | py | Python | layers/modules/__init__.py | jeongjuns/yolactpose | 6faea1707731e4a4bfb019856d3667e70238cfc6 | [
"MIT"
] | 2 | 2021-08-19T12:50:48.000Z | 2021-08-20T00:19:00.000Z | layers/modules/__init__.py | jeongjuns/yolactpose | 6faea1707731e4a4bfb019856d3667e70238cfc6 | [
"MIT"
] | null | null | null | layers/modules/__init__.py | jeongjuns/yolactpose | 6faea1707731e4a4bfb019856d3667e70238cfc6 | [
"MIT"
] | null | null | null | from .multibox_loss import MultiBoxLoss
__all__ = ['MultiBoxLoss']
| 17.75 | 40 | 0.760563 |
d1d0d2f4ad92983631443a1be8956a4e8a28e55e | 1,730 | py | Python | Geometry/HGCalGeometry/test/python/testHGCalNeighbor_cfg.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 3 | 2018-08-24T19:10:26.000Z | 2019-02-19T11:45:32.000Z | Geometry/HGCalGeometry/test/python/testHGCalNeighbor_cfg.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 7 | 2016-07-17T02:34:54.000Z | 2019-08-13T07:58:37.000Z | Geometry/HGCalGeometry/test/python/testHGCalNeighbor_cfg.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 5 | 2018-08-21T16:37:52.000Z | 2020-01-09T13:33:17.000Z | import FWCore.ParameterSet.Config as cms
from Configuration.Eras.Era_Phase2C4_cff import Phase2C4
process = cms.Process("PROD",Phase2C4)
process.load("SimGeneral.HepPDTESSource.pdt_cfi")
process.load("Configuration.Geometry.GeometryExtended2023D28Reco_cff")
process.load('Configuration.StandardSequences.MagneticField_... | 37.608696 | 126 | 0.769364 |
c4b0eea79950f72f75142dacacd35f1764bf99c7 | 12,106 | py | Python | testing/test_session.py | tinkerlin/pytest | bed3918cbc800682681a26c163f4cb0868b3a612 | [
"MIT"
] | null | null | null | testing/test_session.py | tinkerlin/pytest | bed3918cbc800682681a26c163f4cb0868b3a612 | [
"MIT"
] | null | null | null | testing/test_session.py | tinkerlin/pytest | bed3918cbc800682681a26c163f4cb0868b3a612 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pytest
from _pytest.main import EXIT_NOTESTSCOLLECTED
class SessionTests(object):
def test_basic_testitem_events(self, testdir):
tfile = testdir.makepyfile(
... | 31.941953 | 92 | 0.564679 |
a9e192ee8871327ff845547f6696b5224bc52453 | 14,801 | py | Python | fastai/basic_data.py | flpeters/fastai | 54a9e3cf4fd0fa11fc2453a5389cc9263f6f0d77 | [
"Apache-2.0"
] | 4 | 2020-06-01T17:17:47.000Z | 2020-06-02T03:42:55.000Z | fastai/basic_data.py | flpeters/fastai | 54a9e3cf4fd0fa11fc2453a5389cc9263f6f0d77 | [
"Apache-2.0"
] | 2 | 2021-09-28T02:18:33.000Z | 2022-02-26T07:38:04.000Z | fastai/basic_data.py | flpeters/fastai | 54a9e3cf4fd0fa11fc2453a5389cc9263f6f0d77 | [
"Apache-2.0"
] | 1 | 2022-01-09T00:28:15.000Z | 2022-01-09T00:28:15.000Z | "`fastai.data` loads and manages datasets with `DataBunch`"
from .torch_core import *
from torch.utils.data.dataloader import default_collate
DatasetType = Enum('DatasetType', 'Train Valid Test Single Fix')
__all__ = ['DataBunch', 'DeviceDataLoader', 'DatasetType', 'load_data']
old_dl_init = torch.utils.data.DataLoad... | 52.116197 | 225 | 0.666374 |
143215e570306edc63ec06970b966d4768ef66be | 2,974 | py | Python | plugin/chailand.py | pasha00000/mbplugin | e919c7c899495ae7f4b04fc2568991bb717bed9a | [
"MIT"
] | null | null | null | plugin/chailand.py | pasha00000/mbplugin | e919c7c899495ae7f4b04fc2568991bb717bed9a | [
"MIT"
] | null | null | null | plugin/chailand.py | pasha00000/mbplugin | e919c7c899495ae7f4b04fc2568991bb717bed9a | [
"MIT"
] | null | null | null | # -*- coding: utf8 -*-
''' Автор ArtyLa '''
import browsercontroller
icon = '789c8d90dd4b53611cc75db36ded2d9b83d80b7412f71211dec4bca828b2a288a0022b2970b5c9e8562abaf33fe8aadca82eca20c2a13799292d7676f6727674b51d75ad2ccb98b3bb9aa35969876fcfd956196ccb2f7c38cf737ecfe79cdfef3978c2d1d8508a8360273455903450e502a947b4656a45... | 84.971429 | 1,148 | 0.801614 |
f2b040c1e643477f2f817536a9c5858b61ef4dc5 | 463 | py | Python | plotly/validators/histogram2dcontour/_reversescale.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 2 | 2020-03-24T11:41:14.000Z | 2021-01-14T07:59:43.000Z | plotly/validators/histogram2dcontour/_reversescale.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | null | null | null | plotly/validators/histogram2dcontour/_reversescale.py | faezs/plotly.py | 6009b5b9c746e5d2a2849ad255a4eb234b551ed7 | [
"MIT"
] | 4 | 2019-06-03T14:49:12.000Z | 2022-01-06T01:05:12.000Z | import _plotly_utils.basevalidators
class ReversescaleValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(
self,
plotly_name='reversescale',
parent_name='histogram2dcontour',
**kwargs
):
super(ReversescaleValidator, self).__init__(
plotly... | 24.368421 | 75 | 0.615551 |
e80d076e3197e8a5244efc497098a4d1363c61d7 | 326 | py | Python | democracy_club/apps/donations/urls.py | pmk01/Website | 1ae0fb4e1a0be0bf9597a0ab5dc49d9365cbe755 | [
"BSD-3-Clause"
] | null | null | null | democracy_club/apps/donations/urls.py | pmk01/Website | 1ae0fb4e1a0be0bf9597a0ab5dc49d9365cbe755 | [
"BSD-3-Clause"
] | null | null | null | democracy_club/apps/donations/urls.py | pmk01/Website | 1ae0fb4e1a0be0bf9597a0ab5dc49d9365cbe755 | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import url
from .views import DonateFormView, DonateThanksView, ProcessDonationView
urlpatterns = [
url(r'thanks', DonateThanksView.as_view(), name="donate_thanks"),
url(r'process', ProcessDonationView.as_view(), name="donate_process"),
url(r'', DonateFormView.as_view(), name="donate... | 32.6 | 74 | 0.742331 |
1fa533bc3d91ceda9d3326d19ca3f97e562d12b3 | 1,306 | py | Python | core/tests/conftest.py | LucasSRocha/CashBack_GB | 184f124bfcbd0c18472980a88bd95c0652a86e2f | [
"MIT"
] | null | null | null | core/tests/conftest.py | LucasSRocha/CashBack_GB | 184f124bfcbd0c18472980a88bd95c0652a86e2f | [
"MIT"
] | 1 | 2020-06-30T07:44:53.000Z | 2020-06-30T07:44:53.000Z | core/tests/conftest.py | LucasSRocha/CashBack_GB | 184f124bfcbd0c18472980a88bd95c0652a86e2f | [
"MIT"
] | null | null | null | from datetime import date
from decimal import Decimal
import pytest
from core.models import PreApprovedSales, RegisteredSale
from core.serializers import (PreApprovedSalesSerializer,
RegisteredSaleSerializer)
@pytest.fixture
def cpf():
return "12345678909"
@pytest.fixture
def inv... | 17.890411 | 67 | 0.73124 |
cd243be65f41d27ee7da5e87d6b84536e3c9b5a5 | 386 | py | Python | tests/test.simulation.py | XCaellaX/osim-rl | 6ec6f2c7e98ab510f8b37db4fb573ade69d13c0b | [
"MIT"
] | 867 | 2017-01-21T20:53:36.000Z | 2022-03-20T09:47:08.000Z | tests/test.simulation.py | XCaellaX/osim-rl | 6ec6f2c7e98ab510f8b37db4fb573ade69d13c0b | [
"MIT"
] | 197 | 2017-01-22T21:27:36.000Z | 2022-01-10T16:18:35.000Z | tests/test.simulation.py | XCaellaX/osim-rl | 6ec6f2c7e98ab510f8b37db4fb573ade69d13c0b | [
"MIT"
] | 277 | 2017-02-01T18:42:18.000Z | 2022-03-23T11:30:31.000Z | from osim.env import L2RunEnv
import numpy as np
import unittest
class SimulationTest(unittest.TestCase):
def test1(self):
env = L2RunEnv(visualize=False)
observation = env.reset()
action = env.action_space.sample()
action[5] = np.NaN
self.assertRaises(ValueError, ... | 22.705882 | 55 | 0.65544 |
3bccacedb480b3cd191f691349460c5f3be472ee | 1,650 | py | Python | experiments/test_userBushRouteFinder.py | salomonw/mixed-traffic-amod-route-rebalance | 7f1edeb195a7bfab835e596ad84deead2957943e | [
"MIT"
] | 1 | 2022-03-07T16:15:56.000Z | 2022-03-07T16:15:56.000Z | experiments/test_userBushRouteFinder.py | salomonw/mixed-traffic-amod-route-rebalance | 7f1edeb195a7bfab835e596ad84deead2957943e | [
"MIT"
] | null | null | null | experiments/test_userBushRouteFinder.py | salomonw/mixed-traffic-amod-route-rebalance | 7f1edeb195a7bfab835e596ad84deead2957943e | [
"MIT"
] | null | null | null | import src.tnet as tnet
import src.CARS as cars
import src.routeFinder as routeFinder
#netFile, gFile, fcoeffs, tstamp, dir_out = tnet.get_network_parameters('EMA', experiment_name='EMA_penRate_comparison-'+'REB')
#netFile, gFile, fcoeffs, tstamp, dir_out = tnet.get_network_parameters('NYC_Uber_small_1', experiment_na... | 55 | 150 | 0.735758 |
acd4f4740b2daae305cf24d0e7bd950c703b9e20 | 38,401 | py | Python | python/tvm/relay/op/contrib/tensorrt.py | hsaputra/tvm | 91c905d541ca9e6021e42d7e97a27f06592f11bd | [
"Apache-2.0"
] | 1 | 2020-12-09T09:02:29.000Z | 2020-12-09T09:02:29.000Z | python/tvm/relay/op/contrib/tensorrt.py | hsaputra/tvm | 91c905d541ca9e6021e42d7e97a27f06592f11bd | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/op/contrib/tensorrt.py | hsaputra/tvm | 91c905d541ca9e6021e42d7e97a27f06592f11bd | [
"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 not u... | 38.906788 | 100 | 0.652066 |
453a74ec587bb6d73a72d2e52460d73cc2a803c4 | 1,169 | py | Python | externals/skia/infra/bots/recipes/swarm_skpbench.py | terrajobst/linux-packaging-skiasharp | 47dbb2ff9ae01305b190f409ccea00b3b4f0bc79 | [
"MIT"
] | 1 | 2019-10-29T14:36:32.000Z | 2019-10-29T14:36:32.000Z | externals/skia/infra/bots/recipes/swarm_skpbench.py | terrajobst/linux-packaging-skiasharp | 47dbb2ff9ae01305b190f409ccea00b3b4f0bc79 | [
"MIT"
] | 1 | 2017-06-18T00:25:03.000Z | 2017-11-29T16:01:48.000Z | externals/skia/infra/bots/recipes/swarm_skpbench.py | terrajobst/linux-packaging-skiasharp | 47dbb2ff9ae01305b190f409ccea00b3b4f0bc79 | [
"MIT"
] | 5 | 2017-11-30T06:06:50.000Z | 2022-03-31T21:48:49.000Z | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Recipe module for Skia Swarming skpbench.
DEPS = [
'recipe_engine/path',
'recipe_engine/properties',
'recipe_engine/raw_io',
'skia-recipes/skpbe... | 27.833333 | 79 | 0.594525 |
94b1b46ec42fc7081b4dd452bde74187822cb030 | 400 | py | Python | scripts/subs/generate_key.py | consag/build-and-deploy-informatica | d7caaf5374f4e179cc0fc0a507d3e5da4b00c610 | [
"MIT"
] | 4 | 2019-08-20T11:50:21.000Z | 2020-07-26T18:26:00.000Z | scripts/subs/generate_key.py | consag/build-and-deploy-informatica | d7caaf5374f4e179cc0fc0a507d3e5da4b00c610 | [
"MIT"
] | 1 | 2019-07-05T21:08:55.000Z | 2019-07-05T21:08:55.000Z | scripts/subs/generate_key.py | consag/build-and-deploy-informatica | d7caaf5374f4e179cc0fc0a507d3e5da4b00c610 | [
"MIT"
] | 3 | 2019-11-20T00:29:02.000Z | 2020-12-09T15:05:03.000Z | from Crypto.PublicKey import RSA
secret_code = "Unguessable"
key = RSA.generate(2048)
encrypted_key = key.export_key(passphrase=secret_code, pkcs=8,
protection="scryptAndAES128-CBC")
file_out = open("rsa_key.bin", "wb")
file_out.write(encrypted_key)
file_out.close()
file_out = open("rsa... | 25 | 63 | 0.7075 |
8eb915f91f63077e86dbcc674db30f6e17ab26ae | 9,106 | py | Python | urlscan/komand_urlscan/actions/search/schema.py | emartin-merrill-r7/insightconnect-plugins | a589745dbcc9f01d3e601431e77ab7221a84c117 | [
"MIT"
] | 1 | 2020-03-18T09:14:55.000Z | 2020-03-18T09:14:55.000Z | urlscan/komand_urlscan/actions/search/schema.py | OSSSP/insightconnect-plugins | 846758dab745170cf1a8c146211a8bea9592e8ff | [
"MIT"
] | null | null | null | urlscan/komand_urlscan/actions/search/schema.py | OSSSP/insightconnect-plugins | 846758dab745170cf1a8c146211a8bea9592e8ff | [
"MIT"
] | null | null | null | # GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Component:
DESCRIPTION = "Search urlscan.io"
class Input:
OFFSET = "offset"
Q = "q"
SIZE = "size"
SORT = "sort"
class Output:
RESULTS = "results"
TOTAL = "total"
class SearchInput(komand.Input):
schem... | 23.170483 | 110 | 0.364265 |
db34b0f5abffd641382423c8a57c6edce28fa25a | 3,885 | py | Python | src/tc_perf_event.py | ZirakZaheer/ZeroTrust-Ebpf | b0f1968e5c9fa307a84b62a76f02847845a458db | [
"Apache-2.0"
] | 2 | 2018-11-17T08:16:47.000Z | 2022-01-21T16:45:46.000Z | src/tc_perf_event.py | ZirakZaheer/ZeroTrust-Ebpf | b0f1968e5c9fa307a84b62a76f02847845a458db | [
"Apache-2.0"
] | null | null | null | src/tc_perf_event.py | ZirakZaheer/ZeroTrust-Ebpf | b0f1968e5c9fa307a84b62a76f02847845a458db | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# tc_perf_event.py Output skb and meta data through perf event
#
# Copyright (c) 2016-present, Facebook, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
from bcc import BPF
import ctypes as ct
import pyroute2
from socket import *
from pytap2 import *
import os
from fcntl ... | 28.357664 | 120 | 0.663835 |
bda7b0992b227513686b501ba7a7908157be590e | 2,338 | py | Python | model.py | pk9403/DCC | b865ff083bde4e21ed13b73159bd0ac375e6e44e | [
"MIT"
] | null | null | null | model.py | pk9403/DCC | b865ff083bde4e21ed13b73159bd0ac375e6e44e | [
"MIT"
] | null | null | null | model.py | pk9403/DCC | b865ff083bde4e21ed13b73159bd0ac375e6e44e | [
"MIT"
] | null | null | null | import tensorflow as tf
def create_model(input_shape, num_class):
model = tf.keras.models.Sequential()
model.add(tf.keras.layers.Conv2D(64,(3,3), padding='same', input_shape=input_shape))
model.add(tf.keras.layers.BatchNormalization())
model.add(tf.keras.layers.Activation('relu'))
model.add(tf.ker... | 44.961538 | 89 | 0.69846 |
a6ddecb7daa3e89ae6fda68001e07e8a00894279 | 9,672 | py | Python | experimentToRecord/evaluate_originalConvKB_type13.py | Ancientshi/convKB-KerasVersion | 54d674e8d74f10f2c3a425f7ac5bfae21c68224d | [
"Apache-2.0"
] | 1 | 2021-01-01T10:26:18.000Z | 2021-01-01T10:26:18.000Z | experimentToRecord/evaluate_originalConvKB_type13.py | Ancientshi/convKB-kerasVersion | 54d674e8d74f10f2c3a425f7ac5bfae21c68224d | [
"Apache-2.0"
] | null | null | null | experimentToRecord/evaluate_originalConvKB_type13.py | Ancientshi/convKB-kerasVersion | 54d674e8d74f10f2c3a425f7ac5bfae21c68224d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : evaluate_transE_type13.py
@Contact : Ancientshi@gmail.com
@Modify Time @Author @Version
------------ ------- --------
2020/12/12 3:49 下午 Ferdinand 1.0
@Desciption
----------------
----------------
'''
#!/usr/b... | 35.822222 | 118 | 0.514578 |
7fab9bcc6f764d25a21895e688edf47c54ea59fa | 9,216 | py | Python | py/desispec/test/test_bootcalib.py | Srheft/desispec | f7adfd70e245cfe861b1e6eb781d1216017bed28 | [
"BSD-3-Clause"
] | 24 | 2015-09-29T06:06:29.000Z | 2022-01-14T07:31:45.000Z | py/desispec/test/test_bootcalib.py | Srheft/desispec | f7adfd70e245cfe861b1e6eb781d1216017bed28 | [
"BSD-3-Clause"
] | 1,452 | 2015-02-26T00:14:23.000Z | 2022-03-31T23:35:10.000Z | py/desispec/test/test_bootcalib.py | Srheft/desispec | f7adfd70e245cfe861b1e6eb781d1216017bed28 | [
"BSD-3-Clause"
] | 25 | 2015-02-06T21:39:13.000Z | 2022-02-22T14:16:31.000Z | """
tests bootcalib code
"""
import unittest
from uuid import uuid1
import os
import sys
import numpy as np
import glob
import locale
import requests
from astropy.io import fits
from desispec import bootcalib as desiboot
from desiutil import funcfits as dufits
from desispec.scripts import bootcalib as bootscript
PY... | 37.463415 | 100 | 0.57997 |
ac2e009676b3bdd59d329e4a96127a9a84cff6cd | 3,419 | py | Python | sphinx/ext/imgconverter.py | Symaxion/sphinx | f4f7936b5c3671153c2646387c8258b1c4e25e3c | [
"BSD-2-Clause"
] | 1 | 2019-09-02T00:37:29.000Z | 2019-09-02T00:37:29.000Z | sphinx/ext/imgconverter.py | Symaxion/sphinx | f4f7936b5c3671153c2646387c8258b1c4e25e3c | [
"BSD-2-Clause"
] | null | null | null | sphinx/ext/imgconverter.py | Symaxion/sphinx | f4f7936b5c3671153c2646387c8258b1c4e25e3c | [
"BSD-2-Clause"
] | 1 | 2019-09-02T00:41:05.000Z | 2019-09-02T00:41:05.000Z | """
sphinx.ext.imgconverter
~~~~~~~~~~~~~~~~~~~~~~~
Image converter extension for Sphinx
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import locale
import subprocess
from sphinx.errors import ExtensionError
from sphinx.locale import ... | 32.875 | 86 | 0.561568 |
b8fd751b5da5e6a0b73c60e80c40d2163115d1ad | 4,007 | py | Python | notebooks/3 Switching Linear Dynamical System.py | ahwillia/ssm | ea6f3b33eefbb8e6bcb1a05a8e142bb8af84e41b | [
"MIT"
] | null | null | null | notebooks/3 Switching Linear Dynamical System.py | ahwillia/ssm | ea6f3b33eefbb8e6bcb1a05a8e142bb8af84e41b | [
"MIT"
] | null | null | null | notebooks/3 Switching Linear Dynamical System.py | ahwillia/ssm | ea6f3b33eefbb8e6bcb1a05a8e142bb8af84e41b | [
"MIT"
] | 1 | 2021-03-08T14:49:33.000Z | 2021-03-08T14:49:33.000Z |
# coding: utf-8
# In[1]:
import autograd.numpy as np
import autograd.numpy.random as npr
npr.seed(0)
import matplotlib.pyplot as plt
get_ipython().run_line_magic('matplotlib', 'inline')
import seaborn as sns
sns.set_style("white")
sns.set_context("talk")
color_names = ["windows blue",
"red",
... | 24.888199 | 97 | 0.659097 |
d8a1dac00dd74400d4e4f398ab90138ca0c55479 | 19,067 | py | Python | gui/widgets.py | sharksmhi/SHARKtools | 3b11743568d50848f4f28ee2fc53f8e170799eb5 | [
"MIT"
] | null | null | null | gui/widgets.py | sharksmhi/SHARKtools | 3b11743568d50848f4f28ee2fc53f8e170799eb5 | [
"MIT"
] | null | null | null | gui/widgets.py | sharksmhi/SHARKtools | 3b11743568d50848f4f28ee2fc53f8e170799eb5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
#
# Copyright (c) 2013-2014 SMHI, Swedish Meteorological and Hydrological Institute
# License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit).
import matplotlib as mpl
import tkinter as tk
from tkinter import ttk
from tkinter import messagebox
import... | 39.151951 | 172 | 0.529134 |
a1f41c0fdd8cd5ba5c02fa49ca98b6ada8836047 | 4,349 | py | Python | contrib/seeds/generate-seeds.py | gautes/TrollCoinCore | 21392fb66e6abf50d48598827dbbf15a129e51b1 | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | gautes/TrollCoinCore | 21392fb66e6abf50d48598827dbbf15a129e51b1 | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | gautes/TrollCoinCore | 21392fb66e6abf50d48598827dbbf15a129e51b1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the dir... | 31.28777 | 98 | 0.580363 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.