hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 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 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4a23d1921fe5b6fd01631d6bc07e56ced6fa3e98 | 2,039 | py | Python | src/school_college/migrations/0001_initial.py | paceite/Seelife---An-NGO-Website | 02e6b5ec94d9a76079eccde54b3cd40b9e979def | [
"MIT"
] | null | null | null | src/school_college/migrations/0001_initial.py | paceite/Seelife---An-NGO-Website | 02e6b5ec94d9a76079eccde54b3cd40b9e979def | [
"MIT"
] | null | null | null | src/school_college/migrations/0001_initial.py | paceite/Seelife---An-NGO-Website | 02e6b5ec94d9a76079eccde54b3cd40b9e979def | [
"MIT"
] | null | null | null | # Generated by Django 2.1.7 on 2019-03-17 01:54
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Attendance',
fields=[
... | 37.759259 | 121 | 0.572339 |
4a23d1d1b6e7498aaf73361acab6916f1d1d06a3 | 12,884 | py | Python | src/olympia/devhub/utils.py | snifhex/addons-server | 2b9dee65c10c0dca700ff2d25f3694c7cf769816 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/devhub/utils.py | snifhex/addons-server | 2b9dee65c10c0dca700ff2d25f3694c7cf769816 | [
"BSD-3-Clause"
] | null | null | null | src/olympia/devhub/utils.py | snifhex/addons-server | 2b9dee65c10c0dca700ff2d25f3694c7cf769816 | [
"BSD-3-Clause"
] | null | null | null | import uuid
import waffle
from celery import chain, chord
from django.conf import settings
from django.forms import ValidationError
from django.utils.translation import gettext
import olympia.core.logger
from olympia import amo, core
from olympia.amo.urlresolvers import linkify_and_clean
from olympia.files.models i... | 36.292958 | 88 | 0.625349 |
4a23d1dcbf85cceb229c682da5adedc41c7c6fed | 6,209 | py | Python | salt/modules/ps.py | kaptk2/salt | 8b06fff072c20d77f3447d8521a4667413218ab3 | [
"Apache-2.0"
] | 1 | 2015-06-05T13:47:02.000Z | 2015-06-05T13:47:02.000Z | salt/modules/ps.py | kaptk2/salt | 8b06fff072c20d77f3447d8521a4667413218ab3 | [
"Apache-2.0"
] | null | null | null | salt/modules/ps.py | kaptk2/salt | 8b06fff072c20d77f3447d8521a4667413218ab3 | [
"Apache-2.0"
] | null | null | null | '''
A salt interface to psutil, a system and process library.
See http://code.google.com/p/psutil.
:depends: - psutil Python module
'''
# Import python libs
import sys
import time
# Import third party libs
try:
import psutil
HAS_PSUTIL = True
except ImportError:
HAS_PSUTIL = False
def __virtual__():
... | 22.660584 | 85 | 0.630375 |
4a23d23d0eff725922cdfb57fe221c56b698c113 | 4,117 | py | Python | pp/samples/mask_custom/test_mask.py | PsiQ/gdsfactory | 34c8ecbed465e8eda0d5116687fd02e95e530f35 | [
"MIT"
] | 16 | 2020-02-03T07:05:31.000Z | 2021-12-29T18:40:09.000Z | pp/samples/mask_custom/test_mask.py | PsiQ/gdsfactory | 34c8ecbed465e8eda0d5116687fd02e95e530f35 | [
"MIT"
] | 2 | 2020-01-31T20:01:40.000Z | 2020-09-26T17:50:55.000Z | pp/samples/mask_custom/test_mask.py | PsiQ/gdsfactory | 34c8ecbed465e8eda0d5116687fd02e95e530f35 | [
"MIT"
] | 7 | 2020-02-09T23:16:18.000Z | 2020-10-30T03:12:04.000Z | """
This is a sample on how to define custom components.
You can make a repo out of this file, having one custom component per file
"""
import os
import shutil
import pytest
import pp
from pp.config import CONFIG
from pp.autoplacer.yaml_placer import place_from_yaml
from pp.components.spiral_inner_io import spiral_inne... | 27.085526 | 87 | 0.705125 |
4a23d289b12bd9185b0e1f4cf969dd2201d0769f | 4,060 | py | Python | helmion/tests/test_helmchart.py | RangelReale/helmion | e90c2b6de1001b3e90811a75cda98082a02857b8 | [
"MIT"
] | null | null | null | helmion/tests/test_helmchart.py | RangelReale/helmion | e90c2b6de1001b3e90811a75cda98082a02857b8 | [
"MIT"
] | null | null | null | helmion/tests/test_helmchart.py | RangelReale/helmion | e90c2b6de1001b3e90811a75cda98082a02857b8 | [
"MIT"
] | null | null | null | import unittest
from jsonpatchext.mutators import InitItemMutator # type: ignore
from helmion.helmchart import HelmRequest, HelmChart
from helmion.config import BoolFilter
from helmion.processor import DefaultProcessor
class TestInfo(unittest.TestCase):
def setUp(self):
self.req = HelmRequest(repositor... | 37.943925 | 111 | 0.4367 |
4a23d2d0ef405cd2dfa6859aced5273e8a52c744 | 2,090 | py | Python | useful_scripts/calculate_volume.py | shirtsgroup/finite-temperature-crystal-scripts | 799bc882d958d9afa264a168dae0b3051bafaf0b | [
"MIT"
] | null | null | null | useful_scripts/calculate_volume.py | shirtsgroup/finite-temperature-crystal-scripts | 799bc882d958d9afa264a168dae0b3051bafaf0b | [
"MIT"
] | 8 | 2017-07-25T04:59:35.000Z | 2021-03-25T22:48:53.000Z | useful_scripts/calculate_volume.py | shirtsgroup/finite-temperature-crystal-scripts | 799bc882d958d9afa264a168dae0b3051bafaf0b | [
"MIT"
] | 1 | 2021-01-04T07:01:25.000Z | 2021-01-04T07:01:25.000Z | #!/usr/bin/python
#
# Calculate the volume of a .gro file
#
# Copyright Michael R. Shirts, University of Virginia, 2014
#
import numpy # numerical array library
import pymbar # multistate Bennett acceptance ratio
from pymbar import timeseries # timeseries analysis
from optparse import OptionParser # for parsing comman... | 30.289855 | 102 | 0.657895 |
4a23d3129431a48251cba75a8a14c2c789b18fd5 | 4,304 | py | Python | workspace/asr/conformer/examples/talk.py | shahin-trunk/NeMo | a10ac29a6deb05bcfc672ad287f4a8279c1f9289 | [
"Apache-2.0"
] | null | null | null | workspace/asr/conformer/examples/talk.py | shahin-trunk/NeMo | a10ac29a6deb05bcfc672ad287f4a8279c1f9289 | [
"Apache-2.0"
] | null | null | null | workspace/asr/conformer/examples/talk.py | shahin-trunk/NeMo | a10ac29a6deb05bcfc672ad287f4a8279c1f9289 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions a... | 39.851852 | 136 | 0.693309 |
4a23d4b2ac1699c6555eea1b54e504a8b0b28b34 | 160 | py | Python | Bulb_Switcher/bulb.py | danbaehr/leetcode | 0d135ded6199e191a8afe21b635bc98ce10de3ec | [
"MIT"
] | null | null | null | Bulb_Switcher/bulb.py | danbaehr/leetcode | 0d135ded6199e191a8afe21b635bc98ce10de3ec | [
"MIT"
] | null | null | null | Bulb_Switcher/bulb.py | danbaehr/leetcode | 0d135ded6199e191a8afe21b635bc98ce10de3ec | [
"MIT"
] | null | null | null | class Solution(object):
def bulbSwitch(self, n):
"""
:type n: int
:rtype: int
"""
return int(math.sqrt(n))
| 17.777778 | 32 | 0.44375 |
4a23d511233cfb494a7807aabc67394d71fa7c67 | 5,489 | py | Python | intent/scripts/igt/produce_tagger.py | rgeorgi/intent | 9920798c126f6d354029f7bb0a345e7cdb649f3a | [
"MIT"
] | 3 | 2016-08-05T01:11:57.000Z | 2017-08-26T15:35:51.000Z | intent/scripts/igt/produce_tagger.py | rgeorgi/intent | 9920798c126f6d354029f7bb0a345e7cdb649f3a | [
"MIT"
] | 2 | 2016-03-01T22:41:24.000Z | 2016-09-14T18:39:25.000Z | intent/scripts/igt/produce_tagger.py | rgeorgi/intent | 9920798c126f6d354029f7bb0a345e7cdb649f3a | [
"MIT"
] | null | null | null | '''
Created on Feb 20, 2015
@author: rgeorgi
'''
# Built-in imports -------------------------------------------------------------
import argparse, os, sys, logging
# Internal imports -------------------------------------------------------------
from intent.utils.argutils import existsfile, writefile
from intent.igt.... | 28.73822 | 118 | 0.626344 |
4a23d538b493659a448d941bcc3801fc2abd5b82 | 14,858 | py | Python | src/blib2to3/pgen2/parse.py | cbows/black | 0f26a0369efc7305a1a0120355f78d85b3030e56 | [
"MIT"
] | null | null | null | src/blib2to3/pgen2/parse.py | cbows/black | 0f26a0369efc7305a1a0120355f78d85b3030e56 | [
"MIT"
] | 14 | 2021-12-15T13:35:48.000Z | 2022-03-28T13:37:04.000Z | src/blib2to3/pgen2/parse.py | cbows/black | 0f26a0369efc7305a1a0120355f78d85b3030e56 | [
"MIT"
] | null | null | null | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Parser engine for the grammar tables generated by pgen.
The grammar table must be loaded first.
See Parser/parser.c in the Python distribution for additional info on
how this parsing engine works.
... | 37.71066 | 88 | 0.591802 |
4a23d56ec8a2b6f3f1d48e125424f202cfecbd2f | 1,142 | py | Python | bitmovin_api_sdk/models/progressive_webm_muxing_information.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 11 | 2019-07-03T10:41:16.000Z | 2022-02-25T21:48:06.000Z | bitmovin_api_sdk/models/progressive_webm_muxing_information.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 8 | 2019-11-23T00:01:25.000Z | 2021-04-29T12:30:31.000Z | bitmovin_api_sdk/models/progressive_webm_muxing_information.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 13 | 2020-01-02T14:58:18.000Z | 2022-03-26T12:10:30.000Z | # coding: utf-8
from six import string_types, iteritems
from bitmovin_api_sdk.common.poscheck import poscheck_model
from bitmovin_api_sdk.models.progressive_muxing_information import ProgressiveMuxingInformation
import pprint
class ProgressiveWebmMuxingInformation(ProgressiveMuxingInformation):
def to_dict(sel... | 30.052632 | 95 | 0.688266 |
4a23d5c17e6a9f2369faf6ea31f734f613ec9291 | 2,082 | py | Python | deicode/scripts/_logratio.py | justinshaffer/DEICODE | b7cd4da09c993bdd9ab536b1a5919dbc28d2b9ca | [
"BSD-3-Clause"
] | null | null | null | deicode/scripts/_logratio.py | justinshaffer/DEICODE | b7cd4da09c993bdd9ab536b1a5919dbc28d2b9ca | [
"BSD-3-Clause"
] | null | null | null | deicode/scripts/_logratio.py | justinshaffer/DEICODE | b7cd4da09c993bdd9ab536b1a5919dbc28d2b9ca | [
"BSD-3-Clause"
] | null | null | null | from biom import load_table
import pandas as pd
import numpy as np
import skbio
import os
from deicode.ratios import log_ratios
from deicode.preprocessing import rclr
import click
from gneiss.util import match
from skbio.stats.ordination import OrdinationResults
@click.command()
@click.option('--in_biom', help='Input ... | 38.555556 | 94 | 0.664745 |
4a23d6114366e20f319b6f975e0d4c37d26a37b2 | 53,137 | py | Python | os_win/tests/unit/utils/network/test_networkutils.py | mail2nsrajesh/os-win | b5ee321a097ddc96ea9c7a652a19d88215eab996 | [
"Apache-2.0"
] | null | null | null | os_win/tests/unit/utils/network/test_networkutils.py | mail2nsrajesh/os-win | b5ee321a097ddc96ea9c7a652a19d88215eab996 | [
"Apache-2.0"
] | null | null | null | os_win/tests/unit/utils/network/test_networkutils.py | mail2nsrajesh/os-win | b5ee321a097ddc96ea9c7a652a19d88215eab996 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Cloudbase Solutions Srl
#
# 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 ... | 45.338737 | 79 | 0.684476 |
4a23d644a6962d6ea7eadcf81a11f2f15a39da40 | 3,714 | py | Python | api/cases/libraries/advice.py | uktrade/lite-ap | 4e1a57956bd921992b4a6e2b8fbacbba5720960d | [
"MIT"
] | 3 | 2019-05-15T09:30:39.000Z | 2020-04-22T16:14:23.000Z | api/cases/libraries/advice.py | uktrade/lite-ap | 4e1a57956bd921992b4a6e2b8fbacbba5720960d | [
"MIT"
] | 85 | 2019-04-24T10:39:35.000Z | 2022-03-21T14:52:12.000Z | api/cases/libraries/advice.py | uktrade/lite-ap | 4e1a57956bd921992b4a6e2b8fbacbba5720960d | [
"MIT"
] | 1 | 2021-01-17T11:12:19.000Z | 2021-01-17T11:12:19.000Z | from collections import defaultdict
from api.cases.enums import AdviceType
from api.cases.models import Advice
from api.goods.enums import PvGrading
def group_advice(case, advice, user, new_level):
advice_entities = {entity_field: defaultdict(list) for entity_field in Advice.ENTITY_FIELDS}
for advice in adv... | 34.073394 | 98 | 0.655358 |
4a23d6d7c47dc749445a0953aab2753edece7db2 | 7,343 | py | Python | pytvision/datasets/datasets.py | HelenGuohx/cv-ferattn-code | faa9b7850fe2a0f8c08193bb129b5fec4639d616 | [
"MIT"
] | 1 | 2020-12-22T02:51:37.000Z | 2020-12-22T02:51:37.000Z | pytvision/datasets/datasets.py | HelenGuohx/cv-ferattn-code | faa9b7850fe2a0f8c08193bb129b5fec4639d616 | [
"MIT"
] | 1 | 2021-05-18T11:46:25.000Z | 2021-05-18T11:46:25.000Z | pytvision/datasets/datasets.py | HelenGuohx/cv-ferattn-code | faa9b7850fe2a0f8c08193bb129b5fec4639d616 | [
"MIT"
] | null | null | null | import numpy as np
import random
import torch
from . import utility
from ..transforms.aumentation import ObjectImageAndLabelTransform
import warnings
warnings.filterwarnings("ignore")
class Dataset( object ):
"""
Generic dataset
"""
def __init__(self,
data,
num_channels=1,
... | 31.650862 | 167 | 0.580281 |
4a23d722a94fdc5ff543da80fe3d399f8ce36080 | 96 | py | Python | venv/lib/python3.8/site-packages/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_net_command_factory_json.py | Retraces/UkraineBot | 3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71 | [
"MIT"
] | 2 | 2022-03-13T01:58:52.000Z | 2022-03-31T06:07:54.000Z | venv/lib/python3.8/site-packages/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_net_command_factory_json.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | 19 | 2021-11-20T04:09:18.000Z | 2022-03-23T15:05:55.000Z | venv/lib/python3.8/site-packages/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_net_command_factory_json.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | null | null | null | /home/runner/.cache/pip/pool/a9/78/b5/9c4abbac9a099ac7d70a15c83f46865e955a50f31806d48310ea258758 | 96 | 96 | 0.895833 |
4a23d7c89f4604668dfd771408b1d0e8f5fa7dbe | 8,473 | py | Python | packages/python/plotly/plotly/graph_objs/bar/marker/colorbar/_tickfont.py | labaran1/plotly.py | 7ec751e8fed4a570c11ea4bea2231806389d62eb | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/bar/marker/colorbar/_tickfont.py | labaran1/plotly.py | 7ec751e8fed4a570c11ea4bea2231806389d62eb | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/bar/marker/colorbar/_tickfont.py | labaran1/plotly.py | 7ec751e8fed4a570c11ea4bea2231806389d62eb | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Tickfont(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "bar.marker.colorbar"
_path_str = "bar.marker.colorbar.tickfont"
_valid_props = {"color", "... | 37.162281 | 82 | 0.567214 |
4a23d7fe42f43c8fde334d6f7ef7956c653adfb0 | 12,202 | py | Python | workers/mns_py/src/common/core_network_mock.py | ATownsend/mzbench | 96733b62ee466c25cfe6d308a63b851b4938b4f9 | [
"BSD-3-Clause"
] | 2 | 2020-01-28T20:55:13.000Z | 2020-10-28T15:24:25.000Z | workers/mns_py/src/common/core_network_mock.py | ATownsend/mzbench | 96733b62ee466c25cfe6d308a63b851b4938b4f9 | [
"BSD-3-Clause"
] | null | null | null | workers/mns_py/src/common/core_network_mock.py | ATownsend/mzbench | 96733b62ee466c25cfe6d308a63b851b4938b4f9 | [
"BSD-3-Clause"
] | 1 | 2020-06-04T13:49:14.000Z | 2020-06-04T13:49:14.000Z | ####################################
# Imports
####################################
import requests
import random
import uuid
import time
import sys
import json
import paho.mqtt.client as mqtt
import gevent
#from .MqttClient import MqttClient
from .MacAddress import MacAddress
class CoreNetworkSimple:
def __init_... | 37.088146 | 116 | 0.536469 |
4a23d96721de1171a6f90cd0e547a8add0ce2011 | 86,628 | py | Python | tensorflow/python/ops/variable_scope.py | arnaldog12/tensorflow | 5a4261d2015cf241ca0b6e3e5a023c4957def3bf | [
"Apache-2.0"
] | 3 | 2018-04-23T19:34:31.000Z | 2018-09-13T08:41:34.000Z | tensorflow/python/ops/variable_scope.py | arnaldog12/tensorflow | 5a4261d2015cf241ca0b6e3e5a023c4957def3bf | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/variable_scope.py | arnaldog12/tensorflow | 5a4261d2015cf241ca0b6e3e5a023c4957def3bf | [
"Apache-2.0"
] | 13 | 2018-02-22T21:04:13.000Z | 2020-11-17T11:38:36.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 43.034277 | 103 | 0.668664 |
4a23d9f4eeb714e7969cbfaa2510bcacb90cad6a | 342 | py | Python | appointment/admin.py | md-arru/Heart-Care-System | b7b8472f7b8ea289c8bea5fe00c2856af159f46b | [
"MIT"
] | 20 | 2019-11-26T12:33:25.000Z | 2021-09-02T16:03:59.000Z | appointment/admin.py | md-arru/Heart-Care-System | b7b8472f7b8ea289c8bea5fe00c2856af159f46b | [
"MIT"
] | 14 | 2019-08-23T15:12:34.000Z | 2022-03-11T23:46:34.000Z | appointment/admin.py | md-arru/Heart-Care-System | b7b8472f7b8ea289c8bea5fe00c2856af159f46b | [
"MIT"
] | 23 | 2019-08-19T01:12:25.000Z | 2022-03-08T12:53:44.000Z | from django.contrib import admin
from .models import Appointment
@admin.register(Appointment)
class AppoinmentAdmin(admin.ModelAdmin):
list_display = ['name', 'email', 'phone', 'doctor', 'date', 'time']
date_hierarchy = ('date')
list_filter = ['date', 'doctor', ]
list_per_page = 20
search_fields =... | 28.5 | 71 | 0.675439 |
4a23db137cd92761e02b70dbcc37ee509fb85218 | 7,695 | py | Python | src/mlp_morgan_out.py | yliuhz/PMAW | 23f4f3ec2ccb381be3d4b2edea0878e4015e1ae4 | [
"Apache-2.0"
] | 8 | 2021-12-02T02:25:55.000Z | 2022-03-18T23:41:42.000Z | src/mlp_morgan_out.py | yliuhz/PMAW | 23f4f3ec2ccb381be3d4b2edea0878e4015e1ae4 | [
"Apache-2.0"
] | null | null | null | src/mlp_morgan_out.py | yliuhz/PMAW | 23f4f3ec2ccb381be3d4b2edea0878e4015e1ae4 | [
"Apache-2.0"
] | null | null | null | # MLP
import csv
from itertools import islice
import random
import matplotlib.pyplot as plt
import numpy as np
from sklearn.neural_network import MLPRegressor
from sklearn.preprocessing import MinMaxScaler
from sklearn.model_selection import KFold, train_test_split
import pandas as pd
from sklearn.utils import shuffle
... | 29.037736 | 124 | 0.683431 |
4a23db7bc1b9d39aa878375dec74d1f334c2e818 | 592 | py | Python | tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial003.py | Aryabhata-Rootspring/fastapi | f6237ad05a8468ac19c591181adad38d75372c46 | [
"MIT"
] | 53,007 | 2018-12-08T10:05:29.000Z | 2022-03-31T23:30:02.000Z | tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial003.py | Aryabhata-Rootspring/fastapi | f6237ad05a8468ac19c591181adad38d75372c46 | [
"MIT"
] | 4,155 | 2019-01-05T05:07:49.000Z | 2022-03-31T21:25:38.000Z | tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial003.py | Aryabhata-Rootspring/fastapi | f6237ad05a8468ac19c591181adad38d75372c46 | [
"MIT"
] | 4,092 | 2018-12-09T16:21:00.000Z | 2022-03-31T07:59:45.000Z | from fastapi.testclient import TestClient
from docs_src.path_operation_advanced_configuration.tutorial003 import app
client = TestClient(app)
openapi_schema = {
"openapi": "3.0.2",
"info": {"title": "FastAPI", "version": "0.1.0"},
"paths": {},
}
def test_openapi_schema():
response = client.get("/op... | 24.666667 | 74 | 0.680743 |
4a23dbe58e2787eceab5be26f51d85a6d3bd77bb | 5,091 | py | Python | src/meshcat/animation.py | Arpafaucon/meshcat-python | c3a9ceaa2b82ba1146b174d901a63269a9b5432f | [
"MIT"
] | null | null | null | src/meshcat/animation.py | Arpafaucon/meshcat-python | c3a9ceaa2b82ba1146b174d901a63269a9b5432f | [
"MIT"
] | null | null | null | src/meshcat/animation.py | Arpafaucon/meshcat-python | c3a9ceaa2b82ba1146b174d901a63269a9b5432f | [
"MIT"
] | null | null | null | import tempfile
import tarfile
import os.path
import subprocess
import bisect
from . import transformations as tf
class AnimationTrack(object):
__slots__ = ["name", "jstype", "frames", "values"]
def __init__(self, name, jstype, frames=None, values=None):
self.name = name
self.jstype = jstype... | 30.854545 | 154 | 0.608132 |
4a23dc76db90b6df581fc0a59f9ffc2e68cc6a7d | 31,049 | py | Python | intersight/models/license_account_license_data.py | ategaw-cisco/intersight-python | 9d6476620507281b1dc358e29ac452d56081bbb0 | [
"Apache-2.0"
] | null | null | null | intersight/models/license_account_license_data.py | ategaw-cisco/intersight-python | 9d6476620507281b1dc358e29ac452d56081bbb0 | [
"Apache-2.0"
] | null | null | null | intersight/models/license_account_license_data.py | ategaw-cisco/intersight-python | 9d6476620507281b1dc358e29ac452d56081bbb0 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-262
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class LicenseAccountLicenseData(object):
"""
NOTE: ... | 30.620316 | 669 | 0.639248 |
4a23dd3a66065878fc620f59cc5ee4097b78fec8 | 807 | py | Python | setup.py | george-omosun-e/arweave-python-client | 256ecd192ead7e67705fa9be89fd0f94d1523158 | [
"MIT"
] | null | null | null | setup.py | george-omosun-e/arweave-python-client | 256ecd192ead7e67705fa9be89fd0f94d1523158 | [
"MIT"
] | null | null | null | setup.py | george-omosun-e/arweave-python-client | 256ecd192ead7e67705fa9be89fd0f94d1523158 | [
"MIT"
] | null | null | null | from distutils.core import setup
setup(
name="arweave-client-python",
packages = ['arweave'], # this must be the same as the name above
version="1.0.15.dev0",
description="Client interface for sending transactions on the Arweave permaweb",
author="George Omosun E. Jr.",
author_email="george.omosun.e@@gmail... | 28.821429 | 82 | 0.670384 |
4a23dd52ddcdd6cf99d3fd99a67c31ffdae879b3 | 6,451 | py | Python | opsdroid/connector/rocketchat/__init__.py | shendrekbharath/opsdroid | c4bd284a27c9cd98036705199d896ea20430e467 | [
"Apache-2.0"
] | null | null | null | opsdroid/connector/rocketchat/__init__.py | shendrekbharath/opsdroid | c4bd284a27c9cd98036705199d896ea20430e467 | [
"Apache-2.0"
] | null | null | null | opsdroid/connector/rocketchat/__init__.py | shendrekbharath/opsdroid | c4bd284a27c9cd98036705199d896ea20430e467 | [
"Apache-2.0"
] | null | null | null | """A connector for Rocket.Chat."""
import asyncio
import logging
import datetime
import aiohttp
from opsdroid.connector import Connector
from opsdroid.events import Message
_LOGGER = logging.getLogger(__name__)
API_PATH = '/api/v1/'
class RocketChat(Connector):
"""A connector for the chat service Rocket.Chat.""... | 34.682796 | 75 | 0.567044 |
4a23de0e76bc87440ee4c7a78ab85a9f00c22b05 | 1,961 | py | Python | orchestrator/core/orc_server/device/admin.py | oasis-open/openc2-oif | 9227d38cb53204b45641ac55aefd6a13d2aad563 | [
"Apache-2.0"
] | 2 | 2019-07-02T14:06:24.000Z | 2021-07-07T09:45:54.000Z | orchestrator/core/orc_server/device/admin.py | oasis-open/openc2-oif-orchestrator | 9227d38cb53204b45641ac55aefd6a13d2aad563 | [
"Apache-2.0"
] | 22 | 2020-03-24T16:58:17.000Z | 2022-02-27T15:36:57.000Z | orchestrator/core/orc_server/device/admin.py | oasis-open/openc2-oif | 9227d38cb53204b45641ac55aefd6a13d2aad563 | [
"Apache-2.0"
] | 10 | 2019-04-26T12:22:22.000Z | 2021-08-05T09:16:05.000Z | from django.contrib import admin
from polymorphic.admin import PolymorphicParentModelAdmin, PolymorphicChildModelAdmin, PolymorphicChildModelFilter
from .models import Device, DeviceGroup
from .models.transports import (
# Base
Transport,
TransportAuth,
# Transport Specific
TransportHTTP,
Trans... | 25.802632 | 114 | 0.750637 |
4a23de41b2a5e766632335272a33d6547ee0213b | 811 | py | Python | migrations/versions/20e031b23d18_.py | paked/WPC-fix | bca46731bce6a76f6b7eb79123b79b9c6377bc52 | [
"MIT"
] | 200 | 2015-01-27T18:26:09.000Z | 2021-12-19T14:38:53.000Z | migrations/versions/20e031b23d18_.py | paked/WPC-fix | bca46731bce6a76f6b7eb79123b79b9c6377bc52 | [
"MIT"
] | 12 | 2015-02-09T10:18:38.000Z | 2021-12-13T19:43:56.000Z | migrations/versions/20e031b23d18_.py | paked/WPC-fix | bca46731bce6a76f6b7eb79123b79b9c6377bc52 | [
"MIT"
] | 23 | 2015-02-09T04:42:48.000Z | 2015-02-20T18:58:56.000Z | """empty message
Revision ID: 20e031b23d18
Revises: 28af272381c0
Create Date: 2015-02-04 16:19:45.930039
"""
# revision identifiers, used by Alembic.
revision = '20e031b23d18'
down_revision = '28af272381c0'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto generated by Alembic - ... | 25.34375 | 67 | 0.686806 |
4a23dfad7a1b4f723fdb6848bf914c670e35b79a | 345 | py | Python | nipy/fixes/scipy/setup.py | yarikoptic/NiPy-OLD | 8759b598ac72d3b9df7414642c7a662ad9c55ece | [
"BSD-3-Clause"
] | 1 | 2015-08-22T16:14:45.000Z | 2015-08-22T16:14:45.000Z | nipy/fixes/scipy/setup.py | yarikoptic/NiPy-OLD | 8759b598ac72d3b9df7414642c7a662ad9c55ece | [
"BSD-3-Clause"
] | null | null | null | nipy/fixes/scipy/setup.py | yarikoptic/NiPy-OLD | 8759b598ac72d3b9df7414642c7a662ad9c55ece | [
"BSD-3-Clause"
] | null | null | null | def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('scipy', parent_package, top_path)
config.add_subpackage('stats')
return config
if __name__ == '__main__':
from numpy.distutils.core import setup
setup(**configuratio... | 28.75 | 61 | 0.736232 |
4a23dfb36f38c385a08e2bc4144d2dbc0dd4abe7 | 2,249 | py | Python | parser/config.py | zhancongc/movie_parse | 69d9b31b6b4ff021db9ff1f0c89488f5b6adaf8e | [
"MIT"
] | null | null | null | parser/config.py | zhancongc/movie_parse | 69d9b31b6b4ff021db9ff1f0c89488f5b6adaf8e | [
"MIT"
] | null | null | null | parser/config.py | zhancongc/movie_parse | 69d9b31b6b4ff021db9ff1f0c89488f5b6adaf8e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# alternative user agent
USER_AGENT = [
'Mozilla/5.0 (Windows NT 6.3; WOW64; Trident/7.0; rv:11.0) like Gecko',
'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36',
'Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; SLCC2; .NET CLR ... | 77.551724 | 222 | 0.666518 |
4a23e0891a0ab2c8eaa83bd8f49ed20012c0b578 | 6,988 | py | Python | nova/console/xvp.py | bopopescu/nova_vmware_compute_driver | 60d3936b68030647b9f11970c9e0d060fc286dd9 | [
"Apache-2.0"
] | null | null | null | nova/console/xvp.py | bopopescu/nova_vmware_compute_driver | 60d3936b68030647b9f11970c9e0d060fc286dd9 | [
"Apache-2.0"
] | null | null | null | nova/console/xvp.py | bopopescu/nova_vmware_compute_driver | 60d3936b68030647b9f11970c9e0d060fc286dd9 | [
"Apache-2.0"
] | 2 | 2019-07-08T22:12:35.000Z | 2020-07-24T08:27:24.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2010 OpenStack, LLC.
# 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... | 34.254902 | 79 | 0.595306 |
4a23e0ffd22b7a69ec4fa5d517b34a750e69f826 | 2,179 | py | Python | share/qt/extract_strings_qt.py | Shamsdadu/DigitalDenar | 423a782a0e76dcd449d86e59d6a1dd3204ece9d0 | [
"MIT"
] | 8 | 2019-11-14T13:49:50.000Z | 2019-12-28T13:15:06.000Z | share/qt/extract_strings_qt.py | Shamsdadu/DigitalDenar | 423a782a0e76dcd449d86e59d6a1dd3204ece9d0 | [
"MIT"
] | 1 | 2019-12-13T01:10:02.000Z | 2019-12-13T01:10:59.000Z | share/qt/extract_strings_qt.py | Shamsdadu/DigitalDenar | 423a782a0e76dcd449d86e59d6a1dd3204ece9d0 | [
"MIT"
] | 1 | 2019-12-13T01:00:28.000Z | 2019-12-13T01:00:28.000Z | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt stringdefs so that
they can be picked up by Qt linguist.
'''
from __future__ import division,print_function,unicode_literals
from subprocess import Popen, PIPE
import glob
import operator
import os
import sys
OUT_CPP="qt/digitaldenarstrin... | 25.940476 | 105 | 0.622304 |
4a23e10da8592da1795502e544741e2f7ca392e0 | 711 | py | Python | src/pyretem/subpackage1/module1.py | lpereira95/python-repo-template | 34a91d0d6d7fc6168e9e08deadb6d8fc7f304b9a | [
"MIT"
] | null | null | null | src/pyretem/subpackage1/module1.py | lpereira95/python-repo-template | 34a91d0d6d7fc6168e9e08deadb6d8fc7f304b9a | [
"MIT"
] | null | null | null | src/pyretem/subpackage1/module1.py | lpereira95/python-repo-template | 34a91d0d6d7fc6168e9e08deadb6d8fc7f304b9a | [
"MIT"
] | null | null | null | """This module contains classes.
"""
class AnObject:
"""Defines an object
Args:
a (bool): This is param `a` description.
b (np.array): This is param `b` description.
Attributes:
a (bool): An attribute.
b (np.array): Another attribute.
Notes:
There's a little ... | 21.545455 | 71 | 0.59353 |
4a23e16a95b2dca13de6acf98c6fe6eec566a0f1 | 8,973 | py | Python | elasticdl/python/data/reader/odps_reader.py | zuston/elasticdl | 601609fd44f826a2f5ea209443124b2c9a2f9ccb | [
"MIT"
] | null | null | null | elasticdl/python/data/reader/odps_reader.py | zuston/elasticdl | 601609fd44f826a2f5ea209443124b2c9a2f9ccb | [
"MIT"
] | null | null | null | elasticdl/python/data/reader/odps_reader.py | zuston/elasticdl | 601609fd44f826a2f5ea209443124b2c9a2f9ccb | [
"MIT"
] | null | null | null | # Copyright 2020 The ElasticDL Authors. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 36.181452 | 79 | 0.591664 |
4a23e175c59ead5a2f54c4fea0e337ebf8110e27 | 5,399 | py | Python | src/setup.py | MaicoTimmerman/pretix | 35ac2f0d2b24aa3f9e30ea9eadad5cd2ac3b7634 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-04-16T00:29:21.000Z | 2021-04-16T00:29:21.000Z | src/setup.py | MaicoTimmerman/pretix | 35ac2f0d2b24aa3f9e30ea9eadad5cd2ac3b7634 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/setup.py | MaicoTimmerman/pretix | 35ac2f0d2b24aa3f9e30ea9eadad5cd2ac3b7634 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import os
import sys
from codecs import open
from distutils.command.build import build
from os import path
from setuptools import find_packages, setup
from pretix import __version__
CURRENT_PYTHON = sys.version_info[:2]
REQUIRED_PYTHON = (3, 5)
if CURRENT_PYTHON < REQUIRED_PYTHON:
sys.stderr.write("""
==========... | 29.994444 | 80 | 0.562141 |
4a23e239f2ed0a1c056c08e43e7fb0732ed296ad | 3,508 | py | Python | test/unit/git_class/gitmerge_git_pu.py | deepcoder42/git-lib | 7f5736ea71d6592390222a214b0e51cd3c3151f8 | [
"MIT"
] | null | null | null | test/unit/git_class/gitmerge_git_pu.py | deepcoder42/git-lib | 7f5736ea71d6592390222a214b0e51cd3c3151f8 | [
"MIT"
] | null | null | null | test/unit/git_class/gitmerge_git_pu.py | deepcoder42/git-lib | 7f5736ea71d6592390222a214b0e51cd3c3151f8 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Classification (U)
"""Program: gitmerge_git_pu.py
Description: Unit testing of gitmerge.git_pu in git_class.py.
Usage:
test/unit/git_class/gitmerge_git_pu.py
Arguments:
"""
# Libraries and Global Variables
# Standard
import sys
import os
if sys.version_info < (2, 7):
... | 18.366492 | 78 | 0.601197 |
4a23e28cd57e9b28e067f80613ee6d59217fe829 | 175 | py | Python | sigma/core/util.py | suzuki-shunsuke/pysigma.core | 89fe0d99e8cba015aad245dfda8465af99d1ab9d | [
"MIT"
] | 1 | 2022-02-09T06:38:52.000Z | 2022-02-09T06:38:52.000Z | sigma/core/util.py | suzuki-shunsuke/pysigma.core | 89fe0d99e8cba015aad245dfda8465af99d1ab9d | [
"MIT"
] | null | null | null | sigma/core/util.py | suzuki-shunsuke/pysigma.core | 89fe0d99e8cba015aad245dfda8465af99d1ab9d | [
"MIT"
] | null | null | null | """
"""
def validate(Model, *args, **kwargs):
return Model(*args, **kwargs)
def asdict(model):
return dict((key, getattr(model, key)) for key in model.__fields__)
| 15.909091 | 71 | 0.64 |
4a23e31a07f934a146f333a8498a8e16a0fb1917 | 29,119 | py | Python | src/transformers/adapters/model_mixin.py | AngadSethi/adapter-transformers | b147bba9107a5a561aca28c99f4e4ec2816a6e4f | [
"Apache-2.0"
] | null | null | null | src/transformers/adapters/model_mixin.py | AngadSethi/adapter-transformers | b147bba9107a5a561aca28c99f4e4ec2816a6e4f | [
"Apache-2.0"
] | null | null | null | src/transformers/adapters/model_mixin.py | AngadSethi/adapter-transformers | b147bba9107a5a561aca28c99f4e4ec2816a6e4f | [
"Apache-2.0"
] | null | null | null | import logging
import warnings
from abc import ABC, abstractmethod
from os.path import join
from typing import List, Mapping, Optional, Union
from torch import nn
from .composition import AdapterCompositionBlock, Fuse, Stack, parse_composition
from .configuration import (
ADAPTERFUSION_CONFIG_MAP,
DEFAULT_ADA... | 43.656672 | 140 | 0.658127 |
4a23e35120671f982b166cc60bfd875f3b41a129 | 1,141 | py | Python | tests/test_templatetags.py | NickolausDS/django-globus-portal-framework | 7d8dc9018d2bfcbd72d62344f0abe221b9259d70 | [
"Apache-2.0"
] | null | null | null | tests/test_templatetags.py | NickolausDS/django-globus-portal-framework | 7d8dc9018d2bfcbd72d62344f0abe221b9259d70 | [
"Apache-2.0"
] | 3 | 2021-10-18T15:05:38.000Z | 2022-02-01T19:52:15.000Z | tests/test_templatetags.py | NickolausDS/django-globus-portal-framework | 7d8dc9018d2bfcbd72d62344f0abe221b9259d70 | [
"Apache-2.0"
] | 2 | 2022-02-07T23:56:06.000Z | 2022-02-07T23:58:55.000Z | import pytest
from django.urls import path
from globus_portal_framework.templatetags.is_active import is_active
def view_simple(request):
pass
def view_complex(request, sun, moon, stars):
pass
urlpatterns = [
path('view-simple', view_simple, name='view-simple'),
path('view-complex/<int:sun>/<int:... | 25.355556 | 75 | 0.689746 |
4a23e3bf1040864b135a45d0df95875a4a30b2bb | 987 | py | Python | app/search.py | andela-kerinoso/data_structures_algo | ff9fb75f87e5d86050f4f530f72d7bf68253f3c7 | [
"MIT"
] | 1 | 2019-08-14T19:49:36.000Z | 2019-08-14T19:49:36.000Z | app/search.py | andela-kerinoso/data_structures_algo | ff9fb75f87e5d86050f4f530f72d7bf68253f3c7 | [
"MIT"
] | null | null | null | app/search.py | andela-kerinoso/data_structures_algo | ff9fb75f87e5d86050f4f530f72d7bf68253f3c7 | [
"MIT"
] | 2 | 2017-03-23T00:14:38.000Z | 2017-05-19T09:38:29.000Z | def unsorted_sequential_search(haystack, needle):
endpoint = len(haystack)
counter = 0
found = False
while counter < endpoint and not found:
if haystack[counter] == needle:
found = True
else:
counter += 1
return found
def sorted_sequential_search(haystack, ... | 23.5 | 61 | 0.600811 |
4a23e49193e984f094b0522bb0024ed1e53bc0d9 | 16,621 | py | Python | kubernetes/client/models/v1_stateful_set_spec.py | sthagen/kubernetes-client-python | 3a183048d7d568ba5ea418bcfb8f61713908d3ea | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_stateful_set_spec.py | sthagen/kubernetes-client-python | 3a183048d7d568ba5ea418bcfb8f61713908d3ea | [
"Apache-2.0"
] | 3 | 2021-11-30T03:11:13.000Z | 2022-02-09T03:39:41.000Z | kubernetes/client/models/v1_stateful_set_spec.py | sthagen/kubernetes-client-python | 3a183048d7d568ba5ea418bcfb8f61713908d3ea | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.24
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | 44.921622 | 555 | 0.699416 |
4a23e4a8cb38d07fb13ed7abcd41b4bff00cf532 | 575 | py | Python | Prototypes/Zeta Function/zeta_global.py | jackm245/Visualising-and-Investigating-the-Riemann-Hypothesis | 6eff14b6503cb2faf3bd8b0785239b690bce368a | [
"MIT"
] | 2 | 2021-05-01T19:07:28.000Z | 2021-05-18T07:34:42.000Z | Prototypes/Zeta Function/zeta_global.py | jackm245/Visualising-and-Investigating-the-Riemann-Hypothesis | 6eff14b6503cb2faf3bd8b0785239b690bce368a | [
"MIT"
] | null | null | null | Prototypes/Zeta Function/zeta_global.py | jackm245/Visualising-and-Investigating-the-Riemann-Hypothesis | 6eff14b6503cb2faf3bd8b0785239b690bce368a | [
"MIT"
] | null | null | null | from itertools import count, islice
# binomial coefficient
def binom(n, k):
v = 1
for i in range(k):
v *= (n - i) / (i + 1)
return v
# Global zeta function
def zeta(s, t=100):
if s == 1: return float('inf')
sum1 = 0
for n in range(t):
sum2 = 0
for k in range(n+1):
... | 19.166667 | 56 | 0.497391 |
4a23e8d9179cef98457441580d4aca898be09c7b | 2,358 | py | Python | samples/cli/accelbyte_py_sdk_cli/lobby/_public_get_party_data_v1.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | samples/cli/accelbyte_py_sdk_cli/lobby/_public_get_party_data_v1.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | 1 | 2021-10-13T03:46:58.000Z | 2021-10-13T03:46:58.000Z | samples/cli/accelbyte_py_sdk_cli/lobby/_public_get_party_data_v1.py | AccelByte/accelbyte-python-sdk | dcd311fad111c59da828278975340fb92e0f26f7 | [
"MIT"
] | null | null | null | # Copyright (c) 2021 AccelByte Inc. All Rights Reserved.
# This is licensed software from AccelByte Inc, for limitations
# and restrictions contact your company contract manager.
#
# Code generated. DO NOT EDIT!
# template_file: python-cli-command.j2
# justice-lobby-server (staging)
# pylint: disable=duplicate-code
... | 32.30137 | 100 | 0.748092 |
4a23e94d1a33f33cdb704bdbbb6731f5f4ae9d70 | 3,137 | py | Python | pylua/test/test_timer_lua.py | malirod/pylua | e6a1718428ab77f87c58890436a89bdd408ff95b | [
"MIT"
] | 1 | 2021-12-31T08:58:14.000Z | 2021-12-31T08:58:14.000Z | pylua/test/test_timer_lua.py | malirod/pylua | e6a1718428ab77f87c58890436a89bdd408ff95b | [
"MIT"
] | 12 | 2016-09-08T06:24:05.000Z | 2016-11-30T06:49:09.000Z | pylua/test/test_timer_lua.py | malirod/pylua | e6a1718428ab77f87c58890436a89bdd408ff95b | [
"MIT"
] | 7 | 2016-09-08T17:27:43.000Z | 2018-12-27T17:32:09.000Z | # -*- coding: utf-8 -*-
import timeit
from pylua.timer import Timer, msec_to_sec
from pylua.test.mixin import EventLoopMixin, LuaRuntimeMixin
class TestTimer(EventLoopMixin, LuaRuntimeMixin):
def setup(self):
EventLoopMixin.setup(self)
LuaRuntimeMixin.setup(self)
self.lua_runtime.globals... | 35.247191 | 79 | 0.542875 |
4a23e9d4a5c11381c684797be8e15e8a7a5aefc9 | 3,197 | py | Python | tests/test_controller.py | raboley/categorize-images | bd6fd3ab11efa5b1a9957f86113f9601e4f8f8a0 | [
"MIT"
] | null | null | null | tests/test_controller.py | raboley/categorize-images | bd6fd3ab11efa5b1a9957f86113f9601e4f8f8a0 | [
"MIT"
] | null | null | null | tests/test_controller.py | raboley/categorize-images | bd6fd3ab11efa5b1a9957f86113f9601e4f8f8a0 | [
"MIT"
] | null | null | null | # from .context import categorize
# import os
# import unittest
# class controller(unittest.TestCase):
# """
# ensure that this will recognize images
# Post the json in a folder
# determine the image type (stat, main, side 1 and 2)
# extract the weapon name from the stat page
# post the weapon ... | 45.671429 | 103 | 0.70441 |
4a23ea0f10d52c2e72e43fd5bb80448fb39a03d1 | 12,341 | py | Python | ml-agents/mlagents/trainers/torch/utils.py | Phong13/ml-agents | 393808b50581e66085578b01d9d907b65a9240f0 | [
"Apache-2.0"
] | null | null | null | ml-agents/mlagents/trainers/torch/utils.py | Phong13/ml-agents | 393808b50581e66085578b01d9d907b65a9240f0 | [
"Apache-2.0"
] | null | null | null | ml-agents/mlagents/trainers/torch/utils.py | Phong13/ml-agents | 393808b50581e66085578b01d9d907b65a9240f0 | [
"Apache-2.0"
] | null | null | null | from typing import List, Optional, Tuple
from mlagents.torch_utils import torch, nn
import numpy as np
from mlagents.trainers.torch.encoders import (
SimpleVisualEncoder,
ResNetVisualEncoder,
NatureVisualEncoder,
SmallVisualEncoder,
VectorInput,
)
from mlagents.trainers.settings import EncoderType,... | 40.595395 | 108 | 0.625962 |
4a23eb2928a35900a10bc0c57fa592f5f5c3897e | 6,642 | py | Python | agentQ/ga.py | johbjo09/nn-agentq | fc1524224804146f8611c72e396daf85d96d5732 | [
"MIT"
] | null | null | null | agentQ/ga.py | johbjo09/nn-agentq | fc1524224804146f8611c72e396daf85d96d5732 | [
"MIT"
] | null | null | null | agentQ/ga.py | johbjo09/nn-agentq | fc1524224804146f8611c72e396daf85d96d5732 | [
"MIT"
] | null | null | null | from time import time
import numpy as np
import math
import random
from abc import ABCMeta, abstractmethod, abstractproperty
from copy import deepcopy
class GeneticThing():
__metaclass__ = ABCMeta
@abstractproperty
def fitness(self):
pass
@abstractmethod
def mutate(self, r_mutate):
... | 31.932692 | 122 | 0.572719 |
4a23ebd2940dd6045ef0018c7ee6e296745ba8ad | 51,412 | py | Python | google/cloud/compute_v1/services/target_ssl_proxies/client.py | auphofBSF/python-compute | c81bfa752c9db93edd0cd56fec3a79599704d792 | [
"Apache-2.0"
] | null | null | null | google/cloud/compute_v1/services/target_ssl_proxies/client.py | auphofBSF/python-compute | c81bfa752c9db93edd0cd56fec3a79599704d792 | [
"Apache-2.0"
] | null | null | null | google/cloud/compute_v1/services/target_ssl_proxies/client.py | auphofBSF/python-compute | c81bfa752c9db93edd0cd56fec3a79599704d792 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 45.177504 | 143 | 0.618105 |
4a23ec0a10a019396f00a929660f8fcc7a383c34 | 840 | py | Python | profiles/migrations/0009_auto_20180716_0723.py | doriclazar/peak_30 | a87217e4d0d1f96d39ad214d40a879c7abfaaaee | [
"Apache-2.0"
] | null | null | null | profiles/migrations/0009_auto_20180716_0723.py | doriclazar/peak_30 | a87217e4d0d1f96d39ad214d40a879c7abfaaaee | [
"Apache-2.0"
] | 1 | 2018-07-14T07:35:55.000Z | 2018-07-16T07:40:49.000Z | profiles/migrations/0009_auto_20180716_0723.py | doriclazar/peak_30 | a87217e4d0d1f96d39ad214d40a879c7abfaaaee | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.5 on 2018-07-16 07:23
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('profiles', '0008_auto_20180716_0715'),
]
operations = [
migrations.AlterFie... | 27.096774 | 76 | 0.590476 |
4a23ec27db1276404b86c563a4e19aa3ed35d36f | 2,687 | py | Python | app/core/tests/test_modules.py | yahye-farah/recipte-api | b1bc11b99ebf37bb66a8a46bfb5ffe09f14fe361 | [
"MIT"
] | null | null | null | app/core/tests/test_modules.py | yahye-farah/recipte-api | b1bc11b99ebf37bb66a8a46bfb5ffe09f14fe361 | [
"MIT"
] | null | null | null | app/core/tests/test_modules.py | yahye-farah/recipte-api | b1bc11b99ebf37bb66a8a46bfb5ffe09f14fe361 | [
"MIT"
] | null | null | null | from unittest.mock import patch
from django.test import TestCase
from django.contrib.auth import get_user_model
from core import models
def sample_user(email="test@test.com", password="testpass123"):
'''Create a sample user'''
return get_user_model().objects.create_user(email, password)
class ModelTests(Tes... | 34.012658 | 70 | 0.646818 |
4a23ecbf679f8fe8afbf82509b58056a6efd74ec | 1,292 | py | Python | crlib.py | Zst/CRWar2Track | 6138898add5e242488ee91670b2e636007d1a2af | [
"MIT"
] | null | null | null | crlib.py | Zst/CRWar2Track | 6138898add5e242488ee91670b2e636007d1a2af | [
"MIT"
] | null | null | null | crlib.py | Zst/CRWar2Track | 6138898add5e242488ee91670b2e636007d1a2af | [
"MIT"
] | null | null | null | # Common utils for accessing Clash Royale API
import requests
import sys
def load_auth():
try:
with open("auth.txt", "r") as f:
rv = "Bearer " + f.read().rstrip()
return rv
except IOError:
sys.exit("Could not read authentication token, make sure one is available in an a... | 30.761905 | 104 | 0.580495 |
4a23eccd85192c47f45b02070123288ff6c2d365 | 5,632 | py | Python | dataflow.py | chengsoonong/nbtidy | a3d8efbaab91fbfcaaecfe38e280eb633e645f3e | [
"MIT"
] | null | null | null | dataflow.py | chengsoonong/nbtidy | a3d8efbaab91fbfcaaecfe38e280eb633e645f3e | [
"MIT"
] | 1 | 2015-09-23T06:58:32.000Z | 2015-10-06T02:15:51.000Z | dataflow.py | chengsoonong/nbtidy | a3d8efbaab91fbfcaaecfe38e280eb633e645f3e | [
"MIT"
] | null | null | null | """Extract file read and file write statements from jupyter notebooks.
Try to figure out the data flow from the file names.
"""
import os.path
import re
import nbformat
import argparse
from graphviz import Digraph
# ambiguous = ['\.Open', '\.open']
reader_names = ['\.read_csv', '\.read_hdf', '\.load']
writer_names =... | 34.341463 | 102 | 0.553445 |
4a23ed8a4c3c9ccedb269490e54307b693724e35 | 5,694 | py | Python | venv/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.py | pengwu/scapy_env | 3db9c5dea2e219048a2387649d6d89be342903d9 | [
"MIT"
] | null | null | null | venv/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.py | pengwu/scapy_env | 3db9c5dea2e219048a2387649d6d89be342903d9 | [
"MIT"
] | null | null | null | venv/lib/python2.7/dist-packages/landscape/manager/shutdownmanager.py | pengwu/scapy_env | 3db9c5dea2e219048a2387649d6d89be342903d9 | [
"MIT"
] | null | null | null | import logging
from twisted.internet.defer import Deferred
from twisted.internet.protocol import ProcessProtocol
from twisted.internet.error import ProcessDone
from landscape.manager.plugin import ManagerPlugin, SUCCEEDED, FAILED
class ShutdownFailedError(Exception):
"""Raised when a call to C{/sbin/shutdown} f... | 37.460526 | 79 | 0.652266 |
4a23eea056b9feaf93391244a42939f7765f13d4 | 5,692 | py | Python | bindings/python/ensmallen_graph/datasets/networkrepository/maayanfoodweb.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/networkrepository/maayanfoodweb.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/networkrepository/maayanfoodweb.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph maayan-foodweb.
The graph is automatically retrieved from the NetworkRepository repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2... | 31.798883 | 94 | 0.684469 |
4a23ef17f4bcf692ba445f2320565b535956b1b3 | 2,471 | py | Python | mindspore/train/callback/_time_monitor.py | Greatpanc/mindspore_zhb | c2511f7d6815b9232ac4427e27e2c132ed03e0d9 | [
"Apache-2.0"
] | null | null | null | mindspore/train/callback/_time_monitor.py | Greatpanc/mindspore_zhb | c2511f7d6815b9232ac4427e27e2c132ed03e0d9 | [
"Apache-2.0"
] | null | null | null | mindspore/train/callback/_time_monitor.py | Greatpanc/mindspore_zhb | c2511f7d6815b9232ac4427e27e2c132ed03e0d9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 35.3 | 114 | 0.633347 |
4a23ef83cd5166532b14246dcbb0bbe393da8c7b | 1,609 | py | Python | data/subsample_documents.py | gtzinos/Multi-Instance-Learning | f7d4a5d05ea9c6efe2a405d710d710b4ae4df05e | [
"MIT"
] | 4 | 2018-06-19T12:45:47.000Z | 2019-06-25T18:31:23.000Z | data/subsample_documents.py | gtzinos/Multi-Instance-Learning | f7d4a5d05ea9c6efe2a405d710d710b4ae4df05e | [
"MIT"
] | 1 | 2018-12-29T09:04:09.000Z | 2018-12-29T09:04:09.000Z | data/subsample_documents.py | gtzinos/Multi-Instance-Learning | f7d4a5d05ea9c6efe2a405d710d710b4ae4df05e | [
"MIT"
] | 1 | 2021-12-07T13:47:57.000Z | 2021-12-07T13:47:57.000Z | import re
import numpy as np
np.random.seed(1000001)
source_location = '/home/studadmin/Desktop/delicioust140_documents/fdocuments'
docnamefile = 'DocNameTag.txt'
outdocfile = 'Subsampled_DocNameTag.txt'
Classes = set(['reference', 'design', 'programming', 'internet', 'computer', 'web', 'java', 'writing', 'english'... | 26.816667 | 238 | 0.670603 |
4a23f077147f1890c322d606616ee52c6fa3ffa2 | 4,185 | py | Python | tools/boundhelper.py | ranstar74/Sollumz | 7bb6963885e11b929915913699957e3ac9aa8815 | [
"MIT"
] | null | null | null | tools/boundhelper.py | ranstar74/Sollumz | 7bb6963885e11b929915913699957e3ac9aa8815 | [
"MIT"
] | null | null | null | tools/boundhelper.py | ranstar74/Sollumz | 7bb6963885e11b929915913699957e3ac9aa8815 | [
"MIT"
] | null | null | null | import bpy
from ..sollumz_properties import SollumType, SOLLUMZ_UI_NAMES, BOUND_POLYGON_TYPES
from ..ybn.collision_materials import create_collision_material_from_index
from ..tools.meshhelper import create_box, create_sphere, create_capsule, create_cylinder
from mathutils import Vector, Matrix
def create_bound_shap... | 32.44186 | 128 | 0.651852 |
4a23f117e0e4bbb2acd124b7fb678a1ecb8035c8 | 18,281 | py | Python | cwltool/load_tool.py | michael-kotliar/cwltool | 0bae6e4466cacbd03a8b9cc074f0920516c959a7 | [
"Apache-2.0"
] | null | null | null | cwltool/load_tool.py | michael-kotliar/cwltool | 0bae6e4466cacbd03a8b9cc074f0920516c959a7 | [
"Apache-2.0"
] | null | null | null | cwltool/load_tool.py | michael-kotliar/cwltool | 0bae6e4466cacbd03a8b9cc074f0920516c959a7 | [
"Apache-2.0"
] | null | null | null | """Loads a CWL document."""
import hashlib
import logging
import os
import re
import urllib
import uuid
from typing import (
Any,
Dict,
List,
MutableMapping,
MutableSequence,
Optional,
Tuple,
Union,
cast,
)
from ruamel.yaml.comments import CommentedMap, CommentedSeq
from schema_sal... | 35.088292 | 99 | 0.588808 |
4a23f17e6970ee827ef4d40de97cedd09f13de60 | 6,120 | py | Python | ansible/venv/lib/python2.7/site-packages/ansible/modules/cloud/ovirt/ovirt_external_provider_info.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/modules/cloud/ovirt/ovirt_external_provider_info.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/modules/cloud/ovirt/ovirt_external_provider_info.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2016 Red Hat, Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
#... | 37.777778 | 122 | 0.679575 |
4a23f1c02f2f827896a5f3fc1754b40bc7b328f8 | 6,104 | py | Python | watertap/unit_models/zero_order/tests/test_bioreactor_zo.py | kurbansitterley/watertap | 1a8986a779bdcb36f1481f03eed24c6c42d26481 | [
"BSD-3-Clause-LBNL"
] | null | null | null | watertap/unit_models/zero_order/tests/test_bioreactor_zo.py | kurbansitterley/watertap | 1a8986a779bdcb36f1481f03eed24c6c42d26481 | [
"BSD-3-Clause-LBNL"
] | null | null | null | watertap/unit_models/zero_order/tests/test_bioreactor_zo.py | kurbansitterley/watertap | 1a8986a779bdcb36f1481f03eed24c6c42d26481 | [
"BSD-3-Clause-LBNL"
] | null | null | null | ###############################################################################
# WaterTAP Copyright (c) 2021, The Regents of the University of California,
# through Lawrence Berkeley National Laboratory, Oak Ridge National
# Laboratory, National Renewable Energy Laboratory, and National Energy
# Technology Laboratory ... | 35.283237 | 88 | 0.67464 |
4a23f234e6689a4396c8bb6f659efc291b7801e1 | 29,875 | py | Python | pythran/tests/test_slice.py | davidbrochart/pythran | 24b6c8650fe99791a4091cbdc2c24686e86aa67c | [
"BSD-3-Clause"
] | 1,647 | 2015-01-13T01:45:38.000Z | 2022-03-28T01:23:41.000Z | pythran/tests/test_slice.py | davidbrochart/pythran | 24b6c8650fe99791a4091cbdc2c24686e86aa67c | [
"BSD-3-Clause"
] | 1,116 | 2015-01-01T09:52:05.000Z | 2022-03-18T21:06:40.000Z | pythran/tests/test_slice.py | davidbrochart/pythran | 24b6c8650fe99791a4091cbdc2c24686e86aa67c | [
"BSD-3-Clause"
] | 180 | 2015-02-12T02:47:28.000Z | 2022-03-14T10:28:18.000Z | """ Module to test slice implementation. """
import numpy
from pythran.typing import List, NDArray
from pythran.tests import TestEnv
class TestSlice(TestEnv):
"""
Unittest class for code using slices.
We skip tests for None step as it is equivalent to 1.
TODO : add tests for 1 == step (None as st... | 36.124547 | 65 | 0.478594 |
4a23f3be5162ee5d0a402ff3967ed53d59bc11b6 | 575 | py | Python | tests/test_cli.py | buenrostrolab/parkour | 89e5a726b1606194d114c4bb61741ffb7119b9cf | [
"MIT"
] | 11 | 2017-06-01T01:40:07.000Z | 2019-08-19T22:21:58.000Z | tests/test_cli.py | buenrostrolab/parkour | 89e5a726b1606194d114c4bb61741ffb7119b9cf | [
"MIT"
] | 11 | 2017-05-29T19:14:16.000Z | 2018-11-05T02:06:09.000Z | tests/test_cli.py | buenrostrolab/parkour | 89e5a726b1606194d114c4bb61741ffb7119b9cf | [
"MIT"
] | 2 | 2017-07-20T19:45:02.000Z | 2019-09-29T15:24:59.000Z | import pytest
from click.testing import CliRunner
from parkour import cli
import md5
def file_checksums_equal(file1, file2):
with open(file1) as f:
checksum1 = md5.new(f.read()).digest()
with open(file2) as f:
checksum2 = md5.new(f.read()).digest()
return checksum1==checksum2
def test_t... | 28.75 | 107 | 0.693913 |
4a23f3f3ea316bb6888d2bfd8cba5ff7063548d6 | 715 | py | Python | pl_igscmaes/run_genps.py | Lucklyric/Lucklyric-TSInSAR-PF-IGS_CMAES | 704e45ea433de4fd1106603c9e7ae115adca1c67 | [
"Apache-2.0"
] | 1 | 2021-06-25T13:26:09.000Z | 2021-06-25T13:26:09.000Z | pl_igscmaes/run_genps.py | Lucklyric/TSInSAR-PF-IGS_CMAES | 704e45ea433de4fd1106603c9e7ae115adca1c67 | [
"Apache-2.0"
] | null | null | null | pl_igscmaes/run_genps.py | Lucklyric/TSInSAR-PF-IGS_CMAES | 704e45ea433de4fd1106603c9e7ae115adca1c67 | [
"Apache-2.0"
] | null | null | null | import hydra
from omegaconf import DictConfig, OmegaConf
import logging
from torch.utils.data import DataLoader
import pytorch_lightning as pl
import numpy as np
import json
import os
import joblib
from .data.generate_ps_v2 import generate_ps
log = logging.getLogger(__name__)
@hydra.main(config_path="config", config_... | 21.666667 | 55 | 0.737063 |
4a23f3fe628a6fe5c021e97edfe1f2a0a5d7e9af | 5,079 | py | Python | build/x86/python/m5/internal/param_X86ACPISysDescTable.py | billionshang/gem5 | 18cc4294f32315595f865d07d1f33434e92b06b2 | [
"BSD-3-Clause"
] | null | null | null | build/x86/python/m5/internal/param_X86ACPISysDescTable.py | billionshang/gem5 | 18cc4294f32315595f865d07d1f33434e92b06b2 | [
"BSD-3-Clause"
] | null | null | null | build/x86/python/m5/internal/param_X86ACPISysDescTable.py | billionshang/gem5 | 18cc4294f32315595f865d07d1f33434e92b06b2 | [
"BSD-3-Clause"
] | null | null | null | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.8
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2, 6, 0):
def swig_import_helper():
from os.path imp... | 37.345588 | 187 | 0.732034 |
4a23f432cf5f8bff2f66719b7591c29608fa7fb0 | 605 | py | Python | config/trainer_configs/save_config/faa_dense_net.py | jwspaeth/FAA-Project | afa9d3bec10deead48c4b17dff69df2e02691e41 | [
"MIT"
] | null | null | null | config/trainer_configs/save_config/faa_dense_net.py | jwspaeth/FAA-Project | afa9d3bec10deead48c4b17dff69df2e02691e41 | [
"MIT"
] | 2 | 2019-10-20T00:42:40.000Z | 2019-10-30T18:06:11.000Z | config/trainer_configs/save_config/faa_dense_net.py | jwspaeth/FAA-Project | afa9d3bec10deead48c4b17dff69df2e02691e41 | [
"MIT"
] | null | null | null | from yacs.config import CfgNode as CN
_C = CN()
# Define output parameters
_C.Output = CN()
_C.Output.batch_name = "FaaDense-test-3"
_C.Output.checkpoint_trigger = 1
# Define callback parameters
_C.Callback = CN()
_C.Callback.exists = True
_C.Callback.names = ["MyRecordingCallback", "MemoryCallback", "ResetHistoryCa... | 27.5 | 85 | 0.747107 |
4a23f4fdb7ea714c92d42e823f0e356df52f0518 | 1,029 | py | Python | MultiThread/2_immutable_pattern.py | AtsushiSakai/python_public_sandbox | ab656ef0e862cfd9e0e32a18bf55f6e75ed6b9fe | [
"MIT"
] | null | null | null | MultiThread/2_immutable_pattern.py | AtsushiSakai/python_public_sandbox | ab656ef0e862cfd9e0e32a18bf55f6e75ed6b9fe | [
"MIT"
] | null | null | null | MultiThread/2_immutable_pattern.py | AtsushiSakai/python_public_sandbox | ab656ef0e862cfd9e0e32a18bf55f6e75ed6b9fe | [
"MIT"
] | null | null | null | import threading
class Gate:
def __init__(self, name, address):
self.counter = 0
self._name = name
self._address = address
def through(self):
self.counter += 1
self.check()
@property
def name(self):
return self._name
@property
def address(self... | 19.788462 | 83 | 0.555879 |
4a23f5923eef948b39fa1b57b4ff107e41ff7cc4 | 1,020,790 | py | Python | nova/tests/unit/virt/libvirt/test_driver.py | bopopescu/TestNova | fb6a183b54f87cc078dc6de5be89711ec0d9ac26 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/virt/libvirt/test_driver.py | bopopescu/TestNova | fb6a183b54f87cc078dc6de5be89711ec0d9ac26 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/virt/libvirt/test_driver.py | bopopescu/TestNova | fb6a183b54f87cc078dc6de5be89711ec0d9ac26 | [
"Apache-2.0"
] | 1 | 2020-07-22T22:13:56.000Z | 2020-07-22T22:13:56.000Z | # Copyright 2010 OpenStack Foundation
# Copyright 2012 University Of Minho
#
# 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.... | 45.843176 | 92 | 0.593375 |
4a23f60ae4d4981c154f86980c84b697fda1cf57 | 9,515 | py | Python | infdist/simulator/experiment/legacy/trial.py | zeroos/infdist | 5fca2c42bbe5ea650866a26568d1eaf240b2b47e | [
"MIT"
] | null | null | null | infdist/simulator/experiment/legacy/trial.py | zeroos/infdist | 5fca2c42bbe5ea650866a26568d1eaf240b2b47e | [
"MIT"
] | null | null | null | infdist/simulator/experiment/legacy/trial.py | zeroos/infdist | 5fca2c42bbe5ea650866a26568d1eaf240b2b47e | [
"MIT"
] | null | null | null | from copy import deepcopy
from optimization.agent import ( # NOQA
EstimatingAgent,
FixedRatioAgent,
FullCommAgent,
FullKnowledgeAgent,
GreedyConstrainedAgent,
)
from simulator.network import NS3Network
from simulator import simulator
from optimization import missions, simplesim
from optimization.... | 31.611296 | 79 | 0.575617 |
4a23f63da5d360ccac4fa801eeba104c2f980dca | 11,701 | py | Python | pyLHD/OLHD.py | toledo60/pyLHD | 40df7f2015e06e9e1190cce49c68f17068b86070 | [
"MIT"
] | 1 | 2021-11-20T17:33:43.000Z | 2021-11-20T17:33:43.000Z | pyLHD/OLHD.py | toledo60/pyLHD | 40df7f2015e06e9e1190cce49c68f17068b86070 | [
"MIT"
] | 1 | 2021-11-20T18:43:01.000Z | 2021-11-20T20:04:48.000Z | pyLHD/OLHD.py | toledo60/pyLHD | 40df7f2015e06e9e1190cce49c68f17068b86070 | [
"MIT"
] | null | null | null | import numpy as np
import pyLHD
# --- Orthogonal Latin Hypercube Designs --- #
# --- Butler, N.A. (2001) Construction --- #
def OLHD_Butler01(nrows, ncols):
""" Orthogonal Latin Hypercube Design (OLHD). Based on the construction method of Butler (2001)
Args:
nrows (int): A positive integer specifying the... | 25.436957 | 129 | 0.514571 |
4a23f881d2c8835da2ee2d0fc26e99dd5a5a1b33 | 852 | py | Python | setup.py | lp6m/openvino2tensorflow | b540b89ee1a968a48219f4761e1d5e691293fd2c | [
"MIT"
] | null | null | null | setup.py | lp6m/openvino2tensorflow | b540b89ee1a968a48219f4761e1d5e691293fd2c | [
"MIT"
] | null | null | null | setup.py | lp6m/openvino2tensorflow | b540b89ee1a968a48219f4761e1d5e691293fd2c | [
"MIT"
] | null | null | null | from setuptools import setup, Extension
from setuptools import find_packages
from os import listdir
with open("README.md") as f:
long_description = f.read()
scripts = ["scripts/"+i for i in listdir("scripts")]
if __name__ == "__main__":
setup(
name="openvino2tensorflow",
scripts=scripts,
... | 32.769231 | 130 | 0.664319 |
4a23f8f66a144cf9f035040f95e52e169fd0802f | 923 | py | Python | fedml_core/distributed/communication/gRPC/grpc_server.py | lawsuisum/FedML | 2a7cacbf0b74307f9adedcceb3b0fb6f92c41067 | [
"Apache-2.0"
] | 1 | 2021-08-10T13:16:36.000Z | 2021-08-10T13:16:36.000Z | fedml_core/distributed/communication/gRPC/grpc_server.py | lawsuisum/FedML | 2a7cacbf0b74307f9adedcceb3b0fb6f92c41067 | [
"Apache-2.0"
] | null | null | null | fedml_core/distributed/communication/gRPC/grpc_server.py | lawsuisum/FedML | 2a7cacbf0b74307f9adedcceb3b0fb6f92c41067 | [
"Apache-2.0"
] | null | null | null | from FedML.fedml_core.distributed.communication.gRPC import grpc_comm_manager_pb2, grpc_comm_manager_pb2_grpc
import queue
import threading
lock = threading.Lock()
class GRPCCOMMServicer(grpc_comm_manager_pb2_grpc.gRPCCommManagerServicer):
def __init__(self, host, port, client_num, client_id):
self.host = ... | 32.964286 | 109 | 0.684724 |
4a23f93cc42b489cee8cc385866c9b22cb022077 | 1,694 | py | Python | app/tests/autopilot/Scriptor/tests/__init__.py | Funmungus/scriptor | 47f94211c36a12861f53db998c5d875c93714517 | [
"BSD-2-Clause"
] | null | null | null | app/tests/autopilot/Scriptor/tests/__init__.py | Funmungus/scriptor | 47f94211c36a12861f53db998c5d875c93714517 | [
"BSD-2-Clause"
] | null | null | null | app/tests/autopilot/Scriptor/tests/__init__.py | Funmungus/scriptor | 47f94211c36a12861f53db998c5d875c93714517 | [
"BSD-2-Clause"
] | null | null | null | # -*- Mode: Python; coding: utf-8; indent-tabs-mode: nil; tab-width: 4 -*-
"""Ubuntu Touch App Autopilot tests."""
import os
import logging
import Scriptor
from autopilot.testcase import AutopilotTestCase
from autopilot import logging as autopilot_logging
import ubuntuuitoolkit
from ubuntuuitoolkit import base
log... | 30.8 | 79 | 0.698347 |
4a23f9eb19e8d6995e8076ad3126f4c794247607 | 3,445 | py | Python | lizard_languages/python.py | sdrees/lizard | b95e6ad7e429fd80897cae9fa6dac4989168b280 | [
"MIT"
] | null | null | null | lizard_languages/python.py | sdrees/lizard | b95e6ad7e429fd80897cae9fa6dac4989168b280 | [
"MIT"
] | null | null | null | lizard_languages/python.py | sdrees/lizard | b95e6ad7e429fd80897cae9fa6dac4989168b280 | [
"MIT"
] | null | null | null | ''' Language parser for Python '''
from .code_reader import CodeReader, CodeStateMachine
from .script_language import ScriptLanguageMixIn
def count_spaces(token):
return len(token.replace('\t', ' ' * 8))
class PythonIndents: # pylint: disable=R0902
def __init__(self, context):
self.indents = [0]
... | 33.446602 | 111 | 0.573004 |
4a23fb6a4804cb008c3dd3cd7b5f581cc3350ae2 | 5,865 | py | Python | utils/XeThru_utils/xeX4Thru_software/ModuleConnector/Latest_MC_examples/PYTHON/x4m2x0_plot_sleep_csv_recording_file.py | ApocalyVec/mGesf | 21e0bf37a9d11a3cdde86a8d54e2f6c6a2211ab5 | [
"MIT"
] | 18 | 2020-06-02T11:21:47.000Z | 2022-03-25T08:16:57.000Z | PYTHON/x4m2x0_plot_sleep_csv_recording_file.py | S-B55/HeartConnect | f8a58b7edab18a04d8b10549846370e4c2e17086 | [
"MIT"
] | 4 | 2020-06-20T13:53:44.000Z | 2021-09-11T22:58:21.000Z | PYTHON/x4m2x0_plot_sleep_csv_recording_file.py | S-B55/HeartConnect | f8a58b7edab18a04d8b10549846370e4c2e17086 | [
"MIT"
] | 6 | 2020-04-23T21:30:17.000Z | 2021-08-03T19:59:12.000Z | #!/usr/bin/env python
""" \example x4m2x0_plot_sleep_csv_recording_file.py
Latest examples is located at https://github.com/xethru/XeThru_ModuleConnector_Examples or https://dev.azure.com/xethru/XeThruApps/_git/XeThru_ModuleConnector_Examples.
# Target:
# X4M200/X4M210 sleep recording file.
# Introduction:
# X4M200... | 28.609756 | 216 | 0.632566 |
4a23fb70e2ef4f08400abb224a46c0eab18ca49f | 40,264 | py | Python | spotify/session.py | zapu/pyspotify | a11583f546ecff552d2028ba80f159005d74edd4 | [
"Apache-2.0"
] | 2 | 2016-11-18T08:49:26.000Z | 2018-05-14T13:27:19.000Z | spotify/session.py | zapu/pyspotify | a11583f546ecff552d2028ba80f159005d74edd4 | [
"Apache-2.0"
] | null | null | null | spotify/session.py | zapu/pyspotify | a11583f546ecff552d2028ba80f159005d74edd4 | [
"Apache-2.0"
] | 1 | 2021-06-24T15:57:12.000Z | 2021-06-24T15:57:12.000Z | from __future__ import unicode_literals
import logging
import weakref
import spotify
import spotify.connection
import spotify.player
import spotify.social
from spotify import ffi, lib, serialized, utils, ffi_callback_win
__all__ = [
'Session',
'SessionEvent',
]
logger = logging.getLogger(__name__)
class ... | 35.600354 | 79 | 0.653934 |
4a23fc2486f2f6e20e8a0b67e4ec0836cfa2c5c3 | 2,149 | py | Python | tests/test_gui/test_property.py | akapkotel/arcade | 6e43ec53e7bfa3dee1aa574404794e3695aad381 | [
"MIT"
] | null | null | null | tests/test_gui/test_property.py | akapkotel/arcade | 6e43ec53e7bfa3dee1aa574404794e3695aad381 | [
"MIT"
] | 1 | 2022-03-21T06:24:29.000Z | 2022-03-21T06:24:29.000Z | tests/test_gui/test_property.py | Ibrahim2750mi/arcade | bf3229e64117931bffb8e50926a996a7a8fc9b8b | [
"MIT"
] | null | null | null | import gc
from arcade.gui.property import Property, bind
class MyObject:
name = Property()
class Observer:
called = None
def call(self, *args, **kwargs):
self.called = (args, kwargs)
def __call__(self, *args, **kwargs):
self.called = (args, kwargs)
def test_callback():
obser... | 17.908333 | 53 | 0.632387 |
4a23fda8c83b4fde7242e2f2b2013b39a598b50d | 6,124 | py | Python | ros/src/waypoint_updater/waypoint_updater.py | zhengyu920/CarND-Capstone | cf24cc317379159f466ccd58e77923e192cf4c3c | [
"MIT"
] | null | null | null | ros/src/waypoint_updater/waypoint_updater.py | zhengyu920/CarND-Capstone | cf24cc317379159f466ccd58e77923e192cf4c3c | [
"MIT"
] | null | null | null | ros/src/waypoint_updater/waypoint_updater.py | zhengyu920/CarND-Capstone | cf24cc317379159f466ccd58e77923e192cf4c3c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
import numpy as np
from geometry_msgs.msg import PoseStamped
from styx_msgs.msg import Lane, Waypoint
from std_msgs.msg import Int32
from scipy.spatial import KDTree
import math
'''
This node will publish waypoints from the car's current position to some `x` distance ahead.
As ment... | 35.398844 | 134 | 0.650065 |
4a24001f15fa6b82dd3c41ab172da0df1dbe2970 | 98 | py | Python | contrib/tools/cython/Cython/Distutils/__init__.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | contrib/tools/cython/Cython/Distutils/__init__.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 3,094 | 2015-01-01T15:44:13.000Z | 2022-03-31T19:49:57.000Z | contrib/tools/cython/Cython/Distutils/__init__.py | HeyLey/catboost | f472aed90604ebe727537d9d4a37147985e10ec2 | [
"Apache-2.0"
] | 1,425 | 2015-01-12T07:21:27.000Z | 2022-03-30T14:10:40.000Z | from Cython.Distutils.build_ext import build_ext
from Cython.Distutils.extension import Extension
| 32.666667 | 48 | 0.877551 |
4a240188dad97f59c2a68af5f144eee998d0b310 | 5,567 | py | Python | cloudshell/tg/breaking_point/helpers/bp_cs_reservation_details.py | QualiSystems/cloudshell-tg-breaking-point | 15399c231c0b51df492ddd4a7854f42a5f81a3da | [
"Apache-2.0"
] | null | null | null | cloudshell/tg/breaking_point/helpers/bp_cs_reservation_details.py | QualiSystems/cloudshell-tg-breaking-point | 15399c231c0b51df492ddd4a7854f42a5f81a3da | [
"Apache-2.0"
] | 9 | 2017-04-25T09:16:43.000Z | 2019-07-31T08:55:47.000Z | cloudshell/tg/breaking_point/helpers/bp_cs_reservation_details.py | QualiSystems/cloudshell-tg-breaking-point | 15399c231c0b51df492ddd4a7854f42a5f81a3da | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
import re
from cloudshell.tg.breaking_point.bp_exception import BPException
class BPCSReservationDetails(object):
PORT_FAMILY = ['Port', 'Virtual Port', 'Breaking Point Virtual Port', 'CS_TrafficGeneratorPort',
'CS_VirtualTrafficGeneratorPort']
ST... | 45.631148 | 129 | 0.671816 |
4a2402c00f3201ae651624d08496df0d38886e41 | 1,626 | py | Python | vsts/vsts/extension_management/v4_1/models/contribution_base.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/extension_management/v4_1/models/contribution_base.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | vsts/vsts/extension_management/v4_1/models/contribution_base.py | kenkuo/azure-devops-python-api | 9e920bd25e938fa89ff7f60153e5b9e113ca839d | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 47.823529 | 346 | 0.574416 |
4a2402c18b727d7f6d00c6d5eae0dc7088faf393 | 3,524 | py | Python | python/bench.py | teepark/mummy | 33cad46c5d30d5da615ca038f1b857ca4689c810 | [
"BSD-3-Clause"
] | null | null | null | python/bench.py | teepark/mummy | 33cad46c5d30d5da615ca038f1b857ca4689c810 | [
"BSD-3-Clause"
] | null | null | null | python/bench.py | teepark/mummy | 33cad46c5d30d5da615ca038f1b857ca4689c810 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import random
import sys
import time
import mummy
import oldmummy
try:
import cPickle
except ImportError:
import pickle as cPickle
import string
try:
import bson
except ImportError:
bson = None
try:
import yajl
except ImportError:
yajl = None
try:
import cjson
excep... | 24.472222 | 84 | 0.594211 |
4a2402d719dcac6a23e08b09b43f9ff2bd60e9c1 | 477 | py | Python | src/accounts/migrations/0002_auto_20190720_1006.py | littleprodigy/Twitter | 25ef96a291d295bb91f824f331fd6a648dc79117 | [
"MIT"
] | null | null | null | src/accounts/migrations/0002_auto_20190720_1006.py | littleprodigy/Twitter | 25ef96a291d295bb91f824f331fd6a648dc79117 | [
"MIT"
] | null | null | null | src/accounts/migrations/0002_auto_20190720_1006.py | littleprodigy/Twitter | 25ef96a291d295bb91f824f331fd6a648dc79117 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.3 on 2019-07-20 10:06
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='userprofile',
... | 23.85 | 110 | 0.645702 |
4a24036474cd644389667ac5a12b53adff944b2d | 518 | py | Python | main.py | rageofgods/test-flask | dbb7eb2bf88c31139e5a1380fd818fb61fdef97e | [
"MIT"
] | null | null | null | main.py | rageofgods/test-flask | dbb7eb2bf88c31139e5a1380fd818fb61fdef97e | [
"MIT"
] | null | null | null | main.py | rageofgods/test-flask | dbb7eb2bf88c31139e5a1380fd818fb61fdef97e | [
"MIT"
] | null | null | null | from flask import Flask, render_template
app = Flask(__name__)
# two decorators, same function
@app.route('/')
@app.route('/index.html')
def index():
return render_template('index.html', the_title='Tiger Home Page')
@app.route('/symbol.html')
def symbol():
return render_template('symbol.html', the_title='Tige... | 25.9 | 77 | 0.700772 |
4a24054fc555794ca32c6e3b3884558a02618265 | 505 | py | Python | lab8.py | seanstanaway/IA241-github | ce69c99d02e52919d6bca947769901ed596e73f5 | [
"MIT"
] | null | null | null | lab8.py | seanstanaway/IA241-github | ce69c99d02e52919d6bca947769901ed596e73f5 | [
"MIT"
] | null | null | null | lab8.py | seanstanaway/IA241-github | ce69c99d02e52919d6bca947769901ed596e73f5 | [
"MIT"
] | null | null | null | '''
lab 8 function
'''
#3.1
def count_words(inpu_str):
return len( inpu_str.split() )
#3.2
demo_str = 'hello world!'
print(count_words(demo_str))
#3.3
def find_min(input_list):
min_item = input_list[0]
for num in input_list:
if type(num) is not str:
if min_item>=num:... | 12.317073 | 35 | 0.582178 |
4a2407163452084a112d2adc300d75282ee51552 | 8,077 | py | Python | test/test_conda.py | robertmaynard/hpc-container-maker | fdf20b9881eb41f92b7d73c85b20f5f75ddfe262 | [
"Apache-2.0"
] | 340 | 2018-03-26T00:11:21.000Z | 2022-03-21T03:04:27.000Z | test/test_conda.py | robertmaynard/hpc-container-maker | fdf20b9881eb41f92b7d73c85b20f5f75ddfe262 | [
"Apache-2.0"
] | 103 | 2018-03-24T04:34:24.000Z | 2022-03-31T18:49:57.000Z | test/test_conda.py | robertmaynard/hpc-container-maker | fdf20b9881eb41f92b7d73c85b20f5f75ddfe262 | [
"Apache-2.0"
] | 75 | 2018-05-10T15:42:11.000Z | 2022-03-28T16:51:14.000Z | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 40.18408 | 149 | 0.649251 |
4a2407afda767dd2e413e354fe518ecc9f563ad4 | 62 | py | Python | main/owner/routers.py | MahanBi/Back-End | 5074ac1d341ad2addd1750e4aea2e6800be2bfef | [
"MIT"
] | null | null | null | main/owner/routers.py | MahanBi/Back-End | 5074ac1d341ad2addd1750e4aea2e6800be2bfef | [
"MIT"
] | null | null | null | main/owner/routers.py | MahanBi/Back-End | 5074ac1d341ad2addd1750e4aea2e6800be2bfef | [
"MIT"
] | 1 | 2021-12-06T21:36:28.000Z | 2021-12-06T21:36:28.000Z | from django.urls import re_path
websocket_urlpatterns = [
]
| 10.333333 | 31 | 0.774194 |
4a2407c531c3f876297bb65a1ec6ca37341a5273 | 9,663 | py | Python | venv/lib/python3.8/site-packages/joblib/externals/loky/backend/reduction.py | avrumnoor/NewsSummarizer | a963497ef9bc62d2148aa28e624ea32955992f57 | [
"MIT"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | venv/lib/python3.8/site-packages/joblib/externals/loky/backend/reduction.py | avrumnoor/NewsSummarizer | a963497ef9bc62d2148aa28e624ea32955992f57 | [
"MIT"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | venv/lib/python3.8/site-packages/joblib/externals/loky/backend/reduction.py | avrumnoor/NewsSummarizer | a963497ef9bc62d2148aa28e624ea32955992f57 | [
"MIT"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | ###############################################################################
# Customizable Pickler with some basic reducers
#
# author: Thomas Moreau
#
# adapted from multiprocessing/reduction.py (17/02/2017)
# * Replace the ForkingPickler with a similar _LokyPickler,
# * Add CustomizableLokyPickler to allow cust... | 34.3879 | 81 | 0.639863 |
4a2407c981fd56f724aa08b3a74d9b5ea6881215 | 2,067 | py | Python | pysrc/importfinder.py | CrackerCat/xed | 428712c28e831573579b7f749db63d3a58dcdbd9 | [
"Apache-2.0"
] | 1,261 | 2016-12-16T14:29:30.000Z | 2022-03-30T20:21:25.000Z | pysrc/importfinder.py | CrackerCat/xed | 428712c28e831573579b7f749db63d3a58dcdbd9 | [
"Apache-2.0"
] | 190 | 2016-12-17T13:44:09.000Z | 2022-03-27T09:28:13.000Z | pysrc/importfinder.py | CrackerCat/xed | 428712c28e831573579b7f749db63d3a58dcdbd9 | [
"Apache-2.0"
] | 155 | 2016-12-16T22:17:20.000Z | 2022-02-16T20:53:59.000Z | #!/usr/bin/env python
# -*- python -*-
#BEGIN_LEGAL
#
#Copyright (c) 2019 Intel Corporation
#
# 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-... | 29.956522 | 75 | 0.651185 |
4a2407ed5b53b3fa1dc4e4f56370a12f55aa20a8 | 2,417 | py | Python | tests/parsers/xchatlog.py | GalacticMaster/plaso | 0e3eed472e4ef67f619e89de9fcebba87d1923aa | [
"Apache-2.0"
] | null | null | null | tests/parsers/xchatlog.py | GalacticMaster/plaso | 0e3eed472e4ef67f619e89de9fcebba87d1923aa | [
"Apache-2.0"
] | null | null | null | tests/parsers/xchatlog.py | GalacticMaster/plaso | 0e3eed472e4ef67f619e89de9fcebba87d1923aa | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for the xchatlog parser."""
from __future__ import unicode_literals
import unittest
from plaso.formatters import xchatlog as _ # pylint: disable=unused-import
from plaso.parsers import xchatlog
from tests import test_lib as shared_test_lib
from tests.parsers i... | 30.987179 | 75 | 0.736036 |
4a2408fbdd09725ef63265a3934f3148e97e1584 | 2,163 | py | Python | Drivers/Series_2380_DC_Electronic_Load/Win10_Python_Using_VISA/Model_2380_Example_01_CC_Setup.py | 398786172/keithley | f78c5220841775a45ae60645c774e8b443b02ec3 | [
"BSD-Source-Code"
] | 31 | 2019-04-11T14:25:39.000Z | 2022-03-18T15:09:33.000Z | Drivers/Series_2380_DC_Electronic_Load/Win10_Python_Using_VISA/Model_2380_Example_01_CC_Setup.py | 398786172/keithley | f78c5220841775a45ae60645c774e8b443b02ec3 | [
"BSD-Source-Code"
] | 27 | 2019-04-10T20:21:52.000Z | 2021-12-09T01:59:32.000Z | Drivers/Series_2380_DC_Electronic_Load/Win10_Python_Using_VISA/Model_2380_Example_01_CC_Setup.py | 398786172/keithley | f78c5220841775a45ae60645c774e8b443b02ec3 | [
"BSD-Source-Code"
] | 30 | 2019-06-08T09:38:20.000Z | 2022-03-18T15:10:37.000Z | import visa
import struct
import math
import time
import Keithley_Model_2380_VISA_Driver as kei2380
from ISStreamer.Streamer import Streamer
def writeToInitialState(myCurr, myVolt):
streamer.log("CURR", myCurr)
streamer.log("VOLT", myVolt)
return
#===== MAIN PROGRAM STARTS HERE =====
rm = visa.ResourceMan... | 28.460526 | 79 | 0.701803 |
4a240a926008dfad2dd7c6f094782e0e348081ca | 797 | py | Python | trigger_job.py | pourabkarchaudhuri/tif2obj-convertor | b910e59c4dc8c0dad88ef74cbe9139a91d3c5dd8 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2021-10-01T09:24:42.000Z | 2021-10-01T09:24:42.000Z | trigger_job.py | pourabkarchaudhuri/tif2obj-convertor | b910e59c4dc8c0dad88ef74cbe9139a91d3c5dd8 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 2 | 2021-06-08T20:41:57.000Z | 2022-03-12T00:07:49.000Z | trigger_job.py | pourabkarchaudhuri/tif2obj-convertor | b910e59c4dc8c0dad88ef74cbe9139a91d3c5dd8 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | import argparse
import convert_tif2stl
import convert_stl2obj
import os
def execute_job(path):
OUTPUT_EXPORT_PATH = os.path.join(os.getcwd(), 'output')
if not os.path.exists(OUTPUT_EXPORT_PATH):
os.makedirs(OUTPUT_EXPORT_PATH)
# print("Input at : {}".format(path))
STL_PATH = convert... | 23.441176 | 83 | 0.662484 |
4a240b993bf686ce75c84014dafb1e0f821ae00a | 2,752 | py | Python | online_judges/nim/nim_challenge.py | stephank007/python_challenges | dfd8d18c03a06735f6e4e02b0660007fe2d02f07 | [
"Apache-2.0"
] | null | null | null | online_judges/nim/nim_challenge.py | stephank007/python_challenges | dfd8d18c03a06735f6e4e02b0660007fe2d02f07 | [
"Apache-2.0"
] | null | null | null | online_judges/nim/nim_challenge.py | stephank007/python_challenges | dfd8d18c03a06735f6e4e02b0660007fe2d02f07 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# This notebook was prepared by [Donne Martin](https://github.com/donnemartin). Source and license info is on [GitHub](https://github.com/donnemartin/interactive-coding-challenges).
# # Challenge Notebook
# ## Problem: Determine whether you can win the Nim game given the remaini... | 28.371134 | 261 | 0.686047 |
4a240b9f81e15d700478c59fc70a149b79717f1f | 2,898 | py | Python | tickets/views.py | CarlesLopezMagem/tickets-django-api | 3b1c7668ab467cd42781f83f7656b59c24753b74 | [
"MIT"
] | null | null | null | tickets/views.py | CarlesLopezMagem/tickets-django-api | 3b1c7668ab467cd42781f83f7656b59c24753b74 | [
"MIT"
] | null | null | null | tickets/views.py | CarlesLopezMagem/tickets-django-api | 3b1c7668ab467cd42781f83f7656b59c24753b74 | [
"MIT"
] | null | null | null | from rest_framework import viewsets, mixins
from . import serializers, models, permissions
from django.contrib.auth.models import User
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from rest_framework import status
from django.db.models import F, Func
from django.db... | 40.25 | 112 | 0.676329 |
4a240bf438ef2a8adba4257e0dd764e5804c062d | 5,176 | py | Python | ros/src/waypoint_updater/waypoint_updater.py | craftGhost/CarND-Capstone | a3571d3461585fddf1e3e3704bf1225d574526b6 | [
"MIT"
] | null | null | null | ros/src/waypoint_updater/waypoint_updater.py | craftGhost/CarND-Capstone | a3571d3461585fddf1e3e3704bf1225d574526b6 | [
"MIT"
] | 7 | 2020-01-28T23:04:52.000Z | 2022-02-10T00:22:31.000Z | ros/src/waypoint_updater/waypoint_updater.py | craftGhost/CarND-Capstone | a3571d3461585fddf1e3e3704bf1225d574526b6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from geometry_msgs.msg import PoseStamped
from styx_msgs.msg import Lane, Waypoint
from scipy.spatial import KDTree
from std_msgs.msg import Int32
import numpy as np
import math
'''
This node will publish waypoints from the car's current position to some `x` distance ahead.
As men... | 35.210884 | 132 | 0.647025 |
4a240c805d7b6537f469b4397977406ea2dbe37c | 209 | py | Python | Tan_ShinYi/Assignments/flaskolympics/olympics2/server.py | webguru001/Python-Django-Web | 6264bc4c90ef1432ba0902c76b567cf3caaae221 | [
"MIT"
] | 5 | 2019-05-17T01:30:02.000Z | 2021-06-17T21:02:58.000Z | Tan_ShinYi/Assignments/flaskolympics/olympics2/server.py | curest0x1021/Python-Django-Web | 6264bc4c90ef1432ba0902c76b567cf3caaae221 | [
"MIT"
] | null | null | null | Tan_ShinYi/Assignments/flaskolympics/olympics2/server.py | curest0x1021/Python-Django-Web | 6264bc4c90ef1432ba0902c76b567cf3caaae221 | [
"MIT"
] | null | null | null | from flask import Flask, render_template
app = Flask(__name__)
@app.route('/')
def myfirstfunction():
return render_template('index.html', name="Mike")
if __name__ == '__main__':
app.run(debug = True)
| 20.9 | 53 | 0.708134 |
4a240cb6a5e23f5e760e7a411762c925262d62fa | 77,631 | py | Python | sandbox/rocky/tf/core/layers.py | wjh720/EMI | 01570087003ee83288069e520d1c2a13c8a0b79e | [
"MIT"
] | 36 | 2019-05-15T03:06:57.000Z | 2022-02-23T07:09:42.000Z | sandbox/rocky/tf/core/layers.py | jaekyeom/EMI-1 | 83ea5ee0035e6c918c956a3931102c1447370f73 | [
"MIT"
] | null | null | null | sandbox/rocky/tf/core/layers.py | jaekyeom/EMI-1 | 83ea5ee0035e6c918c956a3931102c1447370f73 | [
"MIT"
] | 12 | 2019-07-20T09:34:17.000Z | 2021-05-23T20:49:15.000Z | # -*- coding: utf-8 -*-
import functools
import numpy as np
import math
import tensorflow as tf
from tensorflow.python.training import moving_averages
from collections import OrderedDict
from collections import deque
from itertools import chain
from inspect import getargspec
from difflib import get_close_matches
from w... | 41.536116 | 120 | 0.584831 |
4a240ce96e1fc23c8038fc83a2d841611f8a2d39 | 971 | py | Python | bot.py | Shetty073/world-of-trucks-bot | dcbd563fd7f7ba750eba015741deefbbf56368c9 | [
"MIT"
] | null | null | null | bot.py | Shetty073/world-of-trucks-bot | dcbd563fd7f7ba750eba015741deefbbf56368c9 | [
"MIT"
] | null | null | null | bot.py | Shetty073/world-of-trucks-bot | dcbd563fd7f7ba750eba015741deefbbf56368c9 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
import configparser
# Get the token from configuration file
config = configparser.ConfigParser()
config.read("config/config.ini")
TOKEN = config["BOT"]["token"]
# Bot code begins
bot = commands.Bot(command_prefix='?', description="just `.ask` for help", case_insensitive... | 24.275 | 97 | 0.682801 |
4a240cf49c830f997ca8c53661bedf77679444dc | 2,301 | py | Python | uob/apps/UDPEchoWithMeasurements/util/MySQLListener.py | tinyos-io/tinyos-3.x-contrib | 3aaf036722a2afc0c0aad588459a5c3e00bd3c01 | [
"BSD-3-Clause",
"MIT"
] | 1 | 2020-02-28T20:35:09.000Z | 2020-02-28T20:35:09.000Z | uob/apps/UDPEchoWithMeasurements/util/MySQLListener.py | tinyos-io/tinyos-3.x-contrib | 3aaf036722a2afc0c0aad588459a5c3e00bd3c01 | [
"BSD-3-Clause",
"MIT"
] | null | null | null | uob/apps/UDPEchoWithMeasurements/util/MySQLListener.py | tinyos-io/tinyos-3.x-contrib | 3aaf036722a2afc0c0aad588459a5c3e00bd3c01 | [
"BSD-3-Clause",
"MIT"
] | null | null | null |
import socket
import UdpReport
import re
import sys
import MySQLdb
port = 7000
if __name__ == '__main__':
conn = MySQLdb.connect (host = "localhost",
user = "b6lowpan",
db = "b6lowpan")
cursor = conn.cursor()
s = socket.socket(socket.AF_INET6, socke... | 25.285714 | 71 | 0.488918 |
4a240d759703db6192c7c9894d017e4bf9788e8e | 303 | py | Python | examples/wrap_external.py | gmerz/ArgTyper | 56e1d60ce2cc8f7d889fb8890ddbe922b85ab9f3 | [
"MIT"
] | 1 | 2021-04-26T19:46:33.000Z | 2021-04-26T19:46:33.000Z | examples/wrap_external.py | gmerz/ArgTyper | 56e1d60ce2cc8f7d889fb8890ddbe922b85ab9f3 | [
"MIT"
] | null | null | null | examples/wrap_external.py | gmerz/ArgTyper | 56e1d60ce2cc8f7d889fb8890ddbe922b85ab9f3 | [
"MIT"
] | null | null | null | import re
import argtyper
argtyper.Argument("pattern", help="The pattern to search for")(re.search)
argtyper.Argument(
"string", help="The string, in which you want to search for the pattern"
)(re.search)
at = argtyper.ArgTyper(re.search)
responses = at(return_responses=True)
print(responses[0])
| 25.25 | 76 | 0.752475 |
4a240d913486af5d4ff79bd357077939ed10b69f | 849 | py | Python | crop.py | dylan-roussin/CRAFT-pytorch | 6aa2eb9339f9245ff9614eb63a26bf9ed017568c | [
"MIT"
] | null | null | null | crop.py | dylan-roussin/CRAFT-pytorch | 6aa2eb9339f9245ff9614eb63a26bf9ed017568c | [
"MIT"
] | null | null | null | crop.py | dylan-roussin/CRAFT-pytorch | 6aa2eb9339f9245ff9614eb63a26bf9ed017568c | [
"MIT"
] | null | null | null | ### for each set of coordinates generated in the res_[filename].txt, crop and output to crop folder - dylan-roussin
# example line: '1706,20,1784,20,1784,38,1706,38'
# read as: bottom-left, bottom-right, top-right, top-left
# bottomleft(1706,20)
# bottomright (1784,20)
# topright (1784,38)
# topleft (1706,38)
impo... | 38.590909 | 181 | 0.725559 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.