hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e6edb34e4b9936953cdd1f4cc012f2bb515d8363 | 1,117 | py | Python | billy/importers/metadata.py | paultag/billy | 70f4c55d760552829a86b30baa6d6eac3f6dc47f | [
"BSD-3-Clause"
] | null | null | null | billy/importers/metadata.py | paultag/billy | 70f4c55d760552829a86b30baa6d6eac3f6dc47f | [
"BSD-3-Clause"
] | null | null | null | billy/importers/metadata.py | paultag/billy | 70f4c55d760552829a86b30baa6d6eac3f6dc47f | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import datetime
import importlib
from billy.core import db
PRESERVED_FIELDS = ('latest_json_url', 'latest_json_date',
'latest_csv_url', 'latest_csv_date')
def import_metadata(abbr):
preserved = {}
old_metadata = db.metadata.find_one({'_id': abbr}) or {}
for fiel... | 30.189189 | 78 | 0.644584 |
44e3e23a653db8efa1013dd18d9932be58c27888 | 506 | py | Python | mysite/comment/migrations/0002_auto_20180824_1532.py | SuperWenFirst/Django-Course | 8cc6cabe7789117f37e009db842b8f8e41d8e5a5 | [
"CNRI-Python"
] | 35 | 2019-03-28T13:57:01.000Z | 2022-03-18T11:29:53.000Z | mysite/comment/migrations/0002_auto_20180824_1532.py | SuperWenFirst/Django-Course | 8cc6cabe7789117f37e009db842b8f8e41d8e5a5 | [
"CNRI-Python"
] | null | null | null | mysite/comment/migrations/0002_auto_20180824_1532.py | SuperWenFirst/Django-Course | 8cc6cabe7789117f37e009db842b8f8e41d8e5a5 | [
"CNRI-Python"
] | 18 | 2019-04-10T06:50:46.000Z | 2022-03-18T11:30:07.000Z | # Generated by Django 2.0.5 on 2018-08-24 07:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('comment', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='comment',
options={'ordering': ['-co... | 22 | 52 | 0.565217 |
e373497f5be0d3e0307ef679df6f121e4eb06a6b | 642 | py | Python | haas_lib_bundles/python/libraries/servo/servo.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/libraries/servo/servo.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | haas_lib_bundles/python/libraries/servo/servo.py | wstong999/AliOS-Things | 6554769cb5b797e28a30a4aa89b3f4cb2ef2f5d9 | [
"Apache-2.0"
] | null | null | null | """
HaaSPython PWM driver for servo
"""
from driver import PWM
class SERVO(object):
def __init__(self, pwmObj):
self.pwmObj = None
if not isinstance(pwmObj, PWM):
raise ValueError("parameter is not an PWM object")
self.pwmObj = pwmObj
def setOptionSero(self,data):
... | 22.928571 | 71 | 0.602804 |
7ad959726c43fc81d4c889254bc4e93f7c09c5b7 | 4,581 | py | Python | third_party/wrappers/sal_wrapper/ut_sal.py | ITh4cker/auto_tools | 8e0e00cdf8bf60ee3f26fa5ae8f18c376298d0aa | [
"Apache-2.0"
] | null | null | null | third_party/wrappers/sal_wrapper/ut_sal.py | ITh4cker/auto_tools | 8e0e00cdf8bf60ee3f26fa5ae8f18c376298d0aa | [
"Apache-2.0"
] | null | null | null | third_party/wrappers/sal_wrapper/ut_sal.py | ITh4cker/auto_tools | 8e0e00cdf8bf60ee3f26fa5ae8f18c376298d0aa | [
"Apache-2.0"
] | 1 | 2021-06-16T07:32:17.000Z | 2021-06-16T07:32:17.000Z | import sys,os
import unittest
from sa import *
from sa_sal_api import *
SAL_ENGINE_FILE = './ut_data/lib/libtmsa.so'
SAL_CONFIG_FILE = './ut_data/ptn/tmsa.cfg'
SAL_LOG_FILE = './ut_data/tmsa.log'
URL = 'http://www.abcxEsoxikdaxcis.com'
scanner = SALScanner(SAL_CONFIG_FILE, SAL_LOG_FILE)
def sample... | 36.648 | 84 | 0.602925 |
8e09e31232efa1037b1f76d7718e8c3152742fef | 173 | py | Python | src/platform/weblogic/fingerprints/WL11.py | 0x27/clusterd | 0f04a4955c61aa523274e9ae35d750f4339b1e59 | [
"MIT"
] | 539 | 2015-01-08T23:59:32.000Z | 2022-03-29T17:53:02.000Z | src/platform/weblogic/fingerprints/WL11.py | M31MOTH/clusterd | d190b2cbaa93820e928a7ce5471c661d4559fb7c | [
"MIT"
] | 21 | 2015-01-17T21:51:21.000Z | 2019-09-20T09:23:18.000Z | src/platform/weblogic/fingerprints/WL11.py | M31MOTH/clusterd | d190b2cbaa93820e928a7ce5471c661d4559fb7c | [
"MIT"
] | 192 | 2015-01-26T20:44:14.000Z | 2021-12-22T01:39:50.000Z | from src.platform.weblogic.interfaces import WLConsole
class FPrint(WLConsole):
def __init__(self):
super(FPrint, self).__init__()
self.version = "11"
| 21.625 | 54 | 0.687861 |
b73ba8d8419bbabfe1e4d29a255b3fbe909c33f0 | 4,082 | py | Python | test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/_auto_rest_http_infrastructure_test_service.py | tasherif-msft/autorest.python | 5b0121bcfa802aedaeda36990e8bcaa2b7e26b14 | [
"MIT"
] | null | null | null | test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/_auto_rest_http_infrastructure_test_service.py | tasherif-msft/autorest.python | 5b0121bcfa802aedaeda36990e8bcaa2b7e26b14 | [
"MIT"
] | null | null | null | test/vanilla/Expected/AcceptanceTests/Http/httpinfrastructure/aio/_auto_rest_http_infrastructure_test_service.py | tasherif-msft/autorest.python | 5b0121bcfa802aedaeda36990e8bcaa2b7e26b14 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.595238 | 95 | 0.740078 |
30685c639f7cc6e520eaa86ae20b8ba0e61d4a9b | 515 | py | Python | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/website_crm/__manifest__.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | 1 | 2019-12-19T01:53:13.000Z | 2019-12-19T01:53:13.000Z | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/website_crm/__manifest__.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/website_crm/__manifest__.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | {
'name': 'Contact Form',
'category': 'Website',
'website': 'https://www.odoo.com/page/website-builder',
'summary': 'Create Leads From Contact Form',
'version': '2.0',
'description': """
Odoo Contact Form
====================
""",
'depends': ['website_form', 'website_partner', 'crm'... | 24.52381 | 59 | 0.545631 |
629c283dcd2b4afa6aac41ac1729afe70c17590c | 601 | py | Python | tests/test_local_recall.py | aliabd/GEM-metrics | 4f5b389c447bcbecb5a407df93ec8c8ace1e9ce8 | [
"MIT"
] | 1 | 2021-04-18T22:09:34.000Z | 2021-04-18T22:09:34.000Z | tests/test_local_recall.py | maybay21/GEM-metrics | 2693f3439547a40897bc30c2ab70e27e992883c0 | [
"MIT"
] | null | null | null | tests/test_local_recall.py | maybay21/GEM-metrics | 2693f3439547a40897bc30c2ab70e27e992883c0 | [
"MIT"
] | 1 | 2021-04-07T17:54:57.000Z | 2021-04-07T17:54:57.000Z | import unittest
import gem_metrics
from tests.test_referenced import TestReferencedMetric
class TestLocalRecall(TestReferencedMetric, unittest.TestCase):
def setUp(self):
super().setUp()
self.metric = gem_metrics.local_recall.LocalRecall()
self.true_results_basic = {'local_recall': {1: 0.6... | 35.352941 | 75 | 0.712146 |
1848bbfa0ace969e34f3c4941bf90468f8a82c24 | 5,468 | py | Python | tests/testhelper.py | pl77/sabnzbd | 7e87a0c759944966ce7318134d8ed89b569ae73f | [
"0BSD",
"PSF-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null | tests/testhelper.py | pl77/sabnzbd | 7e87a0c759944966ce7318134d8ed89b569ae73f | [
"0BSD",
"PSF-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null | tests/testhelper.py | pl77/sabnzbd | 7e87a0c759944966ce7318134d8ed89b569ae73f | [
"0BSD",
"PSF-2.0",
"BSD-2-Clause",
"MIT",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3 -OO
# Copyright 2007-2019 The SABnzbd-Team <team@sabnzbd.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any late... | 33.546012 | 110 | 0.662765 |
21be45fb11826b55a18561d81b70bcb04cb740b9 | 9,975 | py | Python | tests/backends/sqlite/tests.py | imjvdn/scratch-game-1 | 5dffd79f17e0b66d3d2e57262749311aca28e850 | [
"PSF-2.0",
"BSD-3-Clause"
] | 13 | 2015-04-17T02:12:15.000Z | 2021-12-08T19:45:36.000Z | tests/backends/sqlite/tests.py | imjvdn/scratch-game-1 | 5dffd79f17e0b66d3d2e57262749311aca28e850 | [
"PSF-2.0",
"BSD-3-Clause"
] | 10 | 2016-05-19T21:54:42.000Z | 2019-08-09T15:59:50.000Z | tests/backends/sqlite/tests.py | imjvdn/scratch-game-1 | 5dffd79f17e0b66d3d2e57262749311aca28e850 | [
"PSF-2.0",
"BSD-3-Clause"
] | 11 | 2019-09-14T20:57:30.000Z | 2022-01-19T17:59:26.000Z | import re
import threading
import unittest
from sqlite3 import dbapi2
from unittest import mock
from django.core.exceptions import ImproperlyConfigured
from django.db import connection, transaction
from django.db.models import Avg, StdDev, Sum, Variance
from django.db.models.aggregates import Aggregate
from django.db.... | 41.049383 | 105 | 0.649724 |
898776d2c6d530043dec0a43ca203dd726805c07 | 449 | py | Python | alipay/aop/api/response/AlipayEcoEprintPrinterDeleteResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/response/AlipayEcoEprintPrinterDeleteResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/response/AlipayEcoEprintPrinterDeleteResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayEcoEprintPrinterDeleteResponse(AlipayResponse):
def __init__(self):
super(AlipayEcoEprintPrinterDeleteResponse, self).__init__()
def parse_response_content(self, ... | 28.0625 | 109 | 0.783964 |
aff50b0b3b5e8ab66d00220c6daa7c88157bcba2 | 2,569 | py | Python | repo_health/utils.py | ifinanceCanada/edx-repo-health | 4fb9944e084cbaaf171de6b30a98ddf2946a02e5 | [
"Apache-2.0"
] | null | null | null | repo_health/utils.py | ifinanceCanada/edx-repo-health | 4fb9944e084cbaaf171de6b30a98ddf2946a02e5 | [
"Apache-2.0"
] | null | null | null | repo_health/utils.py | ifinanceCanada/edx-repo-health | 4fb9944e084cbaaf171de6b30a98ddf2946a02e5 | [
"Apache-2.0"
] | null | null | null | """
Utility Functions
"""
import functools
import operator
import os
from datetime import datetime
GITHUB_DATETIME_FMT = "%Y-%m-%dT%H:%M:%SZ"
def file_exists(repo_path, file_name):
full_path = os.path.join(repo_path, file_name)
return os.path.isfile(full_path)
def dir_exists(repo_path, dir_name):
full_... | 35.191781 | 107 | 0.666018 |
614eba023b0fc45b797f15e50c09508be014173a | 398 | py | Python | Leetcode/0035. Search Insert Position.py | luckyrabbit85/Python | ed134fd70b4a7b84b183b87b85ad5190f54c9526 | [
"MIT"
] | 1 | 2021-07-15T18:40:26.000Z | 2021-07-15T18:40:26.000Z | Leetcode/0035. Search Insert Position.py | luckyrabbit85/Python | ed134fd70b4a7b84b183b87b85ad5190f54c9526 | [
"MIT"
] | null | null | null | Leetcode/0035. Search Insert Position.py | luckyrabbit85/Python | ed134fd70b4a7b84b183b87b85ad5190f54c9526 | [
"MIT"
] | null | null | null | class Solution:
def searchInsert(self, nums: list[int], target: int) -> int:
left, right = 0, len(nums) - 1
while left <= right:
pivot = (left + right) // 2
if nums[pivot] == target:
return pivot
if target < nums[pivot]:
right = piv... | 30.615385 | 64 | 0.457286 |
2813765a817b9595dd81afb4e61d65c13e1bff4a | 5,796 | py | Python | tb_rest_client/models/models_pe/page_data_short_entity_view.py | maksonlee/python_tb_rest_client | a6cd17ef4de31f68c3226b7a9835292fbac4b1fa | [
"Apache-2.0"
] | 1 | 2021-07-19T10:09:04.000Z | 2021-07-19T10:09:04.000Z | tb_rest_client/models/models_pe/page_data_short_entity_view.py | moravcik94/python_tb_rest_client | 985361890cdf4ccce93d2b24905ad9003c8dfcaa | [
"Apache-2.0"
] | null | null | null | tb_rest_client/models/models_pe/page_data_short_entity_view.py | moravcik94/python_tb_rest_client | 985361890cdf4ccce93d2b24905ad9003c8dfcaa | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# Copyright 2020. ThingsBoard
# #
# 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
# #
# Unl... | 29.723077 | 102 | 0.597826 |
61d08f3f03dd848d1e16801cb2b8d409398166ba | 5,410 | py | Python | src/metarl/tf/algos/erwr.py | neurips2020submission11699/metarl | ae4825d21478fa1fd0aa6b116941ea40caa152a5 | [
"MIT"
] | 2 | 2021-02-07T12:14:52.000Z | 2021-07-29T08:07:22.000Z | src/metarl/tf/algos/erwr.py | neurips2020submission11699/metarl | ae4825d21478fa1fd0aa6b116941ea40caa152a5 | [
"MIT"
] | null | null | null | src/metarl/tf/algos/erwr.py | neurips2020submission11699/metarl | ae4825d21478fa1fd0aa6b116941ea40caa152a5 | [
"MIT"
] | null | null | null | """Episodic Reward Weighted Regression."""
from metarl.tf.algos.vpg import VPG
from metarl.tf.optimizers import LbfgsOptimizer
class ERWR(VPG):
"""Episodic Reward Weighted Regression [1].
Note:
This does not implement the original RwR [2]_ that deals with
"immediate reward problems" since it ... | 47.043478 | 78 | 0.590943 |
02613aaf7a1a94e5a2996158ddc8316f7d3e5934 | 13,270 | py | Python | adaptive_binning_chisquared_2sam/chi2_adaptive_binning.py | weissercn/adaptive_binning_chisquared_2sam | f4684e70af94add187263522fa784bf02b096051 | [
"MIT"
] | null | null | null | adaptive_binning_chisquared_2sam/chi2_adaptive_binning.py | weissercn/adaptive_binning_chisquared_2sam | f4684e70af94add187263522fa784bf02b096051 | [
"MIT"
] | null | null | null | adaptive_binning_chisquared_2sam/chi2_adaptive_binning.py | weissercn/adaptive_binning_chisquared_2sam | f4684e70af94add187263522fa784bf02b096051 | [
"MIT"
] | null | null | null | from __future__ import print_function
import sys
import chi2_plots
import random
import ast
import pickle
"""
This script can be used to get the p value for the Miranda method (=chi squared). It takes input files with column vectors corresponding to
features and lables.
"""
print(__doc__)
import sys
#sys.path.inse... | 43.366013 | 426 | 0.705275 |
4f4ca7e0bf36ed6c13de1ad3ccd4a51a9751acab | 10,153 | py | Python | example.streambook.py | Davidnet/treex-1 | 40a0c498c7e50afa917316bf9b4d55138c58378e | [
"MIT"
] | null | null | null | example.streambook.py | Davidnet/treex-1 | 40a0c498c7e50afa917316bf9b4d55138c58378e | [
"MIT"
] | null | null | null | example.streambook.py | Davidnet/treex-1 | 40a0c498c7e50afa917316bf9b4d55138c58378e | [
"MIT"
] | null | null | null |
import streamlit as __st
import streambook
__toc = streambook.TOCSidebar()
__toc._add(streambook.H1('Treex'))
__toc._add(streambook.H3('Initialization'))
__toc._add(streambook.H3('Modules are Pytrees'))
__toc._add(streambook.H3('Modules can be sliced'))
__toc._add(streambook.H3('Modules can be merged'))
__toc._add(str... | 41.272358 | 392 | 0.681079 |
8462c9c3dd960d9eac4a801b7fd6555293d5c345 | 6,217 | py | Python | kuveytturk/api.py | iuysal/kuveytturk | e726b933d7a957197902b410d60591967147a7b0 | [
"MIT"
] | 4 | 2019-05-06T10:58:47.000Z | 2020-07-10T12:28:49.000Z | kuveytturk/api.py | iuysal/kuveytturk | e726b933d7a957197902b410d60591967147a7b0 | [
"MIT"
] | null | null | null | kuveytturk/api.py | iuysal/kuveytturk | e726b933d7a957197902b410d60591967147a7b0 | [
"MIT"
] | null | null | null | from kuveytturk.binder import bind_api
from kuveytturk.parsers import JSONParser
def prepare_params(*args, **kwargs):
"""Converts both positional and named arguments into a dict."""
if not kwargs:
kwargs = {}
for arg in args:
# if the positional argument is a dictionary, then put its item... | 35.936416 | 120 | 0.557021 |
3891c554d7633437ec078fab89148b88011395b0 | 800 | py | Python | app/app.py | shujams/Web-Scraping-Challenge | 0883db0aada1dca77b3df3e275c559433ca48a62 | [
"MIT"
] | null | null | null | app/app.py | shujams/Web-Scraping-Challenge | 0883db0aada1dca77b3df3e275c559433ca48a62 | [
"MIT"
] | null | null | null | app/app.py | shujams/Web-Scraping-Challenge | 0883db0aada1dca77b3df3e275c559433ca48a62 | [
"MIT"
] | null | null | null | from flask import Flask, render_template
from flask_pymongo import PyMongo
import scrape_mars
import pymongo
app = Flask(__name__)
# Use flask pymongo to set up mongo connection
app.config["MONGO_URI"] = "mongodb://localhost:27017/mars_app"
mongo = PyMongo(app)
# conn = "mongodb://localhost:27017"
# client = pymongo... | 22.222222 | 62 | 0.70625 |
b6d0d1f6ed4dc6df353285336f6efd40fe3bb6f9 | 13,453 | py | Python | e2e_tests/tests/experiment/test_noop.py | coreystatendet/determined | abe5f3d0f64f7b05422507731d800621cf0ace8e | [
"Apache-2.0"
] | null | null | null | e2e_tests/tests/experiment/test_noop.py | coreystatendet/determined | abe5f3d0f64f7b05422507731d800621cf0ace8e | [
"Apache-2.0"
] | null | null | null | e2e_tests/tests/experiment/test_noop.py | coreystatendet/determined | abe5f3d0f64f7b05422507731d800621cf0ace8e | [
"Apache-2.0"
] | null | null | null | import copy
import os
import shutil
import tempfile
import time
from typing import Union
import pytest
from determined.common import check, yaml
from determined.common.api import bindings
from tests import config as conf
from tests import experiment as exp
@pytest.mark.e2e_cpu
def test_noop_long_train_step() -> Non... | 35.309711 | 100 | 0.707129 |
8a2dbef455db7314911f92d9224ff651d6ad6773 | 3,028 | py | Python | src/scripts/swagger_client/models/inline_response200.py | shipyardbuild/circleci-orb | 5cc1393aac44ff62b95db5ec725702d8a7dbb216 | [
"MIT"
] | null | null | null | src/scripts/swagger_client/models/inline_response200.py | shipyardbuild/circleci-orb | 5cc1393aac44ff62b95db5ec725702d8a7dbb216 | [
"MIT"
] | 4 | 2021-09-01T21:15:02.000Z | 2022-01-04T18:37:48.000Z | src/scripts/swagger_client/models/inline_response200.py | shipyardbuild/circleci-orb | 5cc1393aac44ff62b95db5ec725702d8a7dbb216 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Shipyard API
The official OpenAPI spec for the Shipyard API. # noqa: E501
OpenAPI spec version: 0.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class InlineResponse200(object):
"""NOTE: This cla... | 27.279279 | 80 | 0.548877 |
347b02095963564e862d9acd9080cb64ed1dcbac | 1,414 | py | Python | mc/inventory.py | r58Playz/Minecraft | d7a7b3169f12ff9c3014a51474b2875a65458a8e | [
"MIT"
] | 1 | 2020-01-08T15:20:29.000Z | 2020-01-08T15:20:29.000Z | mc/inventory.py | r58Playz/Minecraft | d7a7b3169f12ff9c3014a51474b2875a65458a8e | [
"MIT"
] | 1 | 2020-06-17T23:16:18.000Z | 2020-06-19T03:42:45.000Z | mc/inventory.py | r58Playz/Minecraft | d7a7b3169f12ff9c3014a51474b2875a65458a8e | [
"MIT"
] | 1 | 2020-06-16T03:07:30.000Z | 2020-06-16T03:07:30.000Z | import pyglet
import mc.globals as G
from pyglet.gl import *
class Hotbar:
file='textures/gui/widgets.png'
tex = None
batch = None
vlist = None
def __init__(self, winwidth, winheight):
self.x, self.y = (winwidth//2)-181, 30
self.tex = pyglet.graphics.TextureGroup(G.RESOURCE_LOADER.... | 37.210526 | 190 | 0.613154 |
58adb81fb2f5e2ba8069835bca4e9e4b56c4e14f | 12,158 | py | Python | src/poliastro/earth/atmosphere/coesa62.py | DhruvJ22/poliastro | ac5fafc6d054b2c545e111e5a6aa32259998074a | [
"MIT"
] | 8 | 2015-05-09T17:21:57.000Z | 2020-01-28T06:59:18.000Z | src/poliastro/earth/atmosphere/coesa62.py | DhruvJ22/poliastro | ac5fafc6d054b2c545e111e5a6aa32259998074a | [
"MIT"
] | 4 | 2015-12-29T13:08:01.000Z | 2019-12-27T12:58:04.000Z | src/poliastro/earth/atmosphere/coesa62.py | DhruvJ22/poliastro | ac5fafc6d054b2c545e111e5a6aa32259998074a | [
"MIT"
] | 1 | 2016-10-05T08:34:44.000Z | 2016-10-05T08:34:44.000Z | """ The U.S. Standard Atmosphere 1966 depicts idealized middle-latitude
year-round mean conditions for the range of solar activity that occurs between
sunspot minimum and sunspot maximum.
+--------+---------+---------+-----------+---------------+---------------+
| Z (km) | H (km) | T (K) | p (mbar) | rho (kg / m3)... | 36.731118 | 87 | 0.449252 |
6144b2af1bc515fd69c8cad60ad3bfaeac63dc63 | 1,385 | py | Python | app.py | Sravanalakshmi123/FAKE_NEWS | 6d8da534d3f0e79275c4293643b820967308aab1 | [
"MIT"
] | null | null | null | app.py | Sravanalakshmi123/FAKE_NEWS | 6d8da534d3f0e79275c4293643b820967308aab1 | [
"MIT"
] | null | null | null | app.py | Sravanalakshmi123/FAKE_NEWS | 6d8da534d3f0e79275c4293643b820967308aab1 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, url_for, request
import pandas as pd
import pickle
import re
import os
import numpy as np
app = Flask(__name__)
# Used by bow pickle file
def clean_article(article):
art = re.sub("[^A-Za-z0-9' ]", '', str(article))
art2 = re.sub("[( ' )(' )( ')]", ' ', str(art))
... | 23.87931 | 88 | 0.626715 |
8648f7b9cda4f231a176a55acf845f4832ce4b37 | 28,620 | py | Python | app/models.py | ukblumf/randomise-it | 0610721eba649dfa205b0d3c4b3e24d67aa1d781 | [
"MIT"
] | null | null | null | app/models.py | ukblumf/randomise-it | 0610721eba649dfa205b0d3c4b3e24d67aa1d781 | [
"MIT"
] | null | null | null | app/models.py | ukblumf/randomise-it | 0610721eba649dfa205b0d3c4b3e24d67aa1d781 | [
"MIT"
] | null | null | null | from datetime import datetime
import hashlib
from werkzeug.security import generate_password_hash, check_password_hash
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from markdown import markdown
import bleach
from flask import current_app, request, url_for
from flask_login import UserMix... | 39.151847 | 111 | 0.573655 |
429960c42f6dba6516a4568e280e7a1048d0f58d | 4,444 | py | Python | kineticstoolkit/external/icp.py | alcantarar/kineticstoolkit | d73f6a1102ca40376e52a8ab8575d7fa9591834f | [
"Apache-2.0"
] | 13 | 2020-10-08T12:53:34.000Z | 2022-02-27T17:20:15.000Z | kineticstoolkit/external/icp.py | alcantarar/kineticstoolkit | d73f6a1102ca40376e52a8ab8575d7fa9591834f | [
"Apache-2.0"
] | 81 | 2020-10-08T11:49:05.000Z | 2022-03-06T23:26:18.000Z | kineticstoolkit/external/icp.py | alcantarar/kineticstoolkit | d73f6a1102ca40376e52a8ab8575d7fa9591834f | [
"Apache-2.0"
] | 1 | 2021-09-14T02:59:04.000Z | 2021-09-14T02:59:04.000Z | # Copyright 2016 Clay Flannigan
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 30.438356 | 113 | 0.667417 |
8e2aba32e16d061dbecca31db6777cc49f460602 | 75,594 | py | Python | saleor/graphql/order/tests/test_fulfillment.py | victor-abz/saleor | f8e2b49703d995d4304d5a690dbe9c83631419d0 | [
"CC-BY-4.0"
] | 1 | 2022-03-25T00:21:11.000Z | 2022-03-25T00:21:11.000Z | saleor/graphql/order/tests/test_fulfillment.py | victor-abz/saleor | f8e2b49703d995d4304d5a690dbe9c83631419d0 | [
"CC-BY-4.0"
] | 86 | 2021-11-01T04:51:55.000Z | 2022-03-30T16:30:16.000Z | saleor/graphql/order/tests/test_fulfillment.py | victor-abz/saleor | f8e2b49703d995d4304d5a690dbe9c83631419d0 | [
"CC-BY-4.0"
] | 1 | 2021-12-28T18:02:49.000Z | 2021-12-28T18:02:49.000Z | from unittest.mock import ANY, patch
import graphene
import pytest
from ....core.exceptions import InsufficientStock, InsufficientStockData
from ....giftcard import GiftCardEvents
from ....giftcard.models import GiftCard, GiftCardEvent
from ....order import OrderStatus
from ....order.actions import fulfill_order_line... | 34.486314 | 88 | 0.670013 |
90a8127d5e6a688ed8dd5239fd01785508696718 | 22,668 | py | Python | ngcasa/imaging/_imaging_utils/_standard_grid_bu.py | FedeMPouzols/cngi_prototype | 421a99c460f4092b79120f5bec122de7ce9b8b96 | [
"Apache-2.0"
] | null | null | null | ngcasa/imaging/_imaging_utils/_standard_grid_bu.py | FedeMPouzols/cngi_prototype | 421a99c460f4092b79120f5bec122de7ce9b8b96 | [
"Apache-2.0"
] | null | null | null | ngcasa/imaging/_imaging_utils/_standard_grid_bu.py | FedeMPouzols/cngi_prototype | 421a99c460f4092b79120f5bec122de7ce9b8b96 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 AUI, Inc. Washington DC, USA
#
# 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 ... | 46.641975 | 444 | 0.575878 |
d661b2ed6b1f4edee72c86a5b4b9a35347cdc5e7 | 7,825 | py | Python | tests/integration/workflows/java_maven/test_java_maven.py | zhuhaow/aws-lambda-builders | ca658b37ed5242bfec82e01e33046b22484585cd | [
"Apache-2.0"
] | null | null | null | tests/integration/workflows/java_maven/test_java_maven.py | zhuhaow/aws-lambda-builders | ca658b37ed5242bfec82e01e33046b22484585cd | [
"Apache-2.0"
] | null | null | null | tests/integration/workflows/java_maven/test_java_maven.py | zhuhaow/aws-lambda-builders | ca658b37ed5242bfec82e01e33046b22484585cd | [
"Apache-2.0"
] | null | null | null | import os
import shutil
import tempfile
from pathlib import Path
from unittest import TestCase
from os.path import join
from aws_lambda_builders.builder import LambdaBuilder
from aws_lambda_builders.exceptions import WorkflowFailedError
from aws_lambda_builders.workflows.java.utils import EXPERIMENTAL_MAVEN_SCOPE_AND... | 46.301775 | 117 | 0.698147 |
86521622d97eeb01e0bc6d39b28827f1ac180594 | 2,270 | py | Python | software/scripts/gui.py | slaclab/atlas-rd53-fmc-dev | 1c5e50980dca3389c9b9a8eaa7c215f5c21eff87 | [
"BSD-3-Clause-LBNL"
] | 2 | 2021-08-17T17:59:19.000Z | 2021-08-17T17:59:44.000Z | software/scripts/gui.py | slaclab/atlas-rd53-fmc-dev | 1c5e50980dca3389c9b9a8eaa7c215f5c21eff87 | [
"BSD-3-Clause-LBNL"
] | 3 | 2020-09-14T21:36:26.000Z | 2020-11-02T17:51:41.000Z | software/scripts/gui.py | slaclab/atlas-rd53-fmc-dev | 1c5e50980dca3389c9b9a8eaa7c215f5c21eff87 | [
"BSD-3-Clause-LBNL"
] | 1 | 2020-12-12T23:14:16.000Z | 2020-12-12T23:14:16.000Z | #!/usr/bin/env python3
#-----------------------------------------------------------------------------
# This file is part of the 'Camera link gateway'. It is subject to
# the license terms in the LICENSE.txt file found in the top-level directory
# of this distribution and at:
# https://confluence.slac.stanford.edu/d... | 24.148936 | 78 | 0.546696 |
ec82b281513c9ca5163de5c3556a478f3bfa3b14 | 2,969 | py | Python | feed.py | Ajnasz/pippo | df9092b1261420f7afad7bf1180e59598cb1cdd9 | [
"MIT"
] | 1 | 2016-01-05T16:18:35.000Z | 2016-01-05T16:18:35.000Z | feed.py | Ajnasz/pippo | df9092b1261420f7afad7bf1180e59598cb1cdd9 | [
"MIT"
] | null | null | null | feed.py | Ajnasz/pippo | df9092b1261420f7afad7bf1180e59598cb1cdd9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
import os
import Adafruit_DHT
import Adafruit_IO
import json
import requests
import traceback
from lib import DHTStorage
PIDFILE = "/tmp/pippo.pid"
class PippoLockedError(Exception):
def __init__(self):
self.msg = "Pippo locked"
class PippoNotLockedError(Exception):
def __init_... | 24.53719 | 99 | 0.720108 |
6a188355f8fe2eb78eedcb4e2be147585764891b | 600 | py | Python | magicMirror/weatherModule.py | amldjlee8/MagicMirror | 12f1435ceae629a35d31c43423ff5d5cea813604 | [
"MIT"
] | null | null | null | magicMirror/weatherModule.py | amldjlee8/MagicMirror | 12f1435ceae629a35d31c43423ff5d5cea813604 | [
"MIT"
] | null | null | null | magicMirror/weatherModule.py | amldjlee8/MagicMirror | 12f1435ceae629a35d31c43423ff5d5cea813604 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from urllib.request import urlopen
import json
key = '7047852fabf9ea82'
def getCurWeatInfo():
url = 'http://api.wunderground.com/api/' + key + '/geolookup/conditions/q/UK/London.json'
f = urlopen(url)
json_string = f.read()
parsed_json = json.loads(json_string.decode(... | 37.5 | 94 | 0.67 |
8ef3ed5f1ac0eb50c273a793f813e28ec40a021e | 3,654 | py | Python | homeassistant/components/shelly/const.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 22,481 | 2020-03-02T13:09:59.000Z | 2022-03-31T23:34:28.000Z | homeassistant/components/shelly/const.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/shelly/const.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 11,411 | 2020-03-02T14:19:20.000Z | 2022-03-31T22:46:07.000Z | """Constants for the Shelly integration."""
from __future__ import annotations
import re
from typing import Final
BLOCK: Final = "block"
DATA_CONFIG_ENTRY: Final = "config_entry"
DEVICE: Final = "device"
DOMAIN: Final = "shelly"
REST: Final = "rest"
RPC: Final = "rpc"
CONF_COAP_PORT: Final = "coap_port"
DEFAULT_COAP... | 22.280488 | 78 | 0.700055 |
9602598f5a4a31c6c87b803d962cf618e3a54bc1 | 15,558 | py | Python | addon_common/common/utils.py | Unnoen/retopoflow | 73c7cfc10a0b58937198d60e308ba5248b446490 | [
"OML"
] | 1 | 2022-01-10T23:40:21.000Z | 2022-01-10T23:40:21.000Z | addon_common/common/utils.py | Unnoen/retopoflow | 73c7cfc10a0b58937198d60e308ba5248b446490 | [
"OML"
] | null | null | null | addon_common/common/utils.py | Unnoen/retopoflow | 73c7cfc10a0b58937198d60e308ba5248b446490 | [
"OML"
] | null | null | null | '''
Copyright (C) 2021 CG Cookie
http://cgcookie.com
hello@cgcookie.com
Created by Jonathan Denning, Jonathan Williamson
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 ... | 32.961864 | 97 | 0.575652 |
75e12cf491c5104839b8d2d7628733e5a89df5fa | 3,639 | py | Python | python/main.py | maaaybe/gameoflife | bba3d47204d8939c0bb15875f681e5b35209e708 | [
"MIT"
] | 2 | 2020-07-12T21:07:15.000Z | 2022-03-23T15:33:06.000Z | python/main.py | maaaybe/gameoflife | bba3d47204d8939c0bb15875f681e5b35209e708 | [
"MIT"
] | null | null | null | python/main.py | maaaybe/gameoflife | bba3d47204d8939c0bb15875f681e5b35209e708 | [
"MIT"
] | null | null | null | from time import sleep
import numpy as np
import math
import multiprocessing
AVAILABLE_TOKEN_LENGHT = [n ** 2 for n in range(1, 16)]
class GameOfLife(object):
def __init__(self, x_scale, y_scale, multithreaded=False):
self.width = 16 * x_scale
self.height = 16 * y_scale
self.board = np.z... | 36.757576 | 108 | 0.548228 |
fb6ca365c047999a43007e3be6ff9a1d58936074 | 1,216 | py | Python | testing_again/public/forms.py | jsmyth/testing_again | 897848b0091e76f90d97c05d8c8462af13876d39 | [
"MIT"
] | null | null | null | testing_again/public/forms.py | jsmyth/testing_again | 897848b0091e76f90d97c05d8c8462af13876d39 | [
"MIT"
] | null | null | null | testing_again/public/forms.py | jsmyth/testing_again | 897848b0091e76f90d97c05d8c8462af13876d39 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Public forms."""
from flask_wtf import FlaskForm
from wtforms import PasswordField, StringField
from wtforms.validators import DataRequired
from testing_again.user.models import User
class LoginForm(FlaskForm):
"""Login form."""
username = StringField("Username", validators=[DataR... | 30.4 | 77 | 0.644737 |
b6f90840f2cc6c857fcec635def31bd21be15fc5 | 3,535 | py | Python | undatum/cmds/transformer.py | infoculture/datum | e8ea97ca916ec718c5c2b8866a01fbbe55d6cc55 | [
"MIT"
] | 26 | 2020-04-16T13:54:12.000Z | 2022-03-26T06:21:48.000Z | undatum/cmds/transformer.py | infoculture/datum | e8ea97ca916ec718c5c2b8866a01fbbe55d6cc55 | [
"MIT"
] | 10 | 2020-04-16T13:00:37.000Z | 2022-02-09T11:52:06.000Z | undatum/cmds/transformer.py | infoculture/datum | e8ea97ca916ec718c5c2b8866a01fbbe55d6cc55 | [
"MIT"
] | 5 | 2020-04-20T10:48:08.000Z | 2022-01-30T11:56:54.000Z | from xlrd import open_workbook
from operator import itemgetter, attrgetter
import csv
import zipfile
import sys
import orjson
import bson
import logging
#from xmlr import xmliter
import xml.etree.ElementTree as etree
from collections import defaultdict
from ..utils import get_file_type, get_option, write_items, get_dic... | 37.210526 | 109 | 0.537199 |
d325541692490525347ed59a8124511baa8ccf3f | 801 | py | Python | docs/source/examples/external-credentials.py | aviramha/aio-pika | c480d2e62ac3f3e31a0714114e368bb6fd6eeb34 | [
"Apache-2.0"
] | null | null | null | docs/source/examples/external-credentials.py | aviramha/aio-pika | c480d2e62ac3f3e31a0714114e368bb6fd6eeb34 | [
"Apache-2.0"
] | null | null | null | docs/source/examples/external-credentials.py | aviramha/aio-pika | c480d2e62ac3f3e31a0714114e368bb6fd6eeb34 | [
"Apache-2.0"
] | null | null | null | import asyncio
import aio_pika
import ssl
async def main(loop):
connection = await aio_pika.connect_robust(
host='127.0.0.1',
login='',
ssl=True,
ssl_options=dict(
ca_certs="cacert.pem",
certfile="cert.pem",
keyfile="key.pem",
cert_re... | 22.25 | 60 | 0.573034 |
85bf5e058412fedab966b2f661db34e58d6cc46f | 1,808 | py | Python | app/model/charts/maps/mixed.py | smartlab-br/datahub-api | 193e71172bb4891a5bbffc902da07ef57df9ab07 | [
"MIT"
] | 1 | 2019-07-25T21:15:05.000Z | 2019-07-25T21:15:05.000Z | app/model/charts/maps/mixed.py | smartlab-br/datahub-api | 193e71172bb4891a5bbffc902da07ef57df9ab07 | [
"MIT"
] | 44 | 2019-08-05T15:24:00.000Z | 2022-01-31T23:11:31.000Z | app/model/charts/maps/mixed.py | smartlab-br/datahub-api | 193e71172bb4891a5bbffc902da07ef57df9ab07 | [
"MIT"
] | 1 | 2021-05-11T07:49:51.000Z | 2021-05-11T07:49:51.000Z | ''' Model for fetching chart '''
import folium
from model.charts.maps.base import BaseMap
class Mixed(BaseMap):
""" Mixed map building class """
def __init__(self, layers):
super().__init__(None, None) # Blocks instantiation of dataframes and options
self.layers = layers
def draw(self):
... | 38.468085 | 98 | 0.627212 |
e207dfe8e8beb68e5cb15408532c7ef862e88f83 | 517 | py | Python | hooks/pre_gen_project.py | Blueshoe/hurricane-based-helm-template | af96f375509d74744becd1b31edf3c9538bf28a6 | [
"MIT"
] | 3 | 2021-11-10T14:56:42.000Z | 2022-03-17T13:02:55.000Z | hooks/pre_gen_project.py | django-hurricane/hurricane-based-helm-template | 6d69f115b8da5b879b7f243708406b7b18ce71ab | [
"MIT"
] | 8 | 2021-07-19T11:50:34.000Z | 2022-03-17T11:08:14.000Z | hooks/pre_gen_project.py | django-hurricane/hurricane-based-helm-template | 6d69f115b8da5b879b7f243708406b7b18ce71ab | [
"MIT"
] | null | null | null | import re
import sys
try:
import gnupg
except ImportError:
print("Warning: there is a problem with the import of 'gnupg' which is required for encrypting secret value files.")
APP_SLUG_REGEX = "^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$"
app_slug = '{{ cookiecutter.app_slug }}'
if not... | 28.722222 | 120 | 0.67118 |
3183735bcca38f1022ba8bfee7781730724440cb | 135 | py | Python | T07-25/program.py | maa76/SSof-Project1920 | 9b4ad9ac41a648c425fcfcd49cd52ff84e528bde | [
"MIT"
] | 2 | 2019-11-20T19:26:07.000Z | 2019-11-22T00:42:23.000Z | T07-25/program.py | maa76/SSof-Project1920 | 9b4ad9ac41a648c425fcfcd49cd52ff84e528bde | [
"MIT"
] | 2 | 2019-11-28T05:21:24.000Z | 2019-11-28T05:21:58.000Z | T07-25/program.py | maa76/SSof-Project1920 | 9b4ad9ac41a648c425fcfcd49cd52ff84e528bde | [
"MIT"
] | 25 | 2019-11-27T01:40:56.000Z | 2019-12-04T23:38:59.000Z | a = source()
b = source2()
c = source3()
d = source4()
e = a
f = b + c
g = 2*c + d
c = 1
print(sink(sink(e), c, sink(f), sink(g, 4*a))) | 15 | 46 | 0.511111 |
3ccf98c1450396bc27d3b6ad8c8830fc33b1caac | 3,301 | py | Python | dataLoad.py | sagarcasm/ApacheWebLogExtraction | 63c8ac392fbf80d60de6cef49bb00272c4fc1671 | [
"Apache-2.0"
] | 1 | 2018-12-13T14:59:01.000Z | 2018-12-13T14:59:01.000Z | dataLoad.py | sagarcasm/ApacheWebLogExtraction | 63c8ac392fbf80d60de6cef49bb00272c4fc1671 | [
"Apache-2.0"
] | null | null | null | dataLoad.py | sagarcasm/ApacheWebLogExtraction | 63c8ac392fbf80d60de6cef49bb00272c4fc1671 | [
"Apache-2.0"
] | null | null | null | import pymysql
class webLogs:
def __init__(self, path):
self.path = path
def initialdataLoad(self):
print(self.path)
data = []
#read lines from the csv
with open(self.path) as file:
file = file.readlines()
for line in file:
... | 35.880435 | 175 | 0.55771 |
c3ab7f99bb0ddef4197783f8a6e02d61c4564180 | 702 | py | Python | digHostnameExtractor/hostname_extractor.py | darkshadows123/dig-hostname-extractor | 70f3529cb9a4a683cc0b36392e7949dd09021baa | [
"MIT"
] | null | null | null | digHostnameExtractor/hostname_extractor.py | darkshadows123/dig-hostname-extractor | 70f3529cb9a4a683cc0b36392e7949dd09021baa | [
"MIT"
] | null | null | null | digHostnameExtractor/hostname_extractor.py | darkshadows123/dig-hostname-extractor | 70f3529cb9a4a683cc0b36392e7949dd09021baa | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Author: darkshadows123
import copy
from digExtractor.extractor import Extractor
from dig_hostname_extractor import DIGHostnameExtractor
class HostnameExtractor(Extractor):
def __init__(self):
self.renamed_input_fields = ['text']
self.dhostname = DIGHostnameExtractor()
... | 24.206897 | 63 | 0.68661 |
edc4240cd8bf5e7a41af6f0e501764e332f19a9c | 1,466 | py | Python | 01-Apprenez/4.06a.py | gruiick/openclassrooms-py | add4b28eab8b311dea7c1d3915a22061f54326a9 | [
"BSD-2-Clause"
] | null | null | null | 01-Apprenez/4.06a.py | gruiick/openclassrooms-py | add4b28eab8b311dea7c1d3915a22061f54326a9 | [
"BSD-2-Clause"
] | null | null | null | 01-Apprenez/4.06a.py | gruiick/openclassrooms-py | add4b28eab8b311dea7c1d3915a22061f54326a9 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
# coding: utf-8
# $Id: 4.06a.py 1.4 $
# SPDX-License-Identifier: BSD-2-Clause
""" Réseau (TCP) """
import socket
"""
# serveur :
connexion_principale = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
connexion_principale.bind(('', 12800))
connexion_principale.listen(5)
connexion_avec_clien... | 24.847458 | 74 | 0.772851 |
04cbf20c71f152d152911b0da152ed6eda38d543 | 13,146 | py | Python | tensorflow_probability/python/bijectors/bijector_test_util.py | bourov/probability | 1e4053a0938b4773c3425bcbb07b3f1e5d50c7e2 | [
"Apache-2.0"
] | 2 | 2020-12-17T20:43:24.000Z | 2021-06-11T22:09:16.000Z | tensorflow_probability/python/bijectors/bijector_test_util.py | bourov/probability | 1e4053a0938b4773c3425bcbb07b3f1e5d50c7e2 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/bijectors/bijector_test_util.py | bourov/probability | 1e4053a0938b4773c3425bcbb07b3f1e5d50c7e2 | [
"Apache-2.0"
] | 1 | 2020-12-19T13:05:15.000Z | 2020-12-19T13:05:15.000Z | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 38.893491 | 87 | 0.71246 |
6525ee9bfbe1b4c253d4636c5f42f72dcf481413 | 442 | py | Python | examples/multifunction.py | CuadrosNicolas/Python-Command-Function | 6f9c050a57b2849823f31831186ee2d9bf4bb975 | [
"MIT"
] | null | null | null | examples/multifunction.py | CuadrosNicolas/Python-Command-Function | 6f9c050a57b2849823f31831186ee2d9bf4bb975 | [
"MIT"
] | null | null | null | examples/multifunction.py | CuadrosNicolas/Python-Command-Function | 6f9c050a57b2849823f31831186ee2d9bf4bb975 | [
"MIT"
] | null | null | null | #examples/multifunction.py
from autofunccli import cmdfusion
cmd = cmdfusion("Test with multiple function.")
@cmd.add
def plus(a:int,b:int)->int:
"""
plus operation
:param a: first number
:param b: second number
:return: a+b
"""
return a+b
@cmd.add
def minus(a:int,b:int)->int:
"""
minus operation
:param a: f... | 17 | 47 | 0.683258 |
5006ddadf1564198ee2071ff099e400c38be55d5 | 1,240 | py | Python | examples/lpf-kafka.py | CAIDA/pytimeseries | eb1528b0593f55ab42885d831c05b0adb652e1f9 | [
"BSD-2-Clause"
] | null | null | null | examples/lpf-kafka.py | CAIDA/pytimeseries | eb1528b0593f55ab42885d831c05b0adb652e1f9 | [
"BSD-2-Clause"
] | 1 | 2021-06-02T18:54:27.000Z | 2021-06-03T13:06:19.000Z | examples/lpf-kafka.py | CAIDA/pytimeseries | eb1528b0593f55ab42885d831c05b0adb652e1f9 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
"""
Trivial sample code for writing InfluxDB LPF-formatted data into the hicube time series platform.
This code will not work as-is (i.e., you need a kafka topic created), but should serve as a starting point for writing
producers.
See https://docs.influxdata.com/influxdb/v1.8/write_protocols/li... | 44.285714 | 118 | 0.755645 |
b1dac4e752179255ed7e2e3ace6ee1b569c48759 | 1,821 | py | Python | deep-rl/lib/python2.7/site-packages/OpenGL/GL/SGIX/framezoom.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 210 | 2016-04-09T14:26:00.000Z | 2022-03-25T18:36:19.000Z | deep-rl/lib/python2.7/site-packages/OpenGL/GL/SGIX/framezoom.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 72 | 2016-09-04T09:30:19.000Z | 2022-03-27T17:06:53.000Z | deep-rl/lib/python2.7/site-packages/OpenGL/GL/SGIX/framezoom.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 64 | 2016-04-09T14:26:49.000Z | 2022-03-21T11:19:47.000Z | '''OpenGL extension SGIX.framezoom
This module customises the behaviour of the
OpenGL.raw.GL.SGIX.framezoom to provide a more
Python-friendly API
Overview (from the spec)
This extension provides a additional way to rasterize geometric
primitives and pixel rectangles. The techique is to reduce the
number of pi... | 38.744681 | 71 | 0.794069 |
859c81e5d6d1ddb79fbf4bb8c38fbcf0dcfa829a | 9,052 | py | Python | tasks/utils.py | fk-currenxie/datadog-agent | ff813a337367cd4559cc6edb6794ced266d55c61 | [
"Apache-2.0"
] | null | null | null | tasks/utils.py | fk-currenxie/datadog-agent | ff813a337367cd4559cc6edb6794ced266d55c61 | [
"Apache-2.0"
] | null | null | null | tasks/utils.py | fk-currenxie/datadog-agent | ff813a337367cd4559cc6edb6794ced266d55c61 | [
"Apache-2.0"
] | null | null | null | """
Miscellaneous functions, no tasks here
"""
from __future__ import print_function
import os
import platform
import re
import sys
import json
from subprocess import check_output
import invoke
# constants
ORG_PATH = "github.com/DataDog"
REPO_PATH = "{}/datadog-agent".format(ORG_PATH)
def bin_name(name, android=Fa... | 36.796748 | 120 | 0.631242 |
3ab43488cb4ac2fd7b49b3a681cf9e8bbad59e43 | 8,231 | py | Python | tree_generator.py | elfnor/spacetree-sverchok | 7ba7128478db1f93e32ac2e0b4e5088745babb62 | [
"CC0-1.0"
] | 15 | 2016-09-13T10:48:59.000Z | 2021-04-10T22:42:04.000Z | tree_generator.py | elfnor/spacetree-sverchok | 7ba7128478db1f93e32ac2e0b4e5088745babb62 | [
"CC0-1.0"
] | 1 | 2016-09-26T11:58:36.000Z | 2016-09-29T14:06:28.000Z | tree_generator.py | elfnor/spacetree-sverchok | 7ba7128478db1f93e32ac2e0b4e5088745babb62 | [
"CC0-1.0"
] | 3 | 2017-01-25T23:17:50.000Z | 2020-06-26T15:28:53.000Z | """
in maximum branches s d=100 n=2
in_sockets = [
['s', 'maximum branches', npoints],
['s', 'branch length', dist],
['s', 'minimum distance', min_dist],
['s', 'maximum distance', max_dist],
['s', 'tip radius', tip_radius],
['v', 'tropism', trop],
['v', 'End... | 34.295833 | 121 | 0.486697 |
58aa2d559140a48aa6b78946a8ad76edd1dfd6c4 | 6,239 | py | Python | updown/data/proto_batch_sampler.py | elipugh/nocaps-meta | c8bd3c32c8d223e0ea5457159fb0637d2cdc8116 | [
"MIT"
] | 1 | 2021-08-15T14:03:09.000Z | 2021-08-15T14:03:09.000Z | updown/data/proto_batch_sampler.py | elipugh/nocaps-meta | c8bd3c32c8d223e0ea5457159fb0637d2cdc8116 | [
"MIT"
] | 3 | 2021-09-08T02:38:41.000Z | 2022-03-12T00:50:53.000Z | updown/data/proto_batch_sampler.py | elipugh/nocaps-meta | c8bd3c32c8d223e0ea5457159fb0637d2cdc8116 | [
"MIT"
] | null | null | null | # coding=utf-8
import numpy as np
import torch
from torch.utils.data import Dataset
from allennlp.data import Vocabulary
from updown.config import Config
from updown.data.readers import CocoCaptionsReader, ConstraintBoxesReader, ImageFeaturesReader
from updown.utils.constraints import ConstraintFilter, FiniteStateMa... | 40.512987 | 99 | 0.626863 |
f5ecd1d49fb65af07605e8133045937cd0758e10 | 4,847 | py | Python | torchwisdom/vision/datasets/datasets.py | abbiyanaila/torchwisdom | 56dc95ebca3f6861c7009cb4fa0c034e260236b1 | [
"MIT"
] | 1 | 2019-04-29T12:35:07.000Z | 2019-04-29T12:35:07.000Z | torchwisdom/vision/datasets/datasets.py | abbiyanaila/torchwisdom | 56dc95ebca3f6861c7009cb4fa0c034e260236b1 | [
"MIT"
] | null | null | null | torchwisdom/vision/datasets/datasets.py | abbiyanaila/torchwisdom | 56dc95ebca3f6861c7009cb4fa0c034e260236b1 | [
"MIT"
] | null | null | null | import os
import random
import pathlib
from bisect import insort_right
from collections import defaultdict
import torch.utils.data as data
import PIL
import PIL.Image
from torchwisdom.vision.transforms import pair as ptransforms
class SiamesePairDataset(data.Dataset):
def __init__(self, root, ext='jpg', transfor... | 33.427586 | 111 | 0.557871 |
fb2885ae5da226182dccb3ebd15533bd943d0078 | 95 | py | Python | estimation/apps.py | ahmadsyafrudin/estimation-test | 25b0b80065c8a0c0ba1a1a3b019b522d81501afa | [
"MIT"
] | null | null | null | estimation/apps.py | ahmadsyafrudin/estimation-test | 25b0b80065c8a0c0ba1a1a3b019b522d81501afa | [
"MIT"
] | 8 | 2020-02-12T00:12:47.000Z | 2021-09-22T18:01:47.000Z | estimation/apps.py | ahmadsyafrudin/estimation-test | 25b0b80065c8a0c0ba1a1a3b019b522d81501afa | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class EstimationConfig(AppConfig):
name = 'estimation'
| 15.833333 | 34 | 0.768421 |
135b00dbbc56a70158b4f16a50891fc8f32b9c33 | 6,341 | py | Python | backend/server.py | AMAI-GmbH/label-studio | 8c7ec9e81ae1082a47953c143c1535c881c175d7 | [
"Apache-2.0"
] | 3 | 2020-11-08T16:56:21.000Z | 2021-05-24T06:20:16.000Z | backend/server.py | AMAI-GmbH/label-studio | 8c7ec9e81ae1082a47953c143c1535c881c175d7 | [
"Apache-2.0"
] | null | null | null | backend/server.py | AMAI-GmbH/label-studio | 8c7ec9e81ae1082a47953c143c1535c881c175d7 | [
"Apache-2.0"
] | 2 | 2021-05-24T06:20:18.000Z | 2021-09-03T00:09:30.000Z | #!/usr/bin/env python
from __future__ import print_function
import os
import flask
import json # it MUST be included after flask!
import db
from flask import request, jsonify, make_response, Response
from utils import exception_treatment, answer, log_config, log, config_line_stripped, load_config
# init
c = load_c... | 31.083333 | 113 | 0.66898 |
6287695480428d75acf27d3b957e3ef1e513e63b | 235 | py | Python | lib/pyfrc/config.py | virtuald/pyfrc | f04a70fecc2897129e2f1318a97304e7a9202d31 | [
"MIT"
] | null | null | null | lib/pyfrc/config.py | virtuald/pyfrc | f04a70fecc2897129e2f1318a97304e7a9202d31 | [
"MIT"
] | null | null | null | lib/pyfrc/config.py | virtuald/pyfrc | f04a70fecc2897129e2f1318a97304e7a9202d31 | [
"MIT"
] | null | null | null |
#
# Holds settings that can be checked
#
# Set to True if running in code coverage mode
# -> Since pyfrc 2014.6.0
coverage_mode = False
# Indicates how pyfrc was run: netsim/sim/upload, etc...
# -> Since pyfrc 2014.6.0
mode = None
| 18.076923 | 56 | 0.697872 |
4a3e815fda391596d86a0fa1f4d07e596bc13678 | 2,080 | py | Python | tests/test_api_extensions.py | tesselo/stac-pydantic | 9a5a6534b9fe48b0106317e1a6fc5a09bf95a27b | [
"MIT"
] | 14 | 2021-05-19T19:06:01.000Z | 2022-03-24T11:41:10.000Z | tests/test_api_extensions.py | tesselo/stac-pydantic | 9a5a6534b9fe48b0106317e1a6fc5a09bf95a27b | [
"MIT"
] | 43 | 2020-05-20T23:42:30.000Z | 2021-03-02T19:40:20.000Z | tests/test_api_extensions.py | tesselo/stac-pydantic | 9a5a6534b9fe48b0106317e1a6fc5a09bf95a27b | [
"MIT"
] | 7 | 2021-04-16T12:55:15.000Z | 2022-03-01T19:09:25.000Z | from datetime import datetime
import pytest
from pydantic import ValidationError
from shapely.geometry import Polygon, shape
from stac_pydantic import Item
from stac_pydantic.api.extensions.fields import FieldsExtension
from stac_pydantic.api.search import Search
def test_fields_filter():
fields = FieldsExtensi... | 33.548387 | 82 | 0.600481 |
9fe0d9faa3bc2e224fdc9a9ef215edd89e13d0cd | 32,358 | py | Python | skinematics/quat.py | stes/scikit-kinematics | 1a4d7212c8fff93428cb1d56ac6d77faa32e6bc5 | [
"BSD-3-Clause"
] | 103 | 2016-04-14T14:06:37.000Z | 2022-03-24T12:38:31.000Z | skinematics/quat.py | stes/scikit-kinematics | 1a4d7212c8fff93428cb1d56ac6d77faa32e6bc5 | [
"BSD-3-Clause"
] | 42 | 2016-11-09T15:22:33.000Z | 2021-09-06T09:17:46.000Z | skinematics/quat.py | stes/scikit-kinematics | 1a4d7212c8fff93428cb1d56ac6d77faa32e6bc5 | [
"BSD-3-Clause"
] | 48 | 2016-05-23T07:54:23.000Z | 2022-03-24T14:34:41.000Z | '''
Functions for working with quaternions. Note that all the functions also
work on arrays, and can deal with full quaternions as well as with
quaternion vectors.
A "Quaternion" class is defined, with
- operator overloading for mult, div, and inv.
- indexing
'''
'''
author: Thomas Haslwanter
date: Feb-2018
'''
... | 30.817143 | 231 | 0.496693 |
678fd4a46c18aafa3d1334f9886ba7858f83bfd8 | 2,137 | py | Python | beastx/modules/rename.py | Digasi123percy/Beast-X | cf2c47db6af0c4afaa3b51b76ef7a1a2f0e0bc81 | [
"MIT"
] | 11 | 2021-11-07T12:04:20.000Z | 2022-03-10T10:32:59.000Z | beastx/modules/rename.py | Digasi123percy/Beast-X | cf2c47db6af0c4afaa3b51b76ef7a1a2f0e0bc81 | [
"MIT"
] | null | null | null | beastx/modules/rename.py | Digasi123percy/Beast-X | cf2c47db6af0c4afaa3b51b76ef7a1a2f0e0bc81 | [
"MIT"
] | 114 | 2021-11-07T13:11:19.000Z | 2022-03-31T02:00:04.000Z | import os
import time
from datetime import datetime
from . import *
thumb_image_path = Config.TMP_DOWNLOAD_DIRECTORY + "/thumb_image.jpg"
@beast.on(beastx_cmd(pattern="rename (.*)"))
async def _(event):
if event.fwd_from:
return
thumb = None
if os.path.exists(thumb_image_path):
... | 32.876923 | 85 | 0.578849 |
8e4e4ae632546635235b06c61cf698c2b75a07ea | 62 | py | Python | main.py | realmgame/hellow | 40efb09cca484e7b80e226e4c870d501259c3f05 | [
"Unlicense"
] | null | null | null | main.py | realmgame/hellow | 40efb09cca484e7b80e226e4c870d501259c3f05 | [
"Unlicense"
] | null | null | null | main.py | realmgame/hellow | 40efb09cca484e7b80e226e4c870d501259c3f05 | [
"Unlicense"
] | null | null | null | def main():
print("this")
return {'hello world'}
main() | 12.4 | 26 | 0.580645 |
5ef5fea088f13ee90d0b433e65917db68e48a12d | 3,147 | py | Python | Part 2 - Classification/Section 2 - K-Nearest Neighbors (K-NN)/KNearestNeighbors(knn).py | rudrajit1729/Machine-Learning-Codes-And-Templates | f36e92e9e103fa96549596e38be4c5fa29b2765d | [
"MIT"
] | 4 | 2020-03-28T13:46:21.000Z | 2020-12-12T07:24:26.000Z | Part 2 - Classification/Section 2 - K-Nearest Neighbors (K-NN)/KNearestNeighbors(knn).py | rudrajit1729/Machine-Learning-Codes-And-Templates | f36e92e9e103fa96549596e38be4c5fa29b2765d | [
"MIT"
] | null | null | null | Part 2 - Classification/Section 2 - K-Nearest Neighbors (K-NN)/KNearestNeighbors(knn).py | rudrajit1729/Machine-Learning-Codes-And-Templates | f36e92e9e103fa96549596e38be4c5fa29b2765d | [
"MIT"
] | 1 | 2020-05-10T01:34:28.000Z | 2020-05-10T01:34:28.000Z | # K-Nearest Neighbors
# Importing the libraries
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
# Importing the dataset
dataset = pd.read_csv("Social_Network_Ads.csv")
X = dataset.iloc[:, [2, 3]].values
y = dataset.iloc[:, 4].values
# Splitting the dataset into the Training set and... | 39.835443 | 106 | 0.659358 |
4f92f044fd6b3c4c7045ee850cb9a6a633278070 | 19,470 | py | Python | localization_service/venv/lib/python3.5/site-packages/matplotlib/tests/test_legend.py | vladbragoi/indoor_localization_system | b98d278cbd6a2ff8dcc093631eed0605e9e3a35f | [
"Apache-2.0"
] | null | null | null | localization_service/venv/lib/python3.5/site-packages/matplotlib/tests/test_legend.py | vladbragoi/indoor_localization_system | b98d278cbd6a2ff8dcc093631eed0605e9e3a35f | [
"Apache-2.0"
] | null | null | null | localization_service/venv/lib/python3.5/site-packages/matplotlib/tests/test_legend.py | vladbragoi/indoor_localization_system | b98d278cbd6a2ff8dcc093631eed0605e9e3a35f | [
"Apache-2.0"
] | null | null | null | import collections
import inspect
import platform
from unittest import mock
import numpy as np
import pytest
from matplotlib.testing.decorators import image_comparison
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.transforms as mtransforms
import matplotlib.collections as mcollections
fro... | 35.081081 | 79 | 0.608988 |
53f26eea0df0b38aa5260a340d2c38eac05fefa5 | 440 | py | Python | rest/incoming-phone-numbers/list-get-example-2/list-get-example-2.5.x.py | shaileshn/api-snippets | 08826972154634335378fed0edd2707d7f62b03b | [
"MIT"
] | 2 | 2017-11-23T11:31:20.000Z | 2018-01-22T04:14:02.000Z | rest/incoming-phone-numbers/list-get-example-2/list-get-example-2.5.x.py | berkus/twilio-api-snippets | beaa4e211044cb06daf9b73fb05ad6a7a948f879 | [
"MIT"
] | null | null | null | rest/incoming-phone-numbers/list-get-example-2/list-get-example-2.5.x.py | berkus/twilio-api-snippets | beaa4e211044cb06daf9b73fb05ad6a7a948f879 | [
"MIT"
] | 1 | 2019-10-02T14:36:36.000Z | 2019-10-02T14:36:36.000Z | # Download the Python helper library from twilio.com/docs/python/install
from twilio.rest import TwilioRestClient
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
auth_token = "your_auth_token"
client = TwilioRestClient(account_sid, auth_token)
# A list... | 40 | 72 | 0.825 |
36971932b0b2c5a897cf1641fd696fa3e683fc56 | 7,717 | py | Python | tests/extension/thread_/ram_read_dataflow/test_thread_ram_read_dataflow.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | null | null | null | tests/extension/thread_/ram_read_dataflow/test_thread_ram_read_dataflow.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | null | null | null | tests/extension/thread_/ram_read_dataflow/test_thread_ram_read_dataflow.py | akmaru/veriloggen | 74f998139e8cf613f7703fa4cffd571bbf069bbc | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
import veriloggen
import thread_ram_read_dataflow
expected_verilog = """
module test;
reg CLK;
reg RST;
main
uut
(
.CLK(CLK),
.RST(RST)
);
initial begin
$dumpfile("uut.vcd");
$dumpvars(0, uut, CLK, RST);
en... | 23.671779 | 90 | 0.623429 |
d314720220fa87735419d8f1369a03b851789b6d | 742 | py | Python | kwiklib/dataio/tests/mock.py | fiath/test | b50898dafa90e93da48f573e0b3feb1bb6acd8de | [
"MIT",
"BSD-3-Clause"
] | 7 | 2015-01-20T13:55:51.000Z | 2018-02-06T09:31:21.000Z | kwiklib/dataio/tests/mock.py | fiath/test | b50898dafa90e93da48f573e0b3feb1bb6acd8de | [
"MIT",
"BSD-3-Clause"
] | 6 | 2015-01-08T18:13:53.000Z | 2016-06-22T09:53:53.000Z | kwiklib/dataio/tests/mock.py | fiath/test | b50898dafa90e93da48f573e0b3feb1bb6acd8de | [
"MIT",
"BSD-3-Clause"
] | 8 | 2015-01-22T22:57:19.000Z | 2020-03-19T11:43:56.000Z | """Create mock data"""
# -----------------------------------------------------------------------------
# Imports
# -----------------------------------------------------------------------------
import numpy as np
from kwiklib.dataio.kwik_creation import *
from kwiklib.dataio.experiment import create_experiment
# ----... | 33.727273 | 79 | 0.260108 |
9ebe53ccb324f4b971540b338e79d946943082a4 | 1,465 | py | Python | tests/post/steps/test_seccomp.py | n1603/metalk8s | 2f337a435380102055d3725f0cc2b6165818e880 | [
"Apache-2.0"
] | null | null | null | tests/post/steps/test_seccomp.py | n1603/metalk8s | 2f337a435380102055d3725f0cc2b6165818e880 | [
"Apache-2.0"
] | null | null | null | tests/post/steps/test_seccomp.py | n1603/metalk8s | 2f337a435380102055d3725f0cc2b6165818e880 | [
"Apache-2.0"
] | null | null | null | import os.path
import yaml
from kubernetes import client
import pytest
from pytest_bdd import scenario, when
from tests import kube_utils
from tests import utils
@scenario("../features/seccomp.feature",
"Running a Pod with the 'runtime/default' seccomp profile works")
def test_seccomp(host):
pass
... | 24.416667 | 75 | 0.642321 |
382895fffc465b74c027cebe685ec2ad78e751cb | 1,007 | py | Python | app/core/admin.py | LukaszMalucha/Data-Labs-with-Python-Tableau | 75f2a7ad5cbd7dd22a04e20bdbe0172e669093c3 | [
"MIT"
] | 6 | 2018-09-25T18:37:14.000Z | 2021-04-24T23:58:27.000Z | app/core/admin.py | LukaszMalucha/Data-Labs-with-Python-Tableau | 75f2a7ad5cbd7dd22a04e20bdbe0172e669093c3 | [
"MIT"
] | 12 | 2020-01-08T11:56:11.000Z | 2022-02-27T09:48:02.000Z | app/core/admin.py | LukaszMalucha/Data-Labs-with-Python-Tableau | 75f2a7ad5cbd7dd22a04e20bdbe0172e669093c3 | [
"MIT"
] | 1 | 2019-08-17T04:33:11.000Z | 2019-08-17T04:33:11.000Z | from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as BaseUserAdmin
from core import models
class UserAdmin(BaseUserAdmin):
ordering = ['id']
list_display = ['email', 'name']
list_filter = ('is_active', 'is_staff', 'is_superuser')
search_fields = ['email', 'name']
f... | 30.515152 | 87 | 0.645482 |
6bd05531333ba99539c128a62ea028e2cc6c9a2b | 9,291 | py | Python | clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py | mkinsner/llvm | 589d48844edb12cd357b3024248b93d64b6760bf | [
"Apache-2.0"
] | 2,338 | 2018-06-19T17:34:51.000Z | 2022-03-31T11:00:37.000Z | clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py | mkinsner/llvm | 589d48844edb12cd357b3024248b93d64b6760bf | [
"Apache-2.0"
] | 3,740 | 2019-01-23T15:36:48.000Z | 2022-03-31T22:01:13.000Z | clang-tools-extra/clang-tidy/tool/clang-tidy-diff.py | mkinsner/llvm | 589d48844edb12cd357b3024248b93d64b6760bf | [
"Apache-2.0"
] | 500 | 2019-01-23T07:49:22.000Z | 2022-03-30T02:59:37.000Z | #!/usr/bin/env python
#
#===- clang-tidy-diff.py - ClangTidy Diff Checker -----------*- python -*--===#
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===----------... | 33.908759 | 79 | 0.616618 |
6f397e66399ffd8f14a8d42129c509fef40b08c7 | 1,277 | py | Python | grr/core/grr_response_core/lib/parsers/cron_file_parser.py | ahmednofal/grr | 08a57f6873ee13f425d0106e4143663bc6dbdd60 | [
"Apache-2.0"
] | null | null | null | grr/core/grr_response_core/lib/parsers/cron_file_parser.py | ahmednofal/grr | 08a57f6873ee13f425d0106e4143663bc6dbdd60 | [
"Apache-2.0"
] | null | null | null | grr/core/grr_response_core/lib/parsers/cron_file_parser.py | ahmednofal/grr | 08a57f6873ee13f425d0106e4143663bc6dbdd60 | [
"Apache-2.0"
] | 2 | 2020-08-24T00:22:03.000Z | 2020-11-14T08:34:43.000Z | #!/usr/bin/env python
"""Simple parsers for cron type files."""
from __future__ import absolute_import
from __future__ import unicode_literals
import crontab
from grr_response_core.lib import parser
from grr_response_core.lib import utils
from grr_response_core.lib.rdfvalues import cronjobs as rdf_cronjobs
class ... | 27.76087 | 69 | 0.688332 |
35ac13f82cfc6cf14b1a034ec44fd795ee4addc6 | 435 | py | Python | mysite/app/migrations/0003_organisation_user_id.py | code-build-deploy/backend | 8614a0e67f507944ad9ac759984acc8ddec28876 | [
"MIT"
] | null | null | null | mysite/app/migrations/0003_organisation_user_id.py | code-build-deploy/backend | 8614a0e67f507944ad9ac759984acc8ddec28876 | [
"MIT"
] | null | null | null | mysite/app/migrations/0003_organisation_user_id.py | code-build-deploy/backend | 8614a0e67f507944ad9ac759984acc8ddec28876 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.1 on 2019-12-27 15:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0002_auto_20191227_2030'),
]
operations = [
migrations.AddField(
model_name='organisation',
name='user_id',
... | 21.75 | 62 | 0.602299 |
5ad3ed11897d978e1e98cf86d08ccbb839a993ec | 68 | py | Python | test/code2of5.py | leo-b/elaphe | 3cd075c8d7e2f587096715d4e7bc6ad8bd6df021 | [
"BSD-2-Clause"
] | 10 | 2017-05-18T01:33:31.000Z | 2020-04-09T02:27:27.000Z | test/code2of5.py | leo-b/elaphe | 3cd075c8d7e2f587096715d4e7bc6ad8bd6df021 | [
"BSD-2-Clause"
] | 14 | 2017-05-03T16:34:48.000Z | 2022-02-25T19:07:43.000Z | test/code2of5.py | leo-b/elaphe | 3cd075c8d7e2f587096715d4e7bc6ad8bd6df021 | [
"BSD-2-Clause"
] | 5 | 2017-07-12T19:38:24.000Z | 2021-12-16T08:47:57.000Z | symbology = 'code2of5'
cases = [
('001.png', '01234567'),
]
| 13.6 | 28 | 0.529412 |
bb65a04f2ca6098988677aa5e7eed6d439bcffe2 | 517 | py | Python | docs/version.py | UCLA-IRL/ndn-hydra | e01829253876ff6dbfd6dfaa92142eca08cd6705 | [
"Apache-2.0"
] | 2 | 2021-04-14T04:12:14.000Z | 2021-04-23T02:28:49.000Z | docs/version.py | ZixuanZhong/hydra | e01829253876ff6dbfd6dfaa92142eca08cd6705 | [
"Apache-2.0"
] | 10 | 2021-07-03T18:29:26.000Z | 2022-02-01T04:11:20.000Z | docs/version.py | ZixuanZhong/ndn-distributed-repo | e01829253876ff6dbfd6dfaa92142eca08cd6705 | [
"Apache-2.0"
] | null | null | null | # ----------------------------------------------------------
# NDN Hydra Version
# ----------------------------------------------------------
# @Project: NDN Hydra
# @Date: 2021-01-25
# @Authors: Please check AUTHORS.rst
# @Source-Code: https://github.com/UCLA-IRL/ndn-hydra
# @Documentation: https://ndn-hyd... | 39.769231 | 61 | 0.439072 |
15e19db95d0147ba42859ffd48f61c52c5b0df40 | 850 | py | Python | sysinv/sysinv/sysinv/sysinv/tests/fake_policy.py | etaivan/stx-config | 281e1f110973f96e077645fb01f67b646fc253cc | [
"Apache-2.0"
] | 10 | 2020-02-07T18:57:44.000Z | 2021-09-11T10:29:34.000Z | sysinv/sysinv/sysinv/sysinv/tests/fake_policy.py | etaivan/stx-config | 281e1f110973f96e077645fb01f67b646fc253cc | [
"Apache-2.0"
] | 1 | 2021-01-14T12:01:55.000Z | 2021-01-14T12:01:55.000Z | sysinv/sysinv/sysinv/sysinv/tests/fake_policy.py | etaivan/stx-config | 281e1f110973f96e077645fb01f67b646fc253cc | [
"Apache-2.0"
] | 10 | 2020-10-13T08:37:46.000Z | 2022-02-09T00:21:25.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 OpenStack Foundation
#
# 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.692308 | 75 | 0.731765 |
446e5fcc1a11d1aeafd1b1179de3e0b06b812e60 | 3,477 | py | Python | Med_Cabinet/data/StrainAPItoPG.py | RMDircio/Med_Cabinet_Data_Science | a8d33785a9bfe8d9beaa03c014c897d8d54a91b0 | [
"MIT"
] | 1 | 2020-08-04T08:29:15.000Z | 2020-08-04T08:29:15.000Z | Med_Cabinet/data/StrainAPItoPG.py | RMDircio/Med_Cabinet_Data_Science | a8d33785a9bfe8d9beaa03c014c897d8d54a91b0 | [
"MIT"
] | 4 | 2020-06-19T03:49:01.000Z | 2020-06-26T04:41:57.000Z | Med_Cabinet/data/StrainAPItoPG.py | RMDircio/Med_Cabinet_Data_Science | a8d33785a9bfe8d9beaa03c014c897d8d54a91b0 | [
"MIT"
] | 4 | 2020-06-17T03:21:25.000Z | 2020-06-18T02:26:11.000Z | # StrainAPI.py
# http://strains.evanbusse.com/index.html
import os
import requests
import psycopg2
import json, sys
from pprint import pprint
from dotenv import load_dotenv
from psycopg2 import connect, Error
# Load contents of the .env file into the script's environment
load_dotenv()
# Connect to Elephant PG D... | 25.379562 | 125 | 0.700316 |
efa2275d2372695b1b93aff150047931c1513af6 | 2,018 | py | Python | tests/unit/aws_interface/test_cloudwanderer_boto3_session.py | Sam-Martin/cloud-wanderer | 1879f9bb150054be5bf33fd46a47414b4939529e | [
"MIT"
] | 1 | 2020-12-07T10:37:41.000Z | 2020-12-07T10:37:41.000Z | tests/unit/aws_interface/test_cloudwanderer_boto3_session.py | Sam-Martin/cloud-wanderer | 1879f9bb150054be5bf33fd46a47414b4939529e | [
"MIT"
] | null | null | null | tests/unit/aws_interface/test_cloudwanderer_boto3_session.py | Sam-Martin/cloud-wanderer | 1879f9bb150054be5bf33fd46a47414b4939529e | [
"MIT"
] | null | null | null | from unittest.mock import MagicMock
from cloudwanderer.aws_interface import CloudWandererBoto3ClientConfig, CloudWandererBoto3Session
def test_get_account_id_from_arg():
botocore_session = MagicMock()
subject = CloudWandererBoto3Session(botocore_session=botocore_session, account_id="0123456789012")
asse... | 29.676471 | 113 | 0.721011 |
54b1aa82922e42a75ddd2b86beb0f2543ff0b3e8 | 3,717 | py | Python | app.py | deobandana/SQLAlchemy-Challenge | dc50ac98a938a7f19b9e891610f00c3cfd31ae72 | [
"ADSL"
] | null | null | null | app.py | deobandana/SQLAlchemy-Challenge | dc50ac98a938a7f19b9e891610f00c3cfd31ae72 | [
"ADSL"
] | null | null | null | app.py | deobandana/SQLAlchemy-Challenge | dc50ac98a938a7f19b9e891610f00c3cfd31ae72 | [
"ADSL"
] | null | null | null | from sqlalchemy import create_engine
from sqlalchemy.orm import session
from sqlalchemy.ext import automap
from sqlalchemy import inspect
from sqlalchemy import func
import numpy as np
from flask import Flask, jsonify
engine = create_engine("sqlite:///hawaii.sqlite")
Base = automap.automap_base()
Base.prepare(engine,... | 34.416667 | 110 | 0.602098 |
ff0f168fb50f12c330ff817db43b179040a45860 | 9,260 | py | Python | 6.Graphs/DFS.py | qrzhang/Udacity_Data_Structure_Algorithms | 5b65088884d93e7fcd53b7fcf888e378b514ba2a | [
"MIT"
] | null | null | null | 6.Graphs/DFS.py | qrzhang/Udacity_Data_Structure_Algorithms | 5b65088884d93e7fcd53b7fcf888e378b514ba2a | [
"MIT"
] | null | null | null | 6.Graphs/DFS.py | qrzhang/Udacity_Data_Structure_Algorithms | 5b65088884d93e7fcd53b7fcf888e378b514ba2a | [
"MIT"
] | null | null | null | """
DFS: Depth-First Search
BFS: Breadth-First Search
"""
class Node(object):
def __init__(self, value):
self.value = value
self.edges = []
self.visited = False
class Edge(object):
def __init__(self, value, node_from, node_to):
self.value = value
self.node_from = node... | 37.04 | 92 | 0.640173 |
f43f933aceb4b1341a1d461cfb6098eab4b7ff47 | 1,926 | py | Python | ck_baidu_url_submit.py | wqdyteam/checkinpanel | 69c591a2eed37b9b9f44aa4f940f57d070a19e4d | [
"MIT"
] | 14 | 2021-11-15T02:56:51.000Z | 2022-03-05T16:47:21.000Z | ck_baidu_url_submit.py | wqdyteam/checkinpanel | 69c591a2eed37b9b9f44aa4f940f57d070a19e4d | [
"MIT"
] | null | null | null | ck_baidu_url_submit.py | wqdyteam/checkinpanel | 69c591a2eed37b9b9f44aa4f940f57d070a19e4d | [
"MIT"
] | 5 | 2021-11-04T09:54:08.000Z | 2022-02-23T09:44:59.000Z | # -*- coding: utf-8 -*-
"""
cron: 32 7 * * *
new Env('百度搜索资源平台');
"""
from urllib import parse
import requests
from notify_mtr import send
from utils import get_data
class BaiduUrlSubmit:
def __init__(self, check_items):
self.check_items = check_items
@staticmethod
def url_submit(data_url: str... | 30.09375 | 87 | 0.550883 |
85d549ec14a2a2979676787d1a927602b136f998 | 5,811 | py | Python | train.py | cptbtptp2333/style-token_tacotron2 | 8268a55d6a58fc722158ec360fc4f0b4bfbca7b1 | [
"MIT"
] | 60 | 2018-12-10T00:31:35.000Z | 2022-03-10T18:24:01.000Z | train.py | cptbtptp2333/style-token_tacotron2 | 8268a55d6a58fc722158ec360fc4f0b4bfbca7b1 | [
"MIT"
] | 12 | 2019-04-16T10:33:04.000Z | 2020-12-28T11:00:19.000Z | train.py | cptbtptp2333/style-token_tacotron2 | 8268a55d6a58fc722158ec360fc4f0b4bfbca7b1 | [
"MIT"
] | 22 | 2019-03-16T06:57:01.000Z | 2021-05-25T01:13:15.000Z | import argparse
import os
from time import sleep
import infolog
import tensorflow as tf
from hparams import hparams
from infolog import log
from tacotron.synthesize import tacotron_synthesize
from tacotron.train import tacotron_train
from wavenet_vocoder.train import wavenet_train
log = infolog.log
def save_seq(fil... | 41.805755 | 146 | 0.696266 |
5e81a4e894499dd793699c3c9f485cc86c3194e8 | 2,904 | py | Python | experiments/task71/train_bert.py | manzar96/st7 | 8dac6fa3497e5a3594766a232a9e8436120e9563 | [
"MIT"
] | null | null | null | experiments/task71/train_bert.py | manzar96/st7 | 8dac6fa3497e5a3594766a232a9e8436120e9563 | [
"MIT"
] | null | null | null | experiments/task71/train_bert.py | manzar96/st7 | 8dac6fa3497e5a3594766a232a9e8436120e9563 | [
"MIT"
] | null | null | null | import math
import torch
import torch.nn as nn
from tqdm import tqdm
from torch.optim import Adam
from torch.utils.data import DataLoader
from transformers import BertTokenizer, BertModel
from core.data.dataset import Task71Dataset
from core.data.collators import Task71aCollator
from core.models.modules.heads import B... | 35.851852 | 76 | 0.694559 |
5c2cf031380b5eeaab309d65dcbad54b010fc818 | 4,794 | py | Python | Content/Networking/Route53/WorkloadManager/src/awsroute53/prerequiste_environments.py | saikirangurijal/cloudcentersuite | 5fd1907fdd1c32a8a575e2671b6a9ed9f68f2875 | [
"Apache-2.0"
] | 8 | 2018-12-19T00:37:59.000Z | 2020-07-16T15:05:40.000Z | Content/Networking/Route53/WorkloadManager/src/awsroute53/prerequiste_environments.py | saikirangurijal/cloudcentersuite | 5fd1907fdd1c32a8a575e2671b6a9ed9f68f2875 | [
"Apache-2.0"
] | 2 | 2019-03-26T17:53:20.000Z | 2019-11-26T15:26:00.000Z | Content/Networking/Route53/WorkloadManager/src/awsroute53/prerequiste_environments.py | saikirangurijal/cloudcentersuite | 5fd1907fdd1c32a8a575e2671b6a9ed9f68f2875 | [
"Apache-2.0"
] | 9 | 2019-01-09T06:55:48.000Z | 2019-11-27T17:55:03.000Z | "This method is used to get the details from user and assigning to domain creation json"
import json,os
import re,sys
from util import print_error,print_log,print_result,write_error
try:
currentworkingdir = os.getcwd()
filename = os.path.join(currentworkingdir, "createrecordset.json")
print("filename is ... | 40.285714 | 102 | 0.666667 |
4b6f46ddc0a7f57d7f0688762801a66ba6de06ff | 166 | py | Python | allennlp_models/tagging/dataset_readers/conll2003.py | matt-peters/allennlp-models | cdd505ed539fdc2b82e4cc0a23eae4bfd3368e7e | [
"Apache-2.0"
] | 402 | 2020-03-11T22:58:35.000Z | 2022-03-29T09:05:27.000Z | allennlp_models/tagging/dataset_readers/conll2003.py | matt-peters/allennlp-models | cdd505ed539fdc2b82e4cc0a23eae4bfd3368e7e | [
"Apache-2.0"
] | 116 | 2020-03-11T01:26:57.000Z | 2022-03-25T13:03:56.000Z | allennlp_models/tagging/dataset_readers/conll2003.py | matt-peters/allennlp-models | cdd505ed539fdc2b82e4cc0a23eae4bfd3368e7e | [
"Apache-2.0"
] | 140 | 2020-03-11T00:51:35.000Z | 2022-03-29T09:05:36.000Z | from allennlp.data.dataset_readers.conll2003 import Conll2003DatasetReader # noqa: F401
# This component lives in the main repo because we need it there for tests.
| 41.5 | 88 | 0.813253 |
c832329cb4d2f91ef90f482f4db65dd1e6730f43 | 7,683 | py | Python | Scripts/PredictandEvaluate/pred13.py | ankita-2015/Indian-Driving-Dataset-Semantic-Segmentation | 8b8a9c9489c209c819bb46138d9b674b2dd085a5 | [
"MIT"
] | null | null | null | Scripts/PredictandEvaluate/pred13.py | ankita-2015/Indian-Driving-Dataset-Semantic-Segmentation | 8b8a9c9489c209c819bb46138d9b674b2dd085a5 | [
"MIT"
] | null | null | null | Scripts/PredictandEvaluate/pred13.py | ankita-2015/Indian-Driving-Dataset-Semantic-Segmentation | 8b8a9c9489c209c819bb46138d9b674b2dd085a5 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
import matplotlib.patches as mpatches
import tensorflow as tf
from glob import glob
from tqdm import tqdm
import pandas as pd
import keras
from tensorflow.keras import backend as k
import gc
import warnings
warnings.filterwarnings('ignore')
AUTOTUNE = tf.data.experim... | 35.40553 | 179 | 0.626838 |
584810b3cee25463bd2772ebccac860189ba517d | 3,425 | py | Python | 018-4Sum/solution01.py | Eroica-cpp/LeetCode | 07276bd11558f3d0e32bec768b09e886de145f9e | [
"CC-BY-3.0",
"MIT"
] | 7 | 2015-05-05T22:21:30.000Z | 2021-03-13T04:04:15.000Z | 018-4Sum/solution01.py | Eroica-cpp/LeetCode | 07276bd11558f3d0e32bec768b09e886de145f9e | [
"CC-BY-3.0",
"MIT"
] | null | null | null | 018-4Sum/solution01.py | Eroica-cpp/LeetCode | 07276bd11558f3d0e32bec768b09e886de145f9e | [
"CC-BY-3.0",
"MIT"
] | 2 | 2018-12-26T08:13:25.000Z | 2020-07-18T20:18:24.000Z | #!/usr/bin/python
# ==============================================================================
# Author: Tao Li (taoli@ucsd.edu)
# Date: Jun 19, 2015
# Question: 018-4Sum
# Link: https://leetcode.com/problems/4sum/
# ==============================================================================
# Given an... | 37.228261 | 306 | 0.458686 |
f2466dcdf27319adeea7443718bbf38b70a8fbbe | 5,671 | py | Python | lib/spack/spack/test/cmd/url.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2020-09-10T22:50:08.000Z | 2021-01-12T22:18:54.000Z | lib/spack/spack/test/cmd/url.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 17 | 2019-03-21T15:54:00.000Z | 2022-03-29T19:34:28.000Z | lib/spack/spack/test/cmd/url.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2021-04-07T18:27:09.000Z | 2022-03-31T22:52:38.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import re
import sys
import pytest
import spack.repo
from spack.url import UndetectableVersionError
from spack.main impor... | 36.352564 | 78 | 0.662846 |
b1f33f5bd92d0e9fbcece6e1690377446be4d006 | 1,334 | py | Python | dltb/util/helper.py | Petr-By/qtpyvis | 0b9a151ee6b9a56b486c2bece9c1f03414629efc | [
"MIT"
] | 3 | 2017-10-04T14:51:26.000Z | 2017-10-22T09:35:50.000Z | dltb/util/helper.py | krumnack/qtpyvis | 0b9a151ee6b9a56b486c2bece9c1f03414629efc | [
"MIT"
] | 13 | 2017-11-26T10:05:00.000Z | 2018-03-11T14:08:40.000Z | dltb/util/helper.py | krumnack/qtpyvis | 0b9a151ee6b9a56b486c2bece9c1f03414629efc | [
"MIT"
] | 2 | 2017-09-24T21:39:42.000Z | 2017-10-04T15:29:54.000Z | """Several commonly used general purpose functions, classes, decorators,
and context managers, only based on Python standard libraries.
"""
# standard imports
from contextlib import contextmanager
from threading import Lock
class classproperty1(property):
"""A docorator to mark a method as classproperty.
Th... | 25.653846 | 75 | 0.677661 |
4d3cda98f88d98373d76669a54ac74fd23dc82a6 | 129,087 | py | Python | mne/viz/utils.py | mkoculak/mne-python | 85bc0063c7582a4deb2e453ea6c41e49036254a4 | [
"BSD-3-Clause"
] | null | null | null | mne/viz/utils.py | mkoculak/mne-python | 85bc0063c7582a4deb2e453ea6c41e49036254a4 | [
"BSD-3-Clause"
] | null | null | null | mne/viz/utils.py | mkoculak/mne-python | 85bc0063c7582a4deb2e453ea6c41e49036254a4 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Utility functions for plotting M/EEG data."""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# Mainak Jas <mainak... | 39.355793 | 144 | 0.59501 |
31b3bcde14e1cdc94b0db7fdae3ab6af301ddcda | 12,770 | py | Python | dolphintracker/singlecam_tracker/singlecam_tracker.py | UmSenhorQualquer/d-track | 7a7e1cc54176452235731d4ba232545af6e01afc | [
"MIT"
] | 1 | 2021-12-24T07:35:07.000Z | 2021-12-24T07:35:07.000Z | dolphintracker/singlecam_tracker/singlecam_tracker.py | UmSenhorQualquer/d-track | 7a7e1cc54176452235731d4ba232545af6e01afc | [
"MIT"
] | null | null | null | dolphintracker/singlecam_tracker/singlecam_tracker.py | UmSenhorQualquer/d-track | 7a7e1cc54176452235731d4ba232545af6e01afc | [
"MIT"
] | null | null | null | import pyforms
from pyforms import BaseWidget
from pyforms.controls import ControlText
from pyforms.controls import ControlProgress
from pyforms.controls import ControlSlider
from pyforms.controls import ControlButton
from pyforms.controls import ControlPlayer
from pyforms.controls import Control... | 38.81459 | 134 | 0.581911 |
9e0610deed281f15b184fa071649b1a8490bc625 | 7,604 | py | Python | Lib/asyncio/taskgroups.py | dignissimus/cpython | 17357108732c731d6ed4f2bd123ee6ba1ff6891b | [
"0BSD"
] | 1 | 2021-11-05T12:29:12.000Z | 2021-11-05T12:29:12.000Z | Lib/asyncio/taskgroups.py | dignissimus/cpython | 17357108732c731d6ed4f2bd123ee6ba1ff6891b | [
"0BSD"
] | 2 | 2021-12-01T15:01:15.000Z | 2022-02-24T06:16:48.000Z | Lib/asyncio/taskgroups.py | sthagen/python-cpython | dfd438dfb2a0e299cd6ab166f203dfe9740868ae | [
"0BSD"
] | null | null | null | # Adapted with permission from the EdgeDB project.
__all__ = ["TaskGroup"]
from . import events
from . import exceptions
from . import tasks
class TaskGroup:
def __init__(self):
self._entered = False
self._exiting = False
self._aborting = False
self._loop = None
self._p... | 35.203704 | 86 | 0.538401 |
3f2d08e094a6d3421e8049070499375fa1b8653f | 13,000 | py | Python | instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py | ericmustin/opentelemetry-python-contrib | 308369004c71a8d07c18560ac1fb46049a0a8105 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py | ericmustin/opentelemetry-python-contrib | 308369004c71a8d07c18560ac1fb46049a0a8105 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | instrumentation/opentelemetry-instrumentation-wsgi/tests/test_wsgi_middleware.py | ericmustin/opentelemetry-python-contrib | 308369004c71a8d07c18560ac1fb46049a0a8105 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 35.616438 | 99 | 0.638 |
51e396741e42f0b8f9daec8436d679fba77cb508 | 6,327 | py | Python | tests/accelerators/test_dp.py | Flash-321/pytorch-lightning | cdb6f979a062a639a6d709a0e1915a07d5ed50f6 | [
"Apache-2.0"
] | 3 | 2021-05-06T11:31:20.000Z | 2021-05-21T10:37:03.000Z | tests/accelerators/test_dp.py | Flash-321/pytorch-lightning | cdb6f979a062a639a6d709a0e1915a07d5ed50f6 | [
"Apache-2.0"
] | null | null | null | tests/accelerators/test_dp.py | Flash-321/pytorch-lightning | cdb6f979a062a639a6d709a0e1915a07d5ed50f6 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# 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 i... | 31.954545 | 114 | 0.690691 |
b552b11724819f28df8b789906a814e10df21db9 | 18,844 | py | Python | colour/models/tests/test_cam02_ucs.py | rift-labs-developer/colour | 15112dbe824aab0f21447e0db4a046a28a06f43a | [
"BSD-3-Clause"
] | null | null | null | colour/models/tests/test_cam02_ucs.py | rift-labs-developer/colour | 15112dbe824aab0f21447e0db4a046a28a06f43a | [
"BSD-3-Clause"
] | null | null | null | colour/models/tests/test_cam02_ucs.py | rift-labs-developer/colour | 15112dbe824aab0f21447e0db4a046a28a06f43a | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Defines the unit tests for the :mod:`colour.models.cam02_ucs` module.
"""
import numpy as np
import unittest
from itertools import permutations
from colour.appearance import (CAM_KWARGS_CIECAM02_sRGB,
VIEWING_CONDITIONS_CIECAM02, XYZ_to_CIECAM02)
from colour.... | 37.537849 | 79 | 0.587773 |
5ec93ca3d97724bbe63ee549127cb96055b692b8 | 118,235 | py | Python | python/pyspark/pandas/tests/test_groupby.py | almogtavor/spark | 78e6263cce949843c07c821356ea58c4c568ccdc | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2020-05-09T14:37:19.000Z | 2020-05-09T14:37:19.000Z | python/pyspark/pandas/tests/test_groupby.py | akshatb1/spark | 80f6fe2f6de16cef706bcb4ea2f9233131c5e767 | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | python/pyspark/pandas/tests/test_groupby.py | akshatb1/spark | 80f6fe2f6de16cef706bcb4ea2f9233131c5e767 | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 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 us... | 41.153846 | 100 | 0.480315 |
0363a50381fc11dbf75302da96ccf43f9afe5768 | 1,486 | py | Python | IO_server/db2.py | gurkslask/hamcwebc | 8abbe47cdd58972072d6088b63e1c368a63bb4af | [
"BSD-3-Clause"
] | null | null | null | IO_server/db2.py | gurkslask/hamcwebc | 8abbe47cdd58972072d6088b63e1c368a63bb4af | [
"BSD-3-Clause"
] | null | null | null | IO_server/db2.py | gurkslask/hamcwebc | 8abbe47cdd58972072d6088b63e1c368a63bb4af | [
"BSD-3-Clause"
] | null | null | null | """Database connections."""
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from models import Sensor, SensorTimeData
import paho.mqtt.client as mqtt
def put_sql(name, value):
"""Connect to sql and put in values."""
session = Session()
sensor = session.query(Sensor).filter(... | 26.070175 | 74 | 0.668237 |
fe9ebc8725c8839496fee05a6ccca0ffdc005669 | 4,224 | py | Python | storm_kit/gym/kdl_parser.py | maxspahn/storm | cf056514659cab9c5c7ac9d850eae7c56a660726 | [
"MIT"
] | 68 | 2021-04-27T21:10:11.000Z | 2022-03-23T23:13:45.000Z | storm_kit/gym/kdl_parser.py | maxspahn/storm | cf056514659cab9c5c7ac9d850eae7c56a660726 | [
"MIT"
] | 3 | 2021-07-06T11:04:32.000Z | 2022-01-13T07:57:43.000Z | storm_kit/gym/kdl_parser.py | maxspahn/storm | cf056514659cab9c5c7ac9d850eae7c56a660726 | [
"MIT"
] | 16 | 2021-04-28T02:50:45.000Z | 2022-01-13T13:35:43.000Z | #!/usr/bin/env python
#
# MIT License
#
# Copyright (c) 2020-2021 NVIDIA CORPORATION.
#
# 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... | 43.102041 | 97 | 0.613636 |
8f1f6dbd27d94429f012e1c38e7027972a2479a0 | 1,246 | py | Python | tests/test_mass_matrix.py | AdrienCorenflos/blackjax | e3204e17d3833be73d6f703dbb33b68b1431e629 | [
"Apache-2.0"
] | null | null | null | tests/test_mass_matrix.py | AdrienCorenflos/blackjax | e3204e17d3833be73d6f703dbb33b68b1431e629 | [
"Apache-2.0"
] | null | null | null | tests/test_mass_matrix.py | AdrienCorenflos/blackjax | e3204e17d3833be73d6f703dbb33b68b1431e629 | [
"Apache-2.0"
] | null | null | null | import jax
import numpy as np
import pytest
from blackjax.adaptation.mass_matrix import mass_matrix_adaptation
@pytest.mark.parametrize("n_dim", [1, 3])
@pytest.mark.parametrize("is_mass_matrix_diagonal", [True, False])
def test_welford_adaptation(n_dim, is_mass_matrix_diagonal):
num_samples = 3_000
# Gener... | 33.675676 | 82 | 0.718299 |
6e71959a2c611ab904dab93c8db8be0cc3f994ac | 1,314 | py | Python | tests/test_kmeans.py | rmaestre/ml-code-lectures | 9cdc5e8552da10c30dca531ba6eaff41f0689713 | [
"MIT"
] | 2 | 2022-03-28T13:42:07.000Z | 2022-03-28T13:42:12.000Z | tests/test_kmeans.py | rmaestre/ml-code-lectures | 9cdc5e8552da10c30dca531ba6eaff41f0689713 | [
"MIT"
] | null | null | null | tests/test_kmeans.py | rmaestre/ml-code-lectures | 9cdc5e8552da10c30dca531ba6eaff41f0689713 | [
"MIT"
] | 1 | 2022-03-03T08:36:52.000Z | 2022-03-03T08:36:52.000Z | import numpy as np
from ml.datasets.blobs import Blobs
from ml.models.kmeans import Kmeans
def get_data():
dataset = Blobs()
X, y = dataset.generate(
n_samples=100, n_centers=3, random_state=1234, cluster_std=[1.2, 2.4, 2.0]
)
return X, y
def test_init():
X, _ = get_data()
kmeans =... | 23.052632 | 82 | 0.64003 |
1d78a3b31b2e3f7463eb3c8a98e15b2b4febc308 | 17,058 | py | Python | resources/usr/lib/python2.7/dist-packages/numpy/distutils/command/config.py | edawson/parliament2 | 2632aa3484ef64c9539c4885026b705b737f6d1e | [
"Apache-2.0"
] | null | null | null | resources/usr/lib/python2.7/dist-packages/numpy/distutils/command/config.py | edawson/parliament2 | 2632aa3484ef64c9539c4885026b705b737f6d1e | [
"Apache-2.0"
] | null | null | null | resources/usr/lib/python2.7/dist-packages/numpy/distutils/command/config.py | edawson/parliament2 | 2632aa3484ef64c9539c4885026b705b737f6d1e | [
"Apache-2.0"
] | 1 | 2020-05-28T23:01:44.000Z | 2020-05-28T23:01:44.000Z | # Added Fortran compiler support to config. Currently useful only for
# try_compile call. try_run works but is untested for most of Fortran
# compilers (they must define linker_exe first).
# Pearu Peterson
import os, signal
import warnings
import sys
from distutils.command.config import config as old_config
from dist... | 37.002169 | 108 | 0.525091 |
2538455d8f0eb0afe85cdeef8cdeec88afd88082 | 1,332 | py | Python | bicycleparking/serializers.py | bikespace/bikespace | abd05b0232b5ef14bcc5abf64cfd2ef6141938c8 | [
"MIT"
] | 3 | 2019-01-25T23:04:12.000Z | 2019-05-28T18:46:30.000Z | bicycleparking/serializers.py | bikespace/bikespace | abd05b0232b5ef14bcc5abf64cfd2ef6141938c8 | [
"MIT"
] | 12 | 2020-02-11T23:24:06.000Z | 2022-02-10T08:04:25.000Z | bicycleparking/serializers.py | bikespace/bikespace | abd05b0232b5ef14bcc5abf64cfd2ef6141938c8 | [
"MIT"
] | 1 | 2019-01-25T23:08:34.000Z | 2019-01-25T23:08:34.000Z | # MIT License
# Copyright 2017,Code 4 Canada
# written by and for the bicycle parking project, a joint project of
# Civic Tech Toronto, Cycle Toronto, Code 4 Canada, and the
# City of Toronto
#
# Created 2017
# Purpose define serializers for endpoints
#
# Modified 2018 05 30
# Purpose add location endpoint serialize... | 30.272727 | 79 | 0.746246 |
d46ae3d2db36925be865e72e29e7eaa95e0d9e12 | 6,404 | py | Python | tests/app/service/test_service_data_retention_rest.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 41 | 2019-11-28T16:58:41.000Z | 2022-01-28T21:11:16.000Z | tests/app/service/test_service_data_retention_rest.py | cds-snc/notification-api | b1c1064f291eb860b494c3fa65ac256ad70bf47c | [
"MIT"
] | 1,083 | 2019-07-08T12:57:24.000Z | 2022-03-08T18:53:40.000Z | tests/app/service/test_service_data_retention_rest.py | cds-snc/notifier-api | 90b385ec49efbaee7e607516fc7d9f08991af813 | [
"MIT"
] | 9 | 2020-01-24T19:56:43.000Z | 2022-01-27T21:36:53.000Z | import json
import uuid
from app.models import ServiceDataRetention
from tests import create_authorization_header
from tests.app.db import create_service_data_retention
def test_get_service_data_retention(client, sample_service):
sms_data_retention = create_service_data_retention(service=sample_service)
emai... | 43.27027 | 129 | 0.731418 |
e95d1ccf0d72356e9f36243de504e04decabfddf | 165,901 | py | Python | siliconcompiler/core.py | hohe/siliconcompiler | 497f272c87c8f247dcd29db76c8d6ed0c0939e50 | [
"Apache-2.0"
] | null | null | null | siliconcompiler/core.py | hohe/siliconcompiler | 497f272c87c8f247dcd29db76c8d6ed0c0939e50 | [
"Apache-2.0"
] | null | null | null | siliconcompiler/core.py | hohe/siliconcompiler | 497f272c87c8f247dcd29db76c8d6ed0c0939e50 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Silicon Compiler Authors. All Rights Reserved.
import argparse
import base64
import time
import datetime
import multiprocessing
import tarfile
import traceback
import asyncio
from subprocess import run, PIPE
import os
import pathlib
import sys
import gzip
import re
import json
import logging
import ha... | 39.537893 | 160 | 0.51509 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.