hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
91528b3f2f89922e3836be3837da6f0268fac9ad | 2,148 | py | Python | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/identity_properties_py3.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | null | null | null | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/identity_properties_py3.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | null | null | null | sdk/containerregistry/azure-mgmt-containerregistry/azure/mgmt/containerregistry/v2019_05_01/models/identity_properties_py3.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 44.75 | 131 | 0.668994 |
9152a300303b7ebfad45a478968744ece28e7eeb | 1,546 | py | Python | QUANTAXIS_Monitor_GUI/ProgressDlgs/ProgressDlg_Timeout.py | simplezhang57/QUANTAXIS | 0fab23ee3cc4048a30b5eed3c311a5c9cdce8110 | [
"MIT"
] | 2 | 2018-10-29T12:01:55.000Z | 2021-03-05T10:28:59.000Z | QUANTAXIS_Monitor_GUI/ProgressDlgs/ProgressDlg_Timeout.py | frosthaoz/QUANTAXIS | f5f482418e5f6e23ac3530089b8d17300d931b48 | [
"MIT"
] | null | null | null | QUANTAXIS_Monitor_GUI/ProgressDlgs/ProgressDlg_Timeout.py | frosthaoz/QUANTAXIS | f5f482418e5f6e23ac3530089b8d17300d931b48 | [
"MIT"
] | 3 | 2018-11-29T07:07:56.000Z | 2021-02-09T17:24:56.000Z | from PyQt5.Qt import QLabel
from PyQt5.Qt import QDialog
from PyQt5.Qt import QMessageBox
from PyQt5.Qt import QHBoxLayout
from PyQt5.Qt import *
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtGui import QCloseEvent
from abc import ABC, abstractmethod
'''
谨慎使用, 调试的时候会锁死! 而且 多线程依赖 UI timer 不是很准确!!
... | 25.766667 | 76 | 0.610608 |
9152b0bbb4c5d2422e1501cc05aad7474fcd2c73 | 5,905 | py | Python | roccclient/models/error.py | Sage-Bionetworks/rocc-client | 85b73afe7d4977094810c0a8094f56ebe7ed3d48 | [
"Apache-2.0"
] | null | null | null | roccclient/models/error.py | Sage-Bionetworks/rocc-client | 85b73afe7d4977094810c0a8094f56ebe7ed3d48 | [
"Apache-2.0"
] | 14 | 2020-12-06T23:54:23.000Z | 2021-02-03T18:35:02.000Z | roccclient/models/error.py | Sage-Bionetworks/rocc-client | 85b73afe7d4977094810c0a8094f56ebe7ed3d48 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Registry of Open Community Challenge API
The OpenAPI specification implemented by the Challenge Registries. # Introduction TBA # noqa: E501
The version of the OpenAPI document: 0.1.4
Contact: thomas.schaffter@sagebionetworks.org
Generated by: https://openapi-generator.tech
"... | 28.119048 | 117 | 0.572904 |
9152b21a62abce0b48251af531ab1c732d49f739 | 497 | py | Python | wanderbits/config.py | Who8MyLunch/WanderBits | 058685971f5ab2083c9fdd7bd2eba960c2ae5992 | [
"MIT"
] | null | null | null | wanderbits/config.py | Who8MyLunch/WanderBits | 058685971f5ab2083c9fdd7bd2eba960c2ae5992 | [
"MIT"
] | 1 | 2018-01-13T20:53:38.000Z | 2018-01-13T20:53:38.000Z | wanderbits/config.py | Who8MyLunch/WanderBits | 058685971f5ab2083c9fdd7bd2eba960c2ae5992 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from __future__ import division, print_function, unicode_literals
"""
Read and write game config files.
"""
import yaml
def read(fname):
"""
Read game config information from file.
"""
info = yaml.load(open(fname))
return info
def write(fname, info):
"""
Write game c... | 18.407407 | 65 | 0.627767 |
9152d277b4f72eb43a5da735ecc79f33d7630fe3 | 2,269 | py | Python | flexget/plugins/metainfo/nzb_size.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | 1 | 2018-05-02T21:14:50.000Z | 2018-05-02T21:14:50.000Z | flexget/plugins/metainfo/nzb_size.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | null | null | null | flexget/plugins/metainfo/nzb_size.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | null | null | null | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
import mimetypes
from flexget import plugin
from flexget.event import event
log = logging.getLogger('nzb_size')
# a bit hacky, add nzb as a known mimetype
mime... | 33.865672 | 106 | 0.566329 |
9152dbe4fb7bfa0cdccec3d99dc1d8a57c6442b5 | 1,365 | py | Python | AlphagoZero/ai.py | sangyi92/alphago_zero | 6acd092e9b904eb725da031f8c5f8b4e1bdae111 | [
"MIT"
] | 10 | 2017-11-14T14:30:44.000Z | 2019-11-11T06:59:36.000Z | AlphagoZero/ai.py | sangyi92/alphago_zero | 6acd092e9b904eb725da031f8c5f8b4e1bdae111 | [
"MIT"
] | 1 | 2018-02-02T10:12:37.000Z | 2018-02-02T10:20:53.000Z | AlphagoZero/ai.py | sangyi92/alphago_zero | 6acd092e9b904eb725da031f8c5f8b4e1bdae111 | [
"MIT"
] | 8 | 2017-11-22T01:22:50.000Z | 2019-03-27T09:04:13.000Z | """Policy players"""
import numpy as np
from AlphagoZero import go
from AlphagoZero import mcts
from operator import itemgetter
class MCTSPlayer(object):
def __init__(self, value_function, policy_function, c_puct=5, n_playout=1600, evaluating=True, self_play=False):
self.mcts = mcts.MCTS(value_function, po... | 35.921053 | 116 | 0.616117 |
9152fa067c0a89eb02b27a74b46329a61c1794de | 1,275 | py | Python | examples/docs_snippets/docs_snippets/concepts/io_management/load_custom_type_from_config.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | examples/docs_snippets/docs_snippets/concepts/io_management/load_custom_type_from_config.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | examples/docs_snippets/docs_snippets/concepts/io_management/load_custom_type_from_config.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | from dagster import In, dagster_type_loader, job, op, usable_as_dagster_type
# def_start_marker
@dagster_type_loader(
config_schema={"diameter": float, "juiciness": float, "cultivar": str}
)
def apple_loader(_context, config):
return Apple(
diameter=config["diameter"],
juiciness=config["juicin... | 23.181818 | 76 | 0.549804 |
91532198cb790e6ef84cb72983ffceeb01a98321 | 3,726 | py | Python | dialogflow_v2/gapic/intents_client_config.py | gertventer1970/dialogflow-python-client-v2 | e78b0e6765f94fb9ecbbc72c9fc30ce7245703e2 | [
"Apache-2.0"
] | 1 | 2020-10-14T07:43:19.000Z | 2020-10-14T07:43:19.000Z | dialogflow_v2/gapic/intents_client_config.py | everydaycodings/dialogflow-python-client-v2 | c1c925d94726f49e549870e087ad79ee491056e2 | [
"Apache-2.0"
] | null | null | null | dialogflow_v2/gapic/intents_client_config.py | everydaycodings/dialogflow-python-client-v2 | c1c925d94726f49e549870e087ad79ee491056e2 | [
"Apache-2.0"
] | null | null | null | config = {
"interfaces": {
"google.cloud.dialogflow.v2.Intents": {
"retry_codes": {
"retry_policy_1_codes": ["UNAVAILABLE"],
"no_retry_codes": [],
"retry_policy_2_codes": ["UNAVAILABLE"],
"no_retry_1_codes": [],
},
... | 42.340909 | 65 | 0.460279 |
915324f51ee374a3e26ef1211a19e1b9ee40375b | 4,265 | py | Python | capnpy/testing/compiler/test_distutils.py | wridgers/capnpy | 63546597cc94434a271187f2e5af60f02e086caa | [
"MIT"
] | 1 | 2019-05-29T19:47:53.000Z | 2019-05-29T19:47:53.000Z | capnpy/testing/compiler/test_distutils.py | wridgers/capnpy | 63546597cc94434a271187f2e5af60f02e086caa | [
"MIT"
] | null | null | null | capnpy/testing/compiler/test_distutils.py | wridgers/capnpy | 63546597cc94434a271187f2e5af60f02e086caa | [
"MIT"
] | 4 | 2018-01-28T23:44:41.000Z | 2019-09-28T17:50:14.000Z | import py
import pytest
import sys
import os
import sysconfig
from capnpy.testing.compiler.support import CompilerTest
from capnpy.compiler.compiler import DistutilsCompiler
@pytest.fixture
def ROOT():
import pkg_resources
try:
dist = pkg_resources.get_distribution('capnpy')
except pkg_resources.D... | 30.905797 | 75 | 0.563189 |
915325f94740cc31513800c5c1122b919959fe3b | 3,026 | py | Python | ev3sim/devices/colour/ev3.py | platy11/ev3sim | df8693523f630e9838b8f79f2b7017a86633d696 | [
"BSD-3-Clause"
] | null | null | null | ev3sim/devices/colour/ev3.py | platy11/ev3sim | df8693523f630e9838b8f79f2b7017a86633d696 | [
"BSD-3-Clause"
] | null | null | null | ev3sim/devices/colour/ev3.py | platy11/ev3sim | df8693523f630e9838b8f79f2b7017a86633d696 | [
"BSD-3-Clause"
] | null | null | null | import random
from ev3sim.devices.base import Device, IDeviceInteractor
from ev3sim.devices.colour.base import ColourSensorMixin
from ev3sim.simulation.loader import ScriptLoader
from ev3sim.visual.manager import ScreenObjectManager
from ev3sim.visual.utils import worldspace_to_screenspace
class ColorInteractor(IDevic... | 36.457831 | 153 | 0.646067 |
91532c4a90d7a60578578846c859300a7126ef20 | 5,193 | py | Python | tests/test_user_management.py | mccbryan3/falconpy | ec4d3a574f2e9b06d046fc8d7ca6818f1f97331f | [
"Unlicense"
] | null | null | null | tests/test_user_management.py | mccbryan3/falconpy | ec4d3a574f2e9b06d046fc8d7ca6818f1f97331f | [
"Unlicense"
] | null | null | null | tests/test_user_management.py | mccbryan3/falconpy | ec4d3a574f2e9b06d046fc8d7ca6818f1f97331f | [
"Unlicense"
] | null | null | null | # test_user_management.py
# This class tests the user_management service class
import os
import sys
import pytest
# Authentication via the test_authorization.py
from tests import test_authorization as Authorization
# Classes to test - manually imported from sibling folder
from falconpy import user_management as Falcon... | 37.905109 | 111 | 0.651261 |
9153372af755aad01bd7b6fe3d394605c602ae10 | 995 | py | Python | packages/fetchai/skills/task_test_skill/__init__.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 28 | 2021-10-31T18:54:14.000Z | 2022-03-17T13:10:43.000Z | packages/fetchai/skills/task_test_skill/__init__.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | 66 | 2021-10-31T11:55:48.000Z | 2022-03-31T06:26:23.000Z | packages/fetchai/skills/task_test_skill/__init__.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2018-2021 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | 36.851852 | 80 | 0.61206 |
91534fe0c7bcb8f33371e9af3f2e2442a4985d4b | 7,871 | py | Python | osmapping.py | astyler/osmapping | cc95908a3e6d6d4ed26f664ddf4dbd267b75b3be | [
"MIT"
] | null | null | null | osmapping.py | astyler/osmapping | cc95908a3e6d6d4ed26f664ddf4dbd267b75b3be | [
"MIT"
] | null | null | null | osmapping.py | astyler/osmapping | cc95908a3e6d6d4ed26f664ddf4dbd267b75b3be | [
"MIT"
] | null | null | null | __author__ = 'alex styler'
import math
import pandas as pd
import numpy as np
import fiona as fio
from matplotlib.figure import Figure
from matplotlib.collections import PathCollection
from mpl_toolkits.basemap import Basemap
from matplotlib.patches import Path
from matplotlib.transforms import Bbox
# haversine fu... | 38.024155 | 112 | 0.623047 |
915369394ca7ecea3327f9d7022b255e907605d4 | 4,590 | py | Python | CV_backdoor/eval_robustness.py | ziqi-zhang/ReMoS_artifact | 9cbac09333aeb0891cc54d287d6829fdf4bd5d23 | [
"MIT"
] | 4 | 2022-03-14T06:11:19.000Z | 2022-03-16T09:21:59.000Z | CV_backdoor/eval_robustness.py | ziqi-zhang/ReMoS_artifact | 9cbac09333aeb0891cc54d287d6829fdf4bd5d23 | [
"MIT"
] | null | null | null | CV_backdoor/eval_robustness.py | ziqi-zhang/ReMoS_artifact | 9cbac09333aeb0891cc54d287d6829fdf4bd5d23 | [
"MIT"
] | 2 | 2022-03-14T22:58:24.000Z | 2022-03-16T05:29:37.000Z | import argparse
import torch
import time
import sys
import numpy as np
import torchvision
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torchcontrib
from PIL import Image
from pdb import set_trace as st
from torchvision import transforms
from advertorch.attacks import LinfP... | 36.428571 | 181 | 0.657298 |
9153793d6f02f96e46399cca0eb6556a893685b4 | 503 | py | Python | nextalbums/__init__.py | seanbrecke/albums | 890b237d9cdafc243a4319e5bad34614b40fcfeb | [
"MIT"
] | null | null | null | nextalbums/__init__.py | seanbrecke/albums | 890b237d9cdafc243a4319e5bad34614b40fcfeb | [
"MIT"
] | null | null | null | nextalbums/__init__.py | seanbrecke/albums | 890b237d9cdafc243a4319e5bad34614b40fcfeb | [
"MIT"
] | null | null | null | import sys
from os import path
# !!!!!!!!!!!!!!!!!!!!!!!!
# THIS CANT BE INSTALLED AS A REGULAR PACKAGE
# since this acts on data files that I'd rather keep part of this
# package, it has to be installed as an editable package
# like:
# python3 -m pip install install --editable ~/Repos/albums [the root dir with the se... | 29.588235 | 96 | 0.713718 |
91539793845ccd3f65846abcb9457b939ee592a2 | 4,045 | py | Python | jishaku/repl/shim36/compilation.py | NCPlayz/jishaku | 9e99154613d03925c94cc1be522604c6065a73bd | [
"MIT"
] | 2 | 2020-10-16T10:01:18.000Z | 2021-11-15T09:43:34.000Z | jishaku/repl/shim36/compilation.py | NCPlayz/jishaku | 9e99154613d03925c94cc1be522604c6065a73bd | [
"MIT"
] | null | null | null | jishaku/repl/shim36/compilation.py | NCPlayz/jishaku | 9e99154613d03925c94cc1be522604c6065a73bd | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
jishaku.repl.compilation
~~~~~~~~~~~~~~~~~~~~~~~~
Constants, functions and classes related to classifying, compiling and executing Python code.
:copyright: (c) 2020 Devon (Gorialis) R
:license: MIT, see LICENSE for more details.
"""
import ast
import asyncio
import inspect
import textwr... | 28.485915 | 118 | 0.651669 |
9153d28560ecaedb63852ad1c8f619c1d4ba55f3 | 1,769 | py | Python | features/steps/canvas_steps.py | cloose/ray-tracer-challenge | 5e9dd56fb67c5cba47172986a963fc22a8cbcaa2 | [
"MIT"
] | null | null | null | features/steps/canvas_steps.py | cloose/ray-tracer-challenge | 5e9dd56fb67c5cba47172986a963fc22a8cbcaa2 | [
"MIT"
] | null | null | null | features/steps/canvas_steps.py | cloose/ray-tracer-challenge | 5e9dd56fb67c5cba47172986a963fc22a8cbcaa2 | [
"MIT"
] | null | null | null | from behave import given, when, then # pylint: disable=no-name-in-module
from core import color, Canvas
@given(u'c <- canvas({w:d}, {h:d})')
def step_impl(context, w, h):
context.c = Canvas(w, h)
@given(u'red <- color(1, 0, 0)')
def step_impl(context):
context.red = color(1, 0, 0)
@when(u'every pixel of ... | 22.679487 | 73 | 0.633126 |
9153e51912f59f7ececc49c7d8923c5256e7b794 | 226 | py | Python | packages/service-library/src/servicelib/openapi_servers.py | oetiker/osparc-simcore | 00918bf8f000840cc70cc49458780a55858d52ea | [
"MIT"
] | null | null | null | packages/service-library/src/servicelib/openapi_servers.py | oetiker/osparc-simcore | 00918bf8f000840cc70cc49458780a55858d52ea | [
"MIT"
] | 2 | 2018-05-13T09:10:57.000Z | 2019-03-06T08:10:40.000Z | packages/service-library/src/servicelib/openapi_servers.py | oetiker/osparc-simcore | 00918bf8f000840cc70cc49458780a55858d52ea | [
"MIT"
] | null | null | null |
def get_server(servers, url):
# Development server: http://{host}:{port}/{basePath}
for server in servers:
if server.url == url:
return server
raise ValueError("Cannot find server %s" % url)
| 22.6 | 57 | 0.615044 |
9153f17bc4a485dc13bdec62790275ce5975fb9d | 2,201 | py | Python | api/franceocr/exceptions.py | LouisTrezzini/projet-mairie | 4907fe212d2a6434a676f7c08b9110cc683fd9d7 | [
"BSD-3-Clause"
] | 2 | 2017-12-17T11:50:21.000Z | 2020-10-29T15:53:34.000Z | api/franceocr/exceptions.py | mairie-de-paris/franceocr | 4907fe212d2a6434a676f7c08b9110cc683fd9d7 | [
"BSD-3-Clause"
] | 4 | 2021-03-18T20:27:53.000Z | 2022-01-13T00:43:21.000Z | api/franceocr/exceptions.py | mairie-de-paris/franceocr | 4907fe212d2a6434a676f7c08b9110cc683fd9d7 | [
"BSD-3-Clause"
] | 4 | 2017-12-17T11:53:09.000Z | 2019-05-27T19:40:28.000Z | """
BSD 3-Clause License
Copyright (c) 2017, Mairie de Paris
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of cond... | 37.948276 | 94 | 0.754203 |
91541b9683e99cdcd9419fbca3e48115f59b6513 | 4,704 | py | Python | salt/modules/win_path.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | 2 | 2015-08-04T21:54:38.000Z | 2019-04-25T21:47:08.000Z | salt/modules/win_path.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | 1 | 2015-09-02T12:49:48.000Z | 2015-09-02T19:22:58.000Z | salt/modules/win_path.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Manage the Windows System PATH
Note that not all Windows applications will rehash the PATH environment variable,
Only the ones that listen to the WM_SETTINGCHANGE message
http://support.microsoft.com/kb/104011
'''
from __future__ import absolute_import
# Python Libs
import logging
import r... | 23.058824 | 102 | 0.591837 |
91541e5adc1836a57c539dd54754add3122ec824 | 18,168 | py | Python | improver_tests/metadata/test_probabilistic.py | owena11/improver | ff658db31364c0bdf3af3940736c260e10544705 | [
"BSD-3-Clause"
] | 77 | 2017-04-26T07:47:40.000Z | 2022-03-31T09:40:49.000Z | improver_tests/metadata/test_probabilistic.py | owena11/improver | ff658db31364c0bdf3af3940736c260e10544705 | [
"BSD-3-Clause"
] | 1,440 | 2017-03-29T10:04:15.000Z | 2022-03-28T10:11:29.000Z | improver_tests/metadata/test_probabilistic.py | MoseleyS/improver | ca028e3a1c842e3ff00b188c8ea6eaedd0a07149 | [
"BSD-3-Clause"
] | 72 | 2017-03-17T16:53:45.000Z | 2022-02-16T09:41:37.000Z | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# (C) British Crown Copyright 2017-2021 Met Office.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | 42.448598 | 87 | 0.700297 |
9154352721cae2f6da911de514c8c369cc6d33a0 | 164 | py | Python | campy/stanford/__init__.py | TristenSeth/campy | 9e726c342d682239e1c19e6f5645c0b2167d7fab | [
"MIT"
] | null | null | null | campy/stanford/__init__.py | TristenSeth/campy | 9e726c342d682239e1c19e6f5645c0b2167d7fab | [
"MIT"
] | null | null | null | campy/stanford/__init__.py | TristenSeth/campy | 9e726c342d682239e1c19e6f5645c0b2167d7fab | [
"MIT"
] | null | null | null | """Get it?! This is the `campy.stanford` subpackage. Like Camp Stanford!"""
print('Did you mean camp.stanford?')
print('Like "Camp Stanford!"')
print("I'm funny!")
| 32.8 | 75 | 0.689024 |
91546e19c21004e639e534eced994fe13fdffc38 | 5,501 | py | Python | scripts/rewards.py | Lorna-Liu/ultrasound_vsumm_RL | 469214c6c9ef7fb8ecdeb29b831307b5be877d5a | [
"MIT"
] | 17 | 2020-09-12T03:28:42.000Z | 2021-11-15T12:10:31.000Z | scripts/rewards.py | Lorna-Liu/ultrasound_vsumm_RL | 469214c6c9ef7fb8ecdeb29b831307b5be877d5a | [
"MIT"
] | 3 | 2020-10-16T08:52:05.000Z | 2022-03-22T02:59:55.000Z | scripts/rewards.py | Lorna-Liu/ultrasound_vsumm_RL | 469214c6c9ef7fb8ecdeb29b831307b5be877d5a | [
"MIT"
] | 1 | 2021-06-02T11:41:12.000Z | 2021-06-02T11:41:12.000Z | import torch
def compute_reward_coff(seq, actions, ignore_far_sim=True, temp_dist_thre=20, use_gpu=False,
div_coff=0.5, rep_coff=0.5):
"""
Compute diversity reward and representativeness reward
Args:
seq: sequence of features, shape (1, seq_len, dim)
actions: binar... | 39.862319 | 105 | 0.643338 |
91547035983177446696163ebbf12e19c130316b | 1,450 | py | Python | revelation/test/test_condition_passed.py | futurecore/revelation | 859de37f5c3ecf5366cc7ba65900754862843366 | [
"BSD-3-Clause"
] | 4 | 2015-09-21T13:52:33.000Z | 2016-12-29T23:24:51.000Z | revelation/test/test_condition_passed.py | futurecore/revelation | 859de37f5c3ecf5366cc7ba65900754862843366 | [
"BSD-3-Clause"
] | 59 | 2015-07-17T01:09:12.000Z | 2016-09-19T13:32:19.000Z | revelation/test/test_condition_passed.py | futurecore/epiphany-simulator | 859de37f5c3ecf5366cc7ba65900754862843366 | [
"BSD-3-Clause"
] | 1 | 2015-08-01T00:42:03.000Z | 2015-08-01T00:42:03.000Z | from revelation.condition_codes import condition_passed
from revelation.test.machine import new_state
from pydgin.misc import FatalError
import pytest
def test_condition_passed():
state = new_state(AZ=1)
assert condition_passed(state, 0b0000)
state.AZ = 0
assert condition_passed(state, 0b0001)
s... | 26.851852 | 55 | 0.686207 |
91547aa328393c0ef3a5ebc0a36c773862d11d1b | 4,837 | py | Python | sciwing/models/simpleclassifier.py | sean-dingxu/sciwing | 75eca1ea43be165eab20cf8bd81bbc19cecda74c | [
"MIT"
] | 50 | 2019-09-13T10:32:29.000Z | 2022-02-14T16:52:53.000Z | sciwing/models/simpleclassifier.py | sean-dingxu/sciwing | 75eca1ea43be165eab20cf8bd81bbc19cecda74c | [
"MIT"
] | 31 | 2019-09-03T11:06:03.000Z | 2021-08-20T14:57:09.000Z | sciwing/models/simpleclassifier.py | sean-dingxu/sciwing | 75eca1ea43be165eab20cf8bd81bbc19cecda74c | [
"MIT"
] | 9 | 2019-09-16T03:25:15.000Z | 2021-05-11T10:28:25.000Z | import torch.nn as nn
from torch.nn.functional import softmax
from torch.nn import CrossEntropyLoss
from typing import List, Any, Dict, Union
from sciwing.data.line import Line
from sciwing.data.label import Label
from wasabi import Printer
from sciwing.utils.class_nursery import ClassNursery
from sciwing.data.datasets... | 35.306569 | 88 | 0.611329 |
9154a25e424a870f9026a01658ba50db2ddd30f6 | 10,710 | py | Python | nova/tests/functional/api_sample_tests/test_servers.py | windskyer/nova | df485344dfd0f9e927e51273a3aaa71d948f2980 | [
"Apache-2.0"
] | null | null | null | nova/tests/functional/api_sample_tests/test_servers.py | windskyer/nova | df485344dfd0f9e927e51273a3aaa71d948f2980 | [
"Apache-2.0"
] | null | null | null | nova/tests/functional/api_sample_tests/test_servers.py | windskyer/nova | df485344dfd0f9e927e51273a3aaa71d948f2980 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 Nebula, Inc.
# Copyright 2013 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
#
# Unless required... | 38.945455 | 79 | 0.607376 |
9154db583d5f85be36efa6383ece9f654a77a231 | 20,379 | py | Python | fairseq/trainer.py | ghchen18/leca | 325c3112d325e671cd5f3ba5f2c7a7bf19abd5e6 | [
"BSD-3-Clause"
] | 11 | 2020-09-30T00:43:58.000Z | 2022-02-25T01:39:08.000Z | fairseq/trainer.py | ghchen18/leca | 325c3112d325e671cd5f3ba5f2c7a7bf19abd5e6 | [
"BSD-3-Clause"
] | 13 | 2020-07-30T08:08:07.000Z | 2022-03-04T01:17:33.000Z | fairseq/trainer.py | ghchen18/leca | 325c3112d325e671cd5f3ba5f2c7a7bf19abd5e6 | [
"BSD-3-Clause"
] | 5 | 2021-05-18T06:50:15.000Z | 2022-02-18T04:42:31.000Z | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
"""
Train a network across multipl... | 41.845996 | 115 | 0.59527 |
9154fa944b0cbf6e5fd66abac3db4f9058a909b4 | 1,626 | py | Python | oscar/lib/python2.7/site-packages/phonenumbers/shortdata/region_US.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/shortdata/region_US.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/shortdata/region_US.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | """Auto-generated file, do not edit by hand. US metadata"""
from ..phonemetadata import NumberFormat, PhoneNumberDesc, PhoneMetadata
PHONE_METADATA_US = PhoneMetadata(id='US', country_code=None, international_prefix=None,
general_desc=PhoneNumberDesc(national_number_pattern='[1-9]\\d{2,5}', possible_length=(3,... | 116.142857 | 361 | 0.710947 |
915506410112e227d6d5e4b44702c686c71939e6 | 12,526 | py | Python | ielex/website/tests.py | lingdb/CoBL-public | e50b441c4281b9299fb1cd0b46f906887cb86dd1 | [
"BSD-2-Clause"
] | 3 | 2017-05-30T04:40:43.000Z | 2019-04-25T14:54:54.000Z | ielex/website/tests.py | lingdb/CoBL-public | e50b441c4281b9299fb1cd0b46f906887cb86dd1 | [
"BSD-2-Clause"
] | null | null | null | ielex/website/tests.py | lingdb/CoBL-public | e50b441c4281b9299fb1cd0b46f906887cb86dd1 | [
"BSD-2-Clause"
] | 3 | 2018-07-02T13:42:12.000Z | 2019-05-17T13:11:13.000Z | from django.test import TestCase
from django.test.client import Client
from django.db import IntegrityError, transaction
import logging
import lxml.html
from ielex.lexicon.models import CognateClass, \
CognateJudgement, \
CognateJudgementCitation, \
... | 36.202312 | 79 | 0.555884 |
9155156449ba85c974c147b1b0e44616aec04220 | 3,302 | py | Python | watermarking-whitebox/regularization.py | Testing4AI/DeepJudge | 5f3a43cd30f7cd858cfbf6d2f78c53155aec4b6d | [
"MIT"
] | 12 | 2022-01-11T08:17:16.000Z | 2022-03-31T12:58:57.000Z | watermarking-whitebox/regularization.py | Testing4AI/DeepJudge | 5f3a43cd30f7cd858cfbf6d2f78c53155aec4b6d | [
"MIT"
] | null | null | null | watermarking-whitebox/regularization.py | Testing4AI/DeepJudge | 5f3a43cd30f7cd858cfbf6d2f78c53155aec4b6d | [
"MIT"
] | null | null | null | from tensorflow.keras.regularizers import Regularizer
import numpy as np
import tensorflow as tf
def random_index_generator(count):
indices = np.arange(0, count)
np.random.shuffle(indices)
for idx in indices:
yield idx
class WatermarkRegularizer(Regularizer):
"""
b signature
... | 34.757895 | 135 | 0.532707 |
915525d9f20a322970962a8f7af1f4bc5fb3f709 | 5,063 | py | Python | pngparser/png.py | AlexGuo1998/png-parser | 4d75f17f158acd6e1f86117bde2a0c5bfceede76 | [
"MIT"
] | 58 | 2019-09-22T20:52:14.000Z | 2022-03-13T21:31:56.000Z | pngparser/png.py | AlexGuo1998/png-parser | 4d75f17f158acd6e1f86117bde2a0c5bfceede76 | [
"MIT"
] | 4 | 2020-01-14T11:10:21.000Z | 2021-12-27T15:21:39.000Z | pngparser/png.py | AlexGuo1998/png-parser | 4d75f17f158acd6e1f86117bde2a0c5bfceede76 | [
"MIT"
] | 7 | 2021-02-14T19:39:03.000Z | 2021-12-25T07:39:49.000Z | import logging
import os
import zlib
from mmap import ACCESS_READ, mmap
from typing import Any, List, Optional, Tuple
from .chunks import ChunkRaw, create_chunk
from .chunktypes import (CHUNK_CRC_SIZE, CHUNK_LENGTH_SIZE, CHUNK_TYPE_SIZE,
TYPE_IDAT, TYPE_IHDR, TYPE_PLTE, is_text_chunk)
from .im... | 31.06135 | 77 | 0.584436 |
915545f133c2a4dd6945a6242fa6651a08cffe9f | 9,771 | py | Python | CHAPTER 11 (search trees)/tree_map_class.py | ahammadshawki8/Data-Structures-Algorithms-in-Python- | fc18b54128cd5bc7639a14999d8f990190b524eb | [
"MIT"
] | null | null | null | CHAPTER 11 (search trees)/tree_map_class.py | ahammadshawki8/Data-Structures-Algorithms-in-Python- | fc18b54128cd5bc7639a14999d8f990190b524eb | [
"MIT"
] | null | null | null | CHAPTER 11 (search trees)/tree_map_class.py | ahammadshawki8/Data-Structures-Algorithms-in-Python- | fc18b54128cd5bc7639a14999d8f990190b524eb | [
"MIT"
] | null | null | null | from map_base_class import *
from linked_binary_tree import *
class TreeMap(LinkedBinaryTree,MapBase):
"""Sorted map implementation using binary search tree."""
#----------------------------override Position class------------------------
class Position(LinkedBinaryTree.Position):
def key(self)... | 40.7125 | 87 | 0.52359 |
91557577311e37da649fc13b0712e570911dea4d | 1,744 | py | Python | aiotdlib/api/functions/get_chat_message_calendar.py | pylakey/pytdlib | a390a298a24a7123f3f3aec9f995dee6d51a478e | [
"MIT"
] | 37 | 2021-05-04T10:41:41.000Z | 2022-03-30T13:48:05.000Z | aiotdlib/api/functions/get_chat_message_calendar.py | pylakey/pytdlib | a390a298a24a7123f3f3aec9f995dee6d51a478e | [
"MIT"
] | 13 | 2021-07-17T19:54:51.000Z | 2022-02-26T06:50:00.000Z | aiotdlib/api/functions/get_chat_message_calendar.py | pylakey/pytdlib | a390a298a24a7123f3f3aec9f995dee6d51a478e | [
"MIT"
] | 7 | 2021-09-22T21:27:11.000Z | 2022-02-20T02:33:19.000Z | # =============================================================================== #
# #
# This file has been generated automatically!! Do not change this manually! #
# ... | 47.135135 | 278 | 0.610092 |
91557cc390a56284991cc99005cd5d9ff1007b30 | 976 | py | Python | crypto.py | accspert/CRM | abe04aa82cd3550be75664f3f35cf0f55c0c25ec | [
"MIT"
] | null | null | null | crypto.py | accspert/CRM | abe04aa82cd3550be75664f3f35cf0f55c0c25ec | [
"MIT"
] | null | null | null | crypto.py | accspert/CRM | abe04aa82cd3550be75664f3f35cf0f55c0c25ec | [
"MIT"
] | null | null | null | import os
from datetime import datetime
from datetime import timedelta
from cryptography.fernet import Fernet
def make_a_expire_date():
if not os.path.isfile('.\\key.key'):
key = Fernet.generate_key()
with open("key.key", "wb") as key_file:
key_file.write(key)
ke... | 28.705882 | 76 | 0.614754 |
9155896fca8a2ca8aa618aa6009ed4e49863fb84 | 2,340 | py | Python | stats.py | Tabrizian/learning-to-quantize | 545ef7075ff01cbb218600878943554954cef53f | [
"Apache-2.0"
] | 16 | 2020-10-16T16:21:50.000Z | 2021-12-15T06:45:12.000Z | stats.py | Tabrizian/learning-to-quantize | 545ef7075ff01cbb218600878943554954cef53f | [
"Apache-2.0"
] | null | null | null | stats.py | Tabrizian/learning-to-quantize | 545ef7075ff01cbb218600878943554954cef53f | [
"Apache-2.0"
] | 4 | 2020-10-27T12:32:28.000Z | 2021-04-25T04:43:45.000Z | import os
import re
import argparse
import numpy as np
def args():
parser = argparse.ArgumentParser(description='Check runs status')
parser.add_argument('--pattern', type=str)
parser.add_argument('--show', action='store_true')
parser.add_argument('--num', type=int, default=10)
parser.add_argument(... | 30.789474 | 92 | 0.523932 |
9155995c2f7389245bf7c47489b0f6f91a74b1c9 | 132,533 | py | Python | salt/minion.py | gravyboat/salt | 4c2d4159fd8705d1b3bb8f90500635f8ccec4f22 | [
"Apache-2.0"
] | 2 | 2015-09-21T14:13:30.000Z | 2016-02-12T11:33:46.000Z | salt/minion.py | eyj/salt | 5232d7f60cb78591d8bad25d796b0a945fc6350c | [
"Apache-2.0"
] | null | null | null | salt/minion.py | eyj/salt | 5232d7f60cb78591d8bad25d796b0a945fc6350c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Routines to set up a minion
'''
# Import python libs
from __future__ import absolute_import, print_function, with_statement
import os
import re
import sys
import copy
import time
import types
import signal
import fnmatch
import logging
import threading
import traceback
import contextlib
impo... | 41.834912 | 165 | 0.545011 |
9155a917909ee917b2153545abd306efc82cbbfc | 4,874 | py | Python | media/fields/files.py | aaboffill/django-allmedia | 67ef405623574d90abf9eefac9a512f609300775 | [
"BSD-3-Clause"
] | null | null | null | media/fields/files.py | aaboffill/django-allmedia | 67ef405623574d90abf9eefac9a512f609300775 | [
"BSD-3-Clause"
] | null | null | null | media/fields/files.py | aaboffill/django-allmedia | 67ef405623574d90abf9eefac9a512f609300775 | [
"BSD-3-Clause"
] | null | null | null | # coding=utf-8
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models.fields.files import FieldFile, FileField
from django.utils.translation import ugettext
from django.utils import six
from ..storage.youtube import PROCESSING_STATUS, FileYoutubeStorage
import json
try:
... | 36.646617 | 120 | 0.651211 |
9155d45e08fbda1de67343580e3aafc49876ba27 | 1,177 | py | Python | setup.py | prurph/ib_insync | e83207e2f649651e787b7b6cdd00458e80f60383 | [
"BSD-2-Clause"
] | 4 | 2018-08-01T03:30:42.000Z | 2022-01-06T11:46:05.000Z | setup.py | chrism2671/ib_insync | b26bc52b5eae23f59368a99d58b903649d89b2af | [
"BSD-2-Clause"
] | null | null | null | setup.py | chrism2671/ib_insync | b26bc52b5eae23f59368a99d58b903649d89b2af | [
"BSD-2-Clause"
] | 1 | 2018-08-17T15:43:20.000Z | 2018-08-17T15:43:20.000Z | import os
import sys
import codecs
from setuptools import setup
from warnings import warn
import ib_insync
if sys.version_info < (3, 0, 0):
raise RuntimeError("ib_insync is for Python 3")
if sys.version_info < (3, 6, 0):
warn("ib_insync requires Python 3.6 or higher")
here = os.path.abspath(os.path.dirname(... | 30.179487 | 74 | 0.672897 |
915607d1a17c717ea2dead710e75f9337a3c0106 | 1,884 | py | Python | qface/helper/qtqml.py | Gagi2k/qface | 5069fdc5f406495590a83a799ecbe30009436f1d | [
"MIT"
] | 38 | 2016-11-30T10:36:56.000Z | 2022-02-19T14:58:00.000Z | qface/helper/qtqml.py | Gagi2k/qface | 5069fdc5f406495590a83a799ecbe30009436f1d | [
"MIT"
] | 70 | 2016-11-30T09:12:58.000Z | 2022-01-27T12:52:41.000Z | qface/helper/qtqml.py | Gagi2k/qface | 5069fdc5f406495590a83a799ecbe30009436f1d | [
"MIT"
] | 23 | 2016-12-07T15:23:15.000Z | 2021-06-07T08:32:40.000Z | """
Provides helper functionality specificially for Qt5 QML code generators
"""
def upper_first(s):
s = str(s)
return s[0].upper() + s[1:]
class Filters(object):
"""provides a set of filters to be used with the template engine"""
classPrefix = ''
@staticmethod
def className(symbol):
... | 26.914286 | 71 | 0.5138 |
915616591384f30a484ced7a822f9ac50882b548 | 25,732 | py | Python | salt/states/iptables.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | 2 | 2015-08-04T21:54:38.000Z | 2019-04-25T21:47:08.000Z | salt/states/iptables.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | 1 | 2015-09-02T12:49:48.000Z | 2015-09-02T19:22:58.000Z | salt/states/iptables.py | Rafflecopter/salt | 08bbfcd4d9b93351d7d5d25b097e892026b6f1cd | [
"Apache-2.0"
] | 1 | 2020-10-19T11:49:50.000Z | 2020-10-19T11:49:50.000Z | # -*- coding: utf-8 -*-
'''
Management of iptables
======================
This is an iptables-specific module designed to manage Linux firewalls. It is
expected that this state module, and other system-specific firewall states, may
at some point be deprecated in favor of a more generic `firewall` state.
.. code-block... | 31.00241 | 116 | 0.50649 |
915619e0e89b055eb691d808c045b5e5b832b89d | 664 | py | Python | trainer/callbacks/start_tensorboard.py | jason-zl190/sisr | 2415d28333c94602c52be9c314a8044165d992cf | [
"Apache-2.0"
] | 2 | 2019-12-15T17:12:46.000Z | 2019-12-15T21:09:31.000Z | trainer/callbacks/start_tensorboard.py | jason-zl190/sisr_ct | 570d638a2e5a3301176af671d6b233deb507564f | [
"Apache-2.0"
] | null | null | null | trainer/callbacks/start_tensorboard.py | jason-zl190/sisr_ct | 570d638a2e5a3301176af671d6b233deb507564f | [
"Apache-2.0"
] | 1 | 2020-04-13T06:56:19.000Z | 2020-04-13T06:56:19.000Z | import tensorflow as tf
import subprocess
import atexit
class StartTensorBoard(tf.keras.callbacks.Callback):
def __init__(self, log_dir):
super()
self.log_dir = log_dir
def start_tensorboard(self, log_dir):
try:
p = subprocess.Popen(['tensorboard', '--host', '0.0.0.... | 31.619048 | 96 | 0.60994 |
915624e67f8c35ede4cee2572fd6fdbc7f664dfc | 5,276 | py | Python | client/core/tests/db_connector_tests.py | vbohinc/CommunityCellularManager | ab330fcb1bc70ee3a8e9bcdac2846ab6c327f87c | [
"BSD-3-Clause"
] | null | null | null | client/core/tests/db_connector_tests.py | vbohinc/CommunityCellularManager | ab330fcb1bc70ee3a8e9bcdac2846ab6c327f87c | [
"BSD-3-Clause"
] | 3 | 2021-03-20T00:02:37.000Z | 2022-02-11T03:46:59.000Z | client/core/tests/db_connector_tests.py | vbohinc/CommunityCellularManager | ab330fcb1bc70ee3a8e9bcdac2846ab6c327f87c | [
"BSD-3-Clause"
] | null | null | null | """Copyright (c) 2016-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
# Tests for the database con... | 34.710526 | 78 | 0.608795 |
91562d5f5aabf26f8f30214a3c94a84a0e52b0f5 | 1,491 | py | Python | parsl/tests/configs/cooley_htex.py | aquanauts/parsl | 978bb483a4a41b3cef083aa242b2a78614a02dd0 | [
"Apache-2.0"
] | null | null | null | parsl/tests/configs/cooley_htex.py | aquanauts/parsl | 978bb483a4a41b3cef083aa242b2a78614a02dd0 | [
"Apache-2.0"
] | null | null | null | parsl/tests/configs/cooley_htex.py | aquanauts/parsl | 978bb483a4a41b3cef083aa242b2a78614a02dd0 | [
"Apache-2.0"
] | null | null | null | # UNTESTED
from parsl.config import Config
from parsl.executors import HighThroughputExecutor
from parsl.addresses import address_by_hostname
from parsl.launchers import MpiRunLauncher
from parsl.providers import CobaltProvider
from parsl.tests.utils import get_rundir
# If you are a developer running tests, make sure... | 36.365854 | 110 | 0.632461 |
915634235b71f8ca12040e205df0f12d209706db | 884 | py | Python | test/test_zodiac.py | MingzheWu418/plastering | 322531e934c3acf2ecc8f520b37a6d255b9959c2 | [
"MIT"
] | 29 | 2018-09-19T01:16:27.000Z | 2022-03-29T14:35:36.000Z | test/test_zodiac.py | MingzheWu418/plastering | 322531e934c3acf2ecc8f520b37a6d255b9959c2 | [
"MIT"
] | 14 | 2019-04-12T18:37:36.000Z | 2022-02-10T00:27:55.000Z | test/test_zodiac.py | MingzheWu418/plastering | 322531e934c3acf2ecc8f520b37a6d255b9959c2 | [
"MIT"
] | 14 | 2019-03-05T23:44:11.000Z | 2022-03-18T07:29:31.000Z | from plastering.inferencers.zodiac import ZodiacInterface
#from plastering.inferencers.zodiac_interface import ZodiacInterface
from plastering.metadata_interface import *
import pdb
#target_building = 'ghc'
#target_building = 'uva_cse'
target_building = 'ap_m'
config = {
'brick_version': '1.0.3',
'brick_file'... | 32.740741 | 74 | 0.718326 |
91563f807e0d348a505a5f26eeca89d32898ab8b | 3,572 | py | Python | wimp/astro/VelocityDist.py | lopez86/WimpSim | 096cf9f3e3e3d8e4552418a9f4f690593d099160 | [
"MIT"
] | 2 | 2020-09-25T10:48:24.000Z | 2020-12-29T19:56:04.000Z | wimp/astro/VelocityDist.py | lopez86/WimpSim | 096cf9f3e3e3d8e4552418a9f4f690593d099160 | [
"MIT"
] | 1 | 2017-06-12T01:12:15.000Z | 2017-06-17T06:33:16.000Z | wimp/astro/VelocityDist.py | lopez86/PyWIMPs | 096cf9f3e3e3d8e4552418a9f4f690593d099160 | [
"MIT"
] | null | null | null | import numpy as np
from .. import units
class VelocityDist:
""" This is the base velocity distribution class.
This particular version implements a truncated
Maxwell-Boltzmann distribution:
f(v) ~ exp( - |v + vE|^2 / v0^2)
where f(v) = 0 when |v+vE| > vesc.
This distribution represents a rou... | 27.90625 | 76 | 0.554871 |
915661464293ec12d7f1f37717c0662f5907acef | 3,679 | py | Python | events_page/config.py | los-verdes/lv-event-pagenerator | 88416b626ff2dca6e2d71fa60bff4823954b3131 | [
"MIT"
] | null | null | null | events_page/config.py | los-verdes/lv-event-pagenerator | 88416b626ff2dca6e2d71fa60bff4823954b3131 | [
"MIT"
] | 7 | 2022-01-16T15:36:40.000Z | 2022-01-25T22:02:12.000Z | events_page/config.py | los-verdes/lv-event-pagenerator | 88416b626ff2dca6e2d71fa60bff4823954b3131 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import json
import os
import re
import hcl
from logzero import logger
from apis import load_credentials
from apis.constants import CalendarColors
# phases of the 🌙
DEFAULT_CALENDAR_ID = "information@losverdesatx.org"
DEFAULT_DISPLAY_TIMEZONE = "US/Central"
DEFAULT_FOLDER_NAME = "calendar-event... | 33.144144 | 104 | 0.646915 |
915691585b2552d0008d3b4f3b4c7d33c998589b | 8,589 | py | Python | tests/tonalmodel_tests/test_diatonic_modality.py | dpazel/music_rep | 2f9de9b98b13df98f1a0a2120b84714725ce527e | [
"MIT"
] | 1 | 2021-05-06T19:45:54.000Z | 2021-05-06T19:45:54.000Z | tests/tonalmodel_tests/test_diatonic_modality.py | dpazel/music_rep | 2f9de9b98b13df98f1a0a2120b84714725ce527e | [
"MIT"
] | null | null | null | tests/tonalmodel_tests/test_diatonic_modality.py | dpazel/music_rep | 2f9de9b98b13df98f1a0a2120b84714725ce527e | [
"MIT"
] | null | null | null | import unittest
from tonalmodel.diatonic_modality import DiatonicModality
from tonalmodel.modality import ModalityType
from tonalmodel.diatonic_tone import DiatonicTone
from tests.utility import build_incremental_intervals
class TestDiatonicModality(unittest.TestCase):
def setUp(self):
pass
def tear... | 52.693252 | 105 | 0.622657 |
915698214345006161a638d539532908c28a5394 | 346 | py | Python | freezer/test/test_backup.py | berez23/freezer | b1df9a65cc3e8a93759e22452205ac4578b62af2 | [
"Apache-2.0"
] | null | null | null | freezer/test/test_backup.py | berez23/freezer | b1df9a65cc3e8a93759e22452205ac4578b62af2 | [
"Apache-2.0"
] | null | null | null | freezer/test/test_backup.py | berez23/freezer | b1df9a65cc3e8a93759e22452205ac4578b62af2 | [
"Apache-2.0"
] | 1 | 2018-12-13T06:41:05.000Z | 2018-12-13T06:41:05.000Z | #!/usr/bin/env python
from freezer.backup import (
backup_mode_mysql, backup_mode_fs, backup_mode_mongo)
from freezer.arguments import backup_arguments
import time
import os
def test_backup_mode_mysql():
# THE WHOLE TEST NEED TO BE CHANGED USING MOCK!!
# Return backup options and arguments
backup_a... | 20.352941 | 57 | 0.765896 |
9156da2c729a07a8c85c9cc45ff0b748aad0bb98 | 2,379 | py | Python | lz4framed/compat.py | Iotic-Labs/py-lz4framed | 571ab2d0fffc19feafedb65fca0e42cf70463b86 | [
"Apache-2.0"
] | 47 | 2016-02-14T21:51:50.000Z | 2022-02-22T16:42:23.000Z | lz4framed/compat.py | Iotic-Labs/py-lz4framed | 571ab2d0fffc19feafedb65fca0e42cf70463b86 | [
"Apache-2.0"
] | 16 | 2016-02-09T17:07:44.000Z | 2020-02-24T18:08:18.000Z | lz4framed/compat.py | Iotic-Labs/py-lz4framed | 571ab2d0fffc19feafedb65fca0e42cf70463b86 | [
"Apache-2.0"
] | 10 | 2016-02-09T16:23:45.000Z | 2020-10-19T03:10:41.000Z | # Copyright (c) 2016 Iotic Labs Ltd. 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
#
# https://github.com/Iotic-Labs/py-lz4framed/blob/master/LICENSE
#
# Unless req... | 39.65 | 80 | 0.757041 |
9156da5c90d92c4bf2a279e36323729f6d222709 | 518 | py | Python | Arquivos em Python/CursoemVideo/Aula11coresnopython.py | PereiraLegend/Anotacoes | 223383adfffec1ebe9bed5e38ada0464ad6b1949 | [
"MIT"
] | 1 | 2022-02-05T21:07:38.000Z | 2022-02-05T21:07:38.000Z | Arquivos em Python/CursoemVideo/Aula11coresnopython.py | PereiraLegend/Anotacoes | 223383adfffec1ebe9bed5e38ada0464ad6b1949 | [
"MIT"
] | null | null | null | Arquivos em Python/CursoemVideo/Aula11coresnopython.py | PereiraLegend/Anotacoes | 223383adfffec1ebe9bed5e38ada0464ad6b1949 | [
"MIT"
] | null | null | null | print("\033[4:31:43m Olá, Mundo! \033[m")
print("\033[0;33;44m Olá, Mundo! \033[m")
a =3
b = 5
print("Os valores são \033[32m {} \033[m e \033[31m {} \033[m!!!".format(a, b))
# Deforma mais avançada
nome = "Lucas"
print("Seja bem vindo, {}{}{} !!!".format("\033[4;34m",nome,"\033[m"))
# Mais uma forma de fazer
nome = "P... | 43.166667 | 96 | 0.606178 |
9156f0f32935aaf0bd9574d8431de0aecf464c56 | 1,787 | py | Python | docs/examples/nn_quickstart.py | sian-chen/LibMultiLabel | 8aa6a3ffff6ac437359de4fb53a99de544fdb720 | [
"MIT"
] | null | null | null | docs/examples/nn_quickstart.py | sian-chen/LibMultiLabel | 8aa6a3ffff6ac437359de4fb53a99de544fdb720 | [
"MIT"
] | 1 | 2021-11-19T01:53:15.000Z | 2021-11-19T01:53:15.000Z | docs/examples/nn_quickstart.py | Eleven1Liu/LibMultiLabel | 56feb362ee0342242656c3303c5f25816f2c12ab | [
"MIT"
] | null | null | null | from libmultilabel.nn.data_utils import load_datasets, load_or_build_label, \
load_or_build_text_dict, get_dataset_loader
from libmultilabel.nn.nn_utils import init_device, init_model, init_trainer, set_seed
# Step 0. Setup seed and device
device = init_device(use_cpu=False) #... | 37.229167 | 104 | 0.61052 |
9157162fae7b5662937978298deaf027d2ec7c5c | 104 | py | Python | community_profiles/__init__.py | nickhand/community-profiles | 8b05e8be5448fd6e75c1c7757592d319ccc6ce13 | [
"MIT"
] | null | null | null | community_profiles/__init__.py | nickhand/community-profiles | 8b05e8be5448fd6e75c1c7757592d319ccc6ce13 | [
"MIT"
] | 3 | 2019-09-25T18:34:29.000Z | 2019-12-30T19:01:53.000Z | community_profiles/__init__.py | nickhand/community-profiles | 8b05e8be5448fd6e75c1c7757592d319ccc6ce13 | [
"MIT"
] | 2 | 2019-09-23T14:13:22.000Z | 2019-09-23T19:27:10.000Z | __version__ = "0.0.1"
from pathlib import Path
data_dir = Path(__file__).parent / "datasets" / "data"
| 17.333333 | 54 | 0.701923 |
915739a28266660dfab7fcb9d6fc6a1440b1bd3f | 2,902 | py | Python | main/test_harness/test_base_selenium.py | mahkhaled/class2go | b32cb441e8d96c257f70cb61274812ebeed2649d | [
"Apache-2.0"
] | null | null | null | main/test_harness/test_base_selenium.py | mahkhaled/class2go | b32cb441e8d96c257f70cb61274812ebeed2649d | [
"Apache-2.0"
] | null | null | null | main/test_harness/test_base_selenium.py | mahkhaled/class2go | b32cb441e8d96c257f70cb61274812ebeed2649d | [
"Apache-2.0"
] | null | null | null | from django.core.urlresolvers import reverse
from django.test import LiveServerTestCase
from nose.plugins.attrib import attr
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait # available since 2.4.0
from os import environ
if ( environ.has_key('C2G_HEADLESS_TESTS') and
environ... | 33.744186 | 127 | 0.682977 |
9157452170492d12dc829b1cfcc2ebd4b82efa36 | 913 | py | Python | Section 1/Video 3/S1V3.py | PacktPublishing/Learn-Machine-Learning-in-3-Hours | 998177445f845282fef98f2685384ba95ff78417 | [
"MIT"
] | 9 | 2018-03-30T07:42:23.000Z | 2021-11-08T13:11:11.000Z | Section 1/Video 3/S1V3.py | PacktPublishing/Learn-Machine-Learning-in-3-Hours | 998177445f845282fef98f2685384ba95ff78417 | [
"MIT"
] | null | null | null | Section 1/Video 3/S1V3.py | PacktPublishing/Learn-Machine-Learning-in-3-Hours | 998177445f845282fef98f2685384ba95ff78417 | [
"MIT"
] | 3 | 2018-04-30T16:19:43.000Z | 2019-12-24T09:51:12.000Z | import numpy as np
from matplotlib import pyplot as plt
def plot_fit(x, y, fig_num, p_1, p_2):
""" Plot polynomial fit """
f = plt.figure(fig_num)
plt.scatter(x, y)
plt.plot(x, p_1(x))
plt.plot(x, p_2(x))
plt.show()
data = np.load('sample.npy')
# Split data into training and testing sets.... | 21.738095 | 65 | 0.665936 |
915751a8c5ebb2a4d93403e1d0a8b2d30a445357 | 21,844 | py | Python | cogs/Information.py | jakebacker/Gompei-Bot | dba3b11874ca19c22f170b8a01928af2b3fb2bd8 | [
"MIT"
] | 9 | 2020-02-14T02:07:39.000Z | 2022-01-08T03:25:22.000Z | cogs/Information.py | jakebacker/Gompei-Bot | dba3b11874ca19c22f170b8a01928af2b3fb2bd8 | [
"MIT"
] | 16 | 2020-02-14T02:10:29.000Z | 2022-02-04T14:50:58.000Z | cogs/Information.py | jakebacker/Gompei-Bot | dba3b11874ca19c22f170b8a01928af2b3fb2bd8 | [
"MIT"
] | 8 | 2020-02-21T14:28:07.000Z | 2022-02-04T14:49:04.000Z | from GompeiFunctions import time_delta_string
from cogs.Permissions import command_channels
from discord.ext import commands
from datetime import datetime
import discord
import typing
class Information(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True, aliase... | 37.989565 | 124 | 0.50119 |
915775645888050e85946f00855398d0c6525429 | 9,650 | py | Python | sdks/python/appcenter_sdk/models/UserProfileResponse.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/appcenter_sdk/models/UserProfileResponse.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/appcenter_sdk/models/UserProfileResponse.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
import pprint
import re # noqa: F401
import six
class UserProfileRes... | 30.15625 | 162 | 0.599275 |
9157789692b2a77b9a1f625577619344a1714338 | 4,275 | py | Python | tests/crud/test_serializers.py | kucera-lukas/piccolo_api | bc8c3ef96fdda1315f9f594e0c817c0d7e533c6f | [
"MIT"
] | null | null | null | tests/crud/test_serializers.py | kucera-lukas/piccolo_api | bc8c3ef96fdda1315f9f594e0c817c0d7e533c6f | [
"MIT"
] | null | null | null | tests/crud/test_serializers.py | kucera-lukas/piccolo_api | bc8c3ef96fdda1315f9f594e0c817c0d7e533c6f | [
"MIT"
] | null | null | null | import decimal
from unittest import TestCase
import pydantic
from piccolo.columns import Numeric, Varchar
from piccolo.columns.column_types import JSON, JSONB, Secret
from piccolo.table import Table
from pydantic import ValidationError
from piccolo_api.crud.serializers import create_pydantic_model
class TestVarchar... | 28.691275 | 78 | 0.640936 |
91578407c8dc4f46925d4adf8df317e3bc9e6766 | 2,601 | py | Python | scattertext/termsignificance/LogOddsRatioSmoothed.py | admariner/scattertext | c2ac33ce01eedf8652d9bd1d61a648751950a367 | [
"Apache-2.0"
] | 2 | 2016-07-24T20:32:18.000Z | 2016-07-26T18:54:18.000Z | scattertext/termsignificance/LogOddsRatioSmoothed.py | JasonKessler/text-to-ideas | c2ac33ce01eedf8652d9bd1d61a648751950a367 | [
"Apache-2.0"
] | 2 | 2021-11-08T22:33:12.000Z | 2021-11-15T04:48:19.000Z | scattertext/termsignificance/LogOddsRatioSmoothed.py | JasonKessler/text-to-ideas | c2ac33ce01eedf8652d9bd1d61a648751950a367 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
from scipy.special import ndtr
from scattertext.Scalers import scale_neg_1_to_1_with_zero_mean_abs_max
from scattertext.termranking import AbsoluteFrequencyRanker
from scattertext.termsignificance.TermSignificance import TermSignificance
def z_to_p_val(z_scores):
# return ... | 23.017699 | 79 | 0.676278 |
915796e8aadb06016920fb94f727319422e7036c | 1,120 | py | Python | src/homework/homework8.py | acc-cosc-1336/cosc-1336-spring-2018-BarndonSelesino | c2ee6a9914383716347765f148d2d15b9e3211b7 | [
"MIT"
] | null | null | null | src/homework/homework8.py | acc-cosc-1336/cosc-1336-spring-2018-BarndonSelesino | c2ee6a9914383716347765f148d2d15b9e3211b7 | [
"MIT"
] | 1 | 2018-02-03T03:41:28.000Z | 2018-02-03T03:41:28.000Z | src/homework/homework8.py | acc-cosc-1336/cosc-1336-spring-2018-BarndonSelesino | c2ee6a9914383716347765f148d2d15b9e3211b7 | [
"MIT"
] | 1 | 2018-04-13T01:17:50.000Z | 2018-04-13T01:17:50.000Z | '''
Write a function named add_inventory with a widgets parameter of type dictionary, widget_name, and quantity
The function will add the widget to the dictionary if it doesn't exist.
If the widget exists it will update the quantity of the widgets.
:param widgets: a dictionary of widgets. Key is widget name, v... | 27.317073 | 107 | 0.699107 |
91579920adfb57c5760237dbae46edbf6516d557 | 739 | py | Python | examples/Parallel_speedup/timer.py | Nicholaswogan/PhotochemPy | 68c45a1d11660ae3d4f2c6ea43ee5dc403d4cb94 | [
"MIT"
] | 11 | 2021-01-06T23:07:04.000Z | 2021-09-27T17:06:03.000Z | examples/Parallel_speedup/timer.py | StAtmos/PhotochemPy | 68c45a1d11660ae3d4f2c6ea43ee5dc403d4cb94 | [
"MIT"
] | 1 | 2021-07-15T09:55:36.000Z | 2021-07-23T17:32:45.000Z | examples/Parallel_speedup/timer.py | StAtmos/PhotochemPy | 68c45a1d11660ae3d4f2c6ea43ee5dc403d4cb94 | [
"MIT"
] | 6 | 2021-01-09T00:22:03.000Z | 2021-08-04T16:01:25.000Z | import numpy as np
from matplotlib import pyplot as plt
import os
import subprocess
max_threads = int(os.cpu_count()/2)
cmd1 = 'rm times.txt'
subprocess.run(cmd1.split())
cmd2 = 'python test.py'
for i in range(1,max_threads+1):
os.environ['OMP_NUM_THREADS'] = str(i)
subprocess.run(cmd2.split())
threads,tim... | 22.393939 | 65 | 0.717185 |
9157b80a5f5ebe5f3eb39ee056a628c8763f8644 | 29,710 | py | Python | pytorch/torch/_jit_internal.py | zhou3968322/dl-code-read | aca204a986dabe2755becff0f42de1082299d791 | [
"MIT"
] | null | null | null | pytorch/torch/_jit_internal.py | zhou3968322/dl-code-read | aca204a986dabe2755becff0f42de1082299d791 | [
"MIT"
] | null | null | null | pytorch/torch/_jit_internal.py | zhou3968322/dl-code-read | aca204a986dabe2755becff0f42de1082299d791 | [
"MIT"
] | null | null | null | """
The weak_script annotation needs to be here instead of inside torch/jit/ so it
can be used in other places in torch/ (namely torch.nn) without running into
circular dependency problems
"""
import contextlib
import collections
import enum
import inspect
import weakref
import warnings
import torch
# This is needed. ... | 36.099635 | 122 | 0.661158 |
9157b9a09cd8d55ea47679aaf8fca40767b3a958 | 539 | py | Python | src/ggrc/models/help.py | Killswitchz/ggrc-core | 2460df94daf66727af248ad821462692917c97a9 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/ggrc/models/help.py | Killswitchz/ggrc-core | 2460df94daf66727af248ad821462692917c97a9 | [
"ECL-2.0",
"Apache-2.0"
] | 10 | 2018-07-06T00:04:23.000Z | 2021-02-26T21:13:20.000Z | src/ggrc/models/help.py | Killswitchz/ggrc-core | 2460df94daf66727af248ad821462692917c97a9 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2017-11-11T22:16:56.000Z | 2017-11-11T22:16:56.000Z | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from ggrc import db
from ggrc.models.deferred import deferred
from ggrc.models.mixins import Titled, Slugged
from ggrc.models import reflection
class Help(Titled, Slugged, db.Model):
__tablename__ = 'hel... | 23.434783 | 78 | 0.721707 |
9157e956af70c9cf755956675f58b4779f566eee | 1,660 | py | Python | src/model/functions.py | VanessaSwerts/imovel-data | d05693b16eab68d8f5cf7b021b8c5ab788633e45 | [
"MIT"
] | null | null | null | src/model/functions.py | VanessaSwerts/imovel-data | d05693b16eab68d8f5cf7b021b8c5ab788633e45 | [
"MIT"
] | null | null | null | src/model/functions.py | VanessaSwerts/imovel-data | d05693b16eab68d8f5cf7b021b8c5ab788633e45 | [
"MIT"
] | null | null | null | class ObjectToNumber():
"""
This class converts property numeric object type to number.
"""
def __init__(self, df):
self.df = df
def areaToNumber(self):
"""
This function converts the area of a property to a number.
"""
newArea = self.df['area'].st... | 34.583333 | 86 | 0.575301 |
9157ee622d3fbbd33dc1b74d7da12659e4c4074e | 1,988 | py | Python | src/model/hydrogen.py | SynteyEmyl/QLab-2 | 3f6b89ad24e893a5485f607c75ca76309f04e6a2 | [
"MIT"
] | null | null | null | src/model/hydrogen.py | SynteyEmyl/QLab-2 | 3f6b89ad24e893a5485f607c75ca76309f04e6a2 | [
"MIT"
] | null | null | null | src/model/hydrogen.py | SynteyEmyl/QLab-2 | 3f6b89ad24e893a5485f607c75ca76309f04e6a2 | [
"MIT"
] | null | null | null | """hydrogen.py:
this file contains the implementation of the
real valued hydrogen wave functions.
"""
__author__ = 'Miguel Angel Avila Torres'
__copyright__ = 'Copyright 2021, hydro-wave-visualizer'
__credits__ = ['Miguel Angel Avila Torres']
__license__ = 'The Legacy License'
__version__ = '1.0.0'
__maintainer__ = f... | 28.811594 | 117 | 0.625755 |
91580159e3c58962d3d038cd0186db8537d89cb2 | 69 | py | Python | lift-learn/metrics/__init__.py | smn-ailab/lift-learn | 158b8be554aad49033ee2eacf14fbbeb2418d6f7 | [
"MIT"
] | 1 | 2019-03-12T11:07:16.000Z | 2019-03-12T11:07:16.000Z | lift-learn/metrics/__init__.py | smn-ailab/lift-learn | 158b8be554aad49033ee2eacf14fbbeb2418d6f7 | [
"MIT"
] | 1 | 2019-02-15T06:21:33.000Z | 2019-02-20T01:03:54.000Z | lift-learn/metrics/__init__.py | smn-ailab/lift-learn | 158b8be554aad49033ee2eacf14fbbeb2418d6f7 | [
"MIT"
] | null | null | null | from ._curves import *
from ._errors import *
from ._values import *
| 17.25 | 22 | 0.73913 |
915858e966eedbae9db2184fa80d00df34cf7f11 | 38,191 | py | Python | modules/unit_tests/core/formats/xml.py | nursix/DRKCM | 09328289ff721c416494398aa751ff99906327cb | [
"MIT"
] | 3 | 2022-01-26T08:07:54.000Z | 2022-03-21T21:53:52.000Z | modules/unit_tests/core/formats/xml.py | nursix/eden-asp | e49f46cb6488918f8d5a163dcd5a900cd686978c | [
"MIT"
] | null | null | null | modules/unit_tests/core/formats/xml.py | nursix/eden-asp | e49f46cb6488918f8d5a163dcd5a900cd686978c | [
"MIT"
] | 1 | 2017-10-03T13:03:47.000Z | 2017-10-03T13:03:47.000Z | # Eden Unit Tests
#
# To run this script use:
# python web2py.py -S eden -M -R applications/eden/modules/unit_tests/core/resource/xml.py
#
import json
import os
import unittest
from io import BytesIO, StringIO
from lxml import etree
from gluon import *
from core import S3Hierarchy, s3_meta_fields, S3Represent, S3Rep... | 34.530741 | 98 | 0.499411 |
91586084cc2e3ce030c785642576e54e3cc87114 | 2,451 | py | Python | venv/Lib/site-packages/pyrogram/raw/types/update_peer_settings.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/raw/types/update_peer_settings.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/update_peer_settings.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 32.68 | 103 | 0.625051 |
91588d71bb0c392a2c93862bcf4b06bbd20d48bc | 9,117 | py | Python | scripts/cross_SVM_random_tree.py | Taosheng-ty/cs6350MLcourse | 738bc5ccc50b78a1721986e1a703a575adda2ca6 | [
"MIT"
] | null | null | null | scripts/cross_SVM_random_tree.py | Taosheng-ty/cs6350MLcourse | 738bc5ccc50b78a1721986e1a703a575adda2ca6 | [
"MIT"
] | null | null | null | scripts/cross_SVM_random_tree.py | Taosheng-ty/cs6350MLcourse | 738bc5ccc50b78a1721986e1a703a575adda2ca6 | [
"MIT"
] | null | null | null | import sys
sys.path.append("../../cs6350MLcourse/")
from algorithms import *
from algorithms.SVM import *
from algorithms.Random_forest import *
from utils import *
import json
import numpy as np
import os
import pandas as pd
from utils import Logger
arg=ml_arg()
argg=arg.parse_args()
# argg=arg.parse_args(["--tree_dep... | 61.601351 | 491 | 0.680926 |
9158c2b3967d1d93a098f7f8bea4cf823faaa408 | 2,485 | py | Python | tf2_gnn/layers/message_passing/rgcn.py | ktaebum/tf2-gnn | 4eb6bf367623fef28c937b632e3caa83288de206 | [
"MIT"
] | 381 | 2020-02-26T19:25:25.000Z | 2022-03-25T05:35:37.000Z | tf2_gnn/layers/message_passing/rgcn.py | ankitshah009/tf2-gnn | 3c763274f6586fb8d4cf3d74e3e0fd03b970b43f | [
"MIT"
] | 25 | 2020-02-26T17:32:57.000Z | 2022-02-21T12:07:51.000Z | tf2_gnn/layers/message_passing/rgcn.py | ankitshah009/tf2-gnn | 3c763274f6586fb8d4cf3d74e3e0fd03b970b43f | [
"MIT"
] | 74 | 2020-02-27T13:57:01.000Z | 2021-12-02T14:35:10.000Z | """Graph convolution layers."""
from typing import Dict, List, Any
import tensorflow as tf
from .gnn_edge_mlp import GNN_Edge_MLP
from .message_passing import MessagePassing, MessagePassingInput, register_message_passing_implementation
from tf2_gnn.utils.constants import SMALL_NUMBER
@register_message_passing_imple... | 36.014493 | 105 | 0.650704 |
9158dbcd44d86f19bd58b9111459080e0ba8d80c | 1,518 | py | Python | client.py | SIIS-cloud/ivp | 964aef735ffad2d647766936648cce8a1ac55116 | [
"Apache-2.0"
] | null | null | null | client.py | SIIS-cloud/ivp | 964aef735ffad2d647766936648cce8a1ac55116 | [
"Apache-2.0"
] | null | null | null | client.py | SIIS-cloud/ivp | 964aef735ffad2d647766936648cce8a1ac55116 | [
"Apache-2.0"
] | null | null | null | # The Integrity Verification Proxy (IVP) additions are ...
#
# Copyright (c) 2012 The Pennsylvania State University
# Systems and Internet Infrastructure Security Laboratory
#
# they were developed by:
#
# Joshua Schiffman <jschiffm@cse.psu.edu>
# Hayawardh Vijayakumar <huv101@cse.psu.edu>
# Trent Jaeger <tjaeger... | 24.483871 | 77 | 0.70224 |
9158ec66be38a5f08da9564f1f0024a0dda183e4 | 35,984 | py | Python | scrapli/factory.py | dmfigol/scrapli | d1f8641a1e3f490dab6bae704f092255efe6655c | [
"MIT"
] | null | null | null | scrapli/factory.py | dmfigol/scrapli | d1f8641a1e3f490dab6bae704f092255efe6655c | [
"MIT"
] | null | null | null | scrapli/factory.py | dmfigol/scrapli | d1f8641a1e3f490dab6bae704f092255efe6655c | [
"MIT"
] | null | null | null | """scrapli.factory"""
import importlib
from copy import deepcopy
from io import BytesIO
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union, cast
from scrapli.driver import AsyncGenericDriver, AsyncNetworkDriver, GenericDriver, NetworkDriver
from scrapli.driver.core import (
AsyncEOSDriver,
... | 44.811955 | 100 | 0.660905 |
9158f29735843e7393349dd6e9af0992bdbe3745 | 4,503 | py | Python | analysis/patterns_bulk_analysis_robustness_decays_subtracted.py | danielmk/pyDentateeLife2020 | b4a9f2beaa0c74dbc9583e2cf228856612596f8a | [
"MIT"
] | null | null | null | analysis/patterns_bulk_analysis_robustness_decays_subtracted.py | danielmk/pyDentateeLife2020 | b4a9f2beaa0c74dbc9583e2cf228856612596f8a | [
"MIT"
] | null | null | null | analysis/patterns_bulk_analysis_robustness_decays_subtracted.py | danielmk/pyDentateeLife2020 | b4a9f2beaa0c74dbc9583e2cf228856612596f8a | [
"MIT"
] | 4 | 2020-02-18T09:25:20.000Z | 2021-11-20T23:52:29.000Z | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import os
import numpy as np
parent = "C:\\Users\\Daniel\\pyDentateData\\robustness\\decays_2-0\\"
all_files = [x for x in os.listdir(parent) if not "figure" in x if '.npz' in x if 'corrs' in x]
tuned_files =
"""
all_input_data = [np.lo... | 36.909836 | 150 | 0.670442 |
91593376cb01629cc4ee647c14f3edb86d96e04b | 48 | py | Python | source/CreateRecordDatabase.py | tcoard/iBLAST | 358d9bb17a0b2cda759f68932e79c4479df68f20 | [
"CC0-1.0"
] | 2 | 2021-03-21T08:45:26.000Z | 2021-03-21T19:02:08.000Z | source/CreateRecordDatabase.py | tcoard/iBLAST | 358d9bb17a0b2cda759f68932e79c4479df68f20 | [
"CC0-1.0"
] | null | null | null | source/CreateRecordDatabase.py | tcoard/iBLAST | 358d9bb17a0b2cda759f68932e79c4479df68f20 | [
"CC0-1.0"
] | 1 | 2021-09-05T20:19:17.000Z | 2021-09-05T20:19:17.000Z | import DBUtility as DB
DB.initialize_database() | 16 | 24 | 0.833333 |
9159468d35e4d32be1c778e152737335cd4d48b0 | 9,327 | py | Python | tempest/api/identity/admin/test_users.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/api/identity/admin/test_users.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | tempest/api/identity/admin/test_users.py | midokura/tempest | b0ec1d280f057d5d9c2eda081bcbda7e381ecb3b | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
# 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 requ... | 44.841346 | 78 | 0.590758 |
91599663f44018e26fd799cb6ae82b20352ffbb8 | 8,675 | py | Python | storm_control/sc_hardware/physikInstrumente/piE873Module.py | BoettigerLab/scopeTest | 50c6601c952adf1d63c7f27b1aba8890e789c280 | [
"MIT"
] | 1 | 2021-03-17T20:25:59.000Z | 2021-03-17T20:25:59.000Z | storm_control/sc_hardware/physikInstrumente/piE873Module.py | BoettigerLab/scopeTest | 50c6601c952adf1d63c7f27b1aba8890e789c280 | [
"MIT"
] | null | null | null | storm_control/sc_hardware/physikInstrumente/piE873Module.py | BoettigerLab/scopeTest | 50c6601c952adf1d63c7f27b1aba8890e789c280 | [
"MIT"
] | 1 | 2021-03-17T21:24:35.000Z | 2021-03-17T21:24:35.000Z | #!/usr/bin/env python
"""
HAL module for controlling a Pi controller.
Adapted from Hal module for a tiger controller by Hazen 05/18.
This module connects to a PI controller (model E873) which controls 3
translation stages (model Q545.140) that are assembled in a 3D stage configuration
Alistair 10/19
"""
import math
f... | 42.317073 | 125 | 0.593429 |
9159b9c6f866ed72d3a94b235d5ee691350b37b1 | 1,121 | py | Python | test_entities/data_creation.py | matgille/boudams | d253ff2ee124e13186b5782ebb3c2d9b4bedd942 | [
"MIT"
] | null | null | null | test_entities/data_creation.py | matgille/boudams | d253ff2ee124e13186b5782ebb3c2d9b4bedd942 | [
"MIT"
] | null | null | null | test_entities/data_creation.py | matgille/boudams | d253ff2ee124e13186b5782ebb3c2d9b4bedd942 | [
"MIT"
] | null | null | null | import random
import sys
def main(file):
random.seed(2324)
with open(file, "r") as input_file:
string_list = input_file.readlines()
output_filename = file.replace(".txt", "dataed.txt")
output_strings_list = []
for line in string_list:
for character in line:
... | 29.5 | 61 | 0.513827 |
9159fa06f76ee1d6c89f064691c245fb23eefab9 | 14,577 | py | Python | src/infi/instruct/buffer/macros.py | jasonjorge/infi.asi | 78a4c34a421102f99b959a659cf7303804627d9b | [
"BSD-3-Clause"
] | 2 | 2015-01-12T21:16:06.000Z | 2019-12-12T05:59:56.000Z | src/infi/instruct/buffer/macros.py | jasonjorge/infi.asi | 78a4c34a421102f99b959a659cf7303804627d9b | [
"BSD-3-Clause"
] | 4 | 2015-02-24T09:18:00.000Z | 2021-06-16T12:55:19.000Z | src/infi/instruct/buffer/macros.py | jasonjorge/infi.asi | 78a4c34a421102f99b959a659cf7303804627d9b | [
"BSD-3-Clause"
] | 4 | 2015-01-07T12:37:54.000Z | 2018-02-08T15:07:17.000Z | from functools import partial
from infi.instruct.utils.kwargs import keep_kwargs_partial
from infi.instruct.utils.safe_repr import safe_repr
from .reference import (Reference, ContextGetAttrReference, FuncCallReference, LengthFuncCallReference,
TotalSizeReference, AfterFieldReference, FieldOrAt... | 40.831933 | 137 | 0.581052 |
915a015a9e3a58eec1ed57bb51127d4921f3507e | 1,652 | py | Python | src/python/ch09/sec05.py | zhuyuanxiang/Dive-into-Deep-Learning | 1237dfe2744aaa1cd42a83961b9516c01b960b83 | [
"MIT"
] | null | null | null | src/python/ch09/sec05.py | zhuyuanxiang/Dive-into-Deep-Learning | 1237dfe2744aaa1cd42a83961b9516c01b960b83 | [
"MIT"
] | null | null | null | src/python/ch09/sec05.py | zhuyuanxiang/Dive-into-Deep-Learning | 1237dfe2744aaa1cd42a83961b9516c01b960b83 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
"""
@Author : zYx.Tom
@Contact : 526614962@qq.com
@site : https://zhuyuanxiang.github.io
---------------------------
@Software : PyCharm
@Project : Dive-into-Deep-Learning
@File : sec0202.py
@Version : v0.1
@Time : 2020-12-27 9:25
@License ... | 28.482759 | 84 | 0.572639 |
915a412c03dc48cb625698363af4b154b4a03244 | 536 | py | Python | flaskapi/myflask01.py | nebiutadele/2022-02-28-Alta3-Python | 9c065540bfdf432103bfffac6eae4972c9f9061a | [
"MIT"
] | null | null | null | flaskapi/myflask01.py | nebiutadele/2022-02-28-Alta3-Python | 9c065540bfdf432103bfffac6eae4972c9f9061a | [
"MIT"
] | null | null | null | flaskapi/myflask01.py | nebiutadele/2022-02-28-Alta3-Python | 9c065540bfdf432103bfffac6eae4972c9f9061a | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# An object of Flask class is our WSGI application
from flask import Flask
# Flask constructor takes the name of current
# module (__name__) as argument
app = Flask(__name__)
# route() function of the Flask class is a
# decorator, tells the application which URL
# should call the associated functio... | 26.8 | 64 | 0.716418 |
915a4aa60b809cc51d6e5e9c29c8bdc92d718289 | 109,398 | py | Python | CatBot_Protect.py | afiz1108/Cats | 5264dec015ef2c87c0950c02dce1e3985f984528 | [
"MIT"
] | null | null | null | CatBot_Protect.py | afiz1108/Cats | 5264dec015ef2c87c0950c02dce1e3985f984528 | [
"MIT"
] | null | null | null | CatBot_Protect.py | afiz1108/Cats | 5264dec015ef2c87c0950c02dce1e3985f984528 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#Cat_Bot
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
import time,random,sys,json,codecs,threading,glob,re,ast,os,subprocess,wikipedia,goslate
import bs4
import ast
import requests,json,urllib
import html5lib
from random import randint
from bs4 import Beau... | 43.532829 | 414 | 0.423353 |
915a899e7b27799e052010b8136b06caaeb40817 | 4,794 | py | Python | dashboard/views/pages.py | riparias/early-warning-webapp | 702691a6ecbabc7865e5f232e125c8dee28a7f2e | [
"MIT"
] | null | null | null | dashboard/views/pages.py | riparias/early-warning-webapp | 702691a6ecbabc7865e5f232e125c8dee28a7f2e | [
"MIT"
] | 124 | 2021-09-02T06:53:33.000Z | 2022-03-31T12:46:51.000Z | dashboard/views/pages.py | riparias/early-warning-webapp | 702691a6ecbabc7865e5f232e125c8dee28a7f2e | [
"MIT"
] | null | null | null | from django.contrib import messages
from django.contrib.auth import authenticate, login
from django.contrib.auth.decorators import login_required
from django.http import HttpResponseForbidden, HttpRequest
from django.shortcuts import render, get_object_or_404, redirect
from dashboard.forms import (
SignUpForm,
... | 34.489209 | 86 | 0.681477 |
915aa981bc26badab951f523d46b50d559bd1a47 | 2,770 | py | Python | scripts/scripts_ipynb/Moster_plot_combine.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 1 | 2021-11-25T16:11:56.000Z | 2021-11-25T16:11:56.000Z | scripts/scripts_ipynb/Moster_plot_combine.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 6 | 2020-02-17T13:44:43.000Z | 2020-06-25T15:35:05.000Z | scripts/scripts_ipynb/Moster_plot_combine.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 1 | 2021-11-25T16:11:56.000Z | 2021-11-25T16:11:56.000Z | import matplotlib.pyplot as plt
import numpy as np
import load
import tree.halomodule as hmo
import pickle
import pandas as pd
import utils.match as mtc
import draw
from load.info import Info
def get_M1(z, M10=11.59 , M11=1.195):
10**(M10 + M11(z/(z+1))
def m_M(M,z):
N = get_M1
N10 = 0.0351
N11 = -0.024... | 26.380952 | 87 | 0.586282 |
915ab2e895d4d42b23dccef7f16bb427f6bbabc4 | 627 | py | Python | src/BribeNet/gui/apps/main.py | RobMurray98/BribeNet | 09ddd8f15d9ab5fac44ae516ed92c6ba5e5119bc | [
"MIT"
] | null | null | null | src/BribeNet/gui/apps/main.py | RobMurray98/BribeNet | 09ddd8f15d9ab5fac44ae516ed92c6ba5e5119bc | [
"MIT"
] | null | null | null | src/BribeNet/gui/apps/main.py | RobMurray98/BribeNet | 09ddd8f15d9ab5fac44ae516ed92c6ba5e5119bc | [
"MIT"
] | null | null | null | import tkinter as tk
class Main(tk.Frame):
"""
Frame for the main menu of the GUI
"""
def __init__(self, master, *args, **kwargs):
tk.Frame.__init__(self, master=master, *args, **kwargs)
title_text = tk.Label(self, text="Bribery Networks", font=("Calibri", 16, "bold"), pady=20)
... | 36.882353 | 112 | 0.658692 |
915ab7c4e11ae3afce7a0947e46b188af233609f | 6,127 | py | Python | src/data_utlis.py | Crazy-Jack/SpatialExpGeneCluster | 9e57c308d1c577a936a2358d0641c65b8130034f | [
"MIT"
] | null | null | null | src/data_utlis.py | Crazy-Jack/SpatialExpGeneCluster | 9e57c308d1c577a936a2358d0641c65b8130034f | [
"MIT"
] | null | null | null | src/data_utlis.py | Crazy-Jack/SpatialExpGeneCluster | 9e57c308d1c577a936a2358d0641c65b8130034f | [
"MIT"
] | null | null | null | import torch
from torch.utils.data import Dataset
from torchvision import transforms, datasets
import numpy as np
from tqdm import tqdm
import pickle
from PIL import Image
import os
class TwoCropTransform:
"""Create two crops of the same image"""
def __init__(self, transform):
self.transform = transf... | 33.118919 | 121 | 0.595397 |
915abe050888ad0b5b6df2d042408e4e2c5554a6 | 11,536 | py | Python | model.py | roctubre/aipnd-project | 84764ab552e070f9502f0af6e4a91535312a956f | [
"MIT"
] | null | null | null | model.py | roctubre/aipnd-project | 84764ab552e070f9502f0af6e4a91535312a956f | [
"MIT"
] | null | null | null | model.py | roctubre/aipnd-project | 84764ab552e070f9502f0af6e4a91535312a956f | [
"MIT"
] | null | null | null | #/usr/bin/env python3
#
# PROGRAMMER: Robert C.
# DATE CREATED: 2019-02-23
# REVISED DATE:
# PURPOSE: A class which implements a pretrained models from torch vision
# and replaces its existing classfier with a custom network.
# It's main use is to predict flower classes.
# - Train the netwo... | 37.454545 | 106 | 0.535021 |
915ac077bbf3b012a6a0cdff1cea172a81f9a4b6 | 2,423 | py | Python | experiments/ashvin/icml2020/hand/pen/offpolicy/awr2.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/hand/pen/offpolicy/awr2.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/hand/pen/offpolicy/awr2.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | """
AWR + SAC from demo experiment
"""
from rlkit.demos.source.dict_to_mdp_path_loader import DictToMDPPathLoader
from rlkit.launchers.experiments.awac.awac_rl import experiment
import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.arglauncher import run_variants
if __name__ == "__main__":
variant = dict(... | 26.922222 | 74 | 0.564589 |
915ac34ba741b9b74e165ff45dd86969db340927 | 938 | py | Python | aristotle/urls.py | jermnelson/FRBR-Redis-Datastore | d44af821536b82f5fafa5bed7a51fa86e9a92243 | [
"Apache-2.0"
] | 1 | 2015-09-24T01:12:02.000Z | 2015-09-24T01:12:02.000Z | aristotle/urls.py | jermnelson/FRBR-Redis-Datastore | d44af821536b82f5fafa5bed7a51fa86e9a92243 | [
"Apache-2.0"
] | 1 | 2021-12-13T19:39:44.000Z | 2021-12-13T19:39:44.000Z | aristotle/urls.py | jermnelson/FRBR-Redis-Datastore | d44af821536b82f5fafa5bed7a51fa86e9a92243 | [
"Apache-2.0"
] | null | null | null | """
mod:`url` FRBR-Redis-Datastore Aristotle base URLS
"""
__author__ = 'Jeremy Nelson'
from django.conf.urls.defaults import patterns, include, url
from django.views.generic.simple import direct_to_template
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
url... | 37.52 | 66 | 0.688699 |
915ae7c0f66747c991b37116de13221a537d73b0 | 18,180 | py | Python | run_convex_hull.py | twistedcubic/attention-rank-collapse | 38b5df6dc2add25f6d945e48a6baf96862368c20 | [
"Apache-2.0"
] | 118 | 2021-03-08T01:46:30.000Z | 2022-02-10T06:51:20.000Z | run_convex_hull.py | twistedcubic/attention-rank-collapse | 38b5df6dc2add25f6d945e48a6baf96862368c20 | [
"Apache-2.0"
] | null | null | null | run_convex_hull.py | twistedcubic/attention-rank-collapse | 38b5df6dc2add25f6d945e48a6baf96862368c20 | [
"Apache-2.0"
] | 11 | 2021-03-08T10:21:11.000Z | 2021-12-30T13:03:20.000Z | import copy
import os
import sys
import numpy as np
import sklearn
import torch
import torch.nn as nn
from tqdm import tqdm
import arguments
import plot
from configuration_san import SANConfig
from functions import create_path
from modeling_san import SANForSequenceClassification
"""
Boolean prediction of whether a... | 36.432866 | 191 | 0.625798 |
915aef63478140ce7f2bee1f90ad06433019de76 | 1,541 | py | Python | day15/test.py | mpirnat/adventofcode | f63ce466b91d5be2687be95fd4ab0b442f1ea5c8 | [
"MIT"
] | 12 | 2015-12-02T05:56:36.000Z | 2017-11-29T18:58:47.000Z | day15/test.py | mpirnat/adventofcode | f63ce466b91d5be2687be95fd4ab0b442f1ea5c8 | [
"MIT"
] | 1 | 2015-12-06T03:36:18.000Z | 2015-12-06T20:52:29.000Z | day15/test.py | mpirnat/adventofcode | f63ce466b91d5be2687be95fd4ab0b442f1ea5c8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import unittest
from day15 import Ingredient, score_recipe, make_recipes, find_best_recipe
class TestScoringRecipes(unittest.TestCase):
ing1 = Ingredient(
name='butterscotch',
capacity=-1,
durability=-2,
flavor=6,
texture=3,
... | 30.215686 | 79 | 0.612589 |
915af0202eed757016ae50d9bee38434f7a0a10a | 4,252 | py | Python | muspy/outputs/music21.py | blankRiot96/muspy | 73f670c1ad93db7be58f0e63a22aa9f7b4f7aa0b | [
"MIT"
] | null | null | null | muspy/outputs/music21.py | blankRiot96/muspy | 73f670c1ad93db7be58f0e63a22aa9f7b4f7aa0b | [
"MIT"
] | null | null | null | muspy/outputs/music21.py | blankRiot96/muspy | 73f670c1ad93db7be58f0e63a22aa9f7b4f7aa0b | [
"MIT"
] | null | null | null | """Music21 converter interface."""
from typing import TYPE_CHECKING
from music21.key import Key
from music21.metadata import Contributor, Copyright
from music21.metadata import Metadata as M21MetaData
from music21.meter import TimeSignature as M21TimeSignature
from music21.note import Note as M21Note
from music21.stre... | 29.734266 | 79 | 0.673565 |
915af1b50ab00881ef5b66ce723221d51c16a156 | 4,621 | py | Python | optimization/basicblock.py | zengljnwpu/yaspc | 5e85efb5fb8bee02471814b10e950dfb5b04c5d5 | [
"MIT"
] | null | null | null | optimization/basicblock.py | zengljnwpu/yaspc | 5e85efb5fb8bee02471814b10e950dfb5b04c5d5 | [
"MIT"
] | null | null | null | optimization/basicblock.py | zengljnwpu/yaspc | 5e85efb5fb8bee02471814b10e950dfb5b04c5d5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri May 12 10:54:38 2017
@author: hellolzc axiqia
"""
from optimization import instruction
class BasicBlock(object):
"""
Basic block class
这个类几乎没有封装,当成结构体用了。。。
"""
# 设计的很糟糕,建议专门设计一个图的数据结构来存block
def __init__(self, number=0):
''' 前序基本块集合
... | 28.701863 | 93 | 0.585588 |
915afb39d5d91e3e0a17ce82f2a4fa3073819e87 | 3,225 | py | Python | py/0450.delete-node-in-a-bst.py | ck2w/leetcode | 2d411530b690a2e51b0ae518bf3efaad2edc1083 | [
"MIT"
] | null | null | null | py/0450.delete-node-in-a-bst.py | ck2w/leetcode | 2d411530b690a2e51b0ae518bf3efaad2edc1083 | [
"MIT"
] | null | null | null | py/0450.delete-node-in-a-bst.py | ck2w/leetcode | 2d411530b690a2e51b0ae518bf3efaad2edc1083 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=450 lang=python3
#
# [450] Delete Node in a BST
#
# https://leetcode.com/problems/delete-node-in-a-bst/description/
#
# algorithms
# Medium (45.95%)
# Likes: 3165
# Dislikes: 113
# Total Accepted: 178.9K
# Total Submissions: 388.9K
# Testcase Example: '[5,3,6,2,4,null,7]\n3'
#
# Given a r... | 25.595238 | 82 | 0.579535 |
915b3cc6d85712d855b384e1394e7a622923bb79 | 774 | py | Python | test/integration/integration_test.py | nareddyt/nighthawk | dfab764fb678089687d8ddb5419972ea06b14df8 | [
"Apache-2.0"
] | null | null | null | test/integration/integration_test.py | nareddyt/nighthawk | dfab764fb678089687d8ddb5419972ea06b14df8 | [
"Apache-2.0"
] | null | null | null | test/integration/integration_test.py | nareddyt/nighthawk | dfab764fb678089687d8ddb5419972ea06b14df8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""@package integration_test.py
Entry point for our integration testing
"""
import logging
import os
import sys
import pytest
if __name__ == '__main__':
path = os.path.dirname(os.path.realpath(__file__))
test_selection_arg = sys.argv[1] if len(sys.argv) > 1 else ""
r = pytest.main(
[... | 26.689655 | 83 | 0.577519 |
915b5a98745496ce49b31f5071dc2023f7be4f8d | 1,895 | py | Python | regrid_cesm_lens.py | oet808/PDO | a1af01787f027ba953685fec0ffd9988d551d249 | [
"MIT"
] | null | null | null | regrid_cesm_lens.py | oet808/PDO | a1af01787f027ba953685fec0ffd9988d551d249 | [
"MIT"
] | null | null | null | regrid_cesm_lens.py | oet808/PDO | a1af01787f027ba953685fec0ffd9988d551d249 | [
"MIT"
] | null | null | null | #!/usr/bin/python
###############################################################################
# Script that calls CDO
# linux command to regrid
# ocean model output to regular 2.5 x 2.5
# grid using bilinear interpolation
# Note: Updated variable naming: smallcaps
# (all capital only for the 'contstant' variable... | 28.712121 | 79 | 0.54934 |
915b9581334b436fce3585b69b9da363f01769ea | 4,628 | py | Python | python_modules/libraries/dagstermill/dagstermill/cli.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagstermill/dagstermill/cli.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagstermill/dagstermill/cli.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | import copy
import os
import subprocess
from typing import Dict, Optional
import click
import nbformat
from papermill.iorw import load_notebook_node, write_ipynb
from dagster import check
from dagster.seven.json import loads
from dagster.utils import mkdir_p, safe_isfile
def get_import_cell():
return nbformat.v... | 33.057143 | 100 | 0.683232 |
915bb9180707552028227314c67a70e3a1d35681 | 15,203 | py | Python | records/migration.py | ecohealthalliance/birt-consumer | 6a98dbc5756125c47e2ec537fd7f52077547f054 | [
"Apache-2.0"
] | null | null | null | records/migration.py | ecohealthalliance/birt-consumer | 6a98dbc5756125c47e2ec537fd7f52077547f054 | [
"Apache-2.0"
] | null | null | null | records/migration.py | ecohealthalliance/birt-consumer | 6a98dbc5756125c47e2ec537fd7f52077547f054 | [
"Apache-2.0"
] | null | null | null | import logging
from datetime import datetime, timedelta
from cerberus import Validator
from conf import settings
from records.record import InvalidRecord, InvalidRecordLength, InvalidRecordProperty, Record
from tools.csv_helpers import TabDialect, CommaDialect
class MigrationChecklistType(object):
""" class that... | 41.3125 | 100 | 0.562389 |
915bbac429f3fede0d1e9e54babc4ce3980af299 | 5,004 | py | Python | homeassistant/components/sensor/tellduslive.py | mbs-technologie/home-assistant | 71fc446425cbb1c0d4670c261ce8ea3bfd83a73d | [
"MIT"
] | 13 | 2017-02-01T13:25:34.000Z | 2022-01-26T01:30:39.000Z | homeassistant/components/sensor/tellduslive.py | mbs-technologie/home-assistant | 71fc446425cbb1c0d4670c261ce8ea3bfd83a73d | [
"MIT"
] | 9 | 2017-07-26T18:05:32.000Z | 2021-12-05T14:16:34.000Z | homeassistant/components/sensor/tellduslive.py | mbs-technologie/home-assistant | 71fc446425cbb1c0d4670c261ce8ea3bfd83a73d | [
"MIT"
] | 21 | 2017-07-26T17:09:40.000Z | 2022-03-27T22:37:22.000Z | """
Support for Tellstick Net/Telstick Live.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.tellduslive/
"""
import logging
from datetime import datetime
from homeassistant.components import tellduslive
from homeassistant.const import (
ATTR... | 31.670886 | 74 | 0.659073 |
915bc09151c4299a8f05d987834d40999cfba44b | 1,366 | py | Python | PhenDisco/ReleaseV1.0/diver/pipeline.py | DBMI/iSeeDELVE | 72b51b275bd8ae2e1587f4b6709f24307dd6560f | [
"BSD-4-Clause-UC"
] | null | null | null | PhenDisco/ReleaseV1.0/diver/pipeline.py | DBMI/iSeeDELVE | 72b51b275bd8ae2e1587f4b6709f24307dd6560f | [
"BSD-4-Clause-UC"
] | null | null | null | PhenDisco/ReleaseV1.0/diver/pipeline.py | DBMI/iSeeDELVE | 72b51b275bd8ae2e1587f4b6709f24307dd6560f | [
"BSD-4-Clause-UC"
] | null | null | null | # Pipeline for demographic mapping tools
# Input is free text input
# Output is demographic mapping
# This is run in server side
# Input : Free text
# Output: Mapping model at ./model.html
# Run:
# python ./pipeline.py 'age first started smoking cigars'
import os,sys
# ===============================================... | 35.025641 | 131 | 0.476574 |
915c1e9ae157444611c72382e2c9e60201243b1d | 1,383 | py | Python | pandas/io/pickle.py | hhuuggoo/pandas | f87ab95c2ecd1be6a3e3acec8f5d81e7f3c8e4bd | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | 26 | 2018-02-14T23:52:58.000Z | 2021-08-16T13:50:03.000Z | pandas/io/pickle.py | josericardo/pandas | fe9aa125c19ce2b22a0c4aabedd68b24df6cb98e | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | pandas/io/pickle.py | josericardo/pandas | fe9aa125c19ce2b22a0c4aabedd68b24df6cb98e | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | 10 | 2018-08-13T19:38:39.000Z | 2020-04-19T03:02:00.000Z | from pandas.compat import cPickle as pkl, pickle_compat as pc, PY3
def to_pickle(obj, path):
"""
Pickle (serialize) object to input file path
Parameters
----------
obj : any object
path : string
File path
"""
with open(path, 'wb') as f:
pkl.dump(obj, f, protocol=pkl.HI... | 25.611111 | 79 | 0.596529 |
915c4038a19163f2132300f306874a15bfc1afb8 | 2,097 | py | Python | eventsourcing/example/domainmodel.py | alexanderlarin/eventsourcing | 6f2a4ded3c783ba3ee465243a48f66ecdee20f52 | [
"BSD-3-Clause"
] | null | null | null | eventsourcing/example/domainmodel.py | alexanderlarin/eventsourcing | 6f2a4ded3c783ba3ee465243a48f66ecdee20f52 | [
"BSD-3-Clause"
] | null | null | null | eventsourcing/example/domainmodel.py | alexanderlarin/eventsourcing | 6f2a4ded3c783ba3ee465243a48f66ecdee20f52 | [
"BSD-3-Clause"
] | null | null | null | from eventsourcing.domain.model.decorators import attribute
from eventsourcing.domain.model.entity import AbstractEntityRepository, TimestampedVersionedEntity, \
EntityWithHashchain
class Example(EntityWithHashchain, TimestampedVersionedEntity):
"""
An example event sourced domain model entity.
"""
... | 30.391304 | 101 | 0.667144 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.