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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5f158ee0c756142d34bd05900eb20b1644adfbe9 | 4,569 | py | Python | plugins/modules/oci_devops_object_content_facts.py | LaudateCorpus1/oci-ansible-collection | 2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_devops_object_content_facts.py | LaudateCorpus1/oci-ansible-collection | 2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7 | [
"Apache-2.0"
] | null | null | null | plugins/modules/oci_devops_object_content_facts.py | LaudateCorpus1/oci-ansible-collection | 2b1cd87b4d652a97c1ca752cfc4fdc4bdb37a7e7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2020, 2022 Oracle and/or its affiliates.
# This software is made available to you under the terms of the GPL 3.0 license or the Apache 2.0 license.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Apache License v2.0
# See LICENSE.TXT for d... | 28.55625 | 155 | 0.677829 |
04e5614a445d89f832d71debcb4ffb6b267a5a12 | 19,246 | py | Python | python/genesys/led_set_g_1.py | DanielTisza/spectralcamera | 4fef93b3b4cd8f83e016070f1c0d68aa0cff5102 | [
"MIT"
] | null | null | null | python/genesys/led_set_g_1.py | DanielTisza/spectralcamera | 4fef93b3b4cd8f83e016070f1c0d68aa0cff5102 | [
"MIT"
] | null | null | null | python/genesys/led_set_g_1.py | DanielTisza/spectralcamera | 4fef93b3b4cd8f83e016070f1c0d68aa0cff5102 | [
"MIT"
] | null | null | null |
from __future__ import print_function
import os
import platform
import sys
from mvIMPACT import acquire
from mvIMPACT.Common import exampleHelper
import ctypes
import numpy as np
import datetime as dt
import matplotlib
from LEDDriver import detect_LED_devices, LEDDriver, LEDException
from spectracular.fpi_driver i... | 27.338068 | 144 | 0.618622 |
e1bbcb70554808c096963d02b38f7656fc591eb0 | 3,587 | py | Python | tohu/v4/spawn_context.py | maxalbert/tohu | 3adf0c58b13ef1e1d716d7d613484d2adc58fb60 | [
"MIT"
] | 1 | 2019-03-07T19:58:45.000Z | 2019-03-07T19:58:45.000Z | tohu/v4/spawn_context.py | maxalbert/tohu | 3adf0c58b13ef1e1d716d7d613484d2adc58fb60 | [
"MIT"
] | 9 | 2017-10-04T15:08:53.000Z | 2021-02-02T21:51:41.000Z | tohu/v4/spawn_context.py | maxalbert/tohu | 3adf0c58b13ef1e1d716d7d613484d2adc58fb60 | [
"MIT"
] | null | null | null | import textwrap
from bidict import bidict
from itertools import count
from .logging import logger
from .primitive_generators import PrimitiveGenerator
from .derived_generators import Apply, GetAttribute, Lookup, SelectOneDerived
__all__ = ['SpawnContext']
class NoExistingSpawn(Exception):
"""
Custom excepti... | 37.364583 | 98 | 0.609144 |
a2111c1deaabe6f5dc6fdb00a01910d19e36f0f4 | 3,534 | py | Python | bindings/python/ensmallen/datasets/string/mycobacteriumrufum.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/mycobacteriumrufum.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/mycobacteriumrufum.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Mycobacterium rufum.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protein as... | 32.722222 | 223 | 0.676287 |
2b028e0fcbaf8105a02750f0b3f377386ae63c17 | 69,420 | py | Python | salt/loader.py | casselt/salt | d8a2ef4e0cd544656489d23d161928879b1fc1c0 | [
"Apache-2.0"
] | null | null | null | salt/loader.py | casselt/salt | d8a2ef4e0cd544656489d23d161928879b1fc1c0 | [
"Apache-2.0"
] | 1 | 2019-08-18T07:03:30.000Z | 2019-08-18T07:03:30.000Z | salt/loader.py | casselt/salt | d8a2ef4e0cd544656489d23d161928879b1fc1c0 | [
"Apache-2.0"
] | 2 | 2020-11-04T06:24:32.000Z | 2020-11-06T11:00:57.000Z | # -*- coding: utf-8 -*-
'''
The Salt loader is the core to Salt's plugin system, the loader scans
directories for python loadable code and organizes the code into the
plugin interfaces used by Salt.
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import re
im... | 35.673176 | 171 | 0.554235 |
14e559d46f39d9ec3c8e6e3446aea40e5e25ec20 | 45,256 | py | Python | thirdparty-cpp/boost_1_62_0/tools/build/src/build/virtual_target.py | nxplatform/nx-mobile | 0dc174c893f2667377cb2ef7e5ffeb212fa8b3e5 | [
"Apache-2.0"
] | 1 | 2018-12-15T19:57:24.000Z | 2018-12-15T19:57:24.000Z | thirdparty-cpp/boost_1_62_0/tools/build/src/build/virtual_target.py | nxplatform/nx-mobile | 0dc174c893f2667377cb2ef7e5ffeb212fa8b3e5 | [
"Apache-2.0"
] | null | null | null | thirdparty-cpp/boost_1_62_0/tools/build/src/build/virtual_target.py | nxplatform/nx-mobile | 0dc174c893f2667377cb2ef7e5ffeb212fa8b3e5 | [
"Apache-2.0"
] | null | null | null | # Status: ported.
# Base revision: 64488.
#
# Copyright (C) Vladimir Prus 2002. Permission to copy, use, modify, sell and
# distribute this software is granted provided this copyright notice appears in
# all copies. This software is provided "as is" without express or implied
# warranty, and with no claim as ... | 38.581415 | 120 | 0.574045 |
3b7eca163baa98a288a84315b6f332c5db77fd5d | 14,894 | py | Python | EDK_II/BaseTools/Scripts/UpdateBuildVersions.py | tomix86/efi-tetris | 67d495c3b00bc6d4abbdcaceae476f99f40afebf | [
"MIT"
] | 8 | 2019-06-03T10:47:48.000Z | 2021-08-21T19:11:38.000Z | EDK_II/BaseTools/Scripts/UpdateBuildVersions.py | tomix86/efi-tetris | 67d495c3b00bc6d4abbdcaceae476f99f40afebf | [
"MIT"
] | null | null | null | EDK_II/BaseTools/Scripts/UpdateBuildVersions.py | tomix86/efi-tetris | 67d495c3b00bc6d4abbdcaceae476f99f40afebf | [
"MIT"
] | 1 | 2021-04-21T06:20:00.000Z | 2021-04-21T06:20:00.000Z | ## @file
# Update build revisions of the tools when performing a developer build
#
# This script will modife the C/Include/Common/BuildVersion.h file and the two
# Python scripts, Python/Common/BuildVersion.py and Python/UPT/BuildVersion.py.
# If SVN is available, the tool will obtain the current checked out version of... | 37.142145 | 120 | 0.625151 |
027f006fa3e52abbaeb56769ddc741fa9aae8536 | 11,075 | py | Python | sdk/python/pulumi_azure_native/web/web_app_host_name_binding_slot.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/web/web_app_host_name_binding_slot.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/web/web_app_host_name_binding_slot.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from .. import _utilities, _tables
from ... | 45.389344 | 1,491 | 0.657698 |
5617e11caa2e1be0f9bec258233f522b191895ad | 7,359 | py | Python | stdplugins/gmquote.py | ppppspsljdhdd/Pepe | 1e57825ddb0ab3ba15a19cad0ecfbf2622f6b851 | [
"Apache-2.0"
] | 20 | 2020-01-25T05:08:26.000Z | 2022-01-18T07:37:53.000Z | stdplugins/gmquote.py | ishaizz/PepeBot | 7440cadc8228106d221fc8e436a0809a86be5159 | [
"Apache-2.0"
] | 15 | 2019-11-07T07:53:56.000Z | 2022-01-23T09:21:17.000Z | stdplugins/gmquote.py | ishaizz/PepeBot | 7440cadc8228106d221fc8e436a0809a86be5159 | [
"Apache-2.0"
] | 62 | 2019-10-20T06:35:19.000Z | 2021-01-23T17:26:05.000Z | # Edited by @Smart_S54
"""
good morning plugin
command: `.gm`
"""
import asyncio
import random
from uniborg.util import admin_cmd
@borg.on(admin_cmd(pattern="ggm"))
async def _(event):
if event.fwd_from:
return
await event.edit("`Wishing GM...`")
await asyncio.sleep(2)
x = random.randran... | 36.979899 | 184 | 0.598043 |
94c54dd323d93eb5613f76765381e5d06fdc40a5 | 6,597 | py | Python | homeassistant/components/remote/__init__.py | zechfox/core | a90d3a051fc402957c24ec782fca1d2f6d9cf8dc | [
"Apache-2.0"
] | 1 | 2021-07-31T15:19:30.000Z | 2021-07-31T15:19:30.000Z | homeassistant/components/remote/__init__.py | zechfox/core | a90d3a051fc402957c24ec782fca1d2f6d9cf8dc | [
"Apache-2.0"
] | 25 | 2021-05-04T08:33:38.000Z | 2022-03-31T06:10:33.000Z | homeassistant/components/remote/__init__.py | zechfox/core | a90d3a051fc402957c24ec782fca1d2f6d9cf8dc | [
"Apache-2.0"
] | null | null | null | """Support to interface with universal remote control devices."""
from __future__ import annotations
from collections.abc import Iterable
from datetime import timedelta
import functools as ft
import logging
from typing import Any, cast, final
import voluptuous as vol
from homeassistant.config_entries import ConfigEn... | 30.971831 | 88 | 0.695771 |
1491254ce933c49373d589978913e2692f36f4c9 | 4,810 | py | Python | main.py | atotev/AMNet | 5d9e6925cbae402ef9825d1a84c3ab4b41921c05 | [
"MIT"
] | null | null | null | main.py | atotev/AMNet | 5d9e6925cbae402ef9825d1a84c3ab4b41921c05 | [
"MIT"
] | null | null | null | main.py | atotev/AMNet | 5d9e6925cbae402ef9825d1a84c3ab4b41921c05 | [
"MIT"
] | null | null | null | __author__ = 'Jiri Fajtl'
__email__ = 'ok1zjf@gmail.com'
__version__= '3.5'
__status__ = "Research"
__date__ = "30/1/2018"
__license__= "MIT License"
import argparse
from amnet_model import *
import amnet_model as amnet_model
from amnet import *
import amnet as amnet
from config import *
from utils import *
def main... | 44.953271 | 173 | 0.663825 |
21aa19fb9daf139b6ec120c31982ffc8794646e4 | 122 | py | Python | src/losses/vicreg.py | johanattia/tensorflow-saint | 95bbfaf51c1f1be96a2884dc664b10e9dd183984 | [
"MIT"
] | 3 | 2022-03-30T20:07:55.000Z | 2022-03-30T21:40:14.000Z | src/losses/vicreg.py | johanattia/tensorflow-saint | 95bbfaf51c1f1be96a2884dc664b10e9dd183984 | [
"MIT"
] | null | null | null | src/losses/vicreg.py | johanattia/tensorflow-saint | 95bbfaf51c1f1be96a2884dc664b10e9dd183984 | [
"MIT"
] | null | null | null | """Self-supervision with VICReg Objective"""
import tensorflow as tf
class VICRegLoss(tf.keras.losses.Loss):
pass
| 13.555556 | 44 | 0.737705 |
a72b3b6b4c727903c9ea87fe6d7166e0bd1b8aee | 1,571 | py | Python | debian/python-nova/usr/lib/python2.7/dist-packages/nova/tests/test_vmmode.py | bopopescu/stacklab-nova | 4ab1698659b663ef222255610d1a5c042706dd65 | [
"Apache-2.0"
] | null | null | null | debian/python-nova/usr/lib/python2.7/dist-packages/nova/tests/test_vmmode.py | bopopescu/stacklab-nova | 4ab1698659b663ef222255610d1a5c042706dd65 | [
"Apache-2.0"
] | null | null | null | debian/python-nova/usr/lib/python2.7/dist-packages/nova/tests/test_vmmode.py | bopopescu/stacklab-nova | 4ab1698659b663ef222255610d1a5c042706dd65 | [
"Apache-2.0"
] | 1 | 2020-07-24T08:31:57.000Z | 2020-07-24T08:31:57.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright (C) 2012 Red Hat, 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... | 31.42 | 78 | 0.65818 |
13e5c4cdc6d640b1791bef9d6e364fdf8a3c6329 | 8,304 | py | Python | openpeerpower/components/binary_sensor/device_condition.py | pcaston/core | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | [
"Apache-2.0"
] | 1 | 2021-07-08T20:09:55.000Z | 2021-07-08T20:09:55.000Z | openpeerpower/components/binary_sensor/device_condition.py | pcaston/core | e74d946cef7a9d4e232ae9e0ba150d18018cfe33 | [
"Apache-2.0"
] | 47 | 2021-02-21T23:43:07.000Z | 2022-03-31T06:07:10.000Z | openpeerpower/components/binary_sensor/device_condition.py | OpenPeerPower/core | f673dfac9f2d0c48fa30af37b0a99df9dd6640ee | [
"Apache-2.0"
] | null | null | null | """Implement device conditions for binary sensor."""
from __future__ import annotations
import voluptuous as vol
from openpeerpower.components.device_automation.const import CONF_IS_OFF, CONF_IS_ON
from openpeerpower.const import ATTR_DEVICE_CLASS, CONF_ENTITY_ID, CONF_FOR, CONF_TYPE
from openpeerpower.core import Op... | 30.529412 | 88 | 0.719894 |
ca9e18977722c870c880367d6d868084c1ce6e8f | 1,499 | py | Python | makeapp/app_templates/webscaff/__module_name__/uwsgicfg.py | idlesign/makeapp | ff4324e91cdde09bf78bfb946f584414ac11160e | [
"BSD-3-Clause"
] | 12 | 2016-07-17T11:49:06.000Z | 2021-07-05T06:22:54.000Z | makeapp/app_templates/webscaff/__module_name__/uwsgicfg.py | idlesign/makeapp | ff4324e91cdde09bf78bfb946f584414ac11160e | [
"BSD-3-Clause"
] | 4 | 2016-06-27T07:36:45.000Z | 2020-03-18T05:56:33.000Z | makeapp/app_templates/webscaff/__module_name__/uwsgicfg.py | idlesign/makeapp | ff4324e91cdde09bf78bfb946f584414ac11160e | [
"BSD-3-Clause"
] | 1 | 2015-09-13T10:44:08.000Z | 2015-09-13T10:44:08.000Z | from uwsgiconf.config import configure_uwsgi
from uwsgiconf.presets.nice import PythonSection
def get_configurations() -> PythonSection:
from django.conf import settings
in_production = settings.IN_PRODUCTION
project = settings.PROJECT_NAME
domain = settings.PROJECT_DOMAIN
dir_state = settings... | 27.759259 | 85 | 0.681788 |
1982069bcbd4ae6b1abc5d6da658214690d30c1f | 8,556 | py | Python | extensions/GnuplotClBridge.py | dszmaj/wikidpad | 1127375665935524ddb623da8dd5137038c7e53e | [
"Apache-2.0",
"MIT"
] | 16 | 2015-02-05T17:32:04.000Z | 2022-01-14T13:46:36.000Z | extensions/GnuplotClBridge.py | dszmaj/wikidpad | 1127375665935524ddb623da8dd5137038c7e53e | [
"Apache-2.0",
"MIT"
] | 8 | 2015-06-20T20:02:41.000Z | 2016-02-23T14:52:32.000Z | extensions/GnuplotClBridge.py | dszmaj/wikidpad | 1127375665935524ddb623da8dd5137038c7e53e | [
"Apache-2.0",
"MIT"
] | 11 | 2015-05-19T09:17:16.000Z | 2017-09-14T00:43:13.000Z | import os, os.path
import subprocess
import wx
from pwiki.TempFileSet import createTempFile
from pwiki.StringOps import mbcsEnc, mbcsDec, lineendToOs
WIKIDPAD_PLUGIN = (("InsertionByKey", 1), ("Options", 1))
def describeInsertionKeys(ver, app):
"""
API function for "InsertionByKey" plugins
... | 36.72103 | 103 | 0.591164 |
7055b21aec54373037a015406597451bca7a1790 | 1,200 | py | Python | olpxek_bot/eval_py.py | kexplo/olpxek-bot | d4ec11d97ea906651a2df225081f33a235e9bd65 | [
"MIT"
] | 7 | 2020-08-18T22:07:24.000Z | 2022-01-01T07:32:20.000Z | olpxek_bot/eval_py.py | kexplo/olpxek_bot | 2fe5352ab1e584f877ba5445ff5af2d179c9b2c8 | [
"MIT"
] | null | null | null | olpxek_bot/eval_py.py | kexplo/olpxek_bot | 2fe5352ab1e584f877ba5445ff5af2d179c9b2c8 | [
"MIT"
] | null | null | null | from RestrictedPython import compile_restricted_eval
from RestrictedPython import (
limited_builtins,
# PrintCollector,
safe_builtins,
utility_builtins,
)
from RestrictedPython.Eval import default_guarded_getitem
from RestrictedPython.Guards import (
# guarded_setattr,
# guarded_delattr
full... | 27.906977 | 67 | 0.7 |
184e4b6d15505b299ca3b92611e5a175867a6a3d | 8,988 | py | Python | user_service_sdk/model/topology/container_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | 5 | 2019-07-31T04:11:05.000Z | 2021-01-07T03:23:20.000Z | user_service_sdk/model/topology/container_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | user_service_sdk/model/topology/container_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: container.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf i... | 43.631068 | 827 | 0.738763 |
19f11a6fc9d9baf5d5e20b24bc5dd0da749d1d75 | 2,198 | py | Python | configure.py | Shura1oplot/dufi | c9c25524020e57d3670c298acca305900b6490e7 | [
"MIT"
] | null | null | null | configure.py | Shura1oplot/dufi | c9c25524020e57d3670c298acca305900b6490e7 | [
"MIT"
] | null | null | null | configure.py | Shura1oplot/dufi | c9c25524020e57d3670c298acca305900b6490e7 | [
"MIT"
] | null | null | null | # [SublimeLinter @python:3]
import sys
import os
from pathlib import Path
import platform
import ctypes
DUFI_VERSION = "0.9.10"
TCL_VERSION = "8.6"
SDK_BASE_DIR = "%ProgramFiles(x86)%\\Windows Kits\\10\\Include"
VC_DIR = "%ProgramFiles(x86)%\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build"
def ma... | 30.957746 | 94 | 0.635123 |
e3759941f4454821b292af4ebc6bd2708938437a | 63 | py | Python | contentstore/__init__.py | praekeltfoundation/seed-stage-based-messaging | c1d39601c0d16fb32cebe7c2e288076c1dc4225b | [
"BSD-3-Clause"
] | 1 | 2017-08-17T14:17:53.000Z | 2017-08-17T14:17:53.000Z | contentstore/__init__.py | praekelt/seed-stage-based-messaging | c1d39601c0d16fb32cebe7c2e288076c1dc4225b | [
"BSD-3-Clause"
] | 69 | 2016-02-19T06:58:00.000Z | 2018-11-26T09:43:42.000Z | contentstore/__init__.py | praekeltfoundation/seed-stage-based-messaging | c1d39601c0d16fb32cebe7c2e288076c1dc4225b | [
"BSD-3-Clause"
] | 2 | 2016-09-28T09:32:00.000Z | 2017-08-18T06:18:36.000Z | default_app_config = "contentstore.apps.ContentStoreAppConfig"
| 31.5 | 62 | 0.873016 |
3ef63fd8ac926a717c2090468d593b85fa6014cf | 2,941 | py | Python | test_panexport.py | shepherdjay/pan-os-scripts | 03bacaa688ba74146532869e636e7a338c922fef | [
"MIT"
] | 2 | 2017-12-10T14:20:15.000Z | 2018-03-29T21:49:19.000Z | test_panexport.py | shepherdjay/pan-os-scripts | 03bacaa688ba74146532869e636e7a338c922fef | [
"MIT"
] | 29 | 2017-02-01T18:02:24.000Z | 2022-03-21T14:32:05.000Z | test_panexport.py | shepherdjay/pan-os-scripts | 03bacaa688ba74146532869e636e7a338c922fef | [
"MIT"
] | 2 | 2017-10-16T16:28:32.000Z | 2017-12-10T14:20:16.000Z | import datetime
import os
import shutil
import tempfile
from unittest import TestCase
from unittest.mock import patch
import xmltodict
from pandas import read_excel
import panexport
TEST_FILE_DIR = "testfiles/"
def get_test_path(file):
path = os.path.join(os.path.dirname(__file__), TEST_FILE_DIR + file)
re... | 29.41 | 93 | 0.637538 |
8026336f951e3ec41a982719a5987ad8a6fd0272 | 257 | py | Python | polls/urls.py | K0Te/django-polls | f9743eb6fbd26c2cea860ee3b175f63c5f090076 | [
"MIT"
] | null | null | null | polls/urls.py | K0Te/django-polls | f9743eb6fbd26c2cea860ee3b175f63c5f090076 | [
"MIT"
] | null | null | null | polls/urls.py | K0Te/django-polls | f9743eb6fbd26c2cea860ee3b175f63c5f090076 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import path
from polls.core import views
urlpatterns = [
path('admin/', admin.site.urls),
path('', views.index, name='index'),
path('polls/<int:question_id>/', views.detail, name='detail'),
]
| 21.416667 | 66 | 0.684825 |
af9df78ab7b34f391e8d69e5ba9c154290119855 | 36,087 | py | Python | g3py/processes/stochastic.py | griosd/g3py | 10402f045d10f1df6d3adf5320e9fb9103b5a6b5 | [
"MIT"
] | 6 | 2016-12-20T19:04:56.000Z | 2020-07-07T23:09:04.000Z | g3py/processes/stochastic.py | griosd/g3py | 10402f045d10f1df6d3adf5320e9fb9103b5a6b5 | [
"MIT"
] | 49 | 2016-12-20T05:44:12.000Z | 2017-09-16T04:13:38.000Z | g3py/processes/stochastic.py | griosd/g3py | 10402f045d10f1df6d3adf5320e9fb9103b5a6b5 | [
"MIT"
] | 5 | 2017-02-15T17:06:12.000Z | 2020-05-23T03:06:40.000Z | import os
import types
import matplotlib.pyplot as plt
import numpy as np
import theano as th
import theano.tensor as tt
from ..bayesian.average import mcmc_ensemble, chains_to_datatrace, plot_datatrace
from ..bayesian.models import GraphicalModel, PlotModel
from ..bayesian.selection import optimize
from ..libs impor... | 44.717472 | 160 | 0.597694 |
b6fc1f2a49e1e2d638f1a30ec506a1e22ed4acc7 | 2,822 | py | Python | tests/components/switcher_kis/test_sensor.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 7 | 2019-08-15T13:36:58.000Z | 2020-03-18T10:46:29.000Z | tests/components/switcher_kis/test_sensor.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 100 | 2020-06-17T22:22:41.000Z | 2022-03-31T06:24:19.000Z | tests/components/switcher_kis/test_sensor.py | Vaarlion/core | f3de8b9f28de01abf72c0f5bb0b457eb1841f201 | [
"Apache-2.0"
] | 11 | 2020-12-16T13:48:14.000Z | 2022-02-01T00:28:05.000Z | """Test the Switcher Sensor Platform."""
import pytest
from homeassistant.components.switcher_kis.const import DATA_DEVICE, DOMAIN
from homeassistant.helpers import entity_registry as er
from homeassistant.util import slugify
from . import init_integration
from .consts import DUMMY_PLUG_DEVICE, DUMMY_SWITCHER_DEVICES... | 30.021277 | 88 | 0.705882 |
f5adece609f840f9f179b7430e59c978aac499a6 | 29,364 | py | Python | nebula2_fork/fbthrift/protocol/TSimpleJSONProtocol.py | linzhiming0826/nebula-python | 0c508aa9780981c1fef2bf826d624a69ca2c64b0 | [
"Apache-2.0"
] | null | null | null | nebula2_fork/fbthrift/protocol/TSimpleJSONProtocol.py | linzhiming0826/nebula-python | 0c508aa9780981c1fef2bf826d624a69ca2c64b0 | [
"Apache-2.0"
] | null | null | null | nebula2_fork/fbthrift/protocol/TSimpleJSONProtocol.py | linzhiming0826/nebula-python | 0c508aa9780981c1fef2bf826d624a69ca2c64b0 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 32.056769 | 86 | 0.592017 |
db5d42b472b560c53d97b07909720521b7db6871 | 3,084 | py | Python | source/COMRegistrationFixes/__init__.py | SWEN-712/screen-reader-brandonp728 | e30c25ad2d10ce632fac0548696a61a872328f59 | [
"bzip2-1.0.6"
] | null | null | null | source/COMRegistrationFixes/__init__.py | SWEN-712/screen-reader-brandonp728 | e30c25ad2d10ce632fac0548696a61a872328f59 | [
"bzip2-1.0.6"
] | null | null | null | source/COMRegistrationFixes/__init__.py | SWEN-712/screen-reader-brandonp728 | e30c25ad2d10ce632fac0548696a61a872328f59 | [
"bzip2-1.0.6"
] | null | null | null | # -*- coding: UTF-8 -*-
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2018 NV Access Limited
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
"""Utilities to re-register particular system COM interfaces needed by NVDA."""
import os
import subprocess
import ... | 40.051948 | 141 | 0.759728 |
df64e239a2e467c8e4429dbeb7039f1aa9965ecc | 1,141 | py | Python | samza-test/src/main/python/integration_tests.py | xiefan46/samza | daeecf51153c3984da90bfabdba69cd97449c86d | [
"Apache-2.0"
] | 860 | 2015-01-25T17:00:10.000Z | 2022-03-30T10:15:32.000Z | samza-test/src/main/python/integration_tests.py | xiefan46/samza | daeecf51153c3984da90bfabdba69cd97449c86d | [
"Apache-2.0"
] | 837 | 2015-07-23T18:48:57.000Z | 2022-03-14T22:49:57.000Z | samza-test/src/main/python/integration_tests.py | xiefan46/samza | daeecf51153c3984da90bfabdba69cd97449c86d | [
"Apache-2.0"
] | 418 | 2015-01-29T18:21:24.000Z | 2022-03-26T13:31:00.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# 'License'); you may not u... | 36.806452 | 62 | 0.734443 |
13802923fe01cec546d2888a939e947709686031 | 170,188 | py | Python | server/bottle.py | Perlatecnica/Blockly4Nucleo | de917fdcd7df0019190ee6ca032d57287c245c12 | [
"MIT"
] | 23 | 2017-01-03T02:35:57.000Z | 2020-01-24T06:41:57.000Z | server/bottle.py | Perlatecnica/Blockly4Nucleo | de917fdcd7df0019190ee6ca032d57287c245c12 | [
"MIT"
] | 15 | 2017-02-16T04:31:57.000Z | 2021-03-25T21:41:08.000Z | server/bottle.py | Perlatecnica/Blockly4Nucleo | de917fdcd7df0019190ee6ca032d57287c245c12 | [
"MIT"
] | 3 | 2017-02-15T03:31:47.000Z | 2018-11-12T16:19:03.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Bottle is a fast and simple micro-framework for small web applications. It
offers request dispatching (Routes) with URL parameter support, templates,
a built-in HTTP Server and adapters for many third party WSGI/HTTP-server and
template engines - all in a single file an... | 38.538949 | 117 | 0.581598 |
55dfc5c46fc0b1c07805669b0bc3eb1224dca2c8 | 6,308 | py | Python | doc/source/conf.py | hugovk/smmap | f0b322afcf6934501bade7776c5331619485a06c | [
"BSD-3-Clause"
] | 41 | 2015-01-16T12:05:11.000Z | 2021-10-15T05:57:53.000Z | doc/source/conf.py | hugovk/smmap | f0b322afcf6934501bade7776c5331619485a06c | [
"BSD-3-Clause"
] | 25 | 2015-01-07T12:44:54.000Z | 2022-01-16T17:17:01.000Z | doc/source/conf.py | hugovk/smmap | f0b322afcf6934501bade7776c5331619485a06c | [
"BSD-3-Clause"
] | 19 | 2015-04-12T17:15:57.000Z | 2022-03-15T21:32:38.000Z | #
# smmap documentation build configuration file, created by
# sphinx-quickstart on Wed Jun 8 15:14:25 2011.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have... | 32.348718 | 80 | 0.722416 |
c80fd2ba15effe3c21ce7d105cda1b815abb4c7b | 1,829 | py | Python | oc_chess_club/models/match.py | PabloLec/oc_chess_club | 69a6ce3111afadce73710d314579af6e6f0cbce6 | [
"MIT"
] | null | null | null | oc_chess_club/models/match.py | PabloLec/oc_chess_club | 69a6ce3111afadce73710d314579af6e6f0cbce6 | [
"MIT"
] | null | null | null | oc_chess_club/models/match.py | PabloLec/oc_chess_club | 69a6ce3111afadce73710d314579af6e6f0cbce6 | [
"MIT"
] | 1 | 2021-07-15T06:49:39.000Z | 2021-07-15T06:49:39.000Z | class Match:
"""Model for match. All matches are associated with a round which is also associated with a tournament.
Attributes:
tournament_id (int): Unique id of the parent tournament.
round_id (int): Unique id of the parent round.
winner (int): Winner of the match. 1 for Player 1, 2 f... | 40.644444 | 109 | 0.616184 |
4e2fdbeecc62fbd4931e7d9d722f589af37b6cf9 | 7,834 | py | Python | docs/conf.py | KevalChotaliya/EDS-Covid-19 | f7e0bd600e2847a6004a50d81422bf6bc013fe9c | [
"FTL"
] | null | null | null | docs/conf.py | KevalChotaliya/EDS-Covid-19 | f7e0bd600e2847a6004a50d81422bf6bc013fe9c | [
"FTL"
] | null | null | null | docs/conf.py | KevalChotaliya/EDS-Covid-19 | f7e0bd600e2847a6004a50d81422bf6bc013fe9c | [
"FTL"
] | null | null | null | # -*- coding: utf-8 -*-
#
# EDS Covid-19 documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values ... | 31.97551 | 80 | 0.705514 |
439c78aaa87b39a4eac1f322ab0de26f3d600e3b | 4,096 | py | Python | retriever.py | raleighlittles/ArrisCableModemMonitoring | 3d33f5ac24322a6403fec24be008cc23463d8be1 | [
"MIT"
] | 15 | 2019-08-19T22:17:07.000Z | 2021-10-07T06:35:32.000Z | retriever.py | raleighlittles/ArrisCableModemMonitoring | 3d33f5ac24322a6403fec24be008cc23463d8be1 | [
"MIT"
] | null | null | null | retriever.py | raleighlittles/ArrisCableModemMonitoring | 3d33f5ac24322a6403fec24be008cc23463d8be1 | [
"MIT"
] | 7 | 2019-10-23T07:31:04.000Z | 2022-01-17T07:00:39.000Z | import datetime
import re
import socket
import typing
import bs4
import requests
# TODO: Extract the IP address of the cable-modem to be a parameter passed through the command line
def make_page_request(url: str = "http://192.168.100.1") -> str:
"""
Makes a GET request to a specified URL and then returns the... | 35.617391 | 144 | 0.656982 |
14028e3ca65236be785870f0cca3f66176e846fc | 693 | py | Python | version1/AIbird.py | CyrusEmber/FlappyBird | a0225de6fc4c152ba4f5e7e46e8f6bc613c065f2 | [
"MIT"
] | 1 | 2021-11-15T04:58:46.000Z | 2021-11-15T04:58:46.000Z | version1/AIbird.py | CyrusEmber/FlappyBird | a0225de6fc4c152ba4f5e7e46e8f6bc613c065f2 | [
"MIT"
] | null | null | null | version1/AIbird.py | CyrusEmber/FlappyBird | a0225de6fc4c152ba4f5e7e46e8f6bc613c065f2 | [
"MIT"
] | null | null | null | import bird
from settings import SPACE, JUMP_SPEED
from version1.CGP import create_pop
class AIBird(bird.Bird):
def __init__(self, individual=None, *args, **kwargs):
super(AIBird, self).__init__(*args, **kwargs)
self.individual = individual
self.individual.find_active_node()
self.s... | 28.875 | 57 | 0.616162 |
a5f84f80270e445d95b6f7e49f871b6bba9d9451 | 3,984 | py | Python | oracle_eval/ideal_mask.py | sevagh/mss-oracle-experiments | 991357fe44f5fcdfad98e187ed11f14e2fd316c5 | [
"MIT"
] | 1 | 2021-05-10T21:55:26.000Z | 2021-05-10T21:55:26.000Z | oracle_eval/ideal_mask.py | sevagh/mss-oracle-experiments | 991357fe44f5fcdfad98e187ed11f14e2fd316c5 | [
"MIT"
] | null | null | null | oracle_eval/ideal_mask.py | sevagh/mss-oracle-experiments | 991357fe44f5fcdfad98e187ed11f14e2fd316c5 | [
"MIT"
] | null | null | null | import sys
import os
import musdb
import gc
import itertools
import museval
import numpy as np
import functools
import argparse
import tqdm
import scipy
from scipy.signal import stft, istft
import json
from shared import TFTransform
from oracle import ideal_mask, ideal_mixphase, ideal_mask_fbin
if __name__ == '__m... | 28.457143 | 97 | 0.517068 |
d7c3c854aca855554eb8309cecac9ea125144719 | 196 | py | Python | model/__init__.py | xiankgx/U-2-Net | ab3ce1c44135579c14716fe9594a355547c02182 | [
"Apache-2.0"
] | null | null | null | model/__init__.py | xiankgx/U-2-Net | ab3ce1c44135579c14716fe9594a355547c02182 | [
"Apache-2.0"
] | null | null | null | model/__init__.py | xiankgx/U-2-Net | ab3ce1c44135579c14716fe9594a355547c02182 | [
"Apache-2.0"
] | null | null | null | from .custom import CustomNet
from .discriminator import MultiScaleNLayerDiscriminator
from .u2net import U2NET, U2NETP, u2net_heavy, u2net_portable, u2net_standard
from .vgg import VGG19Features
| 39.2 | 77 | 0.857143 |
96e1055f7a91ea733ffdb6e5960812f9f0d56dea | 288 | py | Python | examples/spot/wallet/disable_fast_withdraw.py | Banging12/binance-connector-python | dc6fbbd0bb64fb08d73ad8b31e0b81d776efa30b | [
"MIT"
] | 512 | 2021-06-15T08:52:44.000Z | 2022-03-31T09:49:53.000Z | examples/spot/wallet/disable_fast_withdraw.py | Banging12/binance-connector-python | dc6fbbd0bb64fb08d73ad8b31e0b81d776efa30b | [
"MIT"
] | 75 | 2021-06-20T13:49:50.000Z | 2022-03-30T02:45:31.000Z | examples/spot/wallet/disable_fast_withdraw.py | Banging12/binance-connector-python | dc6fbbd0bb64fb08d73ad8b31e0b81d776efa30b | [
"MIT"
] | 156 | 2021-06-18T11:56:36.000Z | 2022-03-29T16:34:22.000Z | #!/usr/bin/env python
import logging
from binance.spot import Spot as Client
from binance.lib.utils import config_logging
config_logging(logging, logging.DEBUG)
key = ""
secret = ""
spot_client = Client(key, secret, show_header=True)
logging.info(spot_client.disable_fast_withdraw())
| 20.571429 | 51 | 0.784722 |
1ad608d5bb6e871b6b4837d4c611a7283c397b89 | 1,554 | py | Python | tests/sentry/incidents/test_receivers.py | lauryndbrown/sentry | c5304e303966566386f5e61df1b72624a30803b4 | [
"BSD-3-Clause"
] | 1 | 2019-07-29T16:21:39.000Z | 2019-07-29T16:21:39.000Z | tests/sentry/incidents/test_receivers.py | lauryndbrown/sentry | c5304e303966566386f5e61df1b72624a30803b4 | [
"BSD-3-Clause"
] | 1 | 2020-11-05T14:54:44.000Z | 2020-11-19T21:54:19.000Z | tests/sentry/incidents/test_receivers.py | lauryndbrown/sentry | c5304e303966566386f5e61df1b72624a30803b4 | [
"BSD-3-Clause"
] | 1 | 2017-02-09T06:36:57.000Z | 2017-02-09T06:36:57.000Z | from __future__ import absolute_import
from sentry.incidents.models import IncidentSuspectCommit
from sentry.models.commit import Commit
from sentry.models.release import Release
from sentry.models.releasecommit import ReleaseCommit
from sentry.models.repository import Repository
from sentry.signals import release_com... | 34.533333 | 87 | 0.636422 |
5e565568ecbf91ae2f2ea95c59bc54cfe4445ea1 | 4,947 | py | Python | tests/test_cli/test_csr.py | lewoudar/certipie | af586d1f9e376f6192aa5f8c24d33417b1e47273 | [
"Apache-2.0"
] | null | null | null | tests/test_cli/test_csr.py | lewoudar/certipie | af586d1f9e376f6192aa5f8c24d33417b1e47273 | [
"Apache-2.0"
] | null | null | null | tests/test_cli/test_csr.py | lewoudar/certipie | af586d1f9e376f6192aa5f8c24d33417b1e47273 | [
"Apache-2.0"
] | null | null | null | import pytest
from certipie.cli.main import cert
from certipie.core import create_private_key
from tests.helpers import assert_csr, skip_mac_os
@pytest.fixture()
def base_arguments() -> list[str]:
return [
'csr',
'-c',
'FR',
'-s',
'Ile-de-France',
'-C',
'Pa... | 30.164634 | 113 | 0.671316 |
fe46a29406644d7259140815a638fd67fb26d14c | 7,949 | py | Python | streamselect/adaptive_learning/discrete_segment.py | BenHals/streamselect | ca5e80f3a8a31a38ac52bccfd92528d73f387a6a | [
"BSD-3-Clause"
] | null | null | null | streamselect/adaptive_learning/discrete_segment.py | BenHals/streamselect | ca5e80f3a8a31a38ac52bccfd92528d73f387a6a | [
"BSD-3-Clause"
] | null | null | null | streamselect/adaptive_learning/discrete_segment.py | BenHals/streamselect | ca5e80f3a8a31a38ac52bccfd92528d73f387a6a | [
"BSD-3-Clause"
] | null | null | null | """ A simple discrete segment adaptive learning system. """
from typing import Callable, Optional
from river.base import Classifier, DriftDetector
from streamselect.adaptive_learning import (
BaseAdaptiveLearner,
BaseBufferedAdaptiveLearner,
get_increasing_buffer_scheduler,
)
from streamselect.concept_re... | 45.422857 | 106 | 0.700969 |
fb2bb5a84babdee3a740ab5da93c6827817ef7cc | 403 | py | Python | Chapter17/example2.py | 3DAlgoLab/Mastering-Concurrency-in-Python | 48e4cb4878830b5f3e23346187ba8ada37f1dd2c | [
"MIT"
] | 66 | 2018-11-21T02:07:16.000Z | 2021-11-08T13:13:31.000Z | Chapter17/example2.py | 3DAlgoLab/Mastering-Concurrency-in-Python | 48e4cb4878830b5f3e23346187ba8ada37f1dd2c | [
"MIT"
] | 2 | 2020-03-11T19:56:39.000Z | 2021-11-15T14:07:05.000Z | Chapter17/example2.py | 3DAlgoLab/Mastering-Concurrency-in-Python | 48e4cb4878830b5f3e23346187ba8ada37f1dd2c | [
"MIT"
] | 58 | 2018-11-03T14:06:10.000Z | 2022-03-17T14:06:55.000Z | # ch17/example2.py
import sys; sys.setswitchinterval(.000001)
import threading
def foo():
global my_list
my_list.append(1)
my_list = []
threads = []
for i in range(1000):
thread = threading.Thread(target=foo)
threads.append(thread)
for thread in threads:
thread.start()
for thread in threads:
... | 15.5 | 44 | 0.684864 |
b6e2dc163693584d0a3db76c3c8e6455cc24fe57 | 628 | py | Python | plotly/validators/layout/scene/yaxis/_autorange.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/layout/scene/yaxis/_autorange.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/validators/layout/scene/yaxis/_autorange.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class AutorangeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self,
plotly_name='autorange',
parent_name='layout.scene.yaxis',
**kwargs
):
super(AutorangeValidator, self).__init__(
plotly_name=... | 29.904762 | 75 | 0.605096 |
f7b41b74e32c6a7be272ca44b5c2037690078c79 | 1,143 | py | Python | Python/sqlmlutils/packagemanagement/download_script.py | ntakru/sqlmlutils | d154f6a6f278510217958a1631578eeca01db6e8 | [
"MIT"
] | 15 | 2019-07-01T04:56:55.000Z | 2021-12-14T18:47:21.000Z | Python/sqlmlutils/packagemanagement/download_script.py | ntakru/sqlmlutils | d154f6a6f278510217958a1631578eeca01db6e8 | [
"MIT"
] | 29 | 2019-05-29T20:59:21.000Z | 2022-03-01T22:46:11.000Z | Python/sqlmlutils/packagemanagement/download_script.py | ntakru/sqlmlutils | d154f6a6f278510217958a1631578eeca01db6e8 | [
"MIT"
] | 26 | 2019-08-12T21:15:25.000Z | 2022-03-11T05:59:00.000Z | # Copyright(c) Microsoft Corporation.
# Licensed under the MIT license.
import pip
import sys
import warnings
from distutils.version import LooseVersion
pipversion = LooseVersion(pip.__version__ )
if pipversion >= LooseVersion("19.3"):
from wheel import pep425tags
from pip._internal.main import... | 33.617647 | 77 | 0.745407 |
9dc77fa289e5c91ab4f2426fa4454a872bc5dd10 | 937 | py | Python | minst.py | Liam-Mackey/MINST-FUN | 82db33fc04406e6f0b7428313f5922c1d0436828 | [
"MIT"
] | null | null | null | minst.py | Liam-Mackey/MINST-FUN | 82db33fc04406e6f0b7428313f5922c1d0436828 | [
"MIT"
] | null | null | null | minst.py | Liam-Mackey/MINST-FUN | 82db33fc04406e6f0b7428313f5922c1d0436828 | [
"MIT"
] | null | null | null | from tensorflow.examples.tutorials.mnist import input_data
mnist = input_data.read_data_sets("MNIST_data/", one_hot=True)
import tensorflow as tf
x = tf.placeholder(tf.float32, [None, 784])
W = tf.Variable(tf.zeros([784, 10]))
b = tf.Variable(tf.zeros([10]))
y = tf.nn.softmax(tf.matmul(x, W) + b)
y_ = tf.placehold... | 28.393939 | 85 | 0.73746 |
3055110d1cb452353fede909d0830b0cdbe5eddd | 98,786 | py | Python | bin/cqlsh.py | rishikthr09/cassandra | 9b770ea0d1cb231de3aed7487258c2ebd48082bb | [
"Apache-2.0"
] | 1 | 2020-03-29T01:56:58.000Z | 2020-03-29T01:56:58.000Z | bin/cqlsh.py | rishikthr09/cassandra | 9b770ea0d1cb231de3aed7487258c2ebd48082bb | [
"Apache-2.0"
] | null | null | null | bin/cqlsh.py | rishikthr09/cassandra | 9b770ea0d1cb231de3aed7487258c2ebd48082bb | [
"Apache-2.0"
] | null | null | null | #!/bin/sh
# -*- mode: Python -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.... | 40.337281 | 195 | 0.62607 |
a7a274010441766880a1798a4249ae1e142533ea | 1,894 | py | Python | redash/serializers.py | hgs847825/redash | 11d09b2f0945fb90898b68b730d12e7a52190251 | [
"BSD-2-Clause"
] | 4 | 2018-07-31T09:39:33.000Z | 2019-05-22T23:56:18.000Z | redash/serializers.py | hgs847825/redash | 11d09b2f0945fb90898b68b730d12e7a52190251 | [
"BSD-2-Clause"
] | 60 | 2019-05-31T06:11:35.000Z | 2021-06-25T15:20:33.000Z | redash/serializers.py | hgs847825/redash | 11d09b2f0945fb90898b68b730d12e7a52190251 | [
"BSD-2-Clause"
] | 2 | 2018-07-06T23:48:38.000Z | 2018-07-11T01:21:05.000Z | """
This will eventually replace all the `to_dict` methods of the different model
classes we have. This will ensure cleaner code and better
separation of concerns.
"""
import json
from funcy import project
from redash import models
def public_widget(widget):
res = {
'id': widget.id,
'width': widg... | 33.821429 | 112 | 0.6283 |
4fd3584b6537f2dcd7ce1a69e73dcfff50604d71 | 4,843 | py | Python | ansible/venv/lib/python2.7/site-packages/ansible/plugins/lookup/template.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | ansible/venv/lib/python2.7/site-packages/ansible/plugins/lookup/template.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 9 | 2017-06-25T03:31:52.000Z | 2021-05-17T23:43:12.000Z | ansible/venv/lib/python2.7/site-packages/ansible/plugins/lookup/template.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | # Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# Copyright: (c) 2012-17, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
DOCUMENTATION = """
lookup... | 39.696721 | 159 | 0.643816 |
5d69364f9f99317da3af8a634e419ab31435622e | 9,187 | py | Python | tests/test_deposit_withdraw.py | SBfin/UniStrategy | 0380a8f49a0b4eace72a56a2d7831100bdf4d276 | [
"Unlicense"
] | 2 | 2021-11-10T17:41:11.000Z | 2022-03-17T08:46:05.000Z | tests/test_deposit_withdraw.py | i001962/UniStrategy | 0380a8f49a0b4eace72a56a2d7831100bdf4d276 | [
"Unlicense"
] | null | null | null | tests/test_deposit_withdraw.py | i001962/UniStrategy | 0380a8f49a0b4eace72a56a2d7831100bdf4d276 | [
"Unlicense"
] | 1 | 2021-11-10T17:41:05.000Z | 2021-11-10T17:41:05.000Z | from brownie import chain, reverts, ZERO_ADDRESS
import pytest
from pytest import approx
@pytest.mark.parametrize(
"amount0Desired,amount1Desired",
[[0, 1], [1, 0], [1e18, 0], [0, 1e18], [1e4, 1e18], [1e18, 1e18]],
)
def test_initial_deposit(
vault,
tokens,
gov,
user,
recipie... | 30.220395 | 88 | 0.639055 |
17913c28be8fca9e5d721f82b1a37392ccc9dd9e | 1,388 | py | Python | tools/delete_momentum.py | sisrfeng/NA-fWebSOD | 49cb75a9a0d557b05968c6b11b0f17a7043f2077 | [
"Apache-2.0"
] | 23 | 2020-03-30T11:48:33.000Z | 2022-03-11T06:34:31.000Z | tools/delete_momentum.py | sisrfeng/NA-fWebSOD | 49cb75a9a0d557b05968c6b11b0f17a7043f2077 | [
"Apache-2.0"
] | 9 | 2020-09-28T07:15:16.000Z | 2022-03-25T08:11:06.000Z | tools/delete_momentum.py | sisrfeng/NA-fWebSOD | 49cb75a9a0d557b05968c6b11b0f17a7043f2077 | [
"Apache-2.0"
] | 10 | 2020-03-30T11:48:34.000Z | 2021-06-02T06:12:36.000Z | #!/usr/bin/env python
# Copyright (c) 2017-present, Facebook, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 28.916667 | 78 | 0.693084 |
2485062c3a96c440ff0b0bac3e5016deaea5893a | 6,748 | py | Python | datasets/bls/unemployment_cps_series/unemployment_cps_series_dag.py | nlarge-google/public-datasets-pipelines | ba4bff67c1ea334c87b3895fffa2f2402e6e56c6 | [
"Apache-2.0"
] | 2 | 2022-02-27T02:31:35.000Z | 2022-02-27T02:32:49.000Z | datasets/bls/unemployment_cps_series/unemployment_cps_series_dag.py | nlarge-google/public-datasets-pipelines | ba4bff67c1ea334c87b3895fffa2f2402e6e56c6 | [
"Apache-2.0"
] | null | null | null | datasets/bls/unemployment_cps_series/unemployment_cps_series_dag.py | nlarge-google/public-datasets-pipelines | ba4bff67c1ea334c87b3895fffa2f2402e6e56c6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 51.907692 | 564 | 0.55987 |
2b0a3acb328774988cc09dc999bd7c802fd78892 | 2,290 | py | Python | fluent_contents/plugins/markup/content_plugins.py | francofuji/django-fluent-contents | 03da447ef0854b0e6a6f8ff39d9281d11efc8587 | [
"Apache-2.0"
] | null | null | null | fluent_contents/plugins/markup/content_plugins.py | francofuji/django-fluent-contents | 03da447ef0854b0e6a6f8ff39d9281d11efc8587 | [
"Apache-2.0"
] | null | null | null | fluent_contents/plugins/markup/content_plugins.py | francofuji/django-fluent-contents | 03da447ef0854b0e6a6f8ff39d9281d11efc8587 | [
"Apache-2.0"
] | null | null | null | """
Markup plugin, rendering human readable formatted text to HTML.
This plugin supports several markup languages:
reStructuredText: Used for Python documentation.
Markdown: Used for GitHub and Stackoverflow comments (both have a dialect/extended version)
Textile: A extensive markup format, also used in Redmine... | 33.676471 | 100 | 0.724454 |
824a04cf3f8b7e81e6607a121d2beaf535be06d5 | 8,022 | py | Python | pkg/tests/install/test.py | hborawski/rules_pkg | 8d542763a3959db79175404758f46c7f3f385fa5 | [
"Apache-2.0"
] | null | null | null | pkg/tests/install/test.py | hborawski/rules_pkg | 8d542763a3959db79175404758f46c7f3f385fa5 | [
"Apache-2.0"
] | null | null | null | pkg/tests/install/test.py | hborawski/rules_pkg | 8d542763a3959db79175404758f46c7f3f385fa5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2021 The Bazel 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 r... | 42.670213 | 125 | 0.600349 |
3546262ecba6163926126718585908cd3e9022aa | 1,063 | py | Python | misc/ragout_config.py | fomightez/LRSDAY | 5786d7dc10987671283c6c8c4217ec244a8e915f | [
"MIT"
] | 24 | 2017-08-31T19:53:42.000Z | 2022-03-02T09:28:10.000Z | misc/ragout_config.py | fomightez/LRSDAY | 5786d7dc10987671283c6c8c4217ec244a8e915f | [
"MIT"
] | 2 | 2019-04-04T16:22:33.000Z | 2019-04-15T12:53:02.000Z | misc/ragout_config.py | fomightez/LRSDAY | 5786d7dc10987671283c6c8c4217ec244a8e915f | [
"MIT"
] | 5 | 2019-04-01T18:03:48.000Z | 2021-07-23T12:45:51.000Z | #(c) 2013-2014 by Authors
#This file is a part of Ragout program.
#Released under the BSD license (see LICENSE file)
"""
This module stores some configuration parameters
"""
vals = {
"overlap" :
{
"min_overlap" : 33,
"max_overlap" : 200,
"max_pa... | 23.108696 | 55 | 0.388523 |
274334b46cb3b7a8408058aa4d4fd685267d7ba0 | 6,588 | py | Python | statsmodels/base/_penalized.py | nikhase/statsmodels | e1822d4513f442002816bb898ca5794785f35c32 | [
"BSD-3-Clause"
] | 2 | 2021-01-25T15:50:42.000Z | 2021-05-26T15:54:56.000Z | statsmodels/base/_penalized.py | nikhase/statsmodels | e1822d4513f442002816bb898ca5794785f35c32 | [
"BSD-3-Clause"
] | null | null | null | statsmodels/base/_penalized.py | nikhase/statsmodels | e1822d4513f442002816bb898ca5794785f35c32 | [
"BSD-3-Clause"
] | 1 | 2019-05-15T12:02:20.000Z | 2019-05-15T12:02:20.000Z | # -*- coding: utf-8 -*-
"""
Created on Sun May 10 08:23:48 2015
Author: Josef Perktold
License: BSD-3
"""
import numpy as np
from ._penalties import NonePenalty
from statsmodels.tools.numdiff import approx_fprime_cs, approx_fprime
class PenalizedMixin(object):
"""Mixin class for Maximum Penalized Likelihood
... | 33.441624 | 79 | 0.604129 |
e18e0cd8f629a27e3ff3a442cea6d5b57bd59852 | 1,478 | py | Python | src/sctools/test/test_platform.py | amcnicho/sctools | 9d09540b18abdbebece111d999770baa5837c728 | [
"BSD-3-Clause"
] | 20 | 2018-07-08T01:52:45.000Z | 2022-03-23T02:39:15.000Z | src/sctools/test/test_platform.py | amcnicho/sctools | 9d09540b18abdbebece111d999770baa5837c728 | [
"BSD-3-Clause"
] | 68 | 2017-10-31T02:50:27.000Z | 2022-01-31T18:17:36.000Z | src/sctools/test/test_platform.py | amcnicho/sctools | 9d09540b18abdbebece111d999770baa5837c728 | [
"BSD-3-Clause"
] | 3 | 2017-11-17T20:13:35.000Z | 2020-09-08T20:39:55.000Z | import os
import tempfile
import pysam
from .. import platform
data_dir = os.path.split(__file__)[0] + "/data/"
def test_attach_barcodes():
"""High-level test of the AttachBarcodes command"""
temp_dir_name = tempfile.mkdtemp()
# Construct cli arguments to pass to the command
temp_output_bam = temp... | 25.929825 | 79 | 0.535859 |
d65495ad2f9f2caf004edb898a8bb82ca26dd70b | 1,396 | py | Python | test/D/HSTeoh/sconstest-singleStringCannotBeMultipleOptions_gdc.py | moroten/scons | 20927b42ed4f0cb87f51287fa3b4b6cf915afcf8 | [
"MIT"
] | 1 | 2020-03-21T05:24:47.000Z | 2020-03-21T05:24:47.000Z | test/D/HSTeoh/sconstest-singleStringCannotBeMultipleOptions_gdc.py | moroten/scons | 20927b42ed4f0cb87f51287fa3b4b6cf915afcf8 | [
"MIT"
] | 4 | 2019-04-11T16:27:45.000Z | 2019-04-11T23:56:30.000Z | test/D/HSTeoh/sconstest-singleStringCannotBeMultipleOptions_gdc.py | moroten/scons | 20927b42ed4f0cb87f51287fa3b4b6cf915afcf8 | [
"MIT"
] | 2 | 2018-01-16T11:29:16.000Z | 2020-05-13T16:48:26.000Z | """
Test compiling and executing using the gdc tool.
"""
#
# __COPYRIGHT__
#
# 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... | 36.736842 | 73 | 0.777221 |
e6a25c39da49ffdba90215a590f01308ae477ea8 | 336 | py | Python | graphdatascience/query_runner/query_runner.py | soerenreichardt/graph-data-science-client | 845c79cabdb21d57b590d51e4ddad0fa7a1caeab | [
"Apache-2.0"
] | null | null | null | graphdatascience/query_runner/query_runner.py | soerenreichardt/graph-data-science-client | 845c79cabdb21d57b590d51e4ddad0fa7a1caeab | [
"Apache-2.0"
] | null | null | null | graphdatascience/query_runner/query_runner.py | soerenreichardt/graph-data-science-client | 845c79cabdb21d57b590d51e4ddad0fa7a1caeab | [
"Apache-2.0"
] | null | null | null | from abc import ABC, abstractmethod
from typing import Any, Dict, List
Row = Dict[str, Any]
QueryResult = List[Row]
class QueryRunner(ABC):
@abstractmethod
def run_query(self, query: str, params: Dict[str, Any] = {}) -> QueryResult:
pass
@abstractmethod
def set_database(self, db: str) -> Non... | 21 | 80 | 0.660714 |
6a9164f027f4d48ab2ab525f9141b35aa1a65d95 | 26,892 | py | Python | src/translate/model.py | risa2000/pyopenvr | 6c153f986d46b61a3e136c144011695841b56502 | [
"BSD-3-Clause"
] | null | null | null | src/translate/model.py | risa2000/pyopenvr | 6c153f986d46b61a3e136c144011695841b56502 | [
"BSD-3-Clause"
] | null | null | null | src/translate/model.py | risa2000/pyopenvr | 6c153f986d46b61a3e136c144011695841b56502 | [
"BSD-3-Clause"
] | null | null | null | from clang.cindex import TypeKind
import inspect
import re
import textwrap
class Declaration(object):
def __init__(self, name, docstring=None):
self.name = name
self.docstring = docstring
def __str__(self):
return f'{self.name}'
class FunctionBase(Declaration):
def __init__(self... | 35.524439 | 112 | 0.541313 |
250c3a57951ba0928d914fa43261e3a4dd7be040 | 30,733 | py | Python | sqlglot/generator.py | RobinL/sqlglot | 7ec1022ac4c1fbaeb44e47d5f187a78e5c14735a | [
"MIT"
] | null | null | null | sqlglot/generator.py | RobinL/sqlglot | 7ec1022ac4c1fbaeb44e47d5f187a78e5c14735a | [
"MIT"
] | null | null | null | sqlglot/generator.py | RobinL/sqlglot | 7ec1022ac4c1fbaeb44e47d5f187a78e5c14735a | [
"MIT"
] | null | null | null | import logging
import sqlglot.expressions as exp
from sqlglot.errors import ErrorLevel, UnsupportedError
from sqlglot.helper import apply_index_offset, csv, ensure_list
from sqlglot.time import format_time
from sqlglot.tokens import Tokenizer
logger = logging.getLogger("sqlglot")
class Generator:
"""
Gener... | 36.5 | 130 | 0.596427 |
1bedefd414d6b1c6393cb913874a02c949bb42fa | 1,546 | py | Python | tests/test_document.py | yschindel/revitron | f373a0388c8b45f14f93510c9e8870190dba3b78 | [
"MIT"
] | 32 | 2020-05-16T15:39:46.000Z | 2022-02-18T04:01:37.000Z | tests/test_document.py | yschindel/revitron | f373a0388c8b45f14f93510c9e8870190dba3b78 | [
"MIT"
] | 3 | 2020-10-10T00:24:38.000Z | 2022-03-14T20:14:10.000Z | tests/test_document.py | yschindel/revitron | f373a0388c8b45f14f93510c9e8870190dba3b78 | [
"MIT"
] | 6 | 2020-10-08T16:14:51.000Z | 2022-01-19T14:33:33.000Z | import revitron
from revitron import _
import utils
class DocumentTests(utils.RevitronTestCase):
def testIsFamily(self):
self.assertFalse(revitron.Document().isFamily())
def testConfigStorage(self):
config = revitron.DocumentConfigStorage()
config.set('test.1', {'key': 'value'})
config.set('test.2', 'stri... | 35.953488 | 89 | 0.734799 |
2aa79d9b49ef35f774cee5b31ed88893c684c42e | 3,669 | py | Python | setup.py | davehowell/sqlfluff | 9666ffd200cdca1c4ddfc7a07c2edcd57ffe058d | [
"MIT"
] | null | null | null | setup.py | davehowell/sqlfluff | 9666ffd200cdca1c4ddfc7a07c2edcd57ffe058d | [
"MIT"
] | null | null | null | setup.py | davehowell/sqlfluff | 9666ffd200cdca1c4ddfc7a07c2edcd57ffe058d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""The script for setting up sqlfluff."""
from __future__ import absolute_import
from __future__ import print_function
import io
import sys
if sys.version_info[0] < 3:
raise Exception("SQLFluff does not support Python 2. Please upgrade to Python 3.")
import confi... | 32.184211 | 90 | 0.615427 |
a181cbd3873dbc1778b82448b90253751c434d82 | 5,222 | py | Python | jaraco/desktop/wallpaper.py | jaraco/jaraco.desktop | 5109a3943fb0596ac26206589afa81b464dbf190 | [
"MIT"
] | null | null | null | jaraco/desktop/wallpaper.py | jaraco/jaraco.desktop | 5109a3943fb0596ac26206589afa81b464dbf190 | [
"MIT"
] | null | null | null | jaraco/desktop/wallpaper.py | jaraco/jaraco.desktop | 5109a3943fb0596ac26206589afa81b464dbf190 | [
"MIT"
] | null | null | null | """
`jaraco.desktop.wallpaper`
Based on nat-geo_background-setter.py by Samuel Huckins
This module contains routines to pull the latest National Geographic
"Picture of the Day" and set it as your desktop background. This module
may be executed directly.
The routine won't run if you are low on space, easily configura... | 27.197917 | 83 | 0.662198 |
50461674942a25fcc151a155fabfca3327ed4956 | 10,161 | py | Python | ws4py/framing.py | soulgalore/wptagent | a26b2b1135e34d458f9d332b8a338bc013d51203 | [
"Apache-2.0"
] | 1,016 | 2015-05-21T09:45:52.000Z | 2022-03-30T07:42:25.000Z | ws4py/framing.py | soulgalore/wptagent | a26b2b1135e34d458f9d332b8a338bc013d51203 | [
"Apache-2.0"
] | 1,713 | 2015-05-19T14:32:45.000Z | 2022-03-29T10:05:48.000Z | ws4py/framing.py | soulgalore/wptagent | a26b2b1135e34d458f9d332b8a338bc013d51203 | [
"Apache-2.0"
] | 640 | 2015-05-20T02:53:52.000Z | 2022-03-31T09:55:23.000Z | # -*- coding: utf-8 -*-
from struct import pack, unpack
from ws4py.exc import FrameTooLargeException, ProtocolException
from ws4py.compat import py3k, ord, range
# Frame opcodes defined in the spec.
OPCODE_CONTINUATION = 0x0
OPCODE_TEXT = 0x1
OPCODE_BINARY = 0x2
OPCODE_CLOSE = 0x8
OPCODE_PING = 0x9
OPCODE_PONG = 0xa
... | 37.083942 | 96 | 0.469639 |
a9ba93b379501dc320fc8cd0c9d05b8aaad04da7 | 463 | py | Python | leap/modules/components/__init__.py | weirayao/leap | 8d10b8413d02d3be49d5c02a13a0aa60a741d8da | [
"MIT"
] | 7 | 2022-01-06T18:37:57.000Z | 2022-03-20T17:11:30.000Z | leap/modules/components/__init__.py | weirayao/leap | 8d10b8413d02d3be49d5c02a13a0aa60a741d8da | [
"MIT"
] | null | null | null | leap/modules/components/__init__.py | weirayao/leap | 8d10b8413d02d3be49d5c02a13a0aa60a741d8da | [
"MIT"
] | null | null | null | """Public API for `leap.modules.components`."""
from leap.modules.components.base import (InverseNotAvailable,
InputOutsideDomain,
Transform,
CompositeTransform,
... | 51.444444 | 71 | 0.38013 |
14ee132b50f211d3d7d86fec3abbea89e668d824 | 849 | py | Python | tests/test_indieweb/conftest.py | rmdes/tanzawa | d53baa10bd6c217cd18628437a88a43e3bd02b70 | [
"Apache-2.0"
] | 25 | 2021-06-13T03:38:44.000Z | 2022-03-15T15:53:31.000Z | tests/test_indieweb/conftest.py | rmdes/tanzawa | d53baa10bd6c217cd18628437a88a43e3bd02b70 | [
"Apache-2.0"
] | 59 | 2021-06-12T23:35:06.000Z | 2022-03-24T21:40:24.000Z | tests/test_indieweb/conftest.py | rmdes/tanzawa | d53baa10bd6c217cd18628437a88a43e3bd02b70 | [
"Apache-2.0"
] | null | null | null | import pytest
from model_bakery import baker
@pytest.fixture
def auth_token():
return "58a51838067faa000320f5266238d673c5897f1d"
@pytest.fixture
def client_id():
return "https://ownyourswarm.p3k.io"
@pytest.fixture
def m_micropub_scope():
from indieweb.models import MMicropubScope
return MMicropu... | 24.970588 | 87 | 0.775029 |
c7494c73ee07f5fdc34b711239e7455fbd57d777 | 35,682 | py | Python | selfdrive/controls/controlsd.py | Hikari1023/Openpilot | b2105d76c797982975706147b2fe42ce940341bc | [
"MIT"
] | null | null | null | selfdrive/controls/controlsd.py | Hikari1023/Openpilot | b2105d76c797982975706147b2fe42ce940341bc | [
"MIT"
] | null | null | null | selfdrive/controls/controlsd.py | Hikari1023/Openpilot | b2105d76c797982975706147b2fe42ce940341bc | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import math
from numbers import Number
from cereal import car, log
from common.numpy_fast import clip
from common.realtime import sec_since_boot, config_realtime_process, Priority, Ratekeeper, DT_CTRL
from common.profiler import Profiler
from common.params import Params, put_nonblockin... | 42.227219 | 136 | 0.699428 |
94e19a64f8cc8de9b0aca6e898845d943788a829 | 582 | py | Python | p049.py | arpit0891/Project-euler | ab36b33c578578595bb518508fa2fe5862f4a044 | [
"MIT"
] | 1 | 2020-05-14T09:22:32.000Z | 2020-05-14T09:22:32.000Z | p049.py | prve17/Project-Euler | 1ff72404ca9ebe7de2eab83d43960d86bc487515 | [
"MIT"
] | 1 | 2020-03-13T12:42:28.000Z | 2020-05-13T13:26:32.000Z | p049.py | prve17/Project-Euler | 1ff72404ca9ebe7de2eab83d43960d86bc487515 | [
"MIT"
] | 3 | 2020-05-13T13:39:46.000Z | 2020-06-26T10:44:53.000Z |
import eulerlib
def compute():
LIMIT = 10000
isprime = eulerlib.list_primality(LIMIT - 1)
for base in range(1000, LIMIT):
if isprime[base]:
for step in range(1, LIMIT):
a = base + step
b = a + step
if a < LIMIT and isprime[a] and has_same_digits(a, base) \
and b < LIMIT and isprime[b]... | 21.555556 | 66 | 0.627148 |
94108f9260a7b091dd003439fcb83a0b7f013560 | 24,049 | py | Python | jp.atcoder/abc042/abc042_a/15373460.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc042/abc042_a/15373460.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc042/abc042_a/15373460.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | import string
import sys
from bisect import bisect_left as bi_l
from bisect import bisect_right as bi_r
from collections import Counter, defaultdict, deque
from heapq import heappop, heappush
from itertools import combinations, product
import numpy as np
inf = float("inf")
MOD = 10**9 + 7
# MOD = 99824435... | 27.082207 | 80 | 0.383592 |
61af03b487a04a8d1f1d0c1e56fe5752bc0a8d14 | 3,393 | py | Python | mnist_keras.py | bharatsunny/installations | 081c83c9c96678804935c52405afd197d8d0a9ea | [
"Apache-2.0"
] | 35 | 2017-03-15T08:17:40.000Z | 2021-11-17T12:46:19.000Z | mnist_keras.py | bharatsunny/installations | 081c83c9c96678804935c52405afd197d8d0a9ea | [
"Apache-2.0"
] | 4 | 2017-10-16T10:54:37.000Z | 2018-12-06T08:10:18.000Z | mnist_keras.py | bharatsunny/installations | 081c83c9c96678804935c52405afd197d8d0a9ea | [
"Apache-2.0"
] | 11 | 2017-06-26T12:36:40.000Z | 2021-03-18T11:35:57.000Z | import tensorflow as tf
from keras.initializers import Constant
from keras.initializers import TruncatedNormal
from keras.layers import Reshape
from keras.layers import Flatten
from keras.layers import Dense
from keras.layers import Dropout
from keras.layers.convolutional import Conv2D
from keras.layers.pooling import ... | 40.879518 | 120 | 0.724138 |
0cde91c56d35cccb423b17f8229a0008fdd9aa45 | 3,932 | py | Python | test/LINK/VersionedLib-j2.py | Valkatraz/scons | 5e70c65f633dcecc035751c9f0c6f894088df8a0 | [
"MIT"
] | 1,403 | 2017-11-23T14:24:01.000Z | 2022-03-30T20:59:39.000Z | test/LINK/VersionedLib-j2.py | Valkatraz/scons | 5e70c65f633dcecc035751c9f0c6f894088df8a0 | [
"MIT"
] | 3,708 | 2017-11-27T13:47:12.000Z | 2022-03-29T17:21:17.000Z | test/LINK/VersionedLib-j2.py | Valkatraz/scons | 5e70c65f633dcecc035751c9f0c6f894088df8a0 | [
"MIT"
] | 281 | 2017-12-01T23:48:38.000Z | 2022-03-31T15:25:44.000Z | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
... | 26.748299 | 79 | 0.683367 |
d26605014e4189da8272f1086919ded2f6db9884 | 2,085 | py | Python | stockroom_bot/tuck_arm.py | amjadmajid/rosbook | 20d4ab94d910adc62c4aecb471ceac13b5cef5ad | [
"Apache-2.0"
] | 442 | 2015-12-11T02:59:16.000Z | 2022-03-31T22:10:25.000Z | stockroom_bot/tuck_arm.py | amjadmajid/rosbook | 20d4ab94d910adc62c4aecb471ceac13b5cef5ad | [
"Apache-2.0"
] | 41 | 2016-01-07T19:15:29.000Z | 2021-12-03T01:52:58.000Z | stockroom_bot/tuck_arm.py | amjadmajid/rosbook | 20d4ab94d910adc62c4aecb471ceac13b5cef5ad | [
"Apache-2.0"
] | 249 | 2015-11-27T10:22:33.000Z | 2022-03-28T09:52:05.000Z | #!/usr/bin/env python
# modified from Fetch's prepare_simulated_robot.py
import rospy, actionlib
from control_msgs.msg import (FollowJointTrajectoryAction,
FollowJointTrajectoryGoal)
from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint
arm_joint_names = \
["shoulder_pan... | 46.333333 | 116 | 0.748201 |
b07448d9e1fe51fa156456fd86b06718f7232a76 | 8,362 | py | Python | samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent.py | Celebrate-future/openapi-generator | 100c078b90f0ce1408139c04bb83df2c2fb51875 | [
"Apache-2.0"
] | null | null | null | samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent.py | Celebrate-future/openapi-generator | 100c078b90f0ce1408139c04bb83df2c2fb51875 | [
"Apache-2.0"
] | null | null | null | samples/client/petstore/python_disallowAdditionalPropertiesIfNotPresent/petstore_api/model/parent.py | Celebrate-future/openapi-generator | 100c078b90f0ce1408139c04bb83df2c2fb51875 | [
"Apache-2.0"
] | null | null | null | """
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
import re # noq... | 39.258216 | 174 | 0.593997 |
13bfa1dab39f1329e03fffe03ab9744fbd1e3682 | 5,408 | py | Python | apel/parsers/lsf.py | sjones-hep-ph-liv-ac-uk/apel | 1dcd3b809e445b0c2284017339638cfaab44892e | [
"Apache-2.0"
] | null | null | null | apel/parsers/lsf.py | sjones-hep-ph-liv-ac-uk/apel | 1dcd3b809e445b0c2284017339638cfaab44892e | [
"Apache-2.0"
] | null | null | null | apel/parsers/lsf.py | sjones-hep-ph-liv-ac-uk/apel | 1dcd3b809e445b0c2284017339638cfaab44892e | [
"Apache-2.0"
] | null | null | null | '''
Copyright (C) 2012 STFC
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 writi... | 38.906475 | 117 | 0.579697 |
9d024bffa3240e84fc7fa196204b7f1ce5082267 | 16,418 | py | Python | pandas/tests/series/indexing/test_boolean.py | r00ta/pandas | 33f91d8f9f2e84f2b5f3ac3f0481b691c977c427 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2019-04-16T21:03:23.000Z | 2021-05-08T13:25:44.000Z | pandas/tests/series/indexing/test_boolean.py | chanson90/pandas | 3f1e5940e3929577f094ea2708f94ee184e7a336 | [
"BSD-3-Clause"
] | null | null | null | pandas/tests/series/indexing/test_boolean.py | chanson90/pandas | 3f1e5940e3929577f094ea2708f94ee184e7a336 | [
"BSD-3-Clause"
] | 1 | 2019-01-01T01:19:30.000Z | 2019-01-01T01:19:30.000Z | # coding=utf-8
# pylint: disable-msg=E1101,W0612
import numpy as np
import pytest
from pandas.compat import lrange, range
from pandas.core.dtypes.common import is_integer
import pandas as pd
from pandas import Index, Series, Timestamp, date_range, isna
from pandas.core.indexing import IndexingError
import pandas.ut... | 26.395498 | 75 | 0.621818 |
d72ba7707b4cce1ceb1dbc9c06f199e72acd3213 | 3,466 | py | Python | test/functional/mempool_limit.py | thothd/unit-e | 44cd02af44592ebfa99f276e20775ed7d2182d02 | [
"MIT"
] | 36 | 2019-04-17T18:58:51.000Z | 2022-01-18T12:16:27.000Z | test/functional/mempool_limit.py | Danpetersen448/unit-e | 4ca86fc55a41e0daeb4409de2719a5523b6007c6 | [
"MIT"
] | 109 | 2019-04-17T17:19:45.000Z | 2019-06-19T15:16:37.000Z | test/functional/mempool_limit.py | Danpetersen448/unit-e | 4ca86fc55a41e0daeb4409de2719a5523b6007c6 | [
"MIT"
] | 16 | 2019-04-17T17:35:42.000Z | 2020-01-09T17:51:05.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool limiting together/eviction with the wallet."""
from decimal import Decimal
from test_fra... | 48.138889 | 166 | 0.681766 |
c220397c78b384479f61aca97158086b1681443c | 7,448 | py | Python | src/python/pants/backend/project_info/tasks/depmap.py | StephanErb/pants | a368267b6b4cf50138ba567f582409ed31bf5db9 | [
"Apache-2.0"
] | 94 | 2015-01-15T21:24:20.000Z | 2022-02-16T16:55:43.000Z | src/python/pants/backend/project_info/tasks/depmap.py | StephanErb/pants | a368267b6b4cf50138ba567f582409ed31bf5db9 | [
"Apache-2.0"
] | 5 | 2020-07-18T01:04:43.000Z | 2021-05-10T08:40:56.000Z | src/python/pants/backend/project_info/tasks/depmap.py | StephanErb/pants | a368267b6b4cf50138ba567f582409ed31bf5db9 | [
"Apache-2.0"
] | 47 | 2015-02-25T02:20:07.000Z | 2022-03-21T00:59:16.000Z | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
from builtins import object
from pants.base.exceptions import TaskError
from pants.java.... | 41.149171 | 99 | 0.673469 |
06e7ffd437d2c524688a9d379430198139f8a8fd | 1,468 | py | Python | test/test_inline_response40025.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | 5 | 2021-05-17T04:45:03.000Z | 2022-03-23T12:51:46.000Z | test/test_inline_response40025.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | null | null | null | test/test_inline_response40025.py | Crypto-APIs/Crypto_APIs_2.0_SDK_Python | c59ebd914850622b2c6500c4c30af31fb9cecf0e | [
"MIT"
] | 2 | 2021-06-02T07:32:26.000Z | 2022-02-12T02:36:23.000Z | """
CryptoAPIs
Crypto APIs 2.0 is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs 2.0 can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of thei... | 37.641026 | 484 | 0.779292 |
1fcb28ada48f87dc469b2253b23eedf906a30674 | 10,120 | gyp | Python | src/third_party/cacheinvalidation/cacheinvalidation.gyp | jxjnjjn/chromium | 435c1d02fd1b99001dc9e1e831632c894523580d | [
"Apache-2.0"
] | 9 | 2018-09-21T05:36:12.000Z | 2021-11-15T15:14:36.000Z | third_party/cacheinvalidation/cacheinvalidation.gyp | devasia1000/chromium | 919a8a666862fb866a6bb7aa7f3ae8c0442b4828 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | third_party/cacheinvalidation/cacheinvalidation.gyp | devasia1000/chromium | 919a8a666862fb866a6bb7aa7f3ae8c0442b4828 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 3 | 2018-11-28T14:54:13.000Z | 2020-07-02T07:36:07.000Z | # Copyright 2012 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.
{
'variables': {
# This library should build cleanly with the extra warnings turned on
# for Chromium.
'chromium_code': 1,
},
'targets': [
... | 43.433476 | 108 | 0.6333 |
7f14a6506cbdb82a4981304a2e0fcbd1004d3515 | 440 | py | Python | vlan.py | ossih/cisco-interfaces | 69222fca9a3b24c7cfe15e19bdb51dd78a367f8e | [
"MIT"
] | null | null | null | vlan.py | ossih/cisco-interfaces | 69222fca9a3b24c7cfe15e19bdb51dd78a367f8e | [
"MIT"
] | null | null | null | vlan.py | ossih/cisco-interfaces | 69222fca9a3b24c7cfe15e19bdb51dd78a367f8e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import yaml
import argparse
## This is old and deprecated
## Use of if.py is recommended instead
parser = argparse.ArgumentParser('vlan.py')
parser.add_argument('-c', '--config', required=True)
args = parser.parse_args()
with open(args.config, 'r') as f:
config = yaml.load(f)
for name,... | 18.333333 | 52 | 0.652273 |
2016e98128404063494c3400010fa1b442c27464 | 1,218 | py | Python | socialite/apps/base/oauth/backends.py | dgouldin/django-socialite | 4de4060f5d8ab89ae9dd4032e66e526873351ba4 | [
"MIT"
] | 1 | 2015-01-30T19:05:26.000Z | 2015-01-30T19:05:26.000Z | socialite/apps/base/oauth/backends.py | dgouldin/django-socialite | 4de4060f5d8ab89ae9dd4032e66e526873351ba4 | [
"MIT"
] | null | null | null | socialite/apps/base/oauth/backends.py | dgouldin/django-socialite | 4de4060f5d8ab89ae9dd4032e66e526873351ba4 | [
"MIT"
] | 2 | 2016-06-26T13:49:31.000Z | 2021-08-13T01:00:15.000Z | from django.contrib.auth.models import User
class BaseOauthBackend:
def validate_service_type(self, base_url):
raise NotImplemented
def get_existing_user(self, access_token):
raise NotImplemented
def register_user(self, access_token):
"""
# FIXME: Would be good to document... | 36.909091 | 129 | 0.673235 |
02054b5a46cc89263231a69ac2f6fa5b67cb1382 | 6,391 | py | Python | tools/train_net.py | qdmy/Adelaidet-Quantization | e88cf41c62dc3944d2bd57ffc1d365535b0a1c4b | [
"Apache-2.0"
] | null | null | null | tools/train_net.py | qdmy/Adelaidet-Quantization | e88cf41c62dc3944d2bd57ffc1d365535b0a1c4b | [
"Apache-2.0"
] | null | null | null | tools/train_net.py | qdmy/Adelaidet-Quantization | e88cf41c62dc3944d2bd57ffc1d365535b0a1c4b | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
Detection Training Script.
This scripts reads a given config file and runs the training or evaluation.
It is an entry point that is made to train standard models in detectron2.
In order to let one script support training of many models,
this s... | 36.3125 | 103 | 0.662964 |
e93c587b1a99351ab8cdce9137e6e8aef61d223f | 7,820 | py | Python | alameda_api/v1alpha1/datahub/common/rawdata_pb2.py | containers-ai/api | ec0fafc7bfd17c16cff1d1737dbceacac5d09fd8 | [
"Apache-2.0"
] | 1 | 2020-05-18T02:34:29.000Z | 2020-05-18T02:34:29.000Z | alameda_api/v1alpha1/datahub/common/rawdata_pb2.py | containers-ai/api | ec0fafc7bfd17c16cff1d1737dbceacac5d09fd8 | [
"Apache-2.0"
] | 9 | 2018-11-01T09:08:51.000Z | 2019-01-12T07:09:06.000Z | alameda_api/v1alpha1/datahub/common/rawdata_pb2.py | containers-ai/api | ec0fafc7bfd17c16cff1d1737dbceacac5d09fd8 | [
"Apache-2.0"
] | 12 | 2018-10-30T02:46:56.000Z | 2021-04-13T07:55:09.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: alameda_api/v1alpha1/datahub/common/rawdata.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf... | 36.542056 | 757 | 0.757801 |
8961ecebf2ca4b4e071b2aa1e8778032bdcb8a52 | 576 | py | Python | AST/block.py | CorentinGoet/miniC-Compiler | 8631b1ce47e9de1c3a3255d7c0a941242ad48292 | [
"MIT"
] | null | null | null | AST/block.py | CorentinGoet/miniC-Compiler | 8631b1ce47e9de1c3a3255d7c0a941242ad48292 | [
"MIT"
] | null | null | null | AST/block.py | CorentinGoet/miniC-Compiler | 8631b1ce47e9de1c3a3255d7c0a941242ad48292 | [
"MIT"
] | null | null | null | """
@author Corentin Goetghebeur (github.com/CorentinGoet)
"""
from AST.node import Node
class Block(Node):
"""
Class representation for the Block node.
The Block node has the following syntax:
Block = {Statements}
"""
def __init__(self, statements: list = None):
"""
Constr... | 18.580645 | 54 | 0.631944 |
5269bef073ba4782bf6ca10afdb8907d76f10027 | 7,820 | py | Python | test/functional/wallet_abandonconflict.py | afghany/castletmp | 9d0daed2a6abaf7d93f9308f5c602db6eeb42c8b | [
"MIT"
] | null | null | null | test/functional/wallet_abandonconflict.py | afghany/castletmp | 9d0daed2a6abaf7d93f9308f5c602db6eeb42c8b | [
"MIT"
] | null | null | null | test/functional/wallet_abandonconflict.py | afghany/castletmp | 9d0daed2a6abaf7d93f9308f5c602db6eeb42c8b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import CastleTestFramework
from test_framework.util import (
asse... | 45.465116 | 137 | 0.652685 |
c32c9f67f8b5a8560e955e4f576ad60ac25b9672 | 2,394 | py | Python | tools/install_venv.py | openstack/zaqar-ui | bae3359ef23c0649081bea5b30afb6a6468d6fc2 | [
"Apache-2.0"
] | 16 | 2016-01-17T08:23:47.000Z | 2019-08-17T05:18:33.000Z | tools/install_venv.py | openstack/zaqar-ui | bae3359ef23c0649081bea5b30afb6a6468d6fc2 | [
"Apache-2.0"
] | null | null | null | tools/install_venv.py | openstack/zaqar-ui | bae3359ef23c0649081bea5b30afb6a6468d6fc2 | [
"Apache-2.0"
] | 4 | 2016-02-05T22:04:28.000Z | 2019-08-17T05:18:38.000Z | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2010 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this... | 32.794521 | 79 | 0.70802 |
7ae1952112057d9eeb14da65cc27b1ac758862b1 | 673 | py | Python | Dataset/emnist/__init__.py | dtczhl/FedTuning | 7b6274a573dfaf847cb3edae8301d8e9e866397c | [
"MIT"
] | null | null | null | Dataset/emnist/__init__.py | dtczhl/FedTuning | 7b6274a573dfaf847cb3edae8301d8e9e866397c | [
"MIT"
] | null | null | null | Dataset/emnist/__init__.py | dtczhl/FedTuning | 7b6274a573dfaf847cb3edae8301d8e9e866397c | [
"MIT"
] | 1 | 2022-02-14T03:21:06.000Z | 2022-02-14T03:21:06.000Z | # number of classes
EMNIST_N_CLASS = 62
# number of input channel
EMNIST_N_INPUT_FEATURE = 1
# input sizes.
EMNIST_INPUT_RESIZE = (28, 28)
# top-1 accuracy
EMNIST_N_TOP_CLASS = 1
# learning rate and momentum
EMNIST_LEARNING_RATE = 0.01
EMNIST_MOMENTUM = 0.9
# train mean and std, need change
EMNIST_TRAIN_MEAN = 0.1... | 21.03125 | 41 | 0.809807 |
41b871d66b9560af0ec8599c1aab5d128d02423c | 234 | py | Python | Chapter 1/gauss.py | indrag49/Computational-Stat-Mech | 0877f54a0245fce815f03478f4fb219fd6314951 | [
"MIT"
] | 19 | 2018-06-29T12:22:47.000Z | 2022-03-10T03:18:18.000Z | Chapter 1/gauss.py | indrag49/Computational-Stat-Mech | 0877f54a0245fce815f03478f4fb219fd6314951 | [
"MIT"
] | null | null | null | Chapter 1/gauss.py | indrag49/Computational-Stat-Mech | 0877f54a0245fce815f03478f4fb219fd6314951 | [
"MIT"
] | 7 | 2018-11-30T01:56:36.000Z | 2021-12-23T15:29:56.000Z | import random
import math as m
def gauss(sigma):
phi=random.uniform(0, 2*m.pi)
Upsilon=-m.log(random.uniform(0, 1))
r=sigma*m.sqrt(2*Upsilon)
x=r*m.cos(phi)
y=r*m.sin(phi)
return [x, y] | 23.4 | 44 | 0.555556 |
f8d1ec2f536a50d4897bd92b5d3e6bf4c9f8e7da | 708 | py | Python | setup.py | Reclaim-The-Night-Leeds/PyParliment | b351505964099c8bcbd80855d21f470c5b9b3a14 | [
"MIT"
] | null | null | null | setup.py | Reclaim-The-Night-Leeds/PyParliment | b351505964099c8bcbd80855d21f470c5b9b3a14 | [
"MIT"
] | 1 | 2021-04-25T21:46:12.000Z | 2021-04-25T21:46:12.000Z | setup.py | Reclaim-The-Night-Leeds/PyParliment | b351505964099c8bcbd80855d21f470c5b9b3a14 | [
"MIT"
] | null | null | null | """
Setup file for PyParliment.
Use setup.cfg to configure your project.
This file was generated with PyScaffold 4.0.1.
PyScaffold helps you to put up the scaffold of your new Python project.
Learn more under: https://pyscaffold.org/
"""
from setuptools import setup
if __name__ == "__main__":
... | 32.181818 | 77 | 0.641243 |
67779fa3efd80fe4038cb069f37e8ede8a385b23 | 3,114 | py | Python | test/python/test_sparse_logreg.py | tbjohns/BlitzML | 0523743e1ae3614bfe3f16aa226d7a27fab2d623 | [
"BSD-3-Clause"
] | 6 | 2015-06-16T05:17:17.000Z | 2018-08-02T05:50:01.000Z | test/python/test_sparse_logreg.py | tbjohns/BlitzML | 0523743e1ae3614bfe3f16aa226d7a27fab2d623 | [
"BSD-3-Clause"
] | 2 | 2018-05-13T13:53:58.000Z | 2019-06-11T14:53:26.000Z | test/python/test_sparse_logreg.py | tbjohns/BlitzML | 0523743e1ae3614bfe3f16aa226d7a27fab2d623 | [
"BSD-3-Clause"
] | 3 | 2018-08-02T05:50:03.000Z | 2021-02-21T04:44:15.000Z | import unittest
import blitzml
import numpy as np
from scipy import sparse as sp
from common import captured_output
from common import matrix_vector_product
from common import normalize_labels
def is_solution(sol, A, b, lam, tol=1e-3):
Aomega = sol.bias + matrix_vector_product(A, sol.weights)
exp_bAomega = np.ex... | 32.778947 | 76 | 0.68754 |
cfaa0039059687f51df3cf855ff613ec13938c46 | 1,686 | py | Python | texto_realmente_falso.py | manfredengler95/generacion_texto_falso | fc9e83dfbe6ca1aee73fd96188b1a499986038a1 | [
"MIT"
] | null | null | null | texto_realmente_falso.py | manfredengler95/generacion_texto_falso | fc9e83dfbe6ca1aee73fd96188b1a499986038a1 | [
"MIT"
] | null | null | null | texto_realmente_falso.py | manfredengler95/generacion_texto_falso | fc9e83dfbe6ca1aee73fd96188b1a499986038a1 | [
"MIT"
] | null | null | null | import random
#recibir archivo
texto = open('entrada.txt','r')
lista = []
diccionario = {}
anterior = ""
#print texto.read(5)
for linea in texto:
linea = linea.split(" ")
lista = lista + linea
#se crea una lista de las palabras del texto en orden
#print lista
#---------------------------------------------------... | 31.222222 | 81 | 0.597272 |
cfdc2acb608d517c9af0fdf48da5bffa9a7c202e | 7,709 | py | Python | cogdl/utils/spmm_utils.py | fishmingyu/cogdl | f6f33c666feb874f13eb43a8adc5db7c918778ec | [
"MIT"
] | null | null | null | cogdl/utils/spmm_utils.py | fishmingyu/cogdl | f6f33c666feb874f13eb43a8adc5db7c918778ec | [
"MIT"
] | null | null | null | cogdl/utils/spmm_utils.py | fishmingyu/cogdl | f6f33c666feb874f13eb43a8adc5db7c918778ec | [
"MIT"
] | null | null | null | import torch
CONFIGS = {
"fast_spmm": None,
"csrmhspmm": None,
"csr_edge_softmax": None,
"fused_gat_func": None,
"fast_spmm_cpu": None,
"spmm_flag": False,
"mh_spmm_flag": False,
"fused_gat_flag": False,
"spmm_cpu_flag": False,
}
def check_fused_gat():
return CONFIGS["fused_g... | 30.350394 | 113 | 0.629005 |
075c8e7e9c0d6c445eb075114d43bbb6c75f0d18 | 969 | py | Python | lesson1_step5.py | scorpion-kit/stepik-QA-Selenium_Python | 94b65d814c511ca364635d966a0f4971192be4fc | [
"MIT"
] | null | null | null | lesson1_step5.py | scorpion-kit/stepik-QA-Selenium_Python | 94b65d814c511ca364635d966a0f4971192be4fc | [
"MIT"
] | null | null | null | lesson1_step5.py | scorpion-kit/stepik-QA-Selenium_Python | 94b65d814c511ca364635d966a0f4971192be4fc | [
"MIT"
] | null | null | null | from selenium import webdriver
import time
import math
def calc(x):
return str(math.log(abs(12*math.sin(int(x)))))
try:
link = "http://suninjuly.github.io/math.html"
browser = webdriver.Chrome()
browser.get(link)
# Ваш код
x_element = browser.find_element_by_css_selector("span#input_value.now... | 23.634146 | 79 | 0.692466 |
a88c4d3eeceb4e0a23ac78ae92f06430ba2edacd | 5,537 | py | Python | tests/test_users.py | brynjolf23/whoKnows | 6f480f24705fd3d1ec233aab0d842164ac53fe34 | [
"Unlicense"
] | null | null | null | tests/test_users.py | brynjolf23/whoKnows | 6f480f24705fd3d1ec233aab0d842164ac53fe34 | [
"Unlicense"
] | null | null | null | tests/test_users.py | brynjolf23/whoKnows | 6f480f24705fd3d1ec233aab0d842164ac53fe34 | [
"Unlicense"
] | 1 | 2020-09-06T19:01:13.000Z | 2020-09-06T19:01:13.000Z | import os
import unittest
from project import app, db
from project._config import BASE_DIR
from project.models import User, Follower
TEST_DB = 'test.db'
class MainTest(unittest.TestCase):
# setup function
def setUp(self):
app.config['TESTING'] = True
app.config['WTF_CSRF_ENABLED'] = False
... | 36.427632 | 82 | 0.629763 |
b78ec4e223ddabda11fbb4a3e0a1449c2fc37a87 | 38,028 | py | Python | instances/passenger_demand/pas-20210421-2109-int18e/34.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/passenger_demand/pas-20210421-2109-int18e/34.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null | instances/passenger_demand/pas-20210421-2109-int18e/34.py | LHcau/scheduling-shared-passenger-and-freight-transport-on-a-fixed-infrastructure | bba1e6af5bc8d9deaa2dc3b83f6fe9ddf15d2a11 | [
"BSD-3-Clause"
] | null | null | null |
"""
PASSENGERS
"""
numPassengers = 4082
passenger_arriving = (
(3, 5, 7, 8, 5, 0, 10, 12, 16, 5, 3, 0), # 0
(7, 9, 3, 8, 6, 0, 7, 8, 6, 4, 2, 0), # 1
(7, 14, 7, 5, 4, 0, 8, 11, 9, 6, 1, 0), # 2
(3, 4, 14, 6, 1, 0, 13, 9, 8, 5, 3, 0), # 3
(7, 8, 10, 3, 4, 0, 10, 14, 6, 5, 3, 0), # 4
(3, 20, 12, 4, 4, 0, 7,... | 113.516418 | 213 | 0.730094 |
07c9dc2895d4801b00a7112b49629eb812fe9039 | 1,620 | py | Python | player.py | Cleymax/WorldScanner | f7221f9d0e94c212b3d7731f690bb8b6ac73a1d4 | [
"MIT"
] | 2 | 2020-02-26T12:22:24.000Z | 2020-02-27T15:59:27.000Z | player.py | Cleymax/WorldScanner | f7221f9d0e94c212b3d7731f690bb8b6ac73a1d4 | [
"MIT"
] | null | null | null | player.py | Cleymax/WorldScanner | f7221f9d0e94c212b3d7731f690bb8b6ac73a1d4 | [
"MIT"
] | null | null | null | from os import listdir
from nbt.nbt import NBTFile
from Item import Item
def is_scan_item(args, _item):
for _id in args.id:
for idd in _id.split(','):
if str(idd) == str(_item.material):
return True
return False
class Player:
def __init__(self, args):
self.a... | 35.217391 | 93 | 0.480247 |
5b6be29ea620c581ab96d137d157ac57d00c569b | 9,273 | py | Python | cigar_filter/pysam_cigar_filter.py | NDHall/pysam_tools | 4de81108bc403db9258820fa4e8d63585f2e689d | [
"MIT"
] | null | null | null | cigar_filter/pysam_cigar_filter.py | NDHall/pysam_tools | 4de81108bc403db9258820fa4e8d63585f2e689d | [
"MIT"
] | null | null | null | cigar_filter/pysam_cigar_filter.py | NDHall/pysam_tools | 4de81108bc403db9258820fa4e8d63585f2e689d | [
"MIT"
] | 1 | 2021-05-27T11:49:29.000Z | 2021-05-27T11:49:29.000Z | import pysam
"""
This script is for filtering out soft-clipped reads that are speciously mapped.
It is of particular concern especially if no attempt has been made to filter
reads during mapping for duplicate regions such as are found between chloroplast
and mitochondrial regions. Even if filtering i... | 34.091912 | 161 | 0.601531 |
4514a92b48e5ec6554b39a1805fb177e41645d73 | 1,159 | py | Python | examples/temperature-offset.py | hboshnak/bme680-python | 8fb321b1ea52a0b2b9c191faedf198e090900f4e | [
"MIT"
] | 169 | 2018-08-16T12:25:54.000Z | 2022-03-08T13:11:58.000Z | examples/temperature-offset.py | hboshnak/bme680-python | 8fb321b1ea52a0b2b9c191faedf198e090900f4e | [
"MIT"
] | 34 | 2018-10-23T16:35:58.000Z | 2022-02-11T11:46:31.000Z | examples/temperature-offset.py | hboshnak/bme680-python | 8fb321b1ea52a0b2b9c191faedf198e090900f4e | [
"MIT"
] | 71 | 2018-08-30T13:38:59.000Z | 2022-01-23T20:22:10.000Z | #!/usr/bin/env python
import bme680
print("""temperature-offset.py - Displays temperature, pressure, and humidity with different offsets.
Press Ctrl+C to exit!
""")
try:
sensor = bme680.BME680(bme680.I2C_ADDR_PRIMARY)
except (RuntimeError, IOError):
sensor = bme680.BME680(bme680.I2C_ADDR_SECONDARY)
# Thes... | 22.72549 | 101 | 0.740293 |
9068f748d4d8ec6358a80a1ad0589f08edadbec0 | 13,555 | py | Python | advanced_filters/forms.py | 9999years/django-advanced-filters | 4f1575a67e751330606a9a3ee4f33eda5214b44e | [
"MIT"
] | null | null | null | advanced_filters/forms.py | 9999years/django-advanced-filters | 4f1575a67e751330606a9a3ee4f33eda5214b44e | [
"MIT"
] | null | null | null | advanced_filters/forms.py | 9999years/django-advanced-filters | 4f1575a67e751330606a9a3ee4f33eda5214b44e | [
"MIT"
] | null | null | null | from datetime import datetime as dt
from pprint import pformat
import logging
import operator
from django import forms
from django.apps import apps
from django.conf import settings
from django.contrib import admin
from django.contrib.admin.utils import get_fields_from_path
from django.db.models import Q, FieldDoesNo... | 37.444751 | 86 | 0.599041 |
dac1b1e23b606a03e325d810f9e5ce8f78754597 | 377 | py | Python | main/stocks/migrations/0004_auto_20170623_2116.py | Hawk94/coin_tracker | 082909e17308a8dd460225c1b035751d12a27106 | [
"MIT"
] | null | null | null | main/stocks/migrations/0004_auto_20170623_2116.py | Hawk94/coin_tracker | 082909e17308a8dd460225c1b035751d12a27106 | [
"MIT"
] | null | null | null | main/stocks/migrations/0004_auto_20170623_2116.py | Hawk94/coin_tracker | 082909e17308a8dd460225c1b035751d12a27106 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-23 21:16
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('stocks', '0003_sandp'),
]
operations = [
migrations.RenameModel(
old_na... | 18.85 | 48 | 0.596817 |
8d11fb7a697800c04561a6a944444d1aa8801930 | 5,730 | py | Python | src/abaqus/Optimization/ShapeDemoldControl.py | Haiiliin/PyAbaqus | f20db6ebea19b73059fe875a53be370253381078 | [
"MIT"
] | 7 | 2022-01-21T09:15:45.000Z | 2022-02-15T09:31:58.000Z | src/abaqus/Optimization/ShapeDemoldControl.py | Haiiliin/PyAbaqus | f20db6ebea19b73059fe875a53be370253381078 | [
"MIT"
] | null | null | null | src/abaqus/Optimization/ShapeDemoldControl.py | Haiiliin/PyAbaqus | f20db6ebea19b73059fe875a53be370253381078 | [
"MIT"
] | null | null | null | from abaqusConstants import *
from .GeometricRestriction import GeometricRestriction
from ..Region.Region import Region
class ShapeDemoldControl(GeometricRestriction):
"""The ShapeDemoldControl object defines a shape demold control geometric restriction.
The ShapeDemoldControl object is derived from the Geome... | 47.355372 | 108 | 0.652356 |
4b97e4369cb6a477782dae8a0f2ee694f149d375 | 5,663 | py | Python | python/mxnet/gluon/data/dataset.py | rah9eu/p3 | 530628be7b7a8dd3e6199c3bebebdbf104005e5f | [
"Apache-2.0"
] | 22 | 2019-02-20T12:42:20.000Z | 2021-12-25T06:09:46.000Z | python/mxnet/gluon/data/dataset.py | rah9eu/p3 | 530628be7b7a8dd3e6199c3bebebdbf104005e5f | [
"Apache-2.0"
] | 4 | 2019-04-01T07:36:04.000Z | 2022-03-24T03:11:26.000Z | python/mxnet/gluon/data/dataset.py | rah9eu/p3 | 530628be7b7a8dd3e6199c3bebebdbf104005e5f | [
"Apache-2.0"
] | 7 | 2019-03-20T16:04:37.000Z | 2021-04-28T18:40:11.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 30.777174 | 81 | 0.61787 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.