hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
159224d689cb96087474e0a0e05aa8337c9e01e8 | 2,754 | py | Python | ssbench/run_state.py | yujunz/ssbench | 9baccf7431537ce811053b7dcadf920ae97040c3 | [
"Apache-2.0",
"MIT"
] | null | null | null | ssbench/run_state.py | yujunz/ssbench | 9baccf7431537ce811053b7dcadf920ae97040c3 | [
"Apache-2.0",
"MIT"
] | null | null | null | ssbench/run_state.py | yujunz/ssbench | 9baccf7431537ce811053b7dcadf920ae97040c3 | [
"Apache-2.0",
"MIT"
] | null | null | null | #
#Copyright (c) 2012-2021, NVIDIA CORPORATION.
#SPDX-License-Identifier: Apache-2.0
from collections import defaultdict, deque
import ssbench
class RunState(object):
"""
An object to track the dynamic "state" of a benchmark run.
"""
def __init__(self):
# Stores one deque of (container_name... | 36.236842 | 79 | 0.569717 |
aa9e905c75362de2b9fea01fb1ee5f95bb827a32 | 7,463 | py | Python | hydra/test_utils/test_utils.py | CarlosXXX407/hydra | 4e006b10d9b005df6abd886991548f02a8d80691 | [
"MIT"
] | null | null | null | hydra/test_utils/test_utils.py | CarlosXXX407/hydra | 4e006b10d9b005df6abd886991548f02a8d80691 | [
"MIT"
] | null | null | null | hydra/test_utils/test_utils.py | CarlosXXX407/hydra | 4e006b10d9b005df6abd886991548f02a8d80691 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""
Utilities used by tests
"""
import copy
import logging
import os
import shutil
import string
import subprocess
import sys
import tempfile
from contextlib import contextmanager
import pytest
import six
from omegaconf import OmegaConf
from hydra... | 27.951311 | 94 | 0.61624 |
55d2f53b347ecf27d8221362d578dfc7e2db841a | 16,570 | py | Python | keras/utils/vis_utils.py | maybeLee/keras | 793620ae1bdda7e37edd485b034e8962fff57f3e | [
"Apache-2.0"
] | 1 | 2022-03-21T02:42:58.000Z | 2022-03-21T02:42:58.000Z | keras/utils/vis_utils.py | maybeLee/keras | 793620ae1bdda7e37edd485b034e8962fff57f3e | [
"Apache-2.0"
] | 1 | 2022-03-31T16:40:51.000Z | 2022-03-31T16:40:51.000Z | keras/utils/vis_utils.py | maybeLee/keras | 793620ae1bdda7e37edd485b034e8962fff57f3e | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.822222 | 80 | 0.653048 |
17a85a06c8acd5f0f34bb4df65bb08843ed1db0a | 974 | py | Python | documents/migrations/0005_auto_20200507_0733.py | stanwood/traidoo-api | 83e8599f2eb54352988bac27e2d4acd30734816d | [
"MIT"
] | 3 | 2020-05-05T12:12:09.000Z | 2020-05-08T08:48:16.000Z | documents/migrations/0005_auto_20200507_0733.py | stanwood/traidoo-api | 83e8599f2eb54352988bac27e2d4acd30734816d | [
"MIT"
] | 160 | 2020-05-19T13:03:43.000Z | 2022-03-12T00:35:28.000Z | documents/migrations/0005_auto_20200507_0733.py | stanwood/traidoo-api | 83e8599f2eb54352988bac27e2d4acd30734816d | [
"MIT"
] | null | null | null | # Generated by Django 2.2.10 on 2020-05-07 07:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('documents', '0004_auto_20200410_1013'),
]
operations = [
migrations.AlterField(
model_name='document',
name='docume... | 51.263158 | 626 | 0.713552 |
5756e971eff3f3773f29ebe1c96b5313c0919da3 | 11,272 | py | Python | tests/test_model.py | achennu/microbenthos | c83fb60d05b5614546466601e973721640e685d4 | [
"MIT"
] | 3 | 2018-04-23T13:51:36.000Z | 2021-08-05T01:53:51.000Z | tests/test_model.py | achennu/microbenthos | c83fb60d05b5614546466601e973721640e685d4 | [
"MIT"
] | 5 | 2018-04-09T20:08:40.000Z | 2018-05-04T23:08:50.000Z | tests/test_model.py | achennu/microbenthos | c83fb60d05b5614546466601e973721640e685d4 | [
"MIT"
] | 2 | 2018-04-09T20:11:50.000Z | 2021-08-06T03:34:06.000Z | import mock
import pytest
from fipy import PhysicalField
from microbenthos import Expression, Entity, yaml, SedimentDBLDomain, DomainEntity
from microbenthos.model.model import MicroBenthosModel, ModelClock, ModelEquation
DOMAIN_DEF = yaml.unsafe_load("""
cls: SedimentDBLDomain
init_params:
cell_size: !unit 50 mu... | 29.277922 | 101 | 0.607789 |
d21c02f3802fbec007b61ff9f3978c36ada5b666 | 7,140 | py | Python | test/runjsontests.py | chfast/jsoncpp | d8cd848ede1071a25846cd90b4fddf269d868ff1 | [
"MIT"
] | 850 | 2018-01-18T05:56:02.000Z | 2022-03-31T08:17:34.000Z | test/runjsontests.py | chfast/jsoncpp | d8cd848ede1071a25846cd90b4fddf269d868ff1 | [
"MIT"
] | 13 | 2020-02-05T10:08:45.000Z | 2020-05-08T00:43:13.000Z | test/runjsontests.py | chfast/jsoncpp | d8cd848ede1071a25846cd90b4fddf269d868ff1 | [
"MIT"
] | 364 | 2018-01-22T02:11:16.000Z | 2022-03-27T12:58:47.000Z | # Copyright 2007 Baptiste Lepilleur
# Distributed under MIT license, or public domain if desired and
# recognized in your jurisdiction.
# See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
from __future__ import print_function
from __future__ import unicode_literals
from io import open
from ... | 40.8 | 101 | 0.594398 |
eeb10a0f43e74cbd8dfc7be8769ccb40cdd5d91a | 199 | py | Python | moksta/users/tests/test_models.py | TEOTSOLE/mokstagram | 58612b49a0d539f9775b2717aeff43c1a3b18938 | [
"MIT"
] | null | null | null | moksta/users/tests/test_models.py | TEOTSOLE/mokstagram | 58612b49a0d539f9775b2717aeff43c1a3b18938 | [
"MIT"
] | null | null | null | moksta/users/tests/test_models.py | TEOTSOLE/mokstagram | 58612b49a0d539f9775b2717aeff43c1a3b18938 | [
"MIT"
] | null | null | null | import pytest
from moksta.users.models import User
pytestmark = pytest.mark.django_db
def test_user_get_absolute_url(user: User):
assert user.get_absolute_url() == f"/users/{user.username}/"
| 19.9 | 64 | 0.768844 |
284ae730eec6b49a43b11fbe0b7ad81ad4c1cb2f | 1,265 | py | Python | threedverse-django/object_storage/views.py | Nicarim/threedverse | 32548eb804ecb8abf8319eef70d1e0fdb874b709 | [
"MIT"
] | null | null | null | threedverse-django/object_storage/views.py | Nicarim/threedverse | 32548eb804ecb8abf8319eef70d1e0fdb874b709 | [
"MIT"
] | 4 | 2021-05-11T17:31:26.000Z | 2022-02-27T06:35:37.000Z | threedverse-django/object_storage/views.py | Nicarim/threedverse | 32548eb804ecb8abf8319eef70d1e0fdb874b709 | [
"MIT"
] | null | null | null | from rest_framework import viewsets
from rest_framework.decorators import action
from rest_framework.response import Response
from object_storage.models import VerseProject, VerseImage
from object_storage.serializers import VerseProjectSerializer, VerseImageSerializer, VerseObjectSerializer
class VerseProjectViewSet... | 39.53125 | 106 | 0.735178 |
a215402a8255d63d619fbc58928e56d5825c12e8 | 2,140 | py | Python | examples/pieris/preprocessing/assembleCountMatrices.py | NCBI-Hackathons/arvos | 1cbea3e93a6659a334183d8119c034f7095d1a5d | [
"MIT"
] | 4 | 2017-05-24T23:49:24.000Z | 2019-09-29T10:18:41.000Z | examples/pieris/preprocessing/assembleCountMatrices.py | NCBI-Hackathons/arvos | 1cbea3e93a6659a334183d8119c034f7095d1a5d | [
"MIT"
] | 3 | 2017-08-20T19:03:10.000Z | 2017-08-20T19:04:39.000Z | examples/pieris/preprocessing/assembleCountMatrices.py | NCBI-Hackathons/arvos | 1cbea3e93a6659a334183d8119c034f7095d1a5d | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""
Use normalized count matrix provided by DESeq2 to get transformed values
"""
__author__ = "Adam Richards"
import sys,os,getopt,csv,time,re,gc
import numpy as np
## declare variables
#homeDir = os.path.join(os.path.expanduser("~"),"sequencing","pieris")
def load_file(sample):
## error chec... | 28.533333 | 101 | 0.604673 |
86af8cc3a1212cd763b7078baee3c5238b02eca6 | 20,928 | py | Python | connectomics/engine/trainer.py | Lauenburg/pytorch_connectomics | c06116343edc65f7c34bcbcc6fe1cff1d9fc579b | [
"MIT"
] | 1 | 2022-01-31T09:32:38.000Z | 2022-01-31T09:32:38.000Z | connectomics/engine/trainer.py | Lauenburg/pytorch_connectomics | c06116343edc65f7c34bcbcc6fe1cff1d9fc579b | [
"MIT"
] | null | null | null | connectomics/engine/trainer.py | Lauenburg/pytorch_connectomics | c06116343edc65f7c34bcbcc6fe1cff1d9fc579b | [
"MIT"
] | null | null | null | from __future__ import print_function, division
from typing import Optional
import warnings
import os
import time
import math
import GPUtil
import numpy as np
from yacs.config import CfgNode
import torch
from torch.cuda.amp import autocast, GradScaler
from .base import TrainerBase
from .solver import *
from ..model ... | 44.717949 | 107 | 0.585484 |
c1dcc8a6132f316ff6230d8c6bf80c45307b1321 | 11,163 | py | Python | MeatFood_enve/Lib/site-packages/django/core/handlers/asgi.py | georgiawang5332/meatFoodManager | 204b5b7aa2a3c5a6c9cc38077a10a72c0c69f140 | [
"MIT"
] | null | null | null | MeatFood_enve/Lib/site-packages/django/core/handlers/asgi.py | georgiawang5332/meatFoodManager | 204b5b7aa2a3c5a6c9cc38077a10a72c0c69f140 | [
"MIT"
] | null | null | null | MeatFood_enve/Lib/site-packages/django/core/handlers/asgi.py | georgiawang5332/meatFoodManager | 204b5b7aa2a3c5a6c9cc38077a10a72c0c69f140 | [
"MIT"
] | null | null | null | import logging
import sys
import tempfile
import traceback
from asgiref.sync import sync_to_async
from django.conf import settings
from django.core import signals
from django.core.exceptions import RequestAborted, RequestDataTooBig
from django.core.handlers import base
from django.http import (
FileResponse, Http... | 38.760417 | 116 | 0.591508 |
57feb0365a461b3d64ebf0f4a06e9f968b3ad483 | 987 | py | Python | faust-project/setup.py | mmatthews06/faust-docker-compose-example | 3f0c153422fce2f38335d001438cf19d4a957f51 | [
"MIT"
] | 1 | 2021-06-24T04:45:19.000Z | 2021-06-24T04:45:19.000Z | faust-project/setup.py | 1339475125/faust-docker-compose-example | 01003bbfb2ea843d9e25480ff09f70673d745ad6 | [
"MIT"
] | null | null | null | faust-project/setup.py | 1339475125/faust-docker-compose-example | 01003bbfb2ea843d9e25480ff09f70673d745ad6 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
requires = [
"colorlog>=3.1.4",
"fastavro<=0.22.3",
"simple-settings",
"faust>=1.10.4",
"python-schema-registry-client",
"typing-extensions==3.7.4.1",
]
setup(
name='faust-example',
version='1.2.1',
description='Faust example with Docker ... | 24.073171 | 84 | 0.609929 |
f2ba02c601fc5d55d8db58841ee40fe6737878e0 | 1,413 | py | Python | titan/components/request.py | DeSireFire/titans | 9194950694084a7cbc6434dfec0ecb2e755f0cdf | [
"Apache-2.0"
] | 17 | 2020-03-14T01:08:07.000Z | 2020-12-26T08:20:14.000Z | titan/components/request.py | DeSireFire/titans | 9194950694084a7cbc6434dfec0ecb2e755f0cdf | [
"Apache-2.0"
] | 4 | 2020-12-05T08:50:55.000Z | 2022-02-27T06:48:21.000Z | titan/components/request.py | DeSireFire/titans | 9194950694084a7cbc6434dfec0ecb2e755f0cdf | [
"Apache-2.0"
] | 1 | 2020-05-24T06:57:03.000Z | 2020-05-24T06:57:03.000Z | # -*- coding: utf-8 -*-
from titan.manages.global_manager import GlobalManager
from titan.utils import make_requests
from titan.components import Base
from titan import dirs
import os
class Request(Base):
def url_format(self):
if self.params.get('url', None):
global_type = self.params.get('glo... | 30.717391 | 68 | 0.58811 |
67d2dd39418a085ba82e6c00e6a804e25d9c85c6 | 498 | py | Python | item_synchronizer/__init__.py | bergercookie/item_synchronizer | 8d4c69af68bc1658b0f0a43de683f1ca132ace58 | [
"MIT"
] | 2 | 2021-11-26T22:41:36.000Z | 2021-12-06T01:23:20.000Z | item_synchronizer/__init__.py | bergercookie/item_synchronizer | 8d4c69af68bc1658b0f0a43de683f1ca132ace58 | [
"MIT"
] | null | null | null | item_synchronizer/__init__.py | bergercookie/item_synchronizer | 8d4c69af68bc1658b0f0a43de683f1ca132ace58 | [
"MIT"
] | null | null | null | """Init."""
from .resolution_strategy import (
AlwaysFirstRS,
AlwaysSecondRS,
LeastRecentRS,
MostRecentRS,
RecencyRS,
ResolutionResult,
ResolutionStrategy,
all_resolution_strategies,
)
from .synchronizer import Synchronizer
__all__ = [
"AlwaysFirstRS",
"AlwaysSecondRS",
"Lea... | 18.444444 | 38 | 0.682731 |
17f5532e52cdd968751c35642d66e604c69dfc0a | 11,528 | py | Python | Scripts/DBotPredictPhishingWords/dbot_predict_phishing_words_test.py | wwylie89/testDemisto | 63a41b2225895597a9b5e06f17dccbd11c3c2014 | [
"MIT"
] | null | null | null | Scripts/DBotPredictPhishingWords/dbot_predict_phishing_words_test.py | wwylie89/testDemisto | 63a41b2225895597a9b5e06f17dccbd11c3c2014 | [
"MIT"
] | 9 | 2021-02-08T20:51:18.000Z | 2021-09-23T23:27:38.000Z | Scripts/DBotPredictPhishingWords/dbot_predict_phishing_words_test.py | wwylie89/testDemisto | 63a41b2225895597a9b5e06f17dccbd11c3c2014 | [
"MIT"
] | null | null | null | from collections import defaultdict
import pytest
from CommonServerPython import *
from DBotPredictPhishingWords import get_model_data, predict_phishing_words
TOKENIZATION_RESULT = None
def get_args():
args = defaultdict(lambda: "yes")
args['encoding'] = 'utf8'
args['encoding'] = 'utf8'
args['remov... | 55.690821 | 117 | 0.562457 |
f7bd7c80422e0a0bb5f24aeec041fc703fc167e8 | 3,723 | py | Python | unittests/components/test_weapon.py | MoyTW/7DRL2016_Rewrite | 99e092dcb8797a25caa3c8a989a574efae19e4d4 | [
"MIT"
] | 2 | 2020-05-10T02:16:28.000Z | 2021-04-05T21:54:10.000Z | unittests/components/test_weapon.py | MoyTW/7DRL2016_Rewrite | 99e092dcb8797a25caa3c8a989a574efae19e4d4 | [
"MIT"
] | null | null | null | unittests/components/test_weapon.py | MoyTW/7DRL2016_Rewrite | 99e092dcb8797a25caa3c8a989a574efae19e4d4 | [
"MIT"
] | null | null | null | import unittest
from dodge.components import Position, Faction, Weapon, Destructible
from dodge.level import Level
from dodge.event import Event
from dodge.config import Config
from dodge.entity import Entity
from dodge.constants import EventType, EventParam, Factions, ComponentType
from unittests.utils import EventSta... | 46.5375 | 127 | 0.664786 |
f406246efcc69c458f36e23ee83d0fee1c5db43f | 2,439 | py | Python | frappe/patches/v12_0/move_email_and_phone_to_child_table.py | nobesnickr/frappe | d72d9cce68dd750cde518d76116ffb50b0685c2f | [
"MIT"
] | null | null | null | frappe/patches/v12_0/move_email_and_phone_to_child_table.py | nobesnickr/frappe | d72d9cce68dd750cde518d76116ffb50b0685c2f | [
"MIT"
] | null | null | null | frappe/patches/v12_0/move_email_and_phone_to_child_table.py | nobesnickr/frappe | d72d9cce68dd750cde518d76116ffb50b0685c2f | [
"MIT"
] | null | null | null | import frappe
def execute():
contact_details = frappe.db.sql("""
SELECT
`name`, `email_id`, `phone`, `mobile_no`, `modified_by`, `creation`, `modified`
FROM `tabContact`
""", as_dict=True)
frappe.reload_doc("contacts", "doctype", "contact_email")
frappe.reload_doc("contacts", "doctype", "contact_phone")
fr... | 28.360465 | 97 | 0.673227 |
5bef796588ecc4e73149aad1050a108da971d915 | 16,851 | py | Python | scripts/genpinctrl/genpinctrl.py | teslabs/hal_stm32 | a0267470e786019e378be18f5786e53ef307497f | [
"Apache-2.0"
] | null | null | null | scripts/genpinctrl/genpinctrl.py | teslabs/hal_stm32 | a0267470e786019e378be18f5786e53ef307497f | [
"Apache-2.0"
] | null | null | null | scripts/genpinctrl/genpinctrl.py | teslabs/hal_stm32 | a0267470e786019e378be18f5786e53ef307497f | [
"Apache-2.0"
] | null | null | null | """
Utility to autogenerate Zephyr DT pinctrl files for all STM32 microcontrollers.
Usage::
python3 genpinctrl.py [-p /path/to/STM32CubeMX] [-o /path/to/output_dir]
Copyright (c) 2020 Teslabs Engineering S.L.
SPDX-License-Identifier: Apache-2.0
"""
import argparse
from collections import OrderedDict
import log... | 29.563158 | 85 | 0.477182 |
3e2fbaf41d89bcde2814acd5e291e8b47936ca8f | 1,654 | py | Python | jokes/social_credit.py | SpikeVN/tro-li | 9746846af2de4973d555e154427e902bc65f8c23 | [
"MIT"
] | 2 | 2022-03-30T05:57:23.000Z | 2022-03-30T05:57:25.000Z | jokes/social_credit.py | SpikeVN/tro-li | 9746846af2de4973d555e154427e902bc65f8c23 | [
"MIT"
] | null | null | null | jokes/social_credit.py | SpikeVN/tro-li | 9746846af2de4973d555e154427e902bc65f8c23 | [
"MIT"
] | 1 | 2022-03-30T05:57:45.000Z | 2022-03-30T05:57:45.000Z | import disnake
import random
from disnake import ApplicationCommandInteraction as Aci
from disnake.ext import commands
import os
import config_manager as cfg
name = "socialcredit"
des = "Tín dụng xã hội. Ngoan thì sống."
banned = [
"Thiên An Môn", "xe tăng", "biểu tình", "dân chủ", "Hồng Kông", "Biển Đông", "Đảo... | 38.465116 | 118 | 0.660218 |
f2ddfd3b7e1ba251b81d95d8a344c2119aaef0cf | 11,796 | py | Python | tests/lib/wheel.py | q0w/pip | 422719863a061640a84c6292e7d86d81e22c938c | [
"MIT"
] | null | null | null | tests/lib/wheel.py | q0w/pip | 422719863a061640a84c6292e7d86d81e22c938c | [
"MIT"
] | 1 | 2022-01-27T19:09:25.000Z | 2022-01-27T19:09:25.000Z | tests/lib/wheel.py | q0w/pip | 422719863a061640a84c6292e7d86d81e22c938c | [
"MIT"
] | null | null | null | """Helper for building wheels as would be in test cases.
"""
import csv
import itertools
from base64 import urlsafe_b64encode
from collections import namedtuple
from copy import deepcopy
from email.message import Message
from enum import Enum
from functools import partial
from hashlib import sha256
from io import Bytes... | 29.863291 | 88 | 0.653357 |
27848f6825b20e2e2e1fe6f7277fecabd9af3b76 | 5,388 | py | Python | main.py | kallmanm/IoT-dApp | a862ea903a390eae3d2b3726823403264b0b0bc1 | [
"MIT"
] | null | null | null | main.py | kallmanm/IoT-dApp | a862ea903a390eae3d2b3726823403264b0b0bc1 | [
"MIT"
] | null | null | null | main.py | kallmanm/IoT-dApp | a862ea903a390eae3d2b3726823403264b0b0bc1 | [
"MIT"
] | null | null | null | from tkinter import *
from tkinter import filedialog
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import time
import random
start_date = "2021-3-1"
stop_date = "2021-3-31"
start_time = "00:00:00"
stop_time = "23:59:59"
def mock_float():
mf = round(random.uniform(0.00, 2.00), 2)
retu... | 29.282609 | 92 | 0.596325 |
1fd2326b5952b2751c29f71d3609bbe35515050a | 233 | py | Python | test/tk/dictTK/convert_to_internal/test_2.py | yuhangwang/plot | 4f81dab2e6e3dc384c370f8dc0a00e8df29770fb | [
"MIT"
] | 1 | 2020-04-10T08:14:43.000Z | 2020-04-10T08:14:43.000Z | test/tk/dictTK/convert_to_internal/test_2.py | yuhangwang/plot | 4f81dab2e6e3dc384c370f8dc0a00e8df29770fb | [
"MIT"
] | 1 | 2016-11-30T20:37:27.000Z | 2016-12-12T11:55:50.000Z | test/tk/dictTK/convert_to_internal/test_2.py | yuhangwang/plot | 4f81dab2e6e3dc384c370f8dc0a00e8df29770fb | [
"MIT"
] | 1 | 2019-12-18T07:56:00.000Z | 2019-12-18T07:56:00.000Z | from plot.tk.dictTK import convert_to_internal
def test():
user_dict = {"p1": {"p2": {"__": "i2", "v": 2}, "__": "i1"}}
solution = {"i1": {"i2": 2}}
answer = convert_to_internal(user_dict)
assert answer == solution
| 25.888889 | 64 | 0.592275 |
95c0ea12add26236caf9c50f2c5390477194316d | 11,087 | py | Python | src/sst/elements/VaultSimC/tests/pimExper.py | jleidel/sst-elements | ad60d81078a9a1dca0ffc04411858491953c6a73 | [
"BSD-3-Clause"
] | null | null | null | src/sst/elements/VaultSimC/tests/pimExper.py | jleidel/sst-elements | ad60d81078a9a1dca0ffc04411858491953c6a73 | [
"BSD-3-Clause"
] | null | null | null | src/sst/elements/VaultSimC/tests/pimExper.py | jleidel/sst-elements | ad60d81078a9a1dca0ffc04411858491953c6a73 | [
"BSD-3-Clause"
] | null | null | null | import sst
import math
# globals
CPUQuads = 2 # "Quads" per CPU
PIMQuads = 1 # "Quads per PIM
PIMs = 2 # number of PIMs
ccLat = "5ns" # cube to cube latency i.e. PIM to PIM
vaultsPerCube = 8
fakeCPU_DC = 0
fakePIM_DC = 0
coreNetBW = "36GB/s"
memNetBW = "36GB/s"
xbarBW = coreNetBW
flit_size = "72B"
coherence_p... | 31.767908 | 118 | 0.579417 |
641c9f613816c5fa2e7e32ea6e52be815c246f3e | 933 | py | Python | 02 - Curso Em Video/Aula 14/E - 059.py | GabrielTrentino/Python_Basico | f13f6448c275c14896337d2018b04cbf5a54efd3 | [
"MIT"
] | null | null | null | 02 - Curso Em Video/Aula 14/E - 059.py | GabrielTrentino/Python_Basico | f13f6448c275c14896337d2018b04cbf5a54efd3 | [
"MIT"
] | null | null | null | 02 - Curso Em Video/Aula 14/E - 059.py | GabrielTrentino/Python_Basico | f13f6448c275c14896337d2018b04cbf5a54efd3 | [
"MIT"
] | null | null | null | num1 = float(input('Digite o primeiro número: '))
num2 = float(input('Digite o segundo número: '))
while True:
print ('-='*10, '''
[ 1 ] Somar
[ 2 ] Multiplicar
[ 3 ] Maior
[ 4 ] Novos números
[ 5 ] Sair do Programa''')
print('-='*10)
opcao = int(input('>>>>> Qual a sua opção? '))
if opcao ==... | 32.172414 | 80 | 0.533762 |
edf70d0977c308890ad6ed374727337297377fb4 | 565 | py | Python | setup.py | cfra/wuschl | fdf7c7be992df950c1ee340f72fe10682ea12afd | [
"MIT"
] | null | null | null | setup.py | cfra/wuschl | fdf7c7be992df950c1ee340f72fe10682ea12afd | [
"MIT"
] | null | null | null | setup.py | cfra/wuschl | fdf7c7be992df950c1ee340f72fe10682ea12afd | [
"MIT"
] | null | null | null | from distutils.core import setup
import sys
if sys.version_info.major >= 3:
sys.stderr.write("Wuschl is currently only for python2, sorry. :(\n")
sys.exit(1)
setup(
name="wuschl",
version="0.3.0",
license='MIT',
author='Christian Franke',
author_email='nobody@nowhere.ws',
description='... | 24.565217 | 73 | 0.635398 |
e3138b77fb32e8b0ba48b413764163d0b384f830 | 6,947 | py | Python | poetry/vcs/git.py | StephenBrown2/poetry | 33dcb825042baaa494aa7581ccadd33f870fb706 | [
"MIT"
] | null | null | null | poetry/vcs/git.py | StephenBrown2/poetry | 33dcb825042baaa494aa7581ccadd33f870fb706 | [
"MIT"
] | null | null | null | poetry/vcs/git.py | StephenBrown2/poetry | 33dcb825042baaa494aa7581ccadd33f870fb706 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import re
import subprocess
from collections import namedtuple
from poetry.utils._compat import decode
PATTERNS = [
re.compile(
r"^(git\+)?"
r"(?P<protocol>https?|git|ssh|rsync|file)://"
r"(?:(?P<user>.+)@)*"
r"(?P<resource>[a-z0-9_.-]*)"
r"(:?P<po... | 28.706612 | 84 | 0.450266 |
9f24edcabd1ed220e449af414ad9953b453b2b29 | 2,421 | py | Python | pyomo_workshop/exercises_wo_soln/exercises/GDP/exercises-1/stripPacking_2.py | bernalde/OptimIQ | d326945a065c68532e3f3b100fe4a288a2981a2b | [
"MIT"
] | null | null | null | pyomo_workshop/exercises_wo_soln/exercises/GDP/exercises-1/stripPacking_2.py | bernalde/OptimIQ | d326945a065c68532e3f3b100fe4a288a2981a2b | [
"MIT"
] | null | null | null | pyomo_workshop/exercises_wo_soln/exercises/GDP/exercises-1/stripPacking_2.py | bernalde/OptimIQ | d326945a065c68532e3f3b100fe4a288a2981a2b | [
"MIT"
] | null | null | null | from pyomo.environ import *
from pyomo.gdp import *
# Strip-packing example from http://minlp.org/library/lib.php?lib=GDP
# This model packs a set of rectangles without rotation or overlap within a
# strip of a given width, minimizing the length of the strip.
model = ConcreteModel()
model.RECTANGLES = Set... | 32.28 | 80 | 0.669145 |
bef14130f10dfecc4dad3767211b408c8666037d | 135,742 | py | Python | terminusdb_client/woqlquery/woql_query.py | Pradhvan/terminusdb-client-python | 1e9969be4e4518233dbaf111f56bc291e0fa4632 | [
"Apache-2.0"
] | null | null | null | terminusdb_client/woqlquery/woql_query.py | Pradhvan/terminusdb-client-python | 1e9969be4e4518233dbaf111f56bc291e0fa4632 | [
"Apache-2.0"
] | null | null | null | terminusdb_client/woqlquery/woql_query.py | Pradhvan/terminusdb-client-python | 1e9969be4e4518233dbaf111f56bc291e0fa4632 | [
"Apache-2.0"
] | null | null | null | import copy
import datetime as dt
import json
# import pprint
import re
import terminusdb_client.woql_utils as utils
from .woql_core import _copy_dict, _tokenize, _tokens_to_json
# pp = pprint.PrettyPrinter(indent=4)
class WOQLQuery:
def __init__(self, query=None, graph="schema/main"):
"""defines the ... | 34.850321 | 254 | 0.530573 |
8fb056c57ede8a9753a30d353666b8fa70d8b8a3 | 4,094 | py | Python | submission/residual_learning/domain_randomization.py | ipab-rad/RRC21 | 32aa3108eadd2fef527ea4150064a476f0661e73 | [
"BSD-3-Clause"
] | 12 | 2021-05-06T18:00:21.000Z | 2022-01-11T14:23:22.000Z | submission/residual_learning/domain_randomization.py | ipab-rad/RRC21 | 32aa3108eadd2fef527ea4150064a476f0661e73 | [
"BSD-3-Clause"
] | 3 | 2021-06-03T16:06:01.000Z | 2021-08-15T13:40:09.000Z | submission/residual_learning/domain_randomization.py | ipab-rad/RRC21 | 32aa3108eadd2fef527ea4150064a476f0661e73 | [
"BSD-3-Clause"
] | 4 | 2021-05-12T02:34:34.000Z | 2021-07-18T19:54:50.000Z | import gin
import numpy as np
import gym
from mp.const import CUBOID_MASS
DYNAMICS_PARAMS = {
'mass': [0.26, 0.25, 0.021],
'restitution': 0.8,
'jointDamping': 0.0,
'lateralFriction': 0.1,
'spinningFriction': 0.1,
'rollingFriction': 0.1,
'linearDamping': 0.5,
'angularDamping': 0.5,
... | 33.284553 | 106 | 0.58427 |
4bcb203e0b86315404dc8a929edc2666ff1fd1f9 | 1,679 | py | Python | codes/data/__init__.py | WestCityInstitute/InvDN | 3846cf3548ccf6690e58be3aafe1f6d98c56b90d | [
"Apache-2.0"
] | 122 | 2021-04-22T05:05:35.000Z | 2022-03-30T03:13:38.000Z | codes/data/__init__.py | WestCityInstitute/InvDN | 3846cf3548ccf6690e58be3aafe1f6d98c56b90d | [
"Apache-2.0"
] | 18 | 2021-04-21T09:35:41.000Z | 2022-03-29T12:02:26.000Z | codes/data/__init__.py | WestCityInstitute/InvDN | 3846cf3548ccf6690e58be3aafe1f6d98c56b90d | [
"Apache-2.0"
] | 20 | 2021-05-20T07:38:44.000Z | 2022-03-21T05:51:26.000Z | '''create dataset and dataloader'''
import logging
import torch
import torch.utils.data
def create_dataloader(dataset, dataset_opt, opt=None, sampler=None):
phase = dataset_opt['phase']
if phase == 'train':
if opt['dist']:
world_size = torch.distributed.get_world_size()
num_wor... | 39.97619 | 100 | 0.594401 |
1730d41bdd462e896f595b96d3bd260a3f00b06c | 2,493 | py | Python | stm32/tools/macosx/gcc/arm-none-eabi/lib/thumb/v7e-m/fpv5/hard/libstdc++.a-gdb.py | BSFrance/BSFrance | db1da987a84a60f568c5a4c79635d596e8ceb88b | [
"MIT"
] | 8 | 2018-02-23T18:48:24.000Z | 2021-02-13T23:57:27.000Z | stm32/tools/macosx/gcc/arm-none-eabi/lib/thumb/v7e-m/fpv5/hard/libstdc++.a-gdb.py | BSFrance/BSFrance | db1da987a84a60f568c5a4c79635d596e8ceb88b | [
"MIT"
] | 2 | 2018-03-11T07:14:30.000Z | 2019-02-17T20:05:26.000Z | stm32/tools/macosx/gcc/arm-none-eabi/lib/thumb/v7e-m/fpv5/hard/libstdc++.a-gdb.py | BSFrance/BSFrance | db1da987a84a60f568c5a4c79635d596e8ceb88b | [
"MIT"
] | 4 | 2018-05-01T14:53:34.000Z | 2021-04-06T12:31:05.000Z | # -*- python -*-
# Copyright (C) 2009-2017 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later versio... | 40.209677 | 95 | 0.724428 |
96e41f1c1f06ee9424c6137ff0ca1c167011ff91 | 1,728 | py | Python | readthedocs/core/urls/single_version.py | italia/readthedocs.org | 440d3885380d20ec24081f76e26d20701749e179 | [
"MIT"
] | 19 | 2018-03-28T12:28:35.000Z | 2022-02-14T20:09:42.000Z | readthedocs/core/urls/single_version.py | berez23/docs.italia.it | 440d3885380d20ec24081f76e26d20701749e179 | [
"MIT"
] | 274 | 2017-10-10T07:59:04.000Z | 2022-03-12T00:56:03.000Z | readthedocs/core/urls/single_version.py | italia/readthedocs.org | 440d3885380d20ec24081f76e26d20701749e179 | [
"MIT"
] | 13 | 2018-04-03T09:49:50.000Z | 2021-04-18T22:04:15.000Z | # -*- coding: utf-8 -*-
"""URL configuration for a single version."""
from functools import reduce
from operator import add
from django.conf import settings
from django.conf.urls import url, include
from django.conf.urls.static import static
from readthedocs.constants import pattern_opts
from readthedocs.core.views ... | 26.584615 | 73 | 0.633681 |
5b59abbffe764a3d87ed893db4323b6b78e687aa | 1,804 | py | Python | tests/unit/docs/test_utils.py | vemel/boto3 | 170ecc64997b1fe28fefd54010d9439dc620fbd4 | [
"Apache-2.0"
] | 1 | 2021-02-16T10:01:25.000Z | 2021-02-16T10:01:25.000Z | tests/unit/docs/test_utils.py | vemel/boto3 | 170ecc64997b1fe28fefd54010d9439dc620fbd4 | [
"Apache-2.0"
] | null | null | null | tests/unit/docs/test_utils.py | vemel/boto3 | 170ecc64997b1fe28fefd54010d9439dc620fbd4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompa... | 42.952381 | 73 | 0.732816 |
0cb4354084b41602b48d35a03c1f9e26768541df | 122 | py | Python | src/pyquickhelper/benchhelper/__init__.py | Pandinosaurus/pyquickhelper | 326276f656cf88989e4d0fcd006ada0d3735bd9e | [
"MIT"
] | 18 | 2015-11-10T08:09:23.000Z | 2022-02-16T11:46:45.000Z | src/pyquickhelper/benchhelper/__init__.py | Pandinosaurus/pyquickhelper | 326276f656cf88989e4d0fcd006ada0d3735bd9e | [
"MIT"
] | 321 | 2015-06-14T21:34:28.000Z | 2021-11-28T17:10:03.000Z | src/pyquickhelper/benchhelper/__init__.py | Pandinosaurus/pyquickhelper | 326276f656cf88989e4d0fcd006ada0d3735bd9e | [
"MIT"
] | 10 | 2015-06-20T01:35:00.000Z | 2022-01-19T15:54:32.000Z | """
@file
@brief Shortcuts to benchhelper
"""
from .benchmark import BenchMark
from .grid_benchmark import GridBenchMark
| 15.25 | 41 | 0.786885 |
430a00221248151bc47d4d969f8d9149873396de | 224 | py | Python | CodeWarsKataStuff/Sort inner content.py | perrymant/CodeWarsKataStuff | 20eb25a3f0070aee5f5ae9a03a656acd5557c021 | [
"MIT"
] | null | null | null | CodeWarsKataStuff/Sort inner content.py | perrymant/CodeWarsKataStuff | 20eb25a3f0070aee5f5ae9a03a656acd5557c021 | [
"MIT"
] | null | null | null | CodeWarsKataStuff/Sort inner content.py | perrymant/CodeWarsKataStuff | 20eb25a3f0070aee5f5ae9a03a656acd5557c021 | [
"MIT"
] | null | null | null |
words = "sort the inner content in descending order"
result = []
for w in words.split():
if len(w)>3:
result.append(w[0]+''.join(sorted(w[1:-1], reverse=True))+w[-1])
else:
result.append(w)
| 22.4 | 72 | 0.566964 |
4fc3a92fbbb5af785a8c440afc570b2b6b818a85 | 2,591 | py | Python | bibstuff/bibstyles/example_numbered.py | cpitclaudel/bibstuff | f78aca09bab72901776d1ee1d500694824780f29 | [
"MIT"
] | 9 | 2015-01-21T00:48:49.000Z | 2017-08-19T14:00:11.000Z | bibstuff/bibstyles/example_numbered.py | cpitclaudel/bibstuff | f78aca09bab72901776d1ee1d500694824780f29 | [
"MIT"
] | 1 | 2020-07-23T16:28:09.000Z | 2020-07-30T02:28:38.000Z | bibstuff/bibstyles/example_numbered.py | cpitclaudel/bibstuff | f78aca09bab72901776d1ee1d500694824780f29 | [
"MIT"
] | 5 | 2015-04-06T22:07:44.000Z | 2020-07-30T02:24:55.000Z | #File: example_numbered.py
"""
:mod:`bibstuff.bibstyles.example_numbered`
------------------------------------------
Provides an examle of how to easily modify an existing style:
Just import everything from that style, and then override
what you wish to change. In this case, we import from
default.py, the default sty... | 32.797468 | 82 | 0.656503 |
383584a6cd7878a417478cf55bb8c657810d0483 | 84,026 | py | Python | pandas/tests/indexes/test_base.py | hasandiwan/pandas | f6059224456f6e287ec43524c6a1286fe398c548 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/indexes/test_base.py | hasandiwan/pandas | f6059224456f6e287ec43524c6a1286fe398c548 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/indexes/test_base.py | hasandiwan/pandas | f6059224456f6e287ec43524c6a1286fe398c548 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | from collections import defaultdict
from datetime import datetime, timedelta
from io import StringIO
import math
import operator
import re
import numpy as np
import pytest
from pandas._libs.tslib import Timestamp
from pandas.compat import IS64
from pandas.compat.numpy import np_datetime64_compat
from pandas.util._tes... | 35.409187 | 88 | 0.575584 |
5072bc5aa3b99f65aa22dd8a1c65735e9b8903f9 | 20,446 | py | Python | python2.7/_sysconfigdata.py | 84KaliPleXon3/sslstrip-hsts-openwrt | f875ded48078a3ed84bffef1e69dcbeaf2e77ae3 | [
"MIT"
] | 4 | 2020-10-31T19:52:05.000Z | 2021-09-22T11:39:27.000Z | python2.7/_sysconfigdata.py | 84KaliPleXon3/sslstrip-hsts-openwrt | f875ded48078a3ed84bffef1e69dcbeaf2e77ae3 | [
"MIT"
] | null | null | null | python2.7/_sysconfigdata.py | 84KaliPleXon3/sslstrip-hsts-openwrt | f875ded48078a3ed84bffef1e69dcbeaf2e77ae3 | [
"MIT"
] | 2 | 2020-02-27T08:28:35.000Z | 2020-09-13T12:39:26.000Z | # system configuration generated and used by the sysconfig module
build_time_vars = {'AC_APPLE_UNIVERSAL_BUILD': 0,
'AIX_GENUINE_CPLUSPLUS': 0,
'AR': 'mips-openwrt-linux-uclibc-gcc-ar',
'ARFLAGS': 'rc',
'ASDLGEN': './Parser/asdl_c.py',
'ASDLGEN_FILES': './Parser/asdl.py ./Parser/asdl_c.py',
'AST_ASDL': './Parser/... | 38.432331 | 2,214 | 0.714859 |
0c6f6396ae8de5df8cf422fc93b156ba663b8068 | 1,640 | py | Python | src/util/cloudsave.py | nostalgebraist/nostalgebraist-autoresponder | 622349c4cad2a7aec1017837416c58a678151aae | [
"MIT"
] | 39 | 2020-06-19T05:38:11.000Z | 2022-03-28T04:35:31.000Z | src/util/cloudsave.py | nostalgebraist/nostalgebraist-autoresponder | 622349c4cad2a7aec1017837416c58a678151aae | [
"MIT"
] | null | null | null | src/util/cloudsave.py | nostalgebraist/nostalgebraist-autoresponder | 622349c4cad2a7aec1017837416c58a678151aae | [
"MIT"
] | 2 | 2021-04-13T18:12:03.000Z | 2021-12-16T23:20:12.000Z | import time
import pickle
import os
import smart_open.gcs
from smart_open import open
CLOUDSAVE_BUCKET = "nost-us"
def resilient_pickle_save(obj, path, backup_path):
tries = 0
done = False
enclosing_dir = backup_path.rpartition("/")[0]
print(f"ensuring {enclosing_dir} exists")
os.makedirs(encl... | 29.818182 | 98 | 0.587805 |
321e9ee7dd8d718e308658a1ee2e796e807d194b | 509 | py | Python | scout/settings/production.py | astonecutter/scout | e2386a30b4c8c222aca3af1c6f3fa3ef94d89ad3 | [
"MIT"
] | null | null | null | scout/settings/production.py | astonecutter/scout | e2386a30b4c8c222aca3af1c6f3fa3ef94d89ad3 | [
"MIT"
] | null | null | null | scout/settings/production.py | astonecutter/scout | e2386a30b4c8c222aca3af1c6f3fa3ef94d89ad3 | [
"MIT"
] | null | null | null | from .base import *
SESSION_COOKIE_SECURE = True
SECURE_HSTS_SECONDS = 2592000 # 30 days
SECURE_HSTS_INCLUDE_SUBDOMAINS = True
SECURE_FRAME_DENY = True
SECURE_CONTENT_TYPE_NOSNIFF = True
SECURE_BROWSER_XSS_FILTER = True
SECURE_SSL_REDIRECT = True
SECURE_REDIRECT_EXEMPT = [
# App Engine doesn't use HTTPS interna... | 26.789474 | 92 | 0.766208 |
1bba399ccea621a232f7b7b68bd7959ba1f86f59 | 22,781 | py | Python | src/train_nn.py | radhe2205/abusive_lang_detection | 330066f505bb75222bdfcf95d29e105aa6282d11 | [
"MIT"
] | null | null | null | src/train_nn.py | radhe2205/abusive_lang_detection | 330066f505bb75222bdfcf95d29e105aa6282d11 | [
"MIT"
] | null | null | null | src/train_nn.py | radhe2205/abusive_lang_detection | 330066f505bb75222bdfcf95d29e105aa6282d11 | [
"MIT"
] | null | null | null | import copy
import json
import torch
from sklearn.metrics import classification_report
from torch import nn
from torch.optim import Adam, SGD
from torch.optim.lr_scheduler import StepLR
from torch.utils.data import DataLoader
import matplotlib.pyplot as plt
import numpy as np
from preprocessing import Preprocessor
fro... | 46.971134 | 213 | 0.637988 |
3de9e30a9dddf260d1553c12b690c80b4630bbfc | 543 | py | Python | pyrolysis_parallel_fran_model/ito_sde/2_param/fake_data/run_ito_sde_2param.py | jcoheur/pybitup-examples | 83bdb2a85f8bdeed7199feaf70fa17fc68263256 | [
"MIT"
] | null | null | null | pyrolysis_parallel_fran_model/ito_sde/2_param/fake_data/run_ito_sde_2param.py | jcoheur/pybitup-examples | 83bdb2a85f8bdeed7199feaf70fa17fc68263256 | [
"MIT"
] | null | null | null | pyrolysis_parallel_fran_model/ito_sde/2_param/fake_data/run_ito_sde_2param.py | jcoheur/pybitup-examples | 83bdb2a85f8bdeed7199feaf70fa17fc68263256 | [
"MIT"
] | null | null | null | # Packages for the pyrolysis model
from pyrolysis_general.src.pyrolysis import PyrolysisParallel
import parallel_reaction_2param
# Packages for stochastic inference
import pybitup
case_name = "pyrolysis_parallel_2param"
input_file_name = "{}.json".format(case_name)
pyrolysis_model = {}
pyrolysis_model["case_name"... | 27.15 | 77 | 0.839779 |
bfb5730652a1fd4e00468aeb494c2b9e7c8dae73 | 756 | py | Python | ttbd/ttbl/test_ttb_client.py | zmdismai/tcf | 3903e0a2f444c3aa14647a5147a0df76a49e4195 | [
"Apache-2.0"
] | null | null | null | ttbd/ttbl/test_ttb_client.py | zmdismai/tcf | 3903e0a2f444c3aa14647a5147a0df76a49e4195 | [
"Apache-2.0"
] | null | null | null | ttbd/ttbl/test_ttb_client.py | zmdismai/tcf | 3903e0a2f444c3aa14647a5147a0df76a49e4195 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python2
#
# Copyright (c) 2017 Intel Corporation
#
# SPDX-License-Identifier: Apache-2.0
#
#
# FIXME: cache the target list's per target broker into a pickled
# ${TCF_CACHE:-~/.tcf/cache}/BROKER.cache; use the cache instead of
# calling target_list(); implement cache-refresh command.
# FIXME: do a pyth... | 20.432432 | 69 | 0.71164 |
2859b78e99f98c4bf3bf94e55a31140b96019bd0 | 690 | py | Python | config.py | pramodpxi/bookshl | 7c77baec213db6193fb7eb099da4466b9a33cad9 | [
"MIT"
] | null | null | null | config.py | pramodpxi/bookshl | 7c77baec213db6193fb7eb099da4466b9a33cad9 | [
"MIT"
] | null | null | null | config.py | pramodpxi/bookshl | 7c77baec213db6193fb7eb099da4466b9a33cad9 | [
"MIT"
] | null | null | null | import tweepy
from secrets import keys
import logging
logger = logging.getLogger()
def create_api():
consumer_key = keys['consumer_key']
consumer_secret = keys['consumer_secret']
access_token = keys['access_token']
access_token_secret = keys['access_token_secret']
auth = tweepy.OAuthHandler(cons... | 27.6 | 61 | 0.718841 |
3cbdf8a803b50cd04a9e37df7e9ebcbc4b250b93 | 2,695 | py | Python | modules/auxiliary/multi/scanner/pma_scanner.py | adolabsnet/HatSploit | 0a08521b7623d4ef1aab8f887cd8a23f460d592c | [
"MIT"
] | 2 | 2021-03-20T05:16:03.000Z | 2021-08-11T16:40:04.000Z | modules/auxiliary/multi/scanner/pma_scanner.py | Lencof/HatSploit | 0a08521b7623d4ef1aab8f887cd8a23f460d592c | [
"MIT"
] | null | null | null | modules/auxiliary/multi/scanner/pma_scanner.py | Lencof/HatSploit | 0a08521b7623d4ef1aab8f887cd8a23f460d592c | [
"MIT"
] | 2 | 2021-03-20T05:16:00.000Z | 2021-08-23T18:20:03.000Z | #!/usr/bin/env python3
#
# MIT License
#
# Copyright (c) 2020-2021 EntySec
#
# 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... | 32.083333 | 110 | 0.646011 |
1920df688514de5420d70ffb5386f23d9a574b74 | 3,738 | py | Python | Cat_Data_Set_Prepare/preprocess_cat_dataset.py | ec500-software-engineering/project-14_Anime_Genration | 78df263f504d692168ebf6b6e045a0ae15a1295d | [
"MIT"
] | null | null | null | Cat_Data_Set_Prepare/preprocess_cat_dataset.py | ec500-software-engineering/project-14_Anime_Genration | 78df263f504d692168ebf6b6e045a0ae15a1295d | [
"MIT"
] | null | null | null | Cat_Data_Set_Prepare/preprocess_cat_dataset.py | ec500-software-engineering/project-14_Anime_Genration | 78df263f504d692168ebf6b6e045a0ae15a1295d | [
"MIT"
] | 1 | 2019-02-25T21:44:47.000Z | 2019-02-25T21:44:47.000Z | ## Modified version of https://github.com/microe/angora-blue/blob/master/cascade_training/describe.py by Erik Hovland
##### I modified it to work with Python 3, changed the paths and made it output a folder for images bigger than 64x64 and a folder for images bigger than 128x128
import cv2
import glob
import math
impo... | 31.411765 | 161 | 0.697432 |
3ab937f1f4c4c273e65501bec31ffec6eca74dd5 | 1,383 | py | Python | ccnet/test-client.py | syncwerk/syncwerk-server-python-ccnet | fe759bd8e7d58bb3c75d46a566edc0b067c53fc0 | [
"Apache-2.0"
] | null | null | null | ccnet/test-client.py | syncwerk/syncwerk-server-python-ccnet | fe759bd8e7d58bb3c75d46a566edc0b067c53fc0 | [
"Apache-2.0"
] | null | null | null | ccnet/test-client.py | syncwerk/syncwerk-server-python-ccnet | fe759bd8e7d58bb3c75d46a566edc0b067c53fc0 | [
"Apache-2.0"
] | null | null | null | import sys
import os
from ccnet import ClientPool, RpcClientBase
from pyrpcsyncwerk import rpcsyncwerk_func
import threading
import logging
RPC_SERVICE_NAME = 'test-rpcserver'
CCNET_CONF_DIR = os.path.expanduser('~/.ccnet')
class TestRpcClient(RpcClientBase):
def __init__(self, client_pool, *args, **kwargs):
... | 21.952381 | 84 | 0.608821 |
b55b3dd050059ef62e2589b58ff6ea1cd3c9201a | 4,691 | py | Python | nicos_pnpi/nero/setups/colimator.py | mlz-ictrl/nicos | a6de0bc194ba42e3dc04a033713b41b5499ba8e1 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 12 | 2019-11-06T15:40:36.000Z | 2022-01-01T16:23:00.000Z | nicos_pnpi/nero/setups/colimator.py | ess-dmsc/nicos | 755d61d403ff7123f804c45fc80c7ff4d762993b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 91 | 2020-08-18T09:20:26.000Z | 2022-02-01T11:07:14.000Z | nicos_pnpi/nero/setups/colimator.py | mlz-ictrl/nicos | a6de0bc194ba42e3dc04a033713b41b5499ba8e1 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 6 | 2020-01-11T10:52:30.000Z | 2022-02-25T12:35:23.000Z | description = 'Colimator'
x_gap_conf = configdata('localconfig.X_GAP_CONF')
y_gap_conf = configdata('localconfig.Y_GAP_CONF')
theta_s_conf = configdata('localconfig.THETA_S_CONF')
x_s_conf = configdata('localconfig.X_S_CONF')
dia1_angle_conf = configdata('localconfig.DIA1_ANGLE_CONF')
dia1_pos_conf = configdata('loc... | 43.036697 | 71 | 0.521637 |
1db699f70941bd751818b87244b564b3b87516a7 | 1,719 | py | Python | salt/sdb/consul.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 9,425 | 2015-01-01T05:59:24.000Z | 2022-03-31T20:44:05.000Z | salt/sdb/consul.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 33,507 | 2015-01-01T00:19:56.000Z | 2022-03-31T23:48:20.000Z | salt/sdb/consul.py | markgras/salt | d66cd3c935533c63870b83228b978ce43e0ef70d | [
"Apache-2.0"
] | 5,810 | 2015-01-01T19:11:45.000Z | 2022-03-31T02:37:20.000Z | """
Consul sdb Module
:maintainer: SaltStack
:maturity: New
:platform: all
This module allows access to Consul using an ``sdb://`` URI
Like all sdb modules, the Consul module requires a configuration profile to
be configured in either the minion or master configuration file. This profile
requires very l... | 21.759494 | 82 | 0.650378 |
3db2a075e027ca4fb48cea7e3b132ea959076ea6 | 173 | py | Python | geekshop/mainapp/admin.py | A1eksAwP/GB-Internet-Store | a7cffcf3e7a73efc0cad3cd67ccdbaf245889ce5 | [
"MIT"
] | null | null | null | geekshop/mainapp/admin.py | A1eksAwP/GB-Internet-Store | a7cffcf3e7a73efc0cad3cd67ccdbaf245889ce5 | [
"MIT"
] | null | null | null | geekshop/mainapp/admin.py | A1eksAwP/GB-Internet-Store | a7cffcf3e7a73efc0cad3cd67ccdbaf245889ce5 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import ProductCategory, Product
# Register your models here.
admin.site.register(ProductCategory)
admin.site.register(Product) | 28.833333 | 44 | 0.83237 |
d8b52dda72c60e32bb6b0e93f3eab7431d6d71bf | 475 | py | Python | income_worksheet_creator/test/test_json_parser.py | jesh-anand/Tools | 4b6ffc96492d49ea1b20cad2f65d8da8b2ff2ab1 | [
"MIT"
] | null | null | null | income_worksheet_creator/test/test_json_parser.py | jesh-anand/Tools | 4b6ffc96492d49ea1b20cad2f65d8da8b2ff2ab1 | [
"MIT"
] | null | null | null | income_worksheet_creator/test/test_json_parser.py | jesh-anand/Tools | 4b6ffc96492d49ea1b20cad2f65d8da8b2ff2ab1 | [
"MIT"
] | null | null | null | """test_json_parser: Unit test to read json content and pass into dictionary"""
import json
def test_parse_json():
content = json.load(open("resources/data.json"))
print(content['h264']['video'])
def test_iterate_over_json():
content = json.load(open("resources/data.json"))
for i in content:
... | 22.619048 | 79 | 0.654737 |
6f7d129edceed0b9445a8f7c4469545ad5cb1508 | 592 | py | Python | nmt/service_test.py | whiskyboy/CVAE_GNMT | 12d01df4b36cb5c44eb719c79cae71d782e1aacd | [
"Apache-2.0"
] | null | null | null | nmt/service_test.py | whiskyboy/CVAE_GNMT | 12d01df4b36cb5c44eb719c79cae71d782e1aacd | [
"Apache-2.0"
] | null | null | null | nmt/service_test.py | whiskyboy/CVAE_GNMT | 12d01df4b36cb5c44eb719c79cae71d782e1aacd | [
"Apache-2.0"
] | null | null | null | #coding:utf8
import sys
from serving.inference_service import AlphaCommentServer
if __name__=="__main__":
server = AlphaCommentServer(model_dir=sys.argv[1])
title = "朱婷 实现 mvp 俱乐部 大满贯 , 昔日 对手 : 唯一 佩服 的 就是 中国 婷 !"
for comment, score in server.comment(title):
print("%s\t%s"%(comment, score))
titl... | 37 | 59 | 0.635135 |
fbd16cf708a3e91526d6bd5b9e822cb277ae0eca | 1,103 | py | Python | 7_Student_Majors/solution.py | resultakak/python-testdom-solutions | 971f0ff6eb57fbc4658e2c18251b386bc28a654c | [
"MIT"
] | 2 | 2022-02-09T10:39:57.000Z | 2022-02-09T10:40:04.000Z | 7_Student_Majors/solution.py | resultakak/python-testdom-solutions | 971f0ff6eb57fbc4658e2c18251b386bc28a654c | [
"MIT"
] | null | null | null | 7_Student_Majors/solution.py | resultakak/python-testdom-solutions | 971f0ff6eb57fbc4658e2c18251b386bc28a654c | [
"MIT"
] | 1 | 2022-02-09T10:45:41.000Z | 2022-02-09T10:45:41.000Z |
students = [("Allen Anderson", "Computer Science"),
("Edgar Einstein", "Engineering"),
("Farrah Finn", "Fine Arts")]
def add_new_student(students, name, major):
students.append((name, major))
def update_student(students, index, name, major):
students[index] = name, major
def find_stu... | 31.514286 | 109 | 0.725295 |
4d64ef4ef3e33c1ede740c5a9914bd6336924f1a | 1,531 | py | Python | pcapfex.py | Godlance/pcapfex | 249c5063a7098228bc8d5dc5737ee68e8a571ba4 | [
"Apache-2.0"
] | null | null | null | pcapfex.py | Godlance/pcapfex | 249c5063a7098228bc8d5dc5737ee68e8a571ba4 | [
"Apache-2.0"
] | null | null | null | pcapfex.py | Godlance/pcapfex | 249c5063a7098228bc8d5dc5737ee68e8a571ba4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2.7
# -*- coding: utf8 -*-
__author__ = 'Viktor Winkelmann'
import argparse
from core.Dispatcher import Dispatcher
VERSION = "1.0"
parser = argparse.ArgumentParser(description='Extract files from a pcap-file.')
parser.add_argument('input', metavar='PCAP_FILE', help='the input file')
parser.add_a... | 41.378378 | 106 | 0.647943 |
3d6595d06ae8df199592c551f4e24f57da60c18d | 13,315 | py | Python | conans/util/files.py | ssaavedra/conan | e15dc7902fbbeaf469798a3b9948ead1ecfc8e3c | [
"MIT"
] | 1 | 2021-08-05T15:33:08.000Z | 2021-08-05T15:33:08.000Z | conans/util/files.py | ssaavedra/conan | e15dc7902fbbeaf469798a3b9948ead1ecfc8e3c | [
"MIT"
] | null | null | null | conans/util/files.py | ssaavedra/conan | e15dc7902fbbeaf469798a3b9948ead1ecfc8e3c | [
"MIT"
] | null | null | null | import errno
import gzip
import hashlib
import os
import platform
import re
import shutil
import stat
import sys
import tarfile
import tempfile
from os.path import abspath, join as joinpath, realpath
from contextlib import contextmanager
import six
from conans.util.log import logger
def walk(top, **kwargs):
i... | 29.921348 | 101 | 0.624033 |
dc24c4e6116be7f2426f30c0497c14384b68eece | 59 | py | Python | src/explainable/backend/tests/__init__.py | as577/xai | d1c95a60fb1ac131ae861f685d15d29a7bb262bf | [
"MIT"
] | null | null | null | src/explainable/backend/tests/__init__.py | as577/xai | d1c95a60fb1ac131ae861f685d15d29a7bb262bf | [
"MIT"
] | null | null | null | src/explainable/backend/tests/__init__.py | as577/xai | d1c95a60fb1ac131ae861f685d15d29a7bb262bf | [
"MIT"
] | null | null | null | '''
Created on 02-Apr-2017
@author: Aditya Srinivasan
'''
| 9.833333 | 26 | 0.677966 |
61b79ccad861003a031aed257c764252c65deece | 393 | py | Python | infrastructure/backend/users/migrations/0002_user_nickname.py | rafilevy/virtual_agronomist | ef9ad5483e3481aad3fb8a1d681d2cc79c3c2639 | [
"MIT"
] | null | null | null | infrastructure/backend/users/migrations/0002_user_nickname.py | rafilevy/virtual_agronomist | ef9ad5483e3481aad3fb8a1d681d2cc79c3c2639 | [
"MIT"
] | null | null | null | infrastructure/backend/users/migrations/0002_user_nickname.py | rafilevy/virtual_agronomist | ef9ad5483e3481aad3fb8a1d681d2cc79c3c2639 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.5 on 2021-01-11 19:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='user',
name='nickname',
field... | 20.684211 | 72 | 0.590331 |
95c5e262b4da5f7adb2dec6d61c74e3194680b9a | 7,735 | py | Python | tests/test_dossier.py | openkamer/tk-api-python | 907b98ccc7602ad7e3e74f1e06f9544fbe66aba3 | [
"MIT"
] | 9 | 2017-11-16T12:39:11.000Z | 2021-10-16T19:30:52.000Z | tests/test_dossier.py | openkamer/tk-api-python | 907b98ccc7602ad7e3e74f1e06f9544fbe66aba3 | [
"MIT"
] | 1 | 2017-11-16T14:20:20.000Z | 2017-11-20T18:49:14.000Z | tests/test_dossier.py | openkamer/tk-api-python | 907b98ccc7602ad7e3e74f1e06f9544fbe66aba3 | [
"MIT"
] | 3 | 2018-09-10T18:57:39.000Z | 2020-06-09T14:13:10.000Z | import datetime
from tkapi.util import queries
from tkapi.zaak import Zaak, ZaakSoort
from tkapi.dossier import Dossier, DossierWetsvoorstel
from tkapi.document import Document
from .core import TKApiTestCase
class TestDossier(TKApiTestCase):
def test_get_dossiers(self):
dossiers = self.api.get_dossier... | 39.065657 | 118 | 0.648869 |
27e7707219da9425be31759dada57a61e9cb00c8 | 6,909 | py | Python | sps/src/waterfaller/infodata.py | danielemichilli/SpS | 23439f04c261dae578cb7815c59e1beaac4c9500 | [
"MIT"
] | 2 | 2021-08-25T01:38:31.000Z | 2021-10-10T08:11:49.000Z | sps/src/waterfaller/infodata.py | danielemichilli/SpS | 23439f04c261dae578cb7815c59e1beaac4c9500 | [
"MIT"
] | 1 | 2020-06-07T14:12:05.000Z | 2020-08-17T22:08:58.000Z | sps/src/waterfaller/infodata.py | danielemichilli/SpS | 23439f04c261dae578cb7815c59e1beaac4c9500 | [
"MIT"
] | 2 | 2020-04-21T03:02:50.000Z | 2020-06-21T05:48:50.000Z | ## Automatically adapted for numpy Apr 14, 2006 by convertcode.py
class infodata:
def __init__(self, filenm):
self.breaks = 0
for line in open(filenm):
if line.startswith(" Data file name"):
self.basenm = line.split("=")[-1].strip()
continue
i... | 47.979167 | 98 | 0.430019 |
8225cf0e9bbaa2fdda3d681a8d1fe8ab0fd08014 | 35,571 | py | Python | paradrop/daemon/paradrop/backend/chute_api.py | lhartung/paradrop-test | 22a491bf3198bf61bcabaedfaecde5b9be97e76f | [
"Apache-2.0"
] | null | null | null | paradrop/daemon/paradrop/backend/chute_api.py | lhartung/paradrop-test | 22a491bf3198bf61bcabaedfaecde5b9be97e76f | [
"Apache-2.0"
] | 7 | 2021-03-18T20:54:50.000Z | 2022-03-11T23:27:40.000Z | paradrop/daemon/paradrop/backend/chute_api.py | lhartung/paradrop-test | 22a491bf3198bf61bcabaedfaecde5b9be97e76f | [
"Apache-2.0"
] | null | null | null | """
Install and manage chutes on the host.
Endpoints for these functions can be found under /api/v1/chutes.
"""
import json
import os
import re
import subprocess
import tarfile
import tempfile
import yaml
from autobahn.twisted.resource import WebSocketResource
from klein import Klein
from paradrop.base import pduti... | 30.931304 | 97 | 0.545332 |
7565a7068c314382cadce36261a4aa26b28170f3 | 8,449 | py | Python | alembic/versions/d5bf8428057a_added_all_initial_tables.py | DillonEnge/tack-board-api | 6f3e57fe61011284d994c761cabe76d26dbcc789 | [
"MIT"
] | null | null | null | alembic/versions/d5bf8428057a_added_all_initial_tables.py | DillonEnge/tack-board-api | 6f3e57fe61011284d994c761cabe76d26dbcc789 | [
"MIT"
] | 9 | 2020-06-23T00:27:59.000Z | 2020-12-13T23:54:30.000Z | alembic/versions/d5bf8428057a_added_all_initial_tables.py | DillonEnge/tack-board-api | 6f3e57fe61011284d994c761cabe76d26dbcc789 | [
"MIT"
] | null | null | null | """Added all initial tables
Revision ID: d5bf8428057a
Revises:
Create Date: 2020-06-21 20:43:31.080820
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = 'd5bf8428057a'
down_revision = None
branch_labels = None
depends_on... | 46.679558 | 99 | 0.682448 |
771d51745300b9bfb71d0a58980695bf274ecf39 | 5,146 | py | Python | examples/optuna/chainermn_integration.py | zjzh/chainer | e9da1423255c58c37be9733f51b158aa9b39dc93 | [
"MIT"
] | 3,705 | 2017-06-01T07:36:12.000Z | 2022-03-30T10:46:15.000Z | examples/optuna/chainermn_integration.py | zjzh/chainer | e9da1423255c58c37be9733f51b158aa9b39dc93 | [
"MIT"
] | 5,998 | 2017-06-01T06:40:17.000Z | 2022-03-08T01:42:44.000Z | examples/optuna/chainermn_integration.py | zjzh/chainer | e9da1423255c58c37be9733f51b158aa9b39dc93 | [
"MIT"
] | 1,150 | 2017-06-02T03:39:46.000Z | 2022-03-29T02:29:32.000Z | """
Optuna example that demonstrates a pruner for ChainerMN.
In this example, we optimize the validation accuracy of hand-written digit
recognition using ChainerMN and MNIST, where architecture of neural network is
optimized. Throughout the training of neural networks, a pruner observes
intermediate results and stops ... | 32.987179 | 79 | 0.684415 |
d38f5963bad5d63d3c5c4970a89fd35c0125864e | 290 | py | Python | month01/day05/demo03.py | Amiao-miao/all-codes | ec50036d42d40086cac5fddf6baf4de18ac91e55 | [
"Apache-2.0"
] | 1 | 2021-02-02T02:17:37.000Z | 2021-02-02T02:17:37.000Z | month01/day05/demo03.py | Amiao-miao/all-codes | ec50036d42d40086cac5fddf6baf4de18ac91e55 | [
"Apache-2.0"
] | null | null | null | month01/day05/demo03.py | Amiao-miao/all-codes | ec50036d42d40086cac5fddf6baf4de18ac91e55 | [
"Apache-2.0"
] | null | null | null | """
列表
删除
"""
list_name = ["邓世竹", "王杰", "崔雪松"]
# 方法1:列表名.remove(元素)
if "王杰" in list_name:
list_name.remove("王杰") # 如果没有报错
# 方法2:del 列表名[索引]
# del 列表名[切片]
del list_name[-1]
print(list_name)
# del list_name[:]
# 练习4:
# 在地区列表中删除“新疆”
# 在新增列表中删除第1个元素
# 在现有列表中删除前2个元素
| 13.809524 | 36 | 0.586207 |
00c4d01831f0ab723edeef6f0b299046cdf5b065 | 6,045 | py | Python | snappass/main.py | badalraina31/snappass | f16106acc7cada1b3f77fddd312faa963e0b6e20 | [
"MIT"
] | null | null | null | snappass/main.py | badalraina31/snappass | f16106acc7cada1b3f77fddd312faa963e0b6e20 | [
"MIT"
] | null | null | null | snappass/main.py | badalraina31/snappass | f16106acc7cada1b3f77fddd312faa963e0b6e20 | [
"MIT"
] | null | null | null | import os
import sys
import uuid
import redis
from cryptography.fernet import Fernet
from flask import abort, Flask, render_template, request, jsonify
from redis.exceptions import ConnectionError
from werkzeug.urls import url_quote_plus
from werkzeug.urls import url_unquote_plus
from distutils.util import strtobool
... | 28.514151 | 89 | 0.68536 |
d4403449e3e9c21928bdb366e5db9ef916c99bd9 | 10,901 | py | Python | src/modules/encoders.py | dumpmemory/Multimodal-Infomax | 9a6dc8f2bfa861cd447ba65c6a037cd7dd24f473 | [
"MIT"
] | 57 | 2021-09-01T15:33:48.000Z | 2022-03-16T08:01:06.000Z | src/modules/encoders.py | dumpmemory/Multimodal-Infomax | 9a6dc8f2bfa861cd447ba65c6a037cd7dd24f473 | [
"MIT"
] | 3 | 2021-09-13T09:44:00.000Z | 2021-11-10T01:13:39.000Z | src/modules/encoders.py | dumpmemory/Multimodal-Infomax | 9a6dc8f2bfa861cd447ba65c6a037cd7dd24f473 | [
"MIT"
] | 13 | 2021-09-03T00:39:57.000Z | 2022-03-28T04:41:38.000Z | import torch
import torch.nn.functional as F
import time
from torch import nn
from torch.nn.utils.rnn import pad_sequence, pack_padded_sequence, pad_packed_sequence
from transformers import BertModel, BertConfig
def add_noise(x, intens=1e-7):
return x + torch.rand(x.size()) * intens
class LanguageEmbeddingLayer(... | 39.64 | 170 | 0.587377 |
32692a06cfd30e4410eb4e98798ea9c43842c676 | 3,020 | py | Python | utils/preciseBN.py | Guangjun-A/---11- | 43ecfae86e5785410d5812d22700bf32397a75e1 | [
"Apache-2.0"
] | null | null | null | utils/preciseBN.py | Guangjun-A/---11- | 43ecfae86e5785410d5812d22700bf32397a75e1 | [
"Apache-2.0"
] | null | null | null | utils/preciseBN.py | Guangjun-A/---11- | 43ecfae86e5785410d5812d22700bf32397a75e1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2021/10/22 10:39
# @Author : Jun
import paddle
import itertools
from tqdm import tqdm
"""
Implement precise bn, which is useful for improving accuracy.
"""
@paddle.no_grad() # speed up and save CUDA memory
def do_preciseBN(model, data_loader,... | 39.736842 | 134 | 0.637086 |
dc6c2c7e7d564e49004d496a153aae8e1016025b | 7,781 | py | Python | util/verification.py | nhannguyen2709/face.evoLVe.PyTorch | 3e617a9cf64f4b35b323ebd11add41acd1bb147a | [
"MIT"
] | 2,716 | 2019-01-04T03:54:45.000Z | 2021-08-12T17:13:41.000Z | util/verification.py | ChenZehao0915/face.evoLVe | 9a3af4b5eabfd3603ae3a8edfce0775bdb0f78dc | [
"MIT"
] | 159 | 2019-01-14T06:57:31.000Z | 2021-08-09T13:27:13.000Z | util/verification.py | ChenZehao0915/face.evoLVe | 9a3af4b5eabfd3603ae3a8edfce0775bdb0f78dc | [
"MIT"
] | 681 | 2019-01-06T12:08:07.000Z | 2021-08-05T16:25:28.000Z | """Helper for evaluation on the Labeled Faces in the Wild dataset
"""
# MIT License
#
# Copyright (c) 2016 David Sandberg
#
# 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 restrictio... | 44.976879 | 156 | 0.672921 |
b4291252852b8a16347b0f1e3bbd28e5eff9576e | 633 | py | Python | pypy/interpreter/astcompiler/consts.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 381 | 2018-08-18T03:37:22.000Z | 2022-02-06T23:57:36.000Z | pypy/interpreter/astcompiler/consts.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 16 | 2018-09-22T18:12:47.000Z | 2022-02-22T20:03:59.000Z | pypy/interpreter/astcompiler/consts.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 55 | 2015-08-16T02:41:30.000Z | 2022-03-20T20:33:35.000Z | """
Various flags used during the compilation process.
"""
CO_OPTIMIZED = 0x0001
CO_NEWLOCALS = 0x0002
CO_VARARGS = 0x0004
CO_VARKEYWORDS = 0x0008
CO_NESTED = 0x0010
CO_GENERATOR = 0x0020
CO_NOFREE = 0x0040
CO_GENERATOR_ALLOWED = 0x1000
CO_FUTURE_DIVISION = 0x2000
CO_FUTURE_ABSOLUTE_IMPORT = 0x4000
CO_FUTURE_WITH_STAT... | 24.346154 | 64 | 0.827804 |
1941f88c978bad03d0445f6f15bdd408180bf22c | 1,378 | py | Python | schoolNameOnly/school.py | ShouravAhmed/Educational-Organization-List | 7d85d85c6dcc2e3d5a568bcd534d62ca2f5aaed0 | [
"MIT"
] | null | null | null | schoolNameOnly/school.py | ShouravAhmed/Educational-Organization-List | 7d85d85c6dcc2e3d5a568bcd534d62ca2f5aaed0 | [
"MIT"
] | null | null | null | schoolNameOnly/school.py | ShouravAhmed/Educational-Organization-List | 7d85d85c6dcc2e3d5a568bcd534d62ca2f5aaed0 | [
"MIT"
] | null | null | null | import requests
import json
import time
import os
projectPath = os.path.normpath(os.getcwd() + os.sep + os.pardir)
class hipoUniDomainList():
def __init__(self):
self.finalData = dict()
self.finalData["source"] = "https://github.com/MLH/mlh-policies/blob/master/schools.csv"
self.finalData[... | 32.046512 | 104 | 0.576923 |
935d933f8322bb0b160fd5a7069e038ffaa4c3e0 | 25 | py | Python | scripts/portal/dojang_exit.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 54 | 2019-04-16T23:24:48.000Z | 2021-12-18T11:41:50.000Z | scripts/portal/dojang_exit.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 3 | 2019-05-19T15:19:41.000Z | 2020-04-27T16:29:16.000Z | scripts/portal/dojang_exit.py | G00dBye/YYMS | 1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb | [
"MIT"
] | 49 | 2020-11-25T23:29:16.000Z | 2022-03-26T16:20:24.000Z | sm.warpOutByUnityPortal() | 25 | 25 | 0.88 |
25a5077c15fd3c1fd56d7cde8ceb39dcca6111a5 | 729 | py | Python | project1/srv/api/__init__.py | mission-liao/flask_template | 59bc2572914363ec14baff7a99ba7ca06b16bed5 | [
"MIT"
] | null | null | null | project1/srv/api/__init__.py | mission-liao/flask_template | 59bc2572914363ec14baff7a99ba7ca06b16bed5 | [
"MIT"
] | null | null | null | project1/srv/api/__init__.py | mission-liao/flask_template | 59bc2572914363ec14baff7a99ba7ca06b16bed5 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from flask.ext.login import LoginManager
from flask.ext.sqlalchemy import SQLAlchemy
from itsdangerous import URLSafeTimedSerializer
from ..utils import register_all_blueprints
from ..factory import create_app, create_rest_app
# globals to avoid import error
app = create_app()
lo... | 28.038462 | 68 | 0.816187 |
d187c315ec76246e4e76c29ecfee18df307e90bf | 953 | py | Python | test/test_http20.py | KOLANICH-libs/hyper | 136040d443583090dd62dbc88cb963f6eaf09e4b | [
"MIT"
] | 831 | 2015-01-08T13:41:56.000Z | 2019-07-14T09:45:28.000Z | test/test_http20.py | KOLANICH-libs/hyper | 136040d443583090dd62dbc88cb963f6eaf09e4b | [
"MIT"
] | 309 | 2015-01-24T09:19:23.000Z | 2019-06-24T16:59:33.000Z | test/test_http20.py | KOLANICH-libs/hyper | 136040d443583090dd62dbc88cb963f6eaf09e4b | [
"MIT"
] | 168 | 2015-01-24T08:29:05.000Z | 2019-06-24T15:44:05.000Z | # -*- coding: utf-8 -*-
"""
test_http20.py
~~~~~~~~~~~~~~
Unit tests for hyper's HTTP/2.0 implementation.
"""
import pytest
from mock import patch
from server import SocketLevelTest
class TestHTTP20Connection(SocketLevelTest):
h2 = True
def test_useful_error_with_no_protocol(self):
self.set_up()
... | 22.162791 | 66 | 0.571878 |
d0d7285d41a15d52d8f5a4891712e1d660ca8f87 | 19,587 | py | Python | bot.py | egor5q/FabricaManagers | b0257f8c423800d74372dba5706200fc572790a3 | [
"MIT"
] | null | null | null | bot.py | egor5q/FabricaManagers | b0257f8c423800d74372dba5706200fc572790a3 | [
"MIT"
] | null | null | null | bot.py | egor5q/FabricaManagers | b0257f8c423800d74372dba5706200fc572790a3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import telebot
import time
import random
import threading
from emoji import emojize
from telebot import types
from pymongo import MongoClient
import traceback
token = os.environ['TELEGRAM_TOKEN']
bot = telebot.TeleBot(token)
client=MongoClient(os.environ['database'])
db=client.fabr... | 36.748593 | 172 | 0.543932 |
bd75d9dedeb79fbcdac9d28cf66e8e548e8ac254 | 1,444 | py | Python | optimus/server/server.py | gaybro8777/Optimus | a64e9ed365aee667a9198372bba478ce69cd280e | [
"Apache-2.0"
] | 1 | 2020-03-24T19:45:36.000Z | 2020-03-24T19:45:36.000Z | optimus/server/server.py | EdwardPlata/Optimus | a64e9ed365aee667a9198372bba478ce69cd280e | [
"Apache-2.0"
] | 8 | 2020-11-13T18:58:19.000Z | 2022-02-10T02:01:47.000Z | optimus/server/server.py | gaybro8777/Optimus | a64e9ed365aee667a9198372bba478ce69cd280e | [
"Apache-2.0"
] | 1 | 2020-03-24T18:43:48.000Z | 2020-03-24T18:43:48.000Z | import logging
import os
import signal
from psutil import NoSuchProcess
from optimus.server.process import Process
class Server:
def __init__(self, path=None):
if path is None:
path = "python " + os.path.dirname(os.path.abspath(__file__)) + "\\run.py"
self.process = None
sel... | 26.740741 | 92 | 0.562327 |
42a47a635a569c9eb20f2f34cbc0782ae43883cd | 1,875 | py | Python | rllib/models/tests/test_lstms.py | spillai/ray | 8b4cb45088a170e37d7d92c2e8a3dacddf67e1bc | [
"Apache-2.0"
] | 2 | 2022-03-25T04:15:10.000Z | 2022-03-25T04:15:15.000Z | rllib/models/tests/test_lstms.py | spillai/ray | 8b4cb45088a170e37d7d92c2e8a3dacddf67e1bc | [
"Apache-2.0"
] | 227 | 2021-10-01T08:00:01.000Z | 2021-12-28T16:47:26.000Z | rllib/models/tests/test_lstms.py | bladesaber/ray | 107001d8b8bea0672d5e987341bd6bfcc4a1420e | [
"Apache-2.0"
] | null | null | null | from gym.spaces import Box, Dict, Discrete, MultiDiscrete, Tuple
import unittest
import ray
from ray import tune
from ray.rllib.examples.env.random_env import RandomEnv
from ray.rllib.utils.test_utils import framework_iterator
class TestLSTMs(unittest.TestCase):
@classmethod
def setUpClass(cls) -> None:
... | 30.241935 | 73 | 0.4976 |
3b1eb0252db501e208a542a3d56fe727688628f6 | 2,584 | py | Python | data/p4VQE/R2/benchmark/startQiskit_QC85.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R2/benchmark/startQiskit_QC85.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R2/benchmark/startQiskit_QC85.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=12
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
import networkx as nx
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collectio... | 27.489362 | 118 | 0.634288 |
fe30aa1303bd0a88a09044201a7dac1aaf7828d2 | 1,644 | py | Python | song_analyzer.py | GuMiner/playlist-dj | e26ccb59f43f058a2af4bba4edd5287bb3122447 | [
"MIT"
] | null | null | null | song_analyzer.py | GuMiner/playlist-dj | e26ccb59f43f058a2af4bba4edd5287bb3122447 | [
"MIT"
] | null | null | null | song_analyzer.py | GuMiner/playlist-dj | e26ccb59f43f058a2af4bba4edd5287bb3122447 | [
"MIT"
] | null | null | null | import concurrent.futures
import subprocess
from config import environment, song_db
def scan_files(files, progress):
with concurrent.futures.ThreadPoolExecutor(max_workers=20) as executor:
futures = [executor.submit(_scan_file, file, progress) for file in files]
return [future.result() for future... | 34.25 | 98 | 0.673358 |
92a67a05188306341e23859505f13ab982d23ebc | 644 | py | Python | dm_page/migrations/0055_auto_20210910_1417.py | AlexanderHalsey/Donation-Manager | 5655d1eb6394f7db9a178c081039c4e149ef6998 | [
"Unlicense"
] | null | null | null | dm_page/migrations/0055_auto_20210910_1417.py | AlexanderHalsey/Donation-Manager | 5655d1eb6394f7db9a178c081039c4e149ef6998 | [
"Unlicense"
] | null | null | null | dm_page/migrations/0055_auto_20210910_1417.py | AlexanderHalsey/Donation-Manager | 5655d1eb6394f7db9a178c081039c4e149ef6998 | [
"Unlicense"
] | null | null | null | # Generated by Django 3.1.7 on 2021-09-10 14:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dm_page', '0054_auto_20210910_1141'),
]
operations = [
migrations.RemoveField(
model_name='recettesfiscale',
name='r... | 23.851852 | 58 | 0.580745 |
044bca71ce9c81c4a2dc344cdb397efa96d5c79c | 2,918 | py | Python | SLAM_Lectures/Unit_D/slam_07_e_measurement_derivative_question.py | yubaoliu/AISLAM | b12bba78b17ca61253ee0584927e3efaaa3d13d8 | [
"MIT"
] | null | null | null | SLAM_Lectures/Unit_D/slam_07_e_measurement_derivative_question.py | yubaoliu/AISLAM | b12bba78b17ca61253ee0584927e3efaaa3d13d8 | [
"MIT"
] | null | null | null | SLAM_Lectures/Unit_D/slam_07_e_measurement_derivative_question.py | yubaoliu/AISLAM | b12bba78b17ca61253ee0584927e3efaaa3d13d8 | [
"MIT"
] | null | null | null | # This adds the derivative of the measurement function h,
# with respect to the state.
#
# slam_07_e_measurement_derivative
# Claus Brenner, 12.12.2012
from lego_robot import *
from math import sqrt, atan2, sin, cos
from numpy import *
class ExtendedKalmanFilter:
@staticmethod
def h(state, landm... | 38.394737 | 88 | 0.646333 |
3b510f22a0e848949f602eebf24d5a069bb55a13 | 2,481 | py | Python | Char6 AlphaGo/resnet.py | rh01/Deep-reinforcement-learning-with-pytorch | fd1853495b885514927c82834f562d2a4df06b28 | [
"MIT"
] | 1 | 2019-11-30T17:47:31.000Z | 2019-11-30T17:47:31.000Z | Char6 AlphaGo/resnet.py | rh01/Deep-reinforcement-learning-with-pytorch | fd1853495b885514927c82834f562d2a4df06b28 | [
"MIT"
] | null | null | null | Char6 AlphaGo/resnet.py | rh01/Deep-reinforcement-learning-with-pytorch | fd1853495b885514927c82834f562d2a4df06b28 | [
"MIT"
] | 2 | 2021-05-25T06:40:50.000Z | 2021-09-20T12:38:55.000Z | from torch import nn
from torch.nn import functional as F
import torch as t
import numpy as np
import time
class ResidualBlock(nn.Module):
'''
Implement ResidualBlock
'''
def __init__(self, inchannel, outchannel, stride=1, shortcut=None):
super(ResidualBlock,self).__init__()
self.left=... | 27.876404 | 77 | 0.583233 |
34478f76ff8ff3fb495ce42066394f1ebfa98470 | 3,168 | py | Python | generate-file-list.py | jamesbak/databox-adls-loader | 1189ba399f63d34d797f51b3a9e655101587d798 | [
"Apache-2.0"
] | null | null | null | generate-file-list.py | jamesbak/databox-adls-loader | 1189ba399f63d34d797f51b3a9e655101587d798 | [
"Apache-2.0"
] | null | null | null | generate-file-list.py | jamesbak/databox-adls-loader | 1189ba399f63d34d797f51b3a9e655101587d798 | [
"Apache-2.0"
] | 1 | 2021-01-06T03:17:23.000Z | 2021-01-06T03:17:23.000Z | #!/usr/bin/env python
import sys, subprocess, logging, itertools, argparse
log = logging.getLogger(__name__)
def processDirectoryIntoUnits(sourceDir, unitSize, dirAllocations, unitsSpaceAvailable):
log.info("Calculating directory sizes for '%s'", sourceDir)
startIdx = len(dirAllocations)
process = subpro... | 59.773585 | 170 | 0.661616 |
f8c7247a4c0c29892ce1e49eb2f6596e1334c8ec | 467 | py | Python | app/orders/domain/product_repository.py | jcazallasc/burriking-citibox | 30f0a4520bedb6b9ba613e8cf279b37f0cc60704 | [
"MIT"
] | null | null | null | app/orders/domain/product_repository.py | jcazallasc/burriking-citibox | 30f0a4520bedb6b9ba613e8cf279b37f0cc60704 | [
"MIT"
] | null | null | null | app/orders/domain/product_repository.py | jcazallasc/burriking-citibox | 30f0a4520bedb6b9ba613e8cf279b37f0cc60704 | [
"MIT"
] | null | null | null | import abc
from orders.domain.entities.product_entity import ProductEntity
from orders.domain.entities.product_option_entity import ProductOptionEntity
class ProductRepository(metaclass=abc.ABCMeta):
@abc.abstractmethod
def get_product(self, product_uuid: str) -> ProductEntity:
raise NotImplementedE... | 29.1875 | 82 | 0.794433 |
440237dbca830425662bbf1d6e95d13d75c4e6aa | 12,901 | py | Python | tests/unit/plugins/openstack/scenarios/heat/test_stacks.py | varuntiwari27/rally | 948fba0e8fe8214dd3716451d2a52e014a4115be | [
"Apache-2.0"
] | null | null | null | tests/unit/plugins/openstack/scenarios/heat/test_stacks.py | varuntiwari27/rally | 948fba0e8fe8214dd3716451d2a52e014a4115be | [
"Apache-2.0"
] | null | null | null | tests/unit/plugins/openstack/scenarios/heat/test_stacks.py | varuntiwari27/rally | 948fba0e8fe8214dd3716451d2a52e014a4115be | [
"Apache-2.0"
] | null | null | null | # Copyright 2014: Mirantis Inc.
# 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 b... | 44.486207 | 79 | 0.69483 |
6dced3aba7f8005b63a74c2dc5fad36b7be6287b | 1,763 | py | Python | onnxruntime/python/backend/backend_rep.py | mszhanyi/onnxruntime | 6f85d3e5c81c919022ac4a77e5a051da8518b15d | [
"MIT"
] | 669 | 2018-12-03T22:00:31.000Z | 2019-05-06T19:42:49.000Z | onnxruntime/python/backend/backend_rep.py | mszhanyi/onnxruntime | 6f85d3e5c81c919022ac4a77e5a051da8518b15d | [
"MIT"
] | 440 | 2018-12-03T21:09:56.000Z | 2019-05-06T20:47:23.000Z | onnxruntime/python/backend/backend_rep.py | mszhanyi/onnxruntime | 6f85d3e5c81c919022ac4a77e5a051da8518b15d | [
"MIT"
] | 140 | 2018-12-03T21:15:28.000Z | 2019-05-06T18:02:36.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
# --------------------------------------------------------------------------
"""
Implements ONNX's backend API.
"""
from typing import Any, Tuple
fro... | 32.648148 | 78 | 0.528077 |
6f4e57f0b9738b19cc4851efd69ed44d592f27fe | 11,166 | py | Python | pyprob/util.py | bayesianbrad/pyprob | a426fc51c1d6da13052979c21af447f9c4023642 | [
"BSD-2-Clause"
] | 1 | 2019-09-21T21:37:50.000Z | 2019-09-21T21:37:50.000Z | pyprob/util.py | bayesianbrad/pyprob | a426fc51c1d6da13052979c21af447f9c4023642 | [
"BSD-2-Clause"
] | null | null | null | pyprob/util.py | bayesianbrad/pyprob | a426fc51c1d6da13052979c21af447f9c4023642 | [
"BSD-2-Clause"
] | null | null | null | import torch
import numpy as np
import random
from termcolor import colored
import inspect
import os
import sys
import enum
import time
import math
from functools import reduce
import operator
import datetime
import inspect
import torch.multiprocessing
from .distributions import Categorical
torch.multiprocessing.set_... | 28.125945 | 322 | 0.653412 |
89158894169076a6b53aa0500320c8679af87079 | 848 | py | Python | app/services/task_service.py | matiasz8/trello_app | 16dd43c293f1d78a9ba03225b5d63ac2a8400764 | [
"MIT"
] | null | null | null | app/services/task_service.py | matiasz8/trello_app | 16dd43c293f1d78a9ba03225b5d63ac2a8400764 | [
"MIT"
] | null | null | null | app/services/task_service.py | matiasz8/trello_app | 16dd43c293f1d78a9ba03225b5d63ac2a8400764 | [
"MIT"
] | null | null | null | import logging
from pydantic import ValidationError
from app.models.trello import TaskCard
from app.services.trello_service import service_trello
logger = logging.getLogger(__name__)
class TaskService():
"""Service who handle Task data."""
@classmethod
def publish_task(cls, payload: dict) -> str:
... | 28.266667 | 91 | 0.637972 |
6dad0f6239463e0df80ec4622516e3f3e12958c1 | 19,823 | py | Python | Indel_searcher_2/Run_indel_searcher.py | CRISPRJWCHOI/CRISPR_toolkit | e903e4476dad29b9b0a1301019ec023308355eb5 | [
"MIT"
] | 6 | 2020-06-12T00:52:07.000Z | 2021-12-08T07:15:19.000Z | Indel_searcher_2/Run_indel_searcher.py | CRISPRJWCHOI/CRISPR_toolkit | e903e4476dad29b9b0a1301019ec023308355eb5 | [
"MIT"
] | 1 | 2021-05-18T01:44:24.000Z | 2021-05-18T02:01:09.000Z | Indel_searcher_2/Run_indel_searcher.py | CRISPRJWCHOI/CRISPR_toolkit | e903e4476dad29b9b0a1301019ec023308355eb5 | [
"MIT"
] | 2 | 2020-12-09T11:42:16.000Z | 2021-05-08T03:59:35.000Z | import os, re, sys, math, logging
import cPickle as pickle
import subprocess as sp
from pdb import set_trace
from datetime import datetime
from optparse import OptionParser
sys.path.insert(0, os.path.dirname(os.getcwd()))
from Core.CoreSystem import InitialFolder, UserFolderAdmin, Helper, RunMulticore, CheckProcesse... | 54.161202 | 241 | 0.58528 |
f0807387cc61b5c1fd006f4521e3eb1549910df0 | 7,141 | py | Python | electrum/plugins/ledger/auth2fa.py | ben-abraham/electrum-ravencoin | 597d27b722be1f8bea4e33e69deadb3dc8348340 | [
"MIT"
] | 28 | 2021-04-03T21:30:17.000Z | 2022-02-22T08:13:14.000Z | electrum/plugins/ledger/auth2fa.py | ben-abraham/electrum-ravencoin | 597d27b722be1f8bea4e33e69deadb3dc8348340 | [
"MIT"
] | 37 | 2021-05-26T14:08:10.000Z | 2022-02-09T23:25:07.000Z | electrum/plugins/ledger/auth2fa.py | ben-abraham/electrum-ravencoin | 597d27b722be1f8bea4e33e69deadb3dc8348340 | [
"MIT"
] | 13 | 2021-04-09T20:22:32.000Z | 2021-12-17T17:18:51.000Z | import copy
from typing import TYPE_CHECKING
from PyQt5.QtWidgets import (QDialog, QLineEdit, QTextEdit, QVBoxLayout, QLabel,
QWidget, QHBoxLayout, QComboBox)
from btchip.btchip import BTChipException
from electrum.gui.qt.util import PasswordLineEdit
from electrum.i18n import _
from ele... | 42.254438 | 157 | 0.612379 |
e7353cd32adb5cfb015dc5d57fcbf8bac501a2c5 | 2,288 | py | Python | mapreduce/mapper-bmojo.py | Ostoja/big-data-project | 3178dfe9e18c71900910c72aa9a621b2092340fb | [
"MIT"
] | 1 | 2019-02-19T09:40:25.000Z | 2019-02-19T09:40:25.000Z | mapreduce/mapper-bmojo.py | Ostoja/big-data-project | 3178dfe9e18c71900910c72aa9a621b2092340fb | [
"MIT"
] | null | null | null | mapreduce/mapper-bmojo.py | Ostoja/big-data-project | 3178dfe9e18c71900910c72aa9a621b2092340fb | [
"MIT"
] | null | null | null | #Mapper za spajanje tabela bmojoweek.tsv i bmojoall.tsv.
import sys
for line in sys.stdin:
try:
movie_id = "-1"
year = "-1"
calendarWeek = "-1"
date = "-1"
rank = "-1"
boxOffice = "-1"
theatres = "-1"
grossBoxOffice = "-1"
... | 36.903226 | 418 | 0.578671 |
d7fec50805574596e553d4a3e247ded560846a97 | 4,715 | py | Python | model/vgg_s/vgg_s.py | rawrawiz/ICNN | 145be374d690bdec32d3a358259584125d08f246 | [
"MIT"
] | 38 | 2020-11-24T13:34:49.000Z | 2022-03-22T13:03:57.000Z | model/vgg_s/vgg_s.py | rawrawiz/ICNN | 145be374d690bdec32d3a358259584125d08f246 | [
"MIT"
] | 9 | 2020-11-03T07:51:23.000Z | 2022-03-11T03:46:19.000Z | model/vgg_s/vgg_s.py | rawrawiz/ICNN | 145be374d690bdec32d3a358259584125d08f246 | [
"MIT"
] | 15 | 2021-01-14T01:43:04.000Z | 2022-03-28T09:21:19.000Z | # -*- coding: utf-8 -*-
import h5py
import math
import copy
import scipy.io as io
from scipy.io import loadmat
import torch
import torch.nn as nn
import torch.nn.functional as F
from model.vgg_s.conv_mask import conv_mask
class vgg_s(nn.Module):
def __init__(self, pretrain_path, label_num, dropou... | 43.657407 | 141 | 0.566066 |
a609fd96b60a5845fd036d05d52198fd305d1b58 | 538 | py | Python | src/main/python/logger.py | ajmitc/addresslabel | 5d2267939a01787a86205617087ce8fe3790ec7d | [
"MIT"
] | null | null | null | src/main/python/logger.py | ajmitc/addresslabel | 5d2267939a01787a86205617087ce8fe3790ec7d | [
"MIT"
] | null | null | null | src/main/python/logger.py | ajmitc/addresslabel | 5d2267939a01787a86205617087ce8fe3790ec7d | [
"MIT"
] | null | null | null |
class Logger( object ):
def __init__( self, prefix ):
self.prefix = prefix
def write( self, lvl, text ):
print "[%s] %s - %s" % (lvl, self.prefix, text)
def info( self, text ):
self.write( "INFO", text )
def warning( self, text ):
self.write( "WARNING", text )
... | 15.371429 | 55 | 0.540892 |
65a4ca6ec54aae0fe4ed4c9fb920b5b40a7dd95c | 35,248 | py | Python | src/tools/analyzer.py | Hiestaa/my-tornado-media-library | 6decb97ad02d0ee1613c53dbb1729474e2ea9b42 | [
"MIT"
] | 1 | 2019-09-14T20:46:23.000Z | 2019-09-14T20:46:23.000Z | src/tools/analyzer.py | Hiestaa/my-tornado-media-library | 6decb97ad02d0ee1613c53dbb1729474e2ea9b42 | [
"MIT"
] | null | null | null | src/tools/analyzer.py | Hiestaa/my-tornado-media-library | 6decb97ad02d0ee1613c53dbb1729474e2ea9b42 | [
"MIT"
] | 1 | 2021-08-24T03:20:46.000Z | 2021-08-24T03:20:46.000Z | # -*- coding: utf8 -*-
from __future__ import unicode_literals
from collections import deque
import logging
from threading import Thread
from enum import Enum
import time
import os
import subprocess
import io
import json
from datetime import datetime
from conf import Conf
from tools.utils import extends
from server ... | 43.950125 | 190 | 0.609368 |
83c2f213eb5556f064d6f92cdc001c766fc698ca | 1,411 | py | Python | test_station.py | Tim-Bonner-1825/Flood-Warning-System | d6d2c232216de521a8ba196e175ee59e820dd1c2 | [
"MIT"
] | null | null | null | test_station.py | Tim-Bonner-1825/Flood-Warning-System | d6d2c232216de521a8ba196e175ee59e820dd1c2 | [
"MIT"
] | null | null | null | test_station.py | Tim-Bonner-1825/Flood-Warning-System | d6d2c232216de521a8ba196e175ee59e820dd1c2 | [
"MIT"
] | null | null | null | # Copyright (C) 2018 Garth N. Wells
#
# SPDX-License-Identifier: MIT
"""Unit test for the station module"""
from floodsystem.station import MonitoringStation
from floodsystem.station import inconsistent_typical_range_stations
def test_create_monitoring_station():
# Create a station
s_id = "test-s-id"
m_... | 28.795918 | 84 | 0.671155 |
993bdb1ac956a123bd969b139a857b9e621f4e06 | 5,125 | py | Python | backends/utils_test.py | Wassaf-Shahzad/micromasters | b1340a8c233499b1d8d22872a6bc1fe7f49fd323 | [
"BSD-3-Clause"
] | null | null | null | backends/utils_test.py | Wassaf-Shahzad/micromasters | b1340a8c233499b1d8d22872a6bc1fe7f49fd323 | [
"BSD-3-Clause"
] | 5 | 2021-03-02T01:42:17.000Z | 2021-06-10T20:42:02.000Z | backends/utils_test.py | umarmughal824/micromasters | ea92d3bcea9be4601150fc497302ddacc1161622 | [
"BSD-3-Clause"
] | null | null | null | """
Tests for the utils
"""
from datetime import timedelta
from unittest.mock import (
MagicMock,
patch,
)
from requests.exceptions import HTTPError
from backends import utils
from backends.edxorg import EdxOrgOAuth2
from micromasters.utils import now_in_utc
from profiles.factories import UserFactory
from sea... | 40.354331 | 103 | 0.686634 |
4668e45e7b4f7aee6a860a6306fc3156761aca36 | 24 | py | Python | interface/__init__.py | fgaspar/myhome | 9942364f913870d3eed3a0a6536872ebf4c83a0c | [
"MIT"
] | null | null | null | interface/__init__.py | fgaspar/myhome | 9942364f913870d3eed3a0a6536872ebf4c83a0c | [
"MIT"
] | null | null | null | interface/__init__.py | fgaspar/myhome | 9942364f913870d3eed3a0a6536872ebf4c83a0c | [
"MIT"
] | null | null | null | __all__ = ['interface']
| 12 | 23 | 0.666667 |
e9b48b1089dc4566b4a76f2d0200acde575b152c | 418 | py | Python | LeetCode/Python3/0049._Group_Anagrams.py | icgw/LeetCode | cb70ca87aa4604d1aec83d4224b3489eacebba75 | [
"MIT"
] | 4 | 2018-09-12T09:32:17.000Z | 2018-12-06T03:17:38.000Z | LeetCode/Python3/0049._Group_Anagrams.py | icgw/algorithm | cb70ca87aa4604d1aec83d4224b3489eacebba75 | [
"MIT"
] | null | null | null | LeetCode/Python3/0049._Group_Anagrams.py | icgw/algorithm | cb70ca87aa4604d1aec83d4224b3489eacebba75 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
class Solution:
def groupAnagrams(self, strs):
"""
:type strs: List[str]
:rtype: List[List[str]]
"""
d = {}
for w in sorted(strs):
k = tuple(sorted(w))
d[k] = d.get(k, []) + [w]
return list(d.values())
if __name_... | 24.588235 | 79 | 0.480861 |
79a1e5ef1d26cd00b08462c080b82eab439bf54c | 106 | py | Python | projecteuler/021.py | Alu0331/python | 0a751b5acf067eae1b04e8f34559b7f580317cb3 | [
"MIT"
] | null | null | null | projecteuler/021.py | Alu0331/python | 0a751b5acf067eae1b04e8f34559b7f580317cb3 | [
"MIT"
] | 1 | 2020-12-30T14:34:06.000Z | 2020-12-31T12:00:29.000Z | projecteuler/021.py | Alu0331/python | 0a751b5acf067eae1b04e8f34559b7f580317cb3 | [
"MIT"
] | null | null | null | def sum_div(n):
s = 0
for i in range(1,n):
if n % i == 0:
s += i
return s
p = sum_div(4)
print(p) | 11.777778 | 21 | 0.518868 |
384569875f61d88664c33dc5e5d4450b098a23ff | 6,519 | py | Python | volttron/platform/vip/agent/subsystems/peerlist.py | cloudcomputingabc/volttron | 6495e26e3185a7af8d0d79ad2586bdf8ea83992d | [
"Apache-2.0",
"BSD-2-Clause"
] | 406 | 2015-01-20T03:08:53.000Z | 2022-03-31T20:59:07.000Z | volttron/platform/vip/agent/subsystems/peerlist.py | cloudcomputingabc/volttron | 6495e26e3185a7af8d0d79ad2586bdf8ea83992d | [
"Apache-2.0",
"BSD-2-Clause"
] | 2,031 | 2015-01-05T21:35:45.000Z | 2022-03-29T21:44:36.000Z | volttron/platform/vip/agent/subsystems/peerlist.py | cloudcomputingabc/volttron | 6495e26e3185a7af8d0d79ad2586bdf8ea83992d | [
"Apache-2.0",
"BSD-2-Clause"
] | 219 | 2015-01-20T14:53:57.000Z | 2022-03-06T00:37:41.000Z | # -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright 2020, Battelle Memorial Institute.
#
# 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... | 36.418994 | 87 | 0.597331 |
c05c326a3ca5f5c7e9a0bc4e2d55e4d57c5b8082 | 58,858 | py | Python | chunkflow/flow/flow.py | fcollman/chunkflow | 5834d406d4fc3579bae37edfb50a11dc67f4a1a3 | [
"Apache-2.0"
] | null | null | null | chunkflow/flow/flow.py | fcollman/chunkflow | 5834d406d4fc3579bae37edfb50a11dc67f4a1a3 | [
"Apache-2.0"
] | null | null | null | chunkflow/flow/flow.py | fcollman/chunkflow | 5834d406d4fc3579bae37edfb50a11dc67f4a1a3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
from functools import update_wrapper, wraps
from time import time
import numpy as np
import click
from cloudvolume.lib import Bbox, Vec, yellow
# from cloudvolume.datasource.precomputed.metadata import PrecomputedMetadata
from cloudvolume import CloudVolume
from cloudvolume.... | 42.619841 | 106 | 0.608991 |
74aa3189edf31358530a2cc3eda835129287c4f1 | 12,806 | py | Python | audio2video/loadstore.py | Junlin-Yin/audio2video-v1 | 43a6a0ace3c27ed51e73e64c796ed38fa05e9f61 | [
"MIT"
] | 2 | 2020-05-24T21:16:19.000Z | 2020-05-24T21:16:21.000Z | audio2video/loadstore.py | Junlin-Yin/audio2video-v1 | 43a6a0ace3c27ed51e73e64c796ed38fa05e9f61 | [
"MIT"
] | null | null | null | audio2video/loadstore.py | Junlin-Yin/audio2video-v1 | 43a6a0ace3c27ed51e73e64c796ed38fa05e9f61 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import tensorflow as tf
import numpy as np
import os
import math
import random
import bisect
import pickle
from __init__ import ref_dir, trn_dir, raw_mfcc_dir, raw_fids_dir, inp_dir
from visual import vfps
def load_raw(vali_rate):
inps = {'tra... | 40.653968 | 119 | 0.569811 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.