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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
85720a88db5024722bcc1458b131d3934654bee2 | 13,346 | py | Python | tftest.py | spookiej/terraform-python-testing-helper | bd74b0b4be6e3e25a10ceff475adf4dc727b2e9d | [
"Apache-2.0"
] | null | null | null | tftest.py | spookiej/terraform-python-testing-helper | bd74b0b4be6e3e25a10ceff475adf4dc727b2e9d | [
"Apache-2.0"
] | null | null | null | tftest.py | spookiej/terraform-python-testing-helper | bd74b0b4be6e3e25a10ceff475adf4dc727b2e9d | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 34.485788 | 89 | 0.690019 |
beb8d7c72c286a206fbc406be755d27ed7d67af5 | 2,954 | py | Python | hood/models.py | tonyishangu/Hoodwatch | b627d1facc46edbd22edb2c22cf864e3310618fc | [
"MIT"
] | null | null | null | hood/models.py | tonyishangu/Hoodwatch | b627d1facc46edbd22edb2c22cf864e3310618fc | [
"MIT"
] | null | null | null | hood/models.py | tonyishangu/Hoodwatch | b627d1facc46edbd22edb2c22cf864e3310618fc | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from django.dispatch import receiver
from django.db.models.signals import post_save
from datetime import datetime
from cloudinary.models import CloudinaryField
class NeighbourHood(models.Model):
name = models.CharField(max_length=50, null=Tr... | 34.348837 | 110 | 0.71564 |
e1742a333d7c6e5ca5f491d44b446f23b10a1f18 | 6,166 | py | Python | probability/discrete/prob_utils.py | vahndi/probability | 6ddf88e6f3d947c96b879e426030f60eb5cb2d59 | [
"MIT"
] | 2 | 2020-02-21T00:47:03.000Z | 2020-09-22T19:00:48.000Z | probability/discrete/prob_utils.py | vahndi/probability | 6ddf88e6f3d947c96b879e426030f60eb5cb2d59 | [
"MIT"
] | 52 | 2020-01-16T16:05:08.000Z | 2022-02-24T15:10:10.000Z | probability/discrete/prob_utils.py | vahndi/probability | 6ddf88e6f3d947c96b879e426030f60eb5cb2d59 | [
"MIT"
] | null | null | null | from typing import Any, Tuple, List, Hashable
from pandas import Series, DataFrame
def _filter_distribution(
distribution: DataFrame,
distribution_name: Hashable,
name_comparator: str, value: Any
) -> Tuple[DataFrame, str]:
"""
Filter probability distribution data using the variable n... | 37.369697 | 80 | 0.632663 |
be26fa82e84568a82164ed32e64e1b532d744971 | 2,620 | py | Python | Old/liaoxuefeng/urllib_first.py | exchris/Pythonlearn | 174f38a86cf1c85d6fc099005aab3568e7549cd0 | [
"MIT"
] | null | null | null | Old/liaoxuefeng/urllib_first.py | exchris/Pythonlearn | 174f38a86cf1c85d6fc099005aab3568e7549cd0 | [
"MIT"
] | 1 | 2018-11-27T09:58:54.000Z | 2018-11-27T09:58:54.000Z | Old/liaoxuefeng/urllib_first.py | exchris/pythonlearn | 174f38a86cf1c85d6fc099005aab3568e7549cd0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2017/7/26 0026 下午 3:49
# @Author : Exchris Tsai
# @Site :
# @File : urllib_first.py
# @Software: PyCharm
__author__ = 'Exchris Tsai'
from urllib import request, parse
from collections import deque
import re
"""
url = r"http://www.ifitshow.com"
data1... | 21.129032 | 60 | 0.559542 |
0068cd4aff51171aece1ff4d29c8d0ea63e4a9fa | 809 | py | Python | sphinx/source/docs/user_guide/examples/interaction_callbacks_js_on_change.py | IuryPiva/bokeh | 25ecf0e460f057a179ae6cdfbc99cdac60e916b2 | [
"BSD-3-Clause"
] | 1 | 2021-04-09T02:57:29.000Z | 2021-04-09T02:57:29.000Z | sphinx/source/docs/user_guide/examples/interaction_callbacks_js_on_change.py | IuryPiva/bokeh | 25ecf0e460f057a179ae6cdfbc99cdac60e916b2 | [
"BSD-3-Clause"
] | 1 | 2021-03-01T14:04:56.000Z | 2021-03-01T14:04:56.000Z | sphinx/source/docs/user_guide/examples/interaction_callbacks_js_on_change.py | IuryPiva/bokeh | 25ecf0e460f057a179ae6cdfbc99cdac60e916b2 | [
"BSD-3-Clause"
] | null | null | null | from bokeh.layouts import column
from bokeh.models import ColumnDataSource, CustomJS, Slider
from bokeh.plotting import Figure, output_file, show
output_file("js_on_change.html")
x = [x*0.005 for x in range(0, 200)]
y = x
source = ColumnDataSource(data=dict(x=x, y=y))
plot = Figure(plot_width=400, plot_height=400)
... | 25.28125 | 66 | 0.666255 |
73f90f6b9ddff70582a3ec86ce334dd582e9acdd | 2,367 | py | Python | hidt/networks/blocks/specnorm.py | constantine7cd/StyleTF | e1fa28735e3c3102a2a857c121a6d8a7d76ae4da | [
"MIT"
] | 638 | 2020-03-14T20:57:24.000Z | 2022-03-31T06:19:14.000Z | hidt/networks/blocks/specnorm.py | constantine7cd/StyleTF | e1fa28735e3c3102a2a857c121a6d8a7d76ae4da | [
"MIT"
] | 13 | 2020-04-02T12:29:10.000Z | 2021-12-27T09:27:22.000Z | hidt/networks/blocks/specnorm.py | constantine7cd/StyleTF | e1fa28735e3c3102a2a857c121a6d8a7d76ae4da | [
"MIT"
] | 83 | 2020-03-20T21:52:52.000Z | 2022-03-01T02:57:25.000Z | __all__ = ['SpectralNorm']
import torch
from torch import nn
def l2normalize(v, eps=1e-12):
return v / (v.norm() + eps)
class SpectralNorm(nn.Module):
"""
Based on the paper "Spectral Normalization for Generative Adversarial Networks" by Takeru Miyato, Toshiki Kataoka, Masanori Koyama, Yuichi Yoshida
... | 34.304348 | 150 | 0.617237 |
26392e2d03a11ff08f11960113bf2c657b1d283c | 1,656 | py | Python | tests/statistical/bayesian/run-bayesian-3.py | JonathanLehner/korali | 90f97d8e2fed2311f988f39cfe014f23ba7dd6cf | [
"MIT"
] | 43 | 2018-07-26T07:20:42.000Z | 2022-03-02T10:23:12.000Z | tests/statistical/bayesian/run-bayesian-3.py | JonathanLehner/korali | 90f97d8e2fed2311f988f39cfe014f23ba7dd6cf | [
"MIT"
] | 212 | 2018-09-21T10:44:07.000Z | 2022-03-22T14:33:05.000Z | tests/statistical/bayesian/run-bayesian-3.py | JonathanLehner/korali | 90f97d8e2fed2311f988f39cfe014f23ba7dd6cf | [
"MIT"
] | 16 | 2018-07-25T15:00:36.000Z | 2022-03-22T14:19:46.000Z | #!/usr/bin/env python3
# In this example, we demonstrate how Korali samples the posterior distribution
# in a bayesian problem where the likelihood is calculated by providing
# reference data points and their objective values.
# Importing the computational model
import sys
sys.path.append('./_model')
from model impor... | 32.470588 | 96 | 0.713768 |
b5ae092ab63cdc3f84ecb87301c51135f4ac0452 | 29,032 | py | Python | places/migrations/0054_auto__add_field_tag_order.py | evrenesat/ganihomes | eece2d8d957989b176cc5a36d723f676862f8d17 | [
"BSD-2-Clause"
] | 24 | 2016-08-06T18:10:54.000Z | 2022-03-04T11:47:39.000Z | places/migrations/0054_auto__add_field_tag_order.py | evrenesat/ganihomes | eece2d8d957989b176cc5a36d723f676862f8d17 | [
"BSD-2-Clause"
] | 1 | 2017-03-28T02:36:50.000Z | 2017-03-28T07:18:57.000Z | places/migrations/0054_auto__add_field_tag_order.py | evrenesat/ganihomes | eece2d8d957989b176cc5a36d723f676862f8d17 | [
"BSD-2-Clause"
] | 13 | 2017-03-28T02:35:32.000Z | 2022-02-21T23:36:15.000Z | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Tag.order'
db.add_column('places_tag', 'order', self.gf('django.db.models.fields.SmallInte... | 85.640118 | 207 | 0.553183 |
004d4774bb916da8f9c38522559dbca8b9de7586 | 972 | py | Python | yardstick/network_services/collector/publisher.py | mythwm/yardstick | ea13581f450c9c44f6f73d383e6a192697a95cc1 | [
"Apache-2.0"
] | 28 | 2017-02-07T07:46:42.000Z | 2021-06-30T08:11:06.000Z | yardstick/network_services/collector/publisher.py | mythwm/yardstick | ea13581f450c9c44f6f73d383e6a192697a95cc1 | [
"Apache-2.0"
] | 6 | 2018-01-18T08:00:54.000Z | 2019-04-11T04:51:41.000Z | yardstick/network_services/collector/publisher.py | mythwm/yardstick | ea13581f450c9c44f6f73d383e6a192697a95cc1 | [
"Apache-2.0"
] | 46 | 2016-12-13T10:05:47.000Z | 2021-02-18T07:33:06.000Z | # Copyright (c) 2016-2017 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-2.0
#
# Unless required by applicable law or agreed... | 32.4 | 77 | 0.704733 |
229477646eeb31b41268ff2203860bd60ee88da8 | 972 | py | Python | utils/common.py | Sult/daf | a4da9e8c96f70577e2490c05e82bdf7d0de1a563 | [
"MIT"
] | null | null | null | utils/common.py | Sult/daf | a4da9e8c96f70577e2490c05e82bdf7d0de1a563 | [
"MIT"
] | null | null | null | utils/common.py | Sult/daf | a4da9e8c96f70577e2490c05e82bdf7d0de1a563 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
from django.conf import settings
from django.utils.timezone import utc
#converts a timestamp to a aware datetime object
def convert_timestamp(timestamp):
try:
temp = datetime.fromtimestamp(timestamp).replace(tzinfo=utc)
return temp
except TypeError:
... | 23.707317 | 69 | 0.667695 |
1d699ec92618e0f59bfcda95478a324ac838c340 | 22,896 | py | Python | src/Algorithms/VertexDynamic.py | Antonio-Cruciani/dynamic-random-graph-generator | 630710aadb8e096ccecfcbcac79f170a97637f77 | [
"CNRI-Python"
] | 3 | 2020-04-06T10:24:06.000Z | 2021-09-26T07:31:03.000Z | src/Algorithms/VertexDynamic.py | Antonio-Cruciani/dynamic-random-graph-generator | 630710aadb8e096ccecfcbcac79f170a97637f77 | [
"CNRI-Python"
] | 2 | 2021-06-18T08:13:26.000Z | 2021-06-18T08:13:36.000Z | src/Algorithms/VertexDynamic.py | Antonio-Cruciani/dynamic-random-graph-generator | 630710aadb8e096ccecfcbcac79f170a97637f77 | [
"CNRI-Python"
] | null | null | null | import networkx as nx
from src.Graphs.Objects.MultipleEdge import DynamicGraph
from src.FileOperations.WriteOnFile import create_file, create_folder, write_on_file_contents
from src.StastModules.Snapshot import get_snapshot_dynamic,get_snapshot_dynamicND
from src.StastModules.SpectralAnalysis import get_spectral_gap_t... | 42.243542 | 151 | 0.505503 |
1f2606a6edf48b7d02fa1b44bd5d2b2ce7d84284 | 2,107 | py | Python | cogs/inactive/ttt.py | MiningMark48/Tidal-Bot | 8db6ecb220fd35930ffe1df5653af7a1ca03c8e9 | [
"MIT"
] | 6 | 2020-08-09T15:43:07.000Z | 2022-03-11T15:12:21.000Z | cogs/inactive/ttt.py | MiningMark48/Tidal-Bot | 8db6ecb220fd35930ffe1df5653af7a1ca03c8e9 | [
"MIT"
] | 6 | 2020-10-29T02:32:40.000Z | 2022-01-13T03:12:45.000Z | cogs/inactive/ttt.py | MiningMark48/Tidal-Bot | 8db6ecb220fd35930ffe1df5653af7a1ca03c8e9 | [
"MIT"
] | 1 | 2021-06-09T08:06:31.000Z | 2021-06-09T08:06:31.000Z | import random
import asyncio
import discord
from discord.ext import commands
from util.decorators import delete_original
class Fun(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(name="tictactoe", aliases=["ttt"])
@delete_original()
async def tic_tac_toe(self, ctx, o... | 30.1 | 146 | 0.565733 |
e0581fdc5d4a5ef3bdec7a3ab8d03481a3b4a90c | 660 | py | Python | setup.py | jaylett/tp_to_statsd | 7ece3ec381cff5b5cfdf26a6daeaf860b07c2ec8 | [
"MIT"
] | null | null | null | setup.py | jaylett/tp_to_statsd | 7ece3ec381cff5b5cfdf26a6daeaf860b07c2ec8 | [
"MIT"
] | null | null | null | setup.py | jaylett/tp_to_statsd | 7ece3ec381cff5b5cfdf26a6daeaf860b07c2ec8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from distutils.core import setup
setup(
name='tp_to_statsd',
version='0.1.2',
description='Record TP figures using statsd.',
author='James Aylett',
author_email='james@tartarus.org',
license='MIT',
packages=['tp_to_statsd',],
scripts=[
'scripts/tp_to_stats... | 23.571429 | 50 | 0.577273 |
0fa81604b71916a190dcd6570f624a2aa8e0f90a | 2,227 | py | Python | sdk/python/pulumi_azure_native/subscription/v20200901/outputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/subscription/v20200901/outputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/subscription/v20200901/outputs.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 32.275362 | 154 | 0.659632 |
88d9f095743a9d95d784dc8bc3fa27767cac9b4f | 3,725 | py | Python | src/tests/api/v1/test_permissions.py | iYasha/studycobra | 097a78e4a3679bfe6934983eb2be77ba76408d77 | [
"MIT"
] | null | null | null | src/tests/api/v1/test_permissions.py | iYasha/studycobra | 097a78e4a3679bfe6934983eb2be77ba76408d77 | [
"MIT"
] | null | null | null | src/tests/api/v1/test_permissions.py | iYasha/studycobra | 097a78e4a3679bfe6934983eb2be77ba76408d77 | [
"MIT"
] | null | null | null | from typing import Any
from typing import List
from typing import Tuple
import pytest
from fastapi.routing import APIRoute
from sso_auth.utils import is_ignored_path
from main import app as fs_app
from starlette import convertors
from starlette import status
from starlette.testclient import TestClient
from tests.utils... | 31.041667 | 80 | 0.679195 |
f18cc8c429f842f41a72b3a040f6f5f291eccae7 | 1,508 | py | Python | imperative/python/test/integration/test_save_load.py | yang-shuohao/MegEngine | 2e8742086563ea442c357b14560245c54e0aa0a3 | [
"Apache-2.0"
] | 1 | 2020-12-11T04:08:25.000Z | 2020-12-11T04:08:25.000Z | imperative/python/test/integration/test_save_load.py | yang-shuohao/MegEngine | 2e8742086563ea442c357b14560245c54e0aa0a3 | [
"Apache-2.0"
] | null | null | null | imperative/python/test/integration/test_save_load.py | yang-shuohao/MegEngine | 2e8742086563ea442c357b14560245c54e0aa0a3 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import megengine as mge
import megengine.autodiff as ad
import megengine.optimizer as optimizer
from megengine import Parameter, tensor
from megengine.core.tensor.raw_tensor import RawTensor
from megengine.module import Module
class Simple(Module):
def __init__(self):
super().__init__(... | 23.2 | 65 | 0.628647 |
7ee66caf866e4604b604d6455b096f0c23c618cc | 20,756 | py | Python | src/engine/SCons/Variables/VariablesTests.py | SConsProject/scons-gh-convert-git | a749e0006af9a7f7d1f744eeaf8407b8226334e7 | [
"MIT"
] | 1 | 2017-01-28T15:39:07.000Z | 2017-01-28T15:39:07.000Z | src/engine/SCons/Variables/VariablesTests.py | SConsProject/scons-gh-convert-git | a749e0006af9a7f7d1f744eeaf8407b8226334e7 | [
"MIT"
] | null | null | null | src/engine/SCons/Variables/VariablesTests.py | SConsProject/scons-gh-convert-git | a749e0006af9a7f7d1f744eeaf8407b8226334e7 | [
"MIT"
] | 1 | 2022-03-23T17:29:35.000Z | 2022-03-23T17:29:35.000Z | #
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicen... | 30.037627 | 81 | 0.518693 |
d9feb6df379b160975feaf592b73e2297241ce24 | 3,866 | py | Python | extract-partitions.py | kenkit/lglaf | 30b625f24d71190b82f78e02f29749b290cd8d46 | [
"MIT"
] | 22 | 2017-09-19T23:49:36.000Z | 2021-11-08T22:03:23.000Z | extract-partitions.py | kenkit/lglaf | 30b625f24d71190b82f78e02f29749b290cd8d46 | [
"MIT"
] | 7 | 2018-04-04T20:38:51.000Z | 2021-11-08T01:40:19.000Z | extract-partitions.py | kenkit/lglaf | 30b625f24d71190b82f78e02f29749b290cd8d46 | [
"MIT"
] | 12 | 2017-11-10T23:01:20.000Z | 2020-12-20T05:06:45.000Z | #!/usr/bin/env python
#
# Dump partitions to file.
#
# Copyright (C) 2015 Peter Wu <peter@lekensteyn.nl>
# Licensed under the MIT license <http://opensource.org/licenses/MIT>.
from contextlib import closing
import argparse, logging, os, struct
import lglaf, partitions
_logger = logging.getLogger("extract-partitions")... | 42.021739 | 122 | 0.623642 |
dc2d46d817012c5aadc7b40ab481bf10a697f3c5 | 8,467 | py | Python | docs/conf.py | JanFan/py-aho-corasick | 6cb87b105b92a4e5fa4f9e7d11ad12c90ed39b7d | [
"MIT"
] | 23 | 2017-08-22T03:59:53.000Z | 2020-09-20T07:49:05.000Z | docs/conf.py | Guangyi-Z/py-aho-corasick | 6cb87b105b92a4e5fa4f9e7d11ad12c90ed39b7d | [
"MIT"
] | 2 | 2018-06-16T10:43:26.000Z | 2018-07-15T21:35:29.000Z | docs/conf.py | JanFan/py-aho-corasick | 6cb87b105b92a4e5fa4f9e7d11ad12c90ed39b7d | [
"MIT"
] | 9 | 2017-04-18T10:52:10.000Z | 2020-04-29T08:54:26.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# py_aho_corasick documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in th... | 30.677536 | 76 | 0.717255 |
f9f6ff4880f77c4fad69435f1c5d7a53ad66235b | 1,949 | py | Python | main.py | estuaryoss/estuary-discovery | 9615a9d544670570f14f4c72ca20f57a0cd9bba4 | [
"Apache-2.0"
] | null | null | null | main.py | estuaryoss/estuary-discovery | 9615a9d544670570f14f4c72ca20f57a0cd9bba4 | [
"Apache-2.0"
] | null | null | null | main.py | estuaryoss/estuary-discovery | 9615a9d544670570f14f4c72ca20f57a0cd9bba4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import sys
from rest.api.constants.env_constants import EnvConstants
from rest.api.eureka_registrator import EurekaRegistrator
from rest.api.loghelpers.message_dumper import MessageDumper
from rest.api.routes import app, fluentd_service
from rest.environment.environment import EnvironmentSinglet... | 48.725 | 115 | 0.781426 |
c46812c3eb7419ce6b63007f9bd79f2bc7187aa8 | 4,625 | py | Python | handlers/WechatKFZ/kfz_view.py | iamjing66/tornaodo_sdk | 242a852d3231e5798aa357a17e5638c7dc0567b9 | [
"MIT"
] | null | null | null | handlers/WechatKFZ/kfz_view.py | iamjing66/tornaodo_sdk | 242a852d3231e5798aa357a17e5638c7dc0567b9 | [
"MIT"
] | null | null | null | handlers/WechatKFZ/kfz_view.py | iamjing66/tornaodo_sdk | 242a852d3231e5798aa357a17e5638c7dc0567b9 | [
"MIT"
] | null | null | null | import logging
import application
from handlers.WechatKFZ import kfz_authorize
from handlers.base import BaseHandler
from handlers.kbeServer.XREditor.Interface import interface_account
from methods.DBManager import DBManager
class WechatLoginCallBackRequest(BaseHandler):
def get(self):
print("self.get... | 49.731183 | 361 | 0.620324 |
6b5f71ca96ed30f383806df4f641ed6dfaaaed38 | 9,334 | py | Python | datamodels/scripts/find_me_another.py | mwregan2/MiriTE | 6b65939454db60bf10619d50fcb5769d23598b76 | [
"CNRI-Python"
] | null | null | null | datamodels/scripts/find_me_another.py | mwregan2/MiriTE | 6b65939454db60bf10619d50fcb5769d23598b76 | [
"CNRI-Python"
] | 24 | 2019-08-09T15:03:20.000Z | 2022-03-04T10:04:48.000Z | datamodels/scripts/find_me_another.py | mwregan2/MiriTE | 6b65939454db60bf10619d50fcb5769d23598b76 | [
"CNRI-Python"
] | 4 | 2019-06-16T15:03:23.000Z | 2020-12-02T19:51:52.000Z | #!/usr/bin/env python
#
# :History:
#
# 21 Jun 2016: Created.
# 20 Jan 2017: Replaced "clobber" parameter with "overwrite".
# 17 Oct 2018: Metadata wildcards now use 'N/A' instead of 'ANY'.
#
# @author: Steven Beard (UKATC)
#
"""
Script `find_me_another` takes a calibration data product, or a file
obtained from the J... | 36.748031 | 88 | 0.581208 |
e89e8240e779b79ac594feebb4ccb1ef9fb6908f | 4,580 | py | Python | Tools/convert2.py | tianqichongzhen/ProgramPrac | 5e575f394179709a4964483308b91796c341e45f | [
"Apache-2.0"
] | 2 | 2019-01-12T13:54:52.000Z | 2021-09-13T12:47:25.000Z | Tools/convert2.py | Johnwei386/Warehouse | 5e575f394179709a4964483308b91796c341e45f | [
"Apache-2.0"
] | null | null | null | Tools/convert2.py | Johnwei386/Warehouse | 5e575f394179709a4964483308b91796c341e45f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# _*_ coding:utf8 _*_
# python2.7
import os
import argparse
# 常用中文标点符号unicode编码
puncs = set([u'\u3002', u'\uFF1F', u'\uFF01', u'\uFF0C', u'\u3001',
u'\uFF1B', u'\uFF1A', u'\u300C', u'\u300D', u'\u300E',
u'\u300F', u'\u2018', u'\u2019', u'\u201C', u'\u201D',
... | 27.42515 | 98 | 0.513974 |
51d16229be1fe396fcb9dcf6e7107aebf92e7c84 | 4,156 | py | Python | server/server/world/zone.py | dablum25/test-game | 28a55beea42c593ef18419dd72abc660a12477d1 | [
"MIT"
] | null | null | null | server/server/world/zone.py | dablum25/test-game | 28a55beea42c593ef18419dd72abc660a12477d1 | [
"MIT"
] | null | null | null | server/server/world/zone.py | dablum25/test-game | 28a55beea42c593ef18419dd72abc660a12477d1 | [
"MIT"
] | null | null | null | import pytmx
import time
from astar import *
from monsterspawn import MonsterSpawn
from npcspawn import NpcSpawn
from warp import Warp
import ConfigParser
def load_zones(world):
config = ConfigParser.RawConfigParser()
config.read('data/zones.ini')
for name in config.sections():
title = config.get(name,'t... | 26.138365 | 105 | 0.587103 |
579d82619bcd958efef2ca6c3d62e2f8d84c0916 | 18,167 | py | Python | pipelineutilities/pipelineutilities/search_files.py | ndlib/mellon-manifest-pipeline | aa90494e73fbc30ce701771ac653d28d533217db | [
"Apache-2.0"
] | 1 | 2021-06-27T15:16:13.000Z | 2021-06-27T15:16:13.000Z | pipelineutilities/pipelineutilities/search_files.py | ndlib/marble-manifest-pipeline | abc036e4c81a8a5e938373a43153e2492a17cbf8 | [
"Apache-2.0"
] | 8 | 2019-11-05T18:58:23.000Z | 2021-09-03T14:54:42.000Z | pipelineutilities/pipelineutilities/search_files.py | ndlib/mellon-manifest-pipeline | aa90494e73fbc30ce701771ac653d28d533217db | [
"Apache-2.0"
] | null | null | null | import boto3
import re
import os
from datetime import datetime, date, timedelta, timezone
from pathlib import Path
from urllib.parse import urlparse
# saved live path
# "libnd-smb-rbsc": ["digital/bookreader", "collections/ead_xml/images"]
bucket_to_url = {
# "libnd-smb-rbsc": 'https://rarebooks.library.nd.edu/',
... | 36.70101 | 177 | 0.568283 |
29ee7530c3e344b09045241e0581a9b522494b8c | 40 | py | Python | example.py | velerofinance/velero-bot-sdk | 6952141c1a445825de2fa421a15220d955bc6c87 | [
"MIT"
] | null | null | null | example.py | velerofinance/velero-bot-sdk | 6952141c1a445825de2fa421a15220d955bc6c87 | [
"MIT"
] | null | null | null | example.py | velerofinance/velero-bot-sdk | 6952141c1a445825de2fa421a15220d955bc6c87 | [
"MIT"
] | null | null | null | if __name__ == '__main__':
print(1)
| 13.333333 | 26 | 0.6 |
028cec6a4bca1bfad7d56c2dd5f9b9e8933a0849 | 2,751 | py | Python | wagtail/asv_tests/unit/test_view_restrictions.py | Arvinwijsman/wagtail | 83bc6da05d954d6c99eebc53a6667ebf7e8670bf | [
"BSD-3-Clause"
] | null | null | null | wagtail/asv_tests/unit/test_view_restrictions.py | Arvinwijsman/wagtail | 83bc6da05d954d6c99eebc53a6667ebf7e8670bf | [
"BSD-3-Clause"
] | null | null | null | wagtail/asv_tests/unit/test_view_restrictions.py | Arvinwijsman/wagtail | 83bc6da05d954d6c99eebc53a6667ebf7e8670bf | [
"BSD-3-Clause"
] | null | null | null | from uuid import uuid4
from datetime import datetime, timezone
from unittest import mock
from unittest.mock import patch, MagicMock
from django import forms
from django.contrib.auth.models import Group
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_lazy
from django.co... | 32.364706 | 91 | 0.672119 |
ae26b0a396a178d5cb89afa9a43d312b7d660a80 | 1,107 | py | Python | Malaria Detection using ConvNets/app.py | drdataSpp/Spp-End2End-Deep-Learning-Projects | 84ab4ab58761effa4fe13e51297f584ec03a885d | [
"Apache-2.0"
] | null | null | null | Malaria Detection using ConvNets/app.py | drdataSpp/Spp-End2End-Deep-Learning-Projects | 84ab4ab58761effa4fe13e51297f584ec03a885d | [
"Apache-2.0"
] | null | null | null | Malaria Detection using ConvNets/app.py | drdataSpp/Spp-End2End-Deep-Learning-Projects | 84ab4ab58761effa4fe13e51297f584ec03a885d | [
"Apache-2.0"
] | null | null | null | from flask import Flask, request, render_template
import tensorflow as tf
import numpy as np
from tensorflow import keras
from tensorflow.keras.models import load_model
from tensorflow.keras.preprocessing.image import load_img, img_to_array
app = Flask(__name__)
MODEL_PATH ='Malaria-Model-2.h5'
model = lo... | 29.131579 | 82 | 0.68654 |
ecfcc0fbcc07e9bde4aeb2fe9ffaa6022d86b109 | 58,598 | py | Python | stips/instruments/instrument.py | york-stsci/STScI-STIPS-1 | 16c439fcea22b2768d462b3e375257f0f050c26a | [
"BSD-3-Clause"
] | null | null | null | stips/instruments/instrument.py | york-stsci/STScI-STIPS-1 | 16c439fcea22b2768d462b3e375257f0f050c26a | [
"BSD-3-Clause"
] | null | null | null | stips/instruments/instrument.py | york-stsci/STScI-STIPS-1 | 16c439fcea22b2768d462b3e375257f0f050c26a | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import,division
__filetype__ = "base"
#External Modules
import glob, logging, os, shutil, sys, types, uuid
import numpy as np
import synphot as syn
import stsynphot as stsyn
from astropy import units as u
from astropy.io import fits as pyfits
from astropy.table import Table, Column, M... | 45.566096 | 174 | 0.568927 |
5dedc7dc5b87a794d992bee82fc8a0a55fd7b457 | 7,336 | py | Python | utils/s3dis_utils/dataset_s3dis.py | Chenfeng1271/JSPNet-Learning-Joint-Semantic-Instance-Segmentation-of-Point-Clouds-via-Similarity-and-Probabili | 1d50417431b5af1ad76b96749e841969d4dc1359 | [
"MIT"
] | 78 | 2019-11-19T00:49:37.000Z | 2022-02-15T04:21:49.000Z | utils/s3dis_utils/dataset_s3dis.py | Chenfeng1271/JSPNet-Learning-Joint-Semantic-Instance-Segmentation-of-Point-Clouds-via-Similarity-and-Probabili | 1d50417431b5af1ad76b96749e841969d4dc1359 | [
"MIT"
] | 15 | 2019-12-15T10:07:57.000Z | 2022-02-18T09:21:28.000Z | utils/s3dis_utils/dataset_s3dis.py | Chenfeng1271/JSPNet | 1d50417431b5af1ad76b96749e841969d4dc1359 | [
"MIT"
] | 16 | 2019-12-03T15:50:03.000Z | 2021-11-08T14:12:40.000Z | import os
import sys
import time
import gc
import numpy as np
import multiprocessing
from concurrent import futures
from functools import partial as functools_partial
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.dirname(os.path.dirname(BASE_DIR))
sys.path.append(BASE_DIR)
sys.path.append(R... | 36.68 | 115 | 0.645447 |
8f55885df8274328198901e751ce368d67567548 | 11,817 | py | Python | python/ccxt/async/btcchina.py | born2net/ccxt | 9995e50ca28513b9a68f774a3517f2c396cc0001 | [
"MIT"
] | null | null | null | python/ccxt/async/btcchina.py | born2net/ccxt | 9995e50ca28513b9a68f774a3517f2c396cc0001 | [
"MIT"
] | null | null | null | python/ccxt/async/btcchina.py | born2net/ccxt | 9995e50ca28513b9a68f774a3517f2c396cc0001 | [
"MIT"
] | 1 | 2018-08-09T18:11:13.000Z | 2018-08-09T18:11:13.000Z | # -*- coding: utf-8 -*-
from ccxt.async.base.exchange import Exchange
import base64
import hashlib
from ccxt.base.errors import AuthenticationError
class btcchina (Exchange):
def describe(self):
return self.deep_extend(super(btcchina, self).describe(), {
'id': 'btcchina',
'name':... | 37.39557 | 128 | 0.469832 |
c86e5d39d9d33a463da10b86e7449392f36eb36f | 2,161 | py | Python | chainer/functions/array/get_item.py | mingxiaoh/chainer-v3 | 815ff00f5eaf7944d6e8a75662ff64a2fe046a4d | [
"BSD-3-Clause"
] | 7 | 2017-05-08T07:02:40.000Z | 2018-12-02T18:35:39.000Z | chainer/functions/array/get_item.py | mingxiaoh/chainer-v3 | 815ff00f5eaf7944d6e8a75662ff64a2fe046a4d | [
"BSD-3-Clause"
] | null | null | null | chainer/functions/array/get_item.py | mingxiaoh/chainer-v3 | 815ff00f5eaf7944d6e8a75662ff64a2fe046a4d | [
"BSD-3-Clause"
] | 1 | 2021-05-27T16:52:11.000Z | 2021-05-27T16:52:11.000Z | import collections
import numpy
import chainer
from chainer import cuda
from chainer import function
from chainer import utils
from chainer.utils import type_check
from chainer import variable
class GetItem(function.Function):
"""Function that slices array and extract elements."""
def __init__(self, slice... | 28.434211 | 77 | 0.610366 |
300dae5aaf07fcc8d5e73a6e0025f1da7a895f68 | 6,397 | py | Python | venv1/Lib/site-packages/tensorflow/contrib/opt/python/training/powersign.py | Soum-Soum/Tensorflow_Face_Finder | fec6c15d2df7012608511ad87f4b55731bf99478 | [
"Apache-2.0",
"MIT"
] | null | null | null | venv1/Lib/site-packages/tensorflow/contrib/opt/python/training/powersign.py | Soum-Soum/Tensorflow_Face_Finder | fec6c15d2df7012608511ad87f4b55731bf99478 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-05-20T00:58:04.000Z | 2021-05-20T00:58:04.000Z | venv1/Lib/site-packages/tensorflow/contrib/opt/python/training/powersign.py | Soum-Soum/Tensorflow_Face_Finder | fec6c15d2df7012608511ad87f4b55731bf99478 | [
"Apache-2.0",
"MIT"
] | null | null | null | # Copyright 2017 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... | 36.976879 | 81 | 0.67094 |
8407f25b56b32abc6538ad9e9dcc41c210ae29fc | 152 | py | Python | project/markdown_files/long/docs/function_programming/func01.py | mintlov3r/oh-my-python | b99e65ebe31926d92d825d8ad3294e970d9dc722 | [
"Apache-2.0"
] | null | null | null | project/markdown_files/long/docs/function_programming/func01.py | mintlov3r/oh-my-python | b99e65ebe31926d92d825d8ad3294e970d9dc722 | [
"Apache-2.0"
] | null | null | null | project/markdown_files/long/docs/function_programming/func01.py | mintlov3r/oh-my-python | b99e65ebe31926d92d825d8ad3294e970d9dc722 | [
"Apache-2.0"
] | null | null | null | # 匿名函数
f = lambda x: x+2
# 等价于,可扩展
def f2(x):
# print(x)
return x+2
# 等价于
# def f3(x): return x+2
print('匿名函数f=', f(2))
print('普通函数f2=', f2(2)) | 13.818182 | 23 | 0.546053 |
01608d54693c40caf9d57bd8fbbfb181c027065b | 4,403 | py | Python | calc_loc_from_loc_and_bearing_and_dist.py | Guymer/PyGuymer | 7970659645f363788d371d00e2128f0cc3a47362 | [
"Apache-2.0"
] | 6 | 2018-09-18T00:48:03.000Z | 2019-12-15T23:48:58.000Z | calc_loc_from_loc_and_bearing_and_dist.py | Guymer/PyGuymer | 7970659645f363788d371d00e2128f0cc3a47362 | [
"Apache-2.0"
] | 1 | 2019-11-19T03:17:25.000Z | 2019-11-19T17:24:45.000Z | calc_loc_from_loc_and_bearing_and_dist.py | Guymer/PyGuymer | 7970659645f363788d371d00e2128f0cc3a47362 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
##############################################################################################
# This file is deprecated because Python 2.x is deprecated #
# A Python 3.x version of this file can be found at: #
# ... | 47.858696 | 264 | 0.488531 |
16d42cd98e83852f95112644d2a01e6a30c1fc1c | 1,577 | py | Python | programming/python/abbreviate.py | ngie-cooper/scratch | c0d806505c2ca5146e2cc04a352a8b2a8c9024e8 | [
"BSD-2-Clause"
] | 3 | 2019-07-03T02:16:39.000Z | 2020-10-25T23:37:00.000Z | programming/python/abbreviate.py | ngie-cooper/scratch | c0d806505c2ca5146e2cc04a352a8b2a8c9024e8 | [
"BSD-2-Clause"
] | null | null | null | programming/python/abbreviate.py | ngie-cooper/scratch | c0d806505c2ca5146e2cc04a352a8b2a8c9024e8 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
"""Abbreviate buffer content repetitions into a more human readable format.
This also demonstrates how to use line_profiler, memory_profiler, and timeit to
measure computation and memory performance, as well as quantify wall time spent
computing the repetitions.
Examples:
% python -m kernprof -... | 22.211268 | 82 | 0.675967 |
ab56a65a8eee168844db66f0bc8edadd1d3c1d41 | 7,096 | py | Python | testing/test_phpcompiler.py | jweinraub/hippyvm | 09c7643aaa1c4ade566e8681abd2543f12bf874c | [
"MIT"
] | 289 | 2015-01-01T15:36:55.000Z | 2022-03-27T00:22:27.000Z | testing/test_phpcompiler.py | jweinraub/hippyvm | 09c7643aaa1c4ade566e8681abd2543f12bf874c | [
"MIT"
] | 26 | 2015-01-21T16:34:41.000Z | 2020-08-26T15:12:54.000Z | testing/test_phpcompiler.py | jweinraub/hippyvm | 09c7643aaa1c4ade566e8681abd2543f12bf874c | [
"MIT"
] | 35 | 2015-01-05T12:09:41.000Z | 2022-03-16T09:30:16.000Z | import py
from hippy.phpcompiler import compile_php, PHPLexerWrapper
from hippy.objspace import ObjSpace
from testing.directrunner import run_php_source, DirectRunner
from testing.test_interpreter import BaseTestInterpreter, MockInterpreter
class LiteralInterpreter(MockInterpreter):
def run_bytecode(self, bc, exp... | 29.940928 | 78 | 0.568348 |
a37c8ad0a8931db56dd078b4c5d35b71ccf1ef66 | 1,160 | py | Python | env/Lib/site-packages/OpenGL/GLES2/EXT/color_buffer_half_float.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 210 | 2016-04-09T14:26:00.000Z | 2022-03-25T18:36:19.000Z | env/Lib/site-packages/OpenGL/GLES2/EXT/color_buffer_half_float.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 72 | 2016-09-04T09:30:19.000Z | 2022-03-27T17:06:53.000Z | env/Lib/site-packages/OpenGL/GLES2/EXT/color_buffer_half_float.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 64 | 2016-04-09T14:26:49.000Z | 2022-03-21T11:19:47.000Z | '''OpenGL extension EXT.color_buffer_half_float
This module customises the behaviour of the
OpenGL.raw.GLES2.EXT.color_buffer_half_float to provide a more
Python-friendly API
Overview (from the spec)
This extension allows 16-bit floating point formats as defined in
OES_texture_half_float to be rendered to via f... | 35.151515 | 73 | 0.817241 |
b08b26dd9a9c0549c026084ddf9e722a380cd38a | 6,337 | py | Python | docs/conf.py | drexelwireless/dragonradio | 885abd68d56af709e7a53737352641908005c45b | [
"MIT"
] | 8 | 2020-12-05T20:30:54.000Z | 2022-01-22T13:32:14.000Z | docs/conf.py | drexelwireless/dragonradio | 885abd68d56af709e7a53737352641908005c45b | [
"MIT"
] | 3 | 2020-10-28T22:15:27.000Z | 2021-01-27T14:43:41.000Z | docs/conf.py | drexelwireless/dragonradio | 885abd68d56af709e7a53737352641908005c45b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 30.033175 | 79 | 0.654095 |
0ce622fef89857e09828a092962b4bb7bd3b581c | 2,505 | py | Python | algorithms/random.py | abacusai/intraprocessing_debiasing | b4f0c35e299022b1e71e26686220e90440687100 | [
"Apache-2.0"
] | 7 | 2020-12-06T17:05:37.000Z | 2021-09-23T10:59:42.000Z | algorithms/random.py | abacusai/intraprocessing_debiasing | b4f0c35e299022b1e71e26686220e90440687100 | [
"Apache-2.0"
] | 2 | 2021-03-01T19:59:50.000Z | 2021-09-25T22:23:27.000Z | algorithms/random.py | abacusai/intraprocessing_debiasing | b4f0c35e299022b1e71e26686220e90440687100 | [
"Apache-2.0"
] | 2 | 2020-12-06T12:13:44.000Z | 2021-02-16T13:50:00.000Z | """
Random Intraprocessing Algorithm.
"""
import copy
import logging
import math
import numpy as np
import torch
from models import load_model
from utils import get_best_thresh, get_test_objective, get_valid_objective
logger = logging.getLogger("Debiasing")
def random_debiasing(model_state_dict, data, config, devi... | 42.457627 | 131 | 0.67505 |
e06f3e512041d8d841c57138b912e18e55a25ef0 | 5,567 | py | Python | planetary_computer/sas.py | QPC-database/planetary-computer-sdk-for-python | ae8fbf6eb9e743100339195cb883e7f8b07d4190 | [
"MIT"
] | 1 | 2021-07-06T14:47:18.000Z | 2021-07-06T14:47:18.000Z | planetary_computer/sas.py | QPC-database/planetary-computer-sdk-for-python | ae8fbf6eb9e743100339195cb883e7f8b07d4190 | [
"MIT"
] | null | null | null | planetary_computer/sas.py | QPC-database/planetary-computer-sdk-for-python | ae8fbf6eb9e743100339195cb883e7f8b07d4190 | [
"MIT"
] | null | null | null | from datetime import datetime, timezone
from typing import Any, Dict
from functools import singledispatch
import requests
from pydantic import BaseModel, Field
from pystac import Asset, Item, ItemCollection
from pystac.utils import datetime_to_str
from pystac_client import ItemSearch
from planetary_computer.settings ... | 31.994253 | 88 | 0.678283 |
31d2573564b5c2caa252000def708938c7741569 | 568 | py | Python | demos/nyu_finger_double_calibration_hwp.py | open-dynamic-robot-initiative/nyu_finger | 6a80c9186cf78e98cb4b6edc2c7531a440266910 | [
"BSD-3-Clause"
] | 2 | 2021-02-17T16:14:20.000Z | 2021-04-26T03:14:30.000Z | demos/nyu_finger_double_calibration_hwp.py | open-dynamic-robot-initiative/nyu_finger | 6a80c9186cf78e98cb4b6edc2c7531a440266910 | [
"BSD-3-Clause"
] | 3 | 2021-06-23T18:05:33.000Z | 2021-08-12T15:55:14.000Z | demos/nyu_finger_double_calibration_hwp.py | open-dynamic-robot-initiative/nyu_finger | 6a80c9186cf78e98cb4b6edc2c7531a440266910 | [
"BSD-3-Clause"
] | 3 | 2021-02-27T17:48:12.000Z | 2021-07-13T21:14:37.000Z | import os.path
import numpy as np
from robot_properties_nyu_finger.config import (
NYUFingerDoubleConfig0, NYUFingerDoubleConfig1)
from nyu_finger.nyu_finger_hwp_cpp import NYUFingerHWP
if __name__ == "__main__":
finger0 = NYUFingerHWP()
finger1 = NYUFingerHWP()
finger0.initialize(NYUFingerDoubleConf... | 24.695652 | 60 | 0.757042 |
cb3e295a1b7fb40b72a5855cb8e060dea2dfb7b0 | 221 | py | Python | game/engine/__init__.py | afreeorange/clueless | b6365e15989763fe6f3f7b4031a8ca3ce3a6420e | [
"MIT"
] | null | null | null | game/engine/__init__.py | afreeorange/clueless | b6365e15989763fe6f3f7b4031a8ca3ce3a6420e | [
"MIT"
] | null | null | null | game/engine/__init__.py | afreeorange/clueless | b6365e15989763fe6f3f7b4031a8ca3ce3a6420e | [
"MIT"
] | null | null | null | import logging
try:
from logging import NullHandler
except ImportError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
logging.getLogger(__name__).addHandler(NullHandler())
| 20.090909 | 53 | 0.710407 |
c610bdcbbfa382f6145058ebf299b88c82b3d90f | 118 | py | Python | moma_example/bootstrapform/__init__.py | gadio/moma-django | 13265379be1dbab18697e5f42f38b3b37f928aa9 | [
"Apache-2.0"
] | 12 | 2015-03-29T05:31:25.000Z | 2019-06-13T16:17:37.000Z | moma_example/bootstrapform/__init__.py | antoniotaranto/moma-django | 13265379be1dbab18697e5f42f38b3b37f928aa9 | [
"Apache-2.0"
] | 8 | 2015-09-04T21:00:50.000Z | 2021-06-10T17:39:44.000Z | moma_example/bootstrapform/__init__.py | antoniotaranto/moma-django | 13265379be1dbab18697e5f42f38b3b37f928aa9 | [
"Apache-2.0"
] | 3 | 2015-03-25T21:52:14.000Z | 2021-01-11T03:02:29.000Z | from bootstrapform.meta import VERSION
"""
This is updated version. Not original one.
"""
__version__ = str(VERSION)
| 16.857143 | 42 | 0.754237 |
7924d1c0994842ae8b1861b4c5edeece6d79e5ed | 1,424 | py | Python | recipe/serializers.py | Asko-Dev/REST-API---Recipe | e6bff4a0a733b541106c4b30150eb5b327b8f7e2 | [
"MIT"
] | null | null | null | recipe/serializers.py | Asko-Dev/REST-API---Recipe | e6bff4a0a733b541106c4b30150eb5b327b8f7e2 | [
"MIT"
] | 5 | 2020-06-06T01:34:08.000Z | 2022-03-12T00:21:49.000Z | recipe/serializers.py | Asko-Dev/REST-API---Recipe | e6bff4a0a733b541106c4b30150eb5b327b8f7e2 | [
"MIT"
] | null | null | null | from rest_framework import serializers
from core.models import Tag, Ingredient, Recipe
class TagSerializer(serializers.ModelSerializer):
"""Serializer for tag objects"""
class Meta:
model = Tag
fields = ('id', 'name')
read_only_fields = ('id',)
class IngredientSerializer(serializer... | 25.890909 | 71 | 0.648174 |
f6c33111a33d19235c151e4953325ac3112d6650 | 17,698 | py | Python | test/test_readme_examples.py | cnheider/imgaug | f0a7432205975e4435c81894a63bb147af67c476 | [
"MIT"
] | 4 | 2018-11-24T15:31:36.000Z | 2020-06-23T02:52:45.000Z | test/test_readme_examples.py | cnheider/imgaug | f0a7432205975e4435c81894a63bb147af67c476 | [
"MIT"
] | null | null | null | test/test_readme_examples.py | cnheider/imgaug | f0a7432205975e4435c81894a63bb147af67c476 | [
"MIT"
] | 2 | 2020-01-14T14:29:49.000Z | 2021-02-20T07:47:02.000Z | """
Script to verify all examples in the readme.
Simply execute
python test_readme_examples.py
"""
from __future__ import print_function, division
import numpy as np
def main():
example_standard_situation()
example_heavy_augmentations()
example_show()
#example_grayscale()
example_determinism()... | 41.544601 | 154 | 0.660696 |
bff424ad495922db84e5e6a1d48960fa485e863d | 443 | py | Python | db.py | M4RFF/perfd | 4a4dfaf7b5c82438b1759e4699b192ab6b510823 | [
"MIT"
] | null | null | null | db.py | M4RFF/perfd | 4a4dfaf7b5c82438b1759e4699b192ab6b510823 | [
"MIT"
] | 1 | 2021-12-12T03:29:52.000Z | 2021-12-17T21:20:40.000Z | db.py | M4RFF/perfd | 4a4dfaf7b5c82438b1759e4699b192ab6b510823 | [
"MIT"
] | 2 | 2021-12-09T17:37:53.000Z | 2021-12-19T05:45:49.000Z | #!/usr/bin/python3
from sql30 import db
class Database(db.Model):
TABLE = 'database'
DB_SCHEMA = {
'db_name': './perfd.db',
'tables': [
{
'name': TABLE,
'fields': {
'perf_name': 'text',
'name_obj_file': 'text',... | 21.095238 | 46 | 0.395034 |
776b516f9473b58c71ad0e22d5d3f01faf133d64 | 6,837 | py | Python | test/functional/rpc_users.py | jkbao21/bitcoin | de78eb66ba67325852b351b1128b3cef6fd4abf3 | [
"MIT"
] | null | null | null | test/functional/rpc_users.py | jkbao21/bitcoin | de78eb66ba67325852b351b1128b3cef6fd4abf3 | [
"MIT"
] | null | null | null | test/functional/rpc_users.py | jkbao21/bitcoin | de78eb66ba67325852b351b1128b3cef6fd4abf3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiple RPC users."""
from test_framework.test_framework import BitcoinTestFramework
from test_f... | 46.195946 | 183 | 0.674419 |
13196dd8532e3b83c7cfd8e3b063431eb18cdeef | 48,684 | py | Python | tools/gen_app_code/app_code_src.py | junitas/coreflightexec | fdeb437e3052f4c89632dfcfe540140ddb8c70b3 | [
"NASA-1.3"
] | null | null | null | tools/gen_app_code/app_code_src.py | junitas/coreflightexec | fdeb437e3052f4c89632dfcfe540140ddb8c70b3 | [
"NASA-1.3"
] | null | null | null | tools/gen_app_code/app_code_src.py | junitas/coreflightexec | fdeb437e3052f4c89632dfcfe540140ddb8c70b3 | [
"NASA-1.3"
] | null | null | null | #========================================================================================
# File: app_code_src.py
# Author: Tam Ngo/JSC
# Date: 2012-02-22
#
# Modification History:
# Date | Author | Description
# ---------------------------
# 10/7/15 | Susanne Strege | Added msg.h header definition and gen... | 28.77305 | 113 | 0.548106 |
aff5d1fb8c3f2b1ced5a7ee6e563dd5a18e6fd72 | 2,650 | py | Python | src/systems/crafting_system.py | CGirdlestone/TextAdventure | 6127d6c98ce3ad4c6e4d4fd0262310e74f2e4fad | [
"MIT"
] | null | null | null | src/systems/crafting_system.py | CGirdlestone/TextAdventure | 6127d6c98ce3ad4c6e4d4fd0262310e74f2e4fad | [
"MIT"
] | null | null | null | src/systems/crafting_system.py | CGirdlestone/TextAdventure | 6127d6c98ce3ad4c6e4d4fd0262310e74f2e4fad | [
"MIT"
] | null | null | null | """crafting_system.py
This class represents a simple crafting system. All recipe-related data is
stored externally in a JSON file.
"""
class CraftingSystem:
def __init__(self, event_queue, **kwargs):
self.event_queue = event_queue
self.event_queue.register_system(self)
self.__dict__.updat... | 36.805556 | 76 | 0.637736 |
5655f0f163a104bdcb91d55a2cb544477adf77be | 916 | py | Python | tests/test_sentiments.py | sam1902/textblob-fr | 8c3573659e35c8fe7809cb2ae3363268476352b7 | [
"MIT"
] | null | null | null | tests/test_sentiments.py | sam1902/textblob-fr | 8c3573659e35c8fe7809cb2ae3363268476352b7 | [
"MIT"
] | null | null | null | tests/test_sentiments.py | sam1902/textblob-fr | 8c3573659e35c8fe7809cb2ae3363268476352b7 | [
"MIT"
] | null | null | null | #!/usr/bin/env
# -*- coding: utf-8 -*-
import unittest
from nose.tools import * # PEP8 asserts
from textblob import TextBlob
from textblob_fr import PatternAnalyzer as FrAnalyzer
class TestPatternAnalyzer(unittest.TestCase):
def setUp(self):
self.analyzer = FrAnalyzer()
self.neg = u"C'est une vo... | 29.548387 | 61 | 0.677948 |
4c7d7415d9e665c94e2bc5dde05d4d078468d8d3 | 1,186 | py | Python | test/test_threading.py | jhidding/parallel-python-workshop | 631851558324be67a10963c6742490314d011c80 | [
"Apache-2.0"
] | 3 | 2020-11-30T15:52:20.000Z | 2021-07-22T10:28:27.000Z | test/test_threading.py | jhidding/parallel-python-workshop | 631851558324be67a10963c6742490314d011c80 | [
"Apache-2.0"
] | 5 | 2021-11-12T11:39:35.000Z | 2022-01-14T10:47:05.000Z | test/test_threading.py | jhidding/parallel-python-workshop | 631851558324be67a10963c6742490314d011c80 | [
"Apache-2.0"
] | 3 | 2021-04-09T09:55:55.000Z | 2021-07-22T10:30:03.000Z | import queue
import threading
import numba
import random
def test_threading():
input_range = [10**6]*4
ncpus = 4
@numba.jit(nopython=True, nogil=True)
def calc_pi_numba(N):
M = 0
for i in range(N):
# Simulate impact coordinates
x = random.uniform(-1, 1)
... | 23.254902 | 75 | 0.542159 |
8efd2f8a2f6c80e6a3c911ae8f8840983de56b25 | 865 | py | Python | leonardo_oscar_dashboard/apps/dashboard.py | leonardo-modules/leonardo-oscar-dashboard | 752bfbc1b7bbffee1f32f756c2ec0066baed9e7a | [
"BSD-3-Clause"
] | null | null | null | leonardo_oscar_dashboard/apps/dashboard.py | leonardo-modules/leonardo-oscar-dashboard | 752bfbc1b7bbffee1f32f756c2ec0066baed9e7a | [
"BSD-3-Clause"
] | null | null | null | leonardo_oscar_dashboard/apps/dashboard.py | leonardo-modules/leonardo-oscar-dashboard | 752bfbc1b7bbffee1f32f756c2ec0066baed9e7a | [
"BSD-3-Clause"
] | null | null | null |
from __future__ import absolute_import
from django.conf.urls import include, url
from oscar.apps.dashboard.app import application
urlpatterns = []
try:
from accounts.dashboard.app import application as accounts_app
urlpatterns += [
url(r'^accounts/', include(accounts_app.get_urls()))
... | 20.595238 | 72 | 0.613873 |
fe2e86f70df87eaa47fdd63f89aff6dfc19a6360 | 6,403 | py | Python | terex.py | kumaransanjay/Terex-a-voice-assistant | 58a87d5f323a32b4e2c66efb9913b3c11add4e7d | [
"Apache-2.0"
] | null | null | null | terex.py | kumaransanjay/Terex-a-voice-assistant | 58a87d5f323a32b4e2c66efb9913b3c11add4e7d | [
"Apache-2.0"
] | null | null | null | terex.py | kumaransanjay/Terex-a-voice-assistant | 58a87d5f323a32b4e2c66efb9913b3c11add4e7d | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from random import random
import random
import webbrowser
import pyttsx3
import datetime
import urllib.request
import re
import speech_recognition as sr
import wikipedia
import os
engine=pyttsx3.init('sapi5')
voices=engine.getProperty('voices')
engine.setProperty('voice',voi... | 28.584821 | 92 | 0.532875 |
11a349a61828217b9352d352d0aa5b11d44c8093 | 1,561 | py | Python | probe.py | karazijal/automatic_xcnn_topologies | 3c17b8537650a1d3d0a95269ebce12c136a12dda | [
"MIT"
] | null | null | null | probe.py | karazijal/automatic_xcnn_topologies | 3c17b8537650a1d3d0a95269ebce12c136a12dda | [
"MIT"
] | null | null | null | probe.py | karazijal/automatic_xcnn_topologies | 3c17b8537650a1d3d0a95269ebce12c136a12dda | [
"MIT"
] | 1 | 2021-11-09T09:06:48.000Z | 2021-11-09T09:06:48.000Z | from keras.models import Model
from keras.layers import Flatten, Dense, BatchNormalization, Dropout
def get_probe(model, layer_name):
for layer in model.layers:
layer.trainable = False
input_tensor = model.input
attach_tensor = model.get_layer(name=layer_name).output
nb_classes = int(model.out... | 36.302326 | 112 | 0.673927 |
899361774262a7ae9e54ace6bcdc328f8a9969d9 | 41,930 | py | Python | tests/test_monitoring_tools.py | danielpops/paasta | 12325d1e884a6d0ace8dcd510da98f6910d28cb0 | [
"Apache-2.0"
] | null | null | null | tests/test_monitoring_tools.py | danielpops/paasta | 12325d1e884a6d0ace8dcd510da98f6910d28cb0 | [
"Apache-2.0"
] | null | null | null | tests/test_monitoring_tools.py | danielpops/paasta | 12325d1e884a6d0ace8dcd510da98f6910d28cb0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015-2016 Yelp Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 40.047755 | 95 | 0.658145 |
dc24fbec378f0383676cb0bfb89b28831709aaea | 1,961 | py | Python | scicopia/app/parser/ScicopiaListener.py | pikatech/Scicopia | dcdb3b4f55b9111fa3b4fe78afdb07bb2ceb9985 | [
"MIT"
] | null | null | null | scicopia/app/parser/ScicopiaListener.py | pikatech/Scicopia | dcdb3b4f55b9111fa3b4fe78afdb07bb2ceb9985 | [
"MIT"
] | 9 | 2021-07-24T16:12:03.000Z | 2021-07-24T16:58:19.000Z | scicopia/app/parser/ScicopiaListener.py | pikatech/Scicopia | dcdb3b4f55b9111fa3b4fe78afdb07bb2ceb9985 | [
"MIT"
] | 1 | 2021-06-18T16:00:06.000Z | 2021-06-18T16:00:06.000Z | # Generated from Scicopia.g4 by ANTLR 4.9.2
from antlr4 import *
if __name__ is not None and "." in __name__:
from .ScicopiaParser import ScicopiaParser
else:
from ScicopiaParser import ScicopiaParser
# This class defines a complete listener for a parse tree produced by ScicopiaParser.
class ScicopiaListener(P... | 29.712121 | 85 | 0.72718 |
acb17f388a24ac86fabb5959b2a3efa022a28e32 | 19,020 | py | Python | pydantic/main.py | pydevd/pydantic | cd50601172462b49cdf09e4d988906ba8f14af87 | [
"MIT"
] | 25 | 2019-06-30T04:37:49.000Z | 2022-03-19T19:57:37.000Z | pydantic/main.py | pydevd/pydantic | cd50601172462b49cdf09e4d988906ba8f14af87 | [
"MIT"
] | 1 | 2018-11-22T15:52:55.000Z | 2018-11-22T15:57:42.000Z | pydantic/main.py | pydevd/pydantic | cd50601172462b49cdf09e4d988906ba8f14af87 | [
"MIT"
] | 4 | 2021-06-25T06:34:49.000Z | 2022-02-07T01:52:10.000Z | import json
import warnings
from abc import ABCMeta
from copy import deepcopy
from functools import partial
from itertools import chain
from pathlib import Path
from types import FunctionType
from typing import Any, Callable, Dict, Set, Type, Union
from .error_wrappers import ErrorWrapper, ValidationError
from .errors... | 37.367387 | 120 | 0.613249 |
f828243bf3b0bfb48856c59dc9a616de6165ae25 | 8,288 | py | Python | dashboard/dashboard/pinpoint/models/quest/find_isolate_test.py | bopopescu/chromium72-third-party-catapult | 774e1355b871e13bb858147a136e9cb476f55030 | [
"BSD-3-Clause"
] | 1 | 2019-01-04T10:08:58.000Z | 2019-01-04T10:08:58.000Z | dashboard/dashboard/pinpoint/models/quest/find_isolate_test.py | kind-john/catapult | 29635376119833f172a58a48a3282d353ce55d2b | [
"BSD-3-Clause"
] | null | null | null | dashboard/dashboard/pinpoint/models/quest/find_isolate_test.py | kind-john/catapult | 29635376119833f172a58a48a3282d353ce55d2b | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import mock
from dashboard.pinpoint.models import isolate
from dashboard.pinpoint.models.change import change_test
from dashboard.pinpoint.... | 31.513308 | 79 | 0.650338 |
64d1a39255de3f77b927f48dfce14da2df378ae8 | 32,167 | py | Python | venv/Lib/site-packages/sqlalchemy/dialects/firebird/base.py | OliviaNabbosa89/Disaster_Responses | 1e66d77c303cec685dfc2ca94f4fca4cc9400570 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/sqlalchemy/dialects/firebird/base.py | OliviaNabbosa89/Disaster_Responses | 1e66d77c303cec685dfc2ca94f4fca4cc9400570 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/sqlalchemy/dialects/firebird/base.py | OliviaNabbosa89/Disaster_Responses | 1e66d77c303cec685dfc2ca94f4fca4cc9400570 | [
"MIT"
] | 1 | 2021-06-20T19:28:37.000Z | 2021-06-20T19:28:37.000Z | # firebird/base.py
# Copyright (C) 2005-2021 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
r"""
.. dialect:: firebird
:name: Firebird
.. note::
The F... | 32.491919 | 80 | 0.555663 |
045388143ae66491ed902a53869a393d4a182a00 | 625 | py | Python | agents/load_ppo_params.py | matthiasgruber/supervisor | f7ab5f5ee67170256033e62e61a5be3410fcf6a8 | [
"MIT"
] | 3 | 2021-08-08T20:22:13.000Z | 2022-01-27T17:22:32.000Z | agents/load_ppo_params.py | matthiasgruber/supervisor | f7ab5f5ee67170256033e62e61a5be3410fcf6a8 | [
"MIT"
] | null | null | null | agents/load_ppo_params.py | matthiasgruber/supervisor | f7ab5f5ee67170256033e62e61a5be3410fcf6a8 | [
"MIT"
] | null | null | null | import pickle
def load_ppo_params():
file = open("logs/baseline_tuning/study.obj", 'rb')
optuna_object = pickle.load(file)
file.close()
model_params = optuna_object.best_params
if model_params["n_steps"] < model_params["batch_size"]:
model_params["nminibatches"] = 1
else:
model... | 32.894737 | 96 | 0.6912 |
68a6f06d752214ba9649ec9bb8fc2912e60ecad7 | 5,069 | py | Python | download_imdb.py | WillSkywalker/scholar | 68a8f1680ccb150b005e440b501c05d7339e43e8 | [
"Apache-2.0"
] | null | null | null | download_imdb.py | WillSkywalker/scholar | 68a8f1680ccb150b005e440b501c05d7339e43e8 | [
"Apache-2.0"
] | null | null | null | download_imdb.py | WillSkywalker/scholar | 68a8f1680ccb150b005e440b501c05d7339e43e8 | [
"Apache-2.0"
] | null | null | null | from optparse import OptionParser
import os
import errno
import tarfile
from torchvision.datasets.utils import download_url
import file_handling as fh
class IMDB:
"""`IMDB <http://ai.stanford.edu/~amaas/data/sentiment/>`_ Dataset.
Args:
root (string): Root directory of dataset where ``processed/t... | 36.467626 | 132 | 0.58118 |
70432a8f0297752867f9c0e6e62e0d1257413f3e | 1,885 | py | Python | app/head/acts/calculation/impulse.py | Matexer/BSPR | a503a8795cb0f4cebe2eedd148aa00aea75b570e | [
"MIT"
] | null | null | null | app/head/acts/calculation/impulse.py | Matexer/BSPR | a503a8795cb0f4cebe2eedd148aa00aea75b570e | [
"MIT"
] | null | null | null | app/head/acts/calculation/impulse.py | Matexer/BSPR | a503a8795cb0f4cebe2eedd148aa00aea75b570e | [
"MIT"
] | null | null | null | from typing import Tuple
from statistics import mean
from ..templates import CalculationActTemplate
from ....core import Impulse, ImpulseOutput
from ....gui.frames import ResultsFrame
class ImpulseAct(CalculationActTemplate):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
s... | 34.907407 | 91 | 0.615385 |
02fc2676e4ef7daafb169ac5c65d32461e778e2c | 12,168 | py | Python | databroker/assets/core.py | ericdill/DataBroker | 970e9148dfab5e77101d40f059ecb30d064eac81 | [
"BSD-3-Clause"
] | 15 | 2019-09-07T13:18:43.000Z | 2022-03-25T07:03:47.000Z | databroker/assets/core.py | ericdill/DataBroker | 970e9148dfab5e77101d40f059ecb30d064eac81 | [
"BSD-3-Clause"
] | 258 | 2019-05-13T23:11:57.000Z | 2022-03-08T22:09:08.000Z | databroker/assets/core.py | ericdill/DataBroker | 970e9148dfab5e77101d40f059ecb30d064eac81 | [
"BSD-3-Clause"
] | 15 | 2019-06-03T20:25:36.000Z | 2022-03-25T14:08:29.000Z | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
from jsonschema import validate as js_validate
import warnings
import uuid
import time as ttime
import pandas as pd
from ..utils import sanitize_np, apply_to_dict_recursively
class DatumNotFound(Ex... | 30.805063 | 79 | 0.62311 |
ae8d7c089f31a437f6f83868c879ed93ab95eadb | 6,803 | py | Python | model.py | bearcatt/single-shot-detector | 649d55aa84f1c988afd920ed8abc601512405825 | [
"MIT"
] | 1 | 2020-01-31T09:28:54.000Z | 2020-01-31T09:28:54.000Z | model.py | bearcatt/single-shot-detector | 649d55aa84f1c988afd920ed8abc601512405825 | [
"MIT"
] | null | null | null | model.py | bearcatt/single-shot-detector | 649d55aa84f1c988afd920ed8abc601512405825 | [
"MIT"
] | null | null | null | import tensorflow as tf
from detector import SSD
from detector.anchor_generator import AnchorGenerator
from detector.box_predictor import RetinaNetBoxPredictor
from detector.feature_extractor import RetinaNetFeatureExtractor
from detector.backbones import mobilenet_v1, shufflenet_v2, resnet, hrnet
from metrics import E... | 37.174863 | 103 | 0.668676 |
090f7a6bd4941a17df6b010eeff613baa549ee60 | 1,461 | py | Python | tools/intogen/runtime/pyenv/lib/python2.7/site-packages/scipy/spatial/tests/test__plotutils.py | globusgenomics/galaxy | 7caf74d9700057587b3e3434c64e82c5b16540f1 | [
"CC-BY-3.0"
] | 1 | 2021-02-05T13:19:58.000Z | 2021-02-05T13:19:58.000Z | tools/intogen/runtime/pyenv/lib/python2.7/site-packages/scipy/spatial/tests/test__plotutils.py | globusgenomics/galaxy | 7caf74d9700057587b3e3434c64e82c5b16540f1 | [
"CC-BY-3.0"
] | 1 | 2018-04-15T22:59:15.000Z | 2018-04-15T22:59:15.000Z | tools/intogen/runtime/pyenv/lib/python2.7/site-packages/scipy/spatial/tests/test__plotutils.py | globusgenomics/galaxy | 7caf74d9700057587b3e3434c64e82c5b16540f1 | [
"CC-BY-3.0"
] | null | null | null | from __future__ import division, print_function, absolute_import
from numpy.testing import dec, assert_, assert_array_equal
try:
import matplotlib
matplotlib.rcParams['backend'] = 'Agg'
import matplotlib.pyplot as plt
has_matplotlib = True
except:
has_matplotlib = False
from scipy.spatial import ... | 30.4375 | 70 | 0.652293 |
1c3a31952cc8585ec814b199d27d13eef56bbe9b | 2,964 | py | Python | osspeak/recognition/actions/library/stdlib.py | OSSpeak/OSSpeak | 327c38a37684165f87bf8d76ab2ca135b43b8ab7 | [
"MIT"
] | 1 | 2020-03-17T10:24:41.000Z | 2020-03-17T10:24:41.000Z | osspeak/recognition/actions/library/stdlib.py | OSSpeak/OSSpeak | 327c38a37684165f87bf8d76ab2ca135b43b8ab7 | [
"MIT"
] | 12 | 2016-09-28T05:16:00.000Z | 2020-11-27T22:32:40.000Z | osspeak/recognition/actions/library/stdlib.py | OSSpeak/OSSpeak | 327c38a37684165f87bf8d76ab2ca135b43b8ab7 | [
"MIT"
] | null | null | null | from recognition.actions.library import (window, thread, engine,
extensions, general, text, clipboard, macro, osspeak, conditionals,
fsystem, math, directinput, flow, process)
from recognition.actions.library import _mouse as mouse
from recognition.actions.library import _keyboard as keyboard
from recognition.actions.l... | 26 | 85 | 0.654858 |
1e53ef4245037cf760e12089c0360b5bda84a10d | 1,945 | py | Python | selfdrive/test/helpers.py | tomidbsimcha/openpilot | 5663c116edbea0235b2a439257ebc6c0d39f4435 | [
"MIT"
] | 2 | 2019-09-04T14:31:54.000Z | 2019-09-13T13:18:46.000Z | selfdrive/test/helpers.py | tomidbsimcha/openpilot | 5663c116edbea0235b2a439257ebc6c0d39f4435 | [
"MIT"
] | null | null | null | selfdrive/test/helpers.py | tomidbsimcha/openpilot | 5663c116edbea0235b2a439257ebc6c0d39f4435 | [
"MIT"
] | 1 | 2020-09-16T07:13:00.000Z | 2020-09-16T07:13:00.000Z | import subprocess
from functools import wraps
from nose.tools import nottest
from common.android import ANDROID
from common.apk import update_apks, start_offroad, pm_apply_packages, android_packages
from common.params import Params
from selfdrive.version import training_version, terms_version
from selfdrive.manager im... | 28.602941 | 86 | 0.693059 |
ceba1096a1a5193dd72b090ff7a77ae03e2e2be9 | 1,650 | py | Python | nova/virt/powervm/constants.py | bopopescu/OpenStack-DNRM-Nova | 7354f378398850113ac93b511547ed05218dc770 | [
"Apache-2.0"
] | 1 | 2021-04-08T10:13:03.000Z | 2021-04-08T10:13:03.000Z | nova/virt/powervm/constants.py | bopopescu/OpenStack-DNRM-Nova | 7354f378398850113ac93b511547ed05218dc770 | [
"Apache-2.0"
] | 1 | 2018-01-19T07:50:49.000Z | 2018-01-19T07:50:49.000Z | nova/virt/powervm/constants.py | bopopescu/OpenStack-DNRM-Nova | 7354f378398850113ac93b511547ed05218dc770 | [
"Apache-2.0"
] | 1 | 2020-07-24T09:07:58.000Z | 2020-07-24T09:07:58.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 IBM Corp.
#
# 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
#
# ... | 33 | 78 | 0.765455 |
5da9c99efb383c6d0f20fb00340fe17aa6a13d4a | 2,031 | py | Python | realworld_benchmark/node_information.py | FedericoStazi/pna | 86581e52f13bdce80a72c941076a7cb136089c9b | [
"MIT"
] | 1 | 2020-11-26T18:16:50.000Z | 2020-11-26T18:16:50.000Z | realworld_benchmark/node_information.py | FedericoStazi/pna | 86581e52f13bdce80a72c941076a7cb136089c9b | [
"MIT"
] | null | null | null | realworld_benchmark/node_information.py | FedericoStazi/pna | 86581e52f13bdce80a72c941076a7cb136089c9b | [
"MIT"
] | null | null | null | import networkx
import random
import numpy
import scipy
import dgl
def normalize(l):
return (l - numpy.mean(l)) / (numpy.std(l) if numpy.std(l) > 1e-6 else 1)
def get_nodes_degree(graph):
return list(graph.in_degrees())
def get_nodes_closeness_centrality(graph):
return list(networkx.closeness_centrality(... | 44.152174 | 118 | 0.69227 |
d66792c15fb84a6215c306744121af81f2d15398 | 2,072 | py | Python | src/bandersnatch_filter_plugins/latest_name.py | hugovk/bandersnatch | ce95eb0d64ba582194618edde6e16d55f0ec3249 | [
"AFL-3.0"
] | null | null | null | src/bandersnatch_filter_plugins/latest_name.py | hugovk/bandersnatch | ce95eb0d64ba582194618edde6e16d55f0ec3249 | [
"AFL-3.0"
] | null | null | null | src/bandersnatch_filter_plugins/latest_name.py | hugovk/bandersnatch | ce95eb0d64ba582194618edde6e16d55f0ec3249 | [
"AFL-3.0"
] | null | null | null | import logging
from operator import itemgetter
from typing import Dict, Sequence, Tuple, Union
from packaging.version import LegacyVersion, Version, parse
from bandersnatch.filter import FilterReleasePlugin
logger = logging.getLogger("bandersnatch")
class LatestReleaseFilter(FilterReleasePlugin):
"""
Plugi... | 30.028986 | 88 | 0.585425 |
ff21b80306e05676b292cdb27daafc15392c5c16 | 1,467 | py | Python | cheritest/trunk/tests/cp2/test_cp2_clcr_otype.py | tupipa/beri | cef1b41d52592cfa7454ddf59f9f2994e447cd66 | [
"Apache-2.0"
] | 36 | 2015-05-29T16:47:19.000Z | 2022-02-08T21:16:26.000Z | cheritest/trunk/tests/cp2/test_cp2_clcr_otype.py | tupipa/beri | cef1b41d52592cfa7454ddf59f9f2994e447cd66 | [
"Apache-2.0"
] | 1 | 2015-10-14T13:05:21.000Z | 2015-10-19T20:34:03.000Z | cheritest/trunk/tests/cp2/test_cp2_clcr_otype.py | tupipa/beri | cef1b41d52592cfa7454ddf59f9f2994e447cd66 | [
"Apache-2.0"
] | 15 | 2015-06-11T07:10:58.000Z | 2021-06-18T05:14:54.000Z | #-
# Copyright (c) 2016 Michael Roe
# All rights reserved.
#
# This software was developed by the University of Cambridge Computer
# Laboratory as part of the Rigorous Engineering of Mainstream Systems (REMS)
# project, funded by EPSRC grant EP/K008528/1.
#
# @BERI_LICENSE_HEADER_START@
#
# Licensed to BERI Open System... | 39.648649 | 136 | 0.770279 |
413bc26df93e44b5af570d98dfedfbe0de18836c | 346 | py | Python | untitled/classes/eletronico.py | walterps/python_intermediario | f282ac4ad7fa34ead6f096797f0e90beb9ec326e | [
"MIT"
] | null | null | null | untitled/classes/eletronico.py | walterps/python_intermediario | f282ac4ad7fa34ead6f096797f0e90beb9ec326e | [
"MIT"
] | null | null | null | untitled/classes/eletronico.py | walterps/python_intermediario | f282ac4ad7fa34ead6f096797f0e90beb9ec326e | [
"MIT"
] | null | null | null | class Eletronico:
def __init__(self, nome):
self._nome = nome
self._ligado = False
def ligar(self):
if self._ligado:
return
self._ligado = True
print(f'{self._nome} esta ligando ! !')
def desligar(self):
if self._ligado:
self._ligado... | 18.210526 | 47 | 0.534682 |
93fdb5e9e425d2438fb69dcc39d346449670f6a1 | 374 | py | Python | libs/WebDriverUtil.py | bugbound/Angularrrgh | 30b31e86cd6678c0619e1bbf4077c62edcbd02a7 | [
"MIT"
] | null | null | null | libs/WebDriverUtil.py | bugbound/Angularrrgh | 30b31e86cd6678c0619e1bbf4077c62edcbd02a7 | [
"MIT"
] | null | null | null | libs/WebDriverUtil.py | bugbound/Angularrrgh | 30b31e86cd6678c0619e1bbf4077c62edcbd02a7 | [
"MIT"
] | null | null | null | from selenium import webdriver
from selenium.webdriver import Chrome
class WebDriverUtil:
@staticmethod
def getWebDriver(proxy):
chrome_options = webdriver.ChromeOptions()
if(proxy):
chrome_options.add_argument("--proxy-server={0}".format(proxy))
driver = Chrome(ch... | 24.933333 | 75 | 0.679144 |
4abba340f0cd417866d78f2a24ad8f736149fdd4 | 367 | py | Python | scripts/gen_key.py | ki-tools/sls_ki_synapse | 8c726a9ec568e3d416049a8813c21bbe87740f16 | [
"Apache-2.0"
] | 1 | 2018-11-21T19:54:34.000Z | 2018-11-21T19:54:34.000Z | scripts/gen_key.py | pcstout/sls_ki_synapse | 8c726a9ec568e3d416049a8813c21bbe87740f16 | [
"Apache-2.0"
] | 5 | 2019-03-12T16:44:35.000Z | 2019-03-15T21:46:00.000Z | scripts/gen_key.py | ki-tools/sls_ki_synapse | 8c726a9ec568e3d416049a8813c21bbe87740f16 | [
"Apache-2.0"
] | 2 | 2019-02-28T23:16:32.000Z | 2019-03-05T22:16:39.000Z | #!/usr/bin/env python3
import secrets
import argparse
def main():
"""
Generates a random key.
"""
parser = argparse.ArgumentParser()
parser.add_argument('bytes', type=int, nargs='?', help='How many bytes to generate.', default=64)
args = parser.parse_args()
print(secrets.token_hex(args.b... | 18.35 | 101 | 0.651226 |
88584d3418494bb775487753c985969226144b4f | 9,487 | py | Python | dashboard/tests/tests_templatetags.py | svenvdmeer/babybuddy | d9485f0208b529c1e19ccfeb8a52e78c76615767 | [
"BSD-2-Clause"
] | null | null | null | dashboard/tests/tests_templatetags.py | svenvdmeer/babybuddy | d9485f0208b529c1e19ccfeb8a52e78c76615767 | [
"BSD-2-Clause"
] | null | null | null | dashboard/tests/tests_templatetags.py | svenvdmeer/babybuddy | d9485f0208b529c1e19ccfeb8a52e78c76615767 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import pytz
from django.contrib.auth.models import User
from django.test import TestCase
from django.utils import timezone
from babybuddy.models import Settings
from core import models
from dashboard.templatetags import cards
class MockUserRequest:
def __init__(self, user):
self.... | 39.529167 | 79 | 0.586803 |
544a1d84239db962772d50db6ae0a32024b5d77d | 50,440 | py | Python | core_orthogonal_archived/sdfrenderer/renderer.py | trisct/DIST-Renderer | 18e8494f07bfa6487710afacda563a899d74e5d2 | [
"MIT"
] | null | null | null | core_orthogonal_archived/sdfrenderer/renderer.py | trisct/DIST-Renderer | 18e8494f07bfa6487710afacda563a899d74e5d2 | [
"MIT"
] | null | null | null | core_orthogonal_archived/sdfrenderer/renderer.py | trisct/DIST-Renderer | 18e8494f07bfa6487710afacda563a899d74e5d2 | [
"MIT"
] | null | null | null | import os, sys
import torch
import torch.nn as nn
import numpy as np
sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', '..'))
from core.utils.decoder_utils import decode_sdf, decode_sdf_gradient
from core.visualize.profiler import Profiler
from core.utils.render_utils import depth2normal
im... | 48.970874 | 344 | 0.64086 |
f917bb82c52df5f1f895cc458b4760919a6bc36f | 281 | py | Python | tf2utils/market.py | offish/tf2-rgb-values | 7a526e9918afef9f79b7be37e81cd374df66c57d | [
"MIT"
] | 1 | 2019-06-16T15:55:38.000Z | 2019-06-16T15:55:38.000Z | tf2utils/market.py | offish/tf2utils | 7a526e9918afef9f79b7be37e81cd374df66c57d | [
"MIT"
] | null | null | null | tf2utils/market.py | offish/tf2utils | 7a526e9918afef9f79b7be37e81cd374df66c57d | [
"MIT"
] | 2 | 2019-03-14T18:58:32.000Z | 2019-04-12T11:02:14.000Z | from tf2utils.methods import request
def get_price(name: str, cur: int = 1, appid: int = 440) -> dict:
overview = 'https://steamcommunity.com/market/priceoverview/'
params = {'currency': cur, 'appid': appid, 'market_hash_name': name}
return request(overview, params)
| 35.125 | 72 | 0.697509 |
5578ddf46fad16683a050f25237e829ec5f2c212 | 16,393 | py | Python | django/utils/feedgenerator.py | benjaoming/django | 6dbe979b4d9396e1b307c7d27388c97c13beb21c | [
"BSD-3-Clause"
] | 2 | 2015-01-21T15:45:07.000Z | 2015-02-21T02:38:13.000Z | django/utils/feedgenerator.py | HenriqueLR/django | d1ca70110f49f0be90206c8da516ac16aebc8c75 | [
"BSD-3-Clause"
] | null | null | null | django/utils/feedgenerator.py | HenriqueLR/django | d1ca70110f49f0be90206c8da516ac16aebc8c75 | [
"BSD-3-Clause"
] | 1 | 2020-05-25T08:55:19.000Z | 2020-05-25T08:55:19.000Z | """
Syndication feed generation library -- used for generating RSS, etc.
Sample usage:
>>> from django.utils import feedgenerator
>>> feed = feedgenerator.Rss201rev2Feed(
... title="Poynter E-Media Tidbits",
... link="http://www.poynter.org/column.asp?id=31",
... description="A group Weblog by the sharpes... | 39.501205 | 107 | 0.61264 |
5eb6ab8a4d9630137f645dbb48cd5f46cb276d6f | 2,324 | py | Python | examples/torch/trpo_pendulum_ray_sampler.py | thanhkaist/garage | 1d840df357282a675b8fce839bb0e5f72a8abba9 | [
"MIT"
] | 7 | 2022-02-01T03:02:24.000Z | 2022-02-10T12:54:05.000Z | examples/torch/trpo_pendulum_ray_sampler.py | thanhkaist/garage | 1d840df357282a675b8fce839bb0e5f72a8abba9 | [
"MIT"
] | null | null | null | examples/torch/trpo_pendulum_ray_sampler.py | thanhkaist/garage | 1d840df357282a675b8fce839bb0e5f72a8abba9 | [
"MIT"
] | 2 | 2022-02-03T03:33:25.000Z | 2022-02-10T12:54:07.000Z | #!/usr/bin/env python3
"""This is an example to train a task with TRPO algorithm (PyTorch).
Uses Ray sampler instead of OnPolicyVectorizedSampler.
Here it runs InvertedDoublePendulum-v2 environment with 100 iterations.
"""
import numpy as np
import ray
import torch
from garage import wrap_experiment
from garage.envs ... | 35.212121 | 77 | 0.654905 |
a6f61c5c223a5c3c8e6af8bf7f15539d0a89ff1c | 1,825 | py | Python | scripts/bse.py | reckbo/ppl | 916d96188a43bbc5915020edfa12f14895b5f66c | [
"BSD-3-Clause"
] | null | null | null | scripts/bse.py | reckbo/ppl | 916d96188a43bbc5915020edfa12f14895b5f66c | [
"BSD-3-Clause"
] | null | null | null | scripts/bse.py | reckbo/ppl | 916d96188a43bbc5915020edfa12f14895b5f66c | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
import operator
from util import logfmt
from plumbum import local, cli, FG
from plumbum.cmd import unu
import logging
logger = logging.getLogger()
logging.basicConfig(level=logging.DEBUG, format=logfmt(__file__))
def get_grad_dirs(hdr):
return [map(floa... | 33.796296 | 99 | 0.62137 |
bb75657b3bc73a7bff61c3ea4edfdb7c3c976aa7 | 2,785 | py | Python | scripts/identify_neuron_classes/deprecated/identify_2nd3rd4thOrder_sensory_synapseThres.py | mwinding/connectome_analysis | dbc747290891805863c9481921d8080dc2043d21 | [
"MIT"
] | 1 | 2021-06-10T05:48:16.000Z | 2021-06-10T05:48:16.000Z | identify_neuron_classes/deprecated/identify_2nd3rd4thOrder_sensory_synapseThres.py | mwinding/connectome_tools | 0392f6b1e924194299ea7760d8386eb01f3371a3 | [
"MIT"
] | 2 | 2022-01-21T11:48:45.000Z | 2022-01-21T11:48:45.000Z | scripts/identify_neuron_classes/deprecated/identify_2nd3rd4thOrder_sensory_synapseThres.py | mwinding/connectome_analysis | dbc747290891805863c9481921d8080dc2043d21 | [
"MIT"
] | 1 | 2022-02-02T15:39:52.000Z | 2022-02-02T15:39:52.000Z | #%%
import os
try:
os.chdir('/Volumes/GoogleDrive/My Drive/python_code/connectome_tools/')
print(os.getcwd())
except:
pass
#%%
import sys
sys.path.append("/Volumes/GoogleDrive/My Drive/python_code/connectome_tools/")
import pandas as pd
import numpy as np
import connectome_tools.process_matrix as promat... | 28.71134 | 104 | 0.721724 |
5f5fbb2c39e4950cc695eef60a8f1e98685126b3 | 2,521 | py | Python | examples/dfp/v201805/proposal_line_item_service/update_proposal_line_items.py | christineyi3898/googleads-python-lib | cd707dc897b93cf1bbb19355f7424e7834e7fb55 | [
"Apache-2.0"
] | 1 | 2019-10-21T04:10:22.000Z | 2019-10-21T04:10:22.000Z | examples/dfp/v201805/proposal_line_item_service/update_proposal_line_items.py | christineyi3898/googleads-python-lib | cd707dc897b93cf1bbb19355f7424e7834e7fb55 | [
"Apache-2.0"
] | null | null | null | examples/dfp/v201805/proposal_line_item_service/update_proposal_line_items.py | christineyi3898/googleads-python-lib | cd707dc897b93cf1bbb19355f7424e7834e7fb55 | [
"Apache-2.0"
] | 1 | 2019-10-21T04:10:51.000Z | 2019-10-21T04:10:51.000Z | #!/usr/bin/env python
#
# Copyright 2015 Google 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 requir... | 34.534247 | 78 | 0.718366 |
7cd0482c75d7157df218071a2e22ce2904d094b6 | 5,130 | py | Python | youtube_dl/extractor/appletrailers.py | Logmytech/youtube-dl-QT | 1497297719a95c4f70fbfa32e0fa4e38cdd475dc | [
"MIT"
] | null | null | null | youtube_dl/extractor/appletrailers.py | Logmytech/youtube-dl-QT | 1497297719a95c4f70fbfa32e0fa4e38cdd475dc | [
"MIT"
] | null | null | null | youtube_dl/extractor/appletrailers.py | Logmytech/youtube-dl-QT | 1497297719a95c4f70fbfa32e0fa4e38cdd475dc | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import compat_urlparse
from ..utils import (
int_or_none,
)
class AppleTrailersIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?trailers\.apple\.com/trailers/(?P<company>[^/]+)/(?P<movie>[^/]+)'... | 36.642857 | 104 | 0.45809 |
39371555d4c38577d65a0b21653aa060a6bfceb8 | 1,514 | py | Python | setup.py | brighthive/jdx-client-api-python | ed94c578a6c9a5e9aadf8764439c22783ac1d9d5 | [
"Apache-2.0"
] | null | null | null | setup.py | brighthive/jdx-client-api-python | ed94c578a6c9a5e9aadf8764439c22783ac1d9d5 | [
"Apache-2.0"
] | null | null | null | setup.py | brighthive/jdx-client-api-python | ed94c578a6c9a5e9aadf8764439c22783ac1d9d5 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
JDX reference application API
This is a collection of schemas and endpoints for the various JDX, Concentric Sky facing REST endpoints, the schemas define an API contract of sorts between the request and response expectations of the JDX reference application. This API is to be mutually deve... | 36.926829 | 317 | 0.737781 |
7d73ee69c02b22c4deb234b6897e5132430f6142 | 1,551 | py | Python | setup.py | Asmodius/sanic-scheduler | 68c0329789dd2d8c8c9a82d33b4864c67ca94006 | [
"MIT"
] | 7 | 2018-11-12T03:35:38.000Z | 2021-01-13T04:30:11.000Z | setup.py | Asmodius/sanic-scheduler | 68c0329789dd2d8c8c9a82d33b4864c67ca94006 | [
"MIT"
] | 1 | 2018-12-19T10:07:57.000Z | 2019-10-21T13:46:19.000Z | setup.py | Asmodius/sanic-scheduler | 68c0329789dd2d8c8c9a82d33b4864c67ca94006 | [
"MIT"
] | 2 | 2019-10-17T10:39:52.000Z | 2019-12-03T10:57:32.000Z | import os
import sys
from setuptools import setup
def read(file_name):
return open(os.path.join(os.path.dirname(__file__), file_name)).read()
meta = {}
exec(read('sanic_scheduler/__meta__.py'), meta)
if sys.argv[-1] == 'publish':
os.system("rm dist/*.gz dist/*.whl")
os.system("git tag -a %s -m 'v%s'" ... | 29.826923 | 84 | 0.633785 |
3163ef859493bb996b1de8d13b84996c07045b22 | 22,484 | py | Python | djangoProject1/venv/Lib/site-packages/owlready2/driver.py | meddhafer97/Risk-management-khnowledge-based-system | aba86734801a9e0313071e2c9931295e0da08ed0 | [
"MIT"
] | null | null | null | djangoProject1/venv/Lib/site-packages/owlready2/driver.py | meddhafer97/Risk-management-khnowledge-based-system | aba86734801a9e0313071e2c9931295e0da08ed0 | [
"MIT"
] | null | null | null | djangoProject1/venv/Lib/site-packages/owlready2/driver.py | meddhafer97/Risk-management-khnowledge-based-system | aba86734801a9e0313071e2c9931295e0da08ed0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Owlready2
# Copyright (C) 2017-2019 Jean-Baptiste LAMY
# LIMICS (Laboratoire d'informatique médicale et d'ingénierie des connaissances en santé), UMR_S 1142
# University Paris 13, Sorbonne paris-Cité, Bobigny, France
# This program is free software: you can redistribute it and/or modify
# it ... | 40.88 | 583 | 0.568582 |
d219d17c660ac000f7d5d6dcef19731b6c61372a | 1,349 | py | Python | mythril/support/loader.py | yrashk/mythril | 0cea8f562726da468ab4761ff1ff3746ab0d747a | [
"MIT"
] | null | null | null | mythril/support/loader.py | yrashk/mythril | 0cea8f562726da468ab4761ff1ff3746ab0d747a | [
"MIT"
] | null | null | null | mythril/support/loader.py | yrashk/mythril | 0cea8f562726da468ab4761ff1ff3746ab0d747a | [
"MIT"
] | 1 | 2018-08-27T02:38:05.000Z | 2018-08-27T02:38:05.000Z | from mythril.disassembler.disassembly import Disassembly
import logging
import re
class DynLoader:
def __init__(self, eth):
self.eth = eth
self.storage_cache = {}
def read_storage(self, contract_address, index):
try:
contract_ref = self.storage_cache[contract_address]
... | 24.981481 | 94 | 0.62639 |
7eeea297bedfd7f471f23c0ce004e83a149e5aea | 16,724 | py | Python | ludwig/modules/metric_modules.py | lnxpy/ludwig | 5efd17f76522df91efbfe761e082b3b256fe7952 | [
"Apache-2.0"
] | null | null | null | ludwig/modules/metric_modules.py | lnxpy/ludwig | 5efd17f76522df91efbfe761e082b3b256fe7952 | [
"Apache-2.0"
] | null | null | null | ludwig/modules/metric_modules.py | lnxpy/ludwig | 5efd17f76522df91efbfe761e082b3b256fe7952 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright (c) 2019 Uber Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 34.340862 | 116 | 0.642251 |
bc8dec915b2a0f836e501455704016f4b1e4eff1 | 14,197 | py | Python | research/differential_privacy/multiple_teachers/input.py | daquexian/models | fad6075359b852b9c0a4c6f1b068790d44a6441a | [
"Apache-2.0"
] | 310 | 2017-01-23T15:04:12.000Z | 2022-01-11T05:50:41.000Z | research/differential_privacy/multiple_teachers/input.py | wzy1510300a28/models | 42a3da72313b8814ef0ced8f425af90b57313b9f | [
"Apache-2.0"
] | 12 | 2017-05-23T17:42:59.000Z | 2020-01-10T05:16:22.000Z | research/differential_privacy/multiple_teachers/input.py | wzy1510300a28/models | 42a3da72313b8814ef0ced8f425af90b57313b9f | [
"Apache-2.0"
] | 73 | 2017-01-24T13:57:45.000Z | 2021-09-29T18:52:57.000Z | # Copyright 2016 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... | 33.483491 | 134 | 0.700007 |
7fc6f3d4b636c25ca81e89df2af542051c764def | 54,986 | py | Python | rapid7vmconsole/models/submission.py | pdeardorff-r7/vm-console-client-python | 4bee83aa4db2b328ba6894cebac55743f922ce5a | [
"MIT"
] | null | null | null | rapid7vmconsole/models/submission.py | pdeardorff-r7/vm-console-client-python | 4bee83aa4db2b328ba6894cebac55743f922ce5a | [
"MIT"
] | null | null | null | rapid7vmconsole/models/submission.py | pdeardorff-r7/vm-console-client-python | 4bee83aa4db2b328ba6894cebac55743f922ce5a | [
"MIT"
] | null | null | null | # coding: utf-8
"""
InsightVM API
# Overview This guide documents the InsightVM Application Programming Interface (API) Version 3. This API supports the Representation State Transfer (REST) design pattern. Unless noted otherwise this API accepts and produces the `application/json` media type. This API uses ... | 215.631373 | 48,045 | 0.495872 |
4df505d10a1bb2fe4bb5d026260be26a9766ad29 | 8,544 | py | Python | raiden/tests/unit/test_wal.py | ezdac/raiden | d7504996e6738b55d5a9dcf9a36ef66797f6f326 | [
"MIT"
] | null | null | null | raiden/tests/unit/test_wal.py | ezdac/raiden | d7504996e6738b55d5a9dcf9a36ef66797f6f326 | [
"MIT"
] | 60 | 2021-06-14T08:32:39.000Z | 2022-03-31T23:45:35.000Z | raiden/tests/unit/test_wal.py | ezdac/raiden | d7504996e6738b55d5a9dcf9a36ef66797f6f326 | [
"MIT"
] | null | null | null | import os
import random
import sqlite3
from dataclasses import dataclass, field
from datetime import datetime
import pytest
import ulid
from raiden.constants import RAIDEN_DB_VERSION
from raiden.exceptions import InvalidDBData
from raiden.storage.serialization import JSONSerializer
from raiden.storage.sqlite import (... | 33.375 | 95 | 0.750585 |
02fa3b7b19b31e82979d0b053a8f7788849dcee0 | 2,522 | py | Python | ansible/venv/lib/python2.7/site-packages/ansible/modules/web_infrastructure/ansible_tower/tower_job_cancel.py | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 0fb18850afe0d8609693ba4b23f29c7cda17d97f | [
"MIT"
] | 17 | 2017-06-07T23:15:01.000Z | 2021-08-30T14:32:36.000Z | ansible/ansible/modules/web_infrastructure/ansible_tower/tower_job_cancel.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 9 | 2017-06-25T03:31:52.000Z | 2021-05-17T23:43:12.000Z | ansible/ansible/modules/web_infrastructure/ansible_tower/tower_job_cancel.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 3 | 2018-05-26T21:31:22.000Z | 2019-09-28T17:00:45.000Z | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1... | 24.72549 | 107 | 0.664552 |
9775abbd4cb9b4b4efa9e0053771c6c695702301 | 1,023 | py | Python | neurst_pt/layers/__init__.py | ishine/neurst | 2ba322393fcfed4261b33f4a657e12bbe321baaa | [
"Apache-2.0"
] | 208 | 2020-11-12T03:56:41.000Z | 2022-03-27T07:01:27.000Z | neurst_pt/layers/__init__.py | ishine/neurst | 2ba322393fcfed4261b33f4a657e12bbe321baaa | [
"Apache-2.0"
] | 16 | 2021-02-20T07:57:03.000Z | 2022-01-27T07:36:31.000Z | neurst_pt/layers/__init__.py | ishine/neurst | 2ba322393fcfed4261b33f4a657e12bbe321baaa | [
"Apache-2.0"
] | 33 | 2020-11-12T04:44:50.000Z | 2022-03-23T09:22:29.000Z | import torch.nn as nn
from neurst.utils.registry import setup_registry
from neurst_pt.layers.attentions.multi_head_attention import MultiHeadAttention, MultiHeadSelfAttention
from neurst_pt.layers.common_layers import PrePostProcessingWrapper, TransformerFFN
build_base_layer, register_base_layer = setup_registry("bas... | 37.888889 | 103 | 0.672532 |
be607bfadcd233e30f6625146a16312c522c6f77 | 13,105 | py | Python | maya/plug-ins/caramel.py | cedricB/circeCharacterWorksTools | cf7d793239c291a8a8aec5c60ede1250415581d9 | [
"MIT"
] | 34 | 2015-03-13T08:40:02.000Z | 2022-03-31T12:30:48.000Z | maya/plug-ins/caramel.py | cedricB/circeCharacterWorksTools | cf7d793239c291a8a8aec5c60ede1250415581d9 | [
"MIT"
] | null | null | null | maya/plug-ins/caramel.py | cedricB/circeCharacterWorksTools | cf7d793239c291a8a8aec5c60ede1250415581d9 | [
"MIT"
] | 9 | 2015-03-13T08:40:04.000Z | 2020-11-06T09:15:45.000Z | '''
########################################################################
# #
# caramel.py #
# #
# Email: ced... | 43.538206 | 144 | 0.570011 |
c8a54a18accd2969ff404dcaadad6fc485edb7ce | 12,962 | py | Python | run_projector.py | johndpope/GenEdi | 9ff8e2f1984aa04c7f634be388db8bb85ee57b35 | [
"MIT"
] | 4 | 2020-12-26T20:03:47.000Z | 2022-02-11T12:04:50.000Z | run_projector.py | GreenLimeSia/Generating-and-Editing | 45fbe1d72bf11b7df9ec22489b6b6b1c503a87a2 | [
"MIT"
] | 3 | 2020-12-26T21:02:00.000Z | 2021-05-27T12:47:08.000Z | run_projector.py | GreenLimeSia/Generating-and-Editing | 45fbe1d72bf11b7df9ec22489b6b6b1c503a87a2 | [
"MIT"
] | 2 | 2020-12-26T20:03:52.000Z | 2021-08-24T02:17:53.000Z | import os
import argparse
import numpy as np
import torch
import warnings
import stylegan2
from stylegan2 import utils
# ----------------------------------------------------------------------------
_description = """StyleGAN2 projector.
Run 'python %(prog)s <subcommand> --help' for subcommand help."""
# ------------... | 31.926108 | 109 | 0.570051 |
49716194cf75b8f81619576046120682fdff9f49 | 1,907 | py | Python | scripts/transfer_datasets.py | thsshz/keras-retinanet | 55d353c5abac95214e38e921ebe72d77c2c21a19 | [
"Apache-2.0"
] | null | null | null | scripts/transfer_datasets.py | thsshz/keras-retinanet | 55d353c5abac95214e38e921ebe72d77c2c21a19 | [
"Apache-2.0"
] | null | null | null | scripts/transfer_datasets.py | thsshz/keras-retinanet | 55d353c5abac95214e38e921ebe72d77c2c21a19 | [
"Apache-2.0"
] | null | null | null | import csv
def transfer_annotations(input_name, output_name, pre_dir):
input_file = open(input_name, 'r')
input_lines = input_file.readlines()
output_lines = []
for input_line in input_lines:
input_line = input_line.rstrip()
annotations = input_line.split(' ')
image_name = pre_... | 35.981132 | 150 | 0.597273 |
8a3226bbcac8409c631f3c2c320d4b3898af8a92 | 3,342 | py | Python | iriusrisk-python-client-lib/iriusrisk_python_client_lib/models/unassing_users_group_request_body.py | iriusrisk/iriusrisk-python-client-lib | 4912706cd1e5c0bc555dbc7da02fb64cbeab3b18 | [
"Apache-2.0"
] | null | null | null | iriusrisk-python-client-lib/iriusrisk_python_client_lib/models/unassing_users_group_request_body.py | iriusrisk/iriusrisk-python-client-lib | 4912706cd1e5c0bc555dbc7da02fb64cbeab3b18 | [
"Apache-2.0"
] | null | null | null | iriusrisk-python-client-lib/iriusrisk_python_client_lib/models/unassing_users_group_request_body.py | iriusrisk/iriusrisk-python-client-lib | 4912706cd1e5c0bc555dbc7da02fb64cbeab3b18 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
IriusRisk API
Products API # noqa: E501
OpenAPI spec version: 1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class UnassingUsersGroupRequestBody(object):
"""NOTE: This class is auto generated b... | 28.322034 | 92 | 0.577199 |
fbb0c5d6125f2ede5f1e035be8a59d6f8cb42b81 | 2,334 | py | Python | src/dependencys/comtypes/comtypes/test/test_outparam.py | Advik-B/Virus | 51bc71b9e0ce4953053d43fc88477ab29957b2c3 | [
"MIT"
] | 1 | 2021-11-24T07:32:20.000Z | 2021-11-24T07:32:20.000Z | src/dependencys/comtypes/comtypes/test/test_outparam.py | Advik-B/Virus | 51bc71b9e0ce4953053d43fc88477ab29957b2c3 | [
"MIT"
] | null | null | null | src/dependencys/comtypes/comtypes/test/test_outparam.py | Advik-B/Virus | 51bc71b9e0ce4953053d43fc88477ab29957b2c3 | [
"MIT"
] | null | null | null | import sys
from ctypes import *
import unittest
import comtypes.test
comtypes.test.requires("devel")
from comtypes import BSTR, IUnknown, GUID, COMMETHOD, HRESULT
if sys.version_info >= (3, 0):
text_type = str
else:
text_type = unicode
class IMalloc(IUnknown):
_iid_ = GUID("{00000002-0000-0000-C000-00... | 29.175 | 86 | 0.622965 |
2aad92209b7dce39de8e5e85dd3ac99c2132eb4d | 3,379 | py | Python | SoftLayer/CLI/virt/create_options.py | SLsthompson/softlayer-python | 6dd6159f3e335e8d0e50dd3f2c8fa8cd62211a06 | [
"MIT"
] | null | null | null | SoftLayer/CLI/virt/create_options.py | SLsthompson/softlayer-python | 6dd6159f3e335e8d0e50dd3f2c8fa8cd62211a06 | [
"MIT"
] | null | null | null | SoftLayer/CLI/virt/create_options.py | SLsthompson/softlayer-python | 6dd6159f3e335e8d0e50dd3f2c8fa8cd62211a06 | [
"MIT"
] | null | null | null | """Virtual server order options."""
# :license: MIT, see LICENSE for more details.
import os
import os.path
import click
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
@click.command()
@environment.pass_env
def cli(env):
"""Virtual server order options."""
vsi =... | 30.169643 | 72 | 0.571175 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.