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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1dda39e783e026916e6f06007e715b7bb877ae34 | 1,141 | py | Python | src/sardana/taurus/qt/qtgui/macrolistener/__init__.py | marc2332/sardana | 48dc9191baaa63f6c714d8c025e8f3f96548ad26 | [
"CC-BY-3.0"
] | 43 | 2016-11-25T15:21:23.000Z | 2021-08-20T06:09:40.000Z | src/sardana/taurus/qt/qtgui/macrolistener/__init__.py | marc2332/sardana | 48dc9191baaa63f6c714d8c025e8f3f96548ad26 | [
"CC-BY-3.0"
] | 1,263 | 2016-11-25T15:58:37.000Z | 2021-11-02T22:23:47.000Z | src/sardana/taurus/qt/qtgui/macrolistener/__init__.py | marc2332/sardana | 48dc9191baaa63f6c714d8c025e8f3f96548ad26 | [
"CC-BY-3.0"
] | 58 | 2016-11-21T11:33:55.000Z | 2021-09-01T06:21:21.000Z | #!/usr/bin/env python
##############################################################################
##
# This file is part of Sardana
##
# http://www.sardana-controls.org/
##
# Copyright 2011 CELLS / ALBA Synchrotron, Bellaterra, Spain
##
# Sardana is free software: you can redistribute it and/or modify
# it under th... | 35.65625 | 78 | 0.646801 |
1dda46a89ada489b1bd61b056a87003c178f2ffd | 2,664 | py | Python | lib/surface/compute/autoscaler/__init__.py | ianel20/google-cloud-sdk | 36ed4e06ba3961d0a8fbf30a3eaabf7db6d4e9c3 | [
"Apache-2.0"
] | null | null | null | lib/surface/compute/autoscaler/__init__.py | ianel20/google-cloud-sdk | 36ed4e06ba3961d0a8fbf30a3eaabf7db6d4e9c3 | [
"Apache-2.0"
] | null | null | null | lib/surface/compute/autoscaler/__init__.py | ianel20/google-cloud-sdk | 36ed4e06ba3961d0a8fbf30a3eaabf7db6d4e9c3 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:23:41.000Z | 2020-07-25T12:23:41.000Z | # Copyright 2014 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 required by applicable law or ag... | 35.052632 | 74 | 0.736862 |
1dda61ac256a4734343c198727c4cfc12930fe24 | 125 | py | Python | tql/utils/request/__init__.py | Jie-Yuan/1_DataMining | f5338388b4f883233f350d4fb9c5903180883430 | [
"Apache-2.0"
] | 14 | 2019-06-25T13:46:32.000Z | 2020-10-27T02:04:59.000Z | tql/utils/request/__init__.py | Jie-Yuan/2_DataMining | f5338388b4f883233f350d4fb9c5903180883430 | [
"Apache-2.0"
] | null | null | null | tql/utils/request/__init__.py | Jie-Yuan/2_DataMining | f5338388b4f883233f350d4fb9c5903180883430 | [
"Apache-2.0"
] | 7 | 2019-06-25T13:26:16.000Z | 2020-10-27T02:05:03.000Z | #!/usr/bin/env python
#-*- coding: utf-8 -*-
"""
__title__ = '__init__.py'
__author__ = 'JieYuan'
__mtime__ = '19-3-12'
"""
| 13.888889 | 25 | 0.6 |
1dda6ff49fee3587e461cd1d59a1913c193f5e7a | 892 | py | Python | utils/simple_functions.py | dezren39/manim | 80d7742446c588dc296bd3afb3465a63b63383db | [
"MIT"
] | 1 | 2020-07-05T12:56:31.000Z | 2020-07-05T12:56:31.000Z | utils/simple_functions.py | elphasminyato/manim | 8488b621ef3367e6a911354d2765684321fed20e | [
"MIT"
] | 3 | 2021-09-08T02:19:38.000Z | 2022-03-12T00:41:00.000Z | utils/simple_functions.py | dezren39/manim | 80d7742446c588dc296bd3afb3465a63b63383db | [
"MIT"
] | 1 | 2020-07-05T12:56:33.000Z | 2020-07-05T12:56:33.000Z | import numpy as np
import operator as op
def sigmoid(x):
return 1.0 / (1 + np.exp(-x))
def choose(n, r):
if n < r:
return 0
if r == 0:
return 1
denom = reduce(op.mul, xrange(1, r + 1), 1)
numer = reduce(op.mul, xrange(n, n - r, -1), 1)
return numer // denom
# Just to have a ... | 26.235294 | 78 | 0.634529 |
1ddaaee3b5786c3584517a795f2a31b55036468a | 24,731 | py | Python | helpers/klabtools.py | kemerelab/NeuroHMM | 31874a924340d8946229375e9a676a694de495a6 | [
"MIT"
] | null | null | null | helpers/klabtools.py | kemerelab/NeuroHMM | 31874a924340d8946229375e9a676a694de495a6 | [
"MIT"
] | null | null | null | helpers/klabtools.py | kemerelab/NeuroHMM | 31874a924340d8946229375e9a676a694de495a6 | [
"MIT"
] | null | null | null | # klabtools.py
# helper functions to process ephys data
# import os.path
# import sys
# import scipy.io
import pandas as pd
import numpy as np
# import re
import seaborn as sns
from matplotlib import pyplot as plt
from scipy.signal import butter, lfilter, filtfilt
import ripple
from mymap import Map
def butter_ban... | 40.675987 | 235 | 0.636691 |
1ddab2ae8cfaecc67ac29fcdc3e10c79f912576c | 2,872 | py | Python | huobi/model/loanorder.py | xiaohuid/huobi_Python | ebc84b2fc560f77fd77457f36ff91906c43646e3 | [
"Apache-2.0"
] | 1 | 2020-12-28T07:04:45.000Z | 2020-12-28T07:04:45.000Z | huobi/model/loanorder.py | xiaohuid/huobi_Python | ebc84b2fc560f77fd77457f36ff91906c43646e3 | [
"Apache-2.0"
] | null | null | null | huobi/model/loanorder.py | xiaohuid/huobi_Python | ebc84b2fc560f77fd77457f36ff91906c43646e3 | [
"Apache-2.0"
] | 1 | 2022-03-27T10:36:04.000Z | 2022-03-27T10:36:04.000Z | from huobi.model.constant import *
class LoanOrder:
"""
The margin order information.
:member
id: The order id.
user_id: The user id.
account_type: The account type which created the loan order.
currency: The currency name.
loan_amount: The amount of the origin loa... | 44.875 | 87 | 0.680014 |
1ddabb699d534b35ef25f3e73d7c6475d11480bc | 4,630 | py | Python | rock4/softtest/pad/uiappium/AppiumServer.py | RockFeng0/rock4automation | a29270ab9fa4cdc79f6453971b7c7a21f01442b0 | [
"MIT"
] | 5 | 2018-09-25T05:49:49.000Z | 2021-12-30T11:06:09.000Z | rock4/softtest/pad/uiappium/AppiumServer.py | RockFeng0/rock4automation | a29270ab9fa4cdc79f6453971b7c7a21f01442b0 | [
"MIT"
] | 3 | 2018-04-01T04:27:21.000Z | 2019-01-03T11:02:33.000Z | rock4/softtest/pad/uiappium/AppiumServer.py | RockFeng0/rock4automation | a29270ab9fa4cdc79f6453971b7c7a21f01442b0 | [
"MIT"
] | 7 | 2018-09-25T05:49:51.000Z | 2021-12-30T11:06:11.000Z | # -*- encoding: utf-8 -*-
'''
Current module: pyrunner.drivers.uiappium.AppiumServer
Rough version history:
v1.0 Original version to use
********************************************************************
@AUTHOR: Administrator-Bruce Luo(罗科峰)
MAIL: lkf20031988@163.com
RCS: rock4.sof... | 33.071429 | 138 | 0.520734 |
1ddb10a0e13abcf6e5e6638eba17b7e07f962338 | 2,705 | py | Python | CLUSTER_MANAGEMENT/ClusterManagement/Clusters/tests.py | udhayprakash/Django_Projects | 5c5257944d36a552428f8b8a926110d64055fc12 | [
"Apache-2.0"
] | null | null | null | CLUSTER_MANAGEMENT/ClusterManagement/Clusters/tests.py | udhayprakash/Django_Projects | 5c5257944d36a552428f8b8a926110d64055fc12 | [
"Apache-2.0"
] | 27 | 2020-06-05T23:26:44.000Z | 2022-02-10T11:21:31.000Z | CLUSTER_MANAGEMENT/ClusterManagement/Clusters/tests.py | udhayprakash/Django_Projects | 5c5257944d36a552428f8b8a926110d64055fc12 | [
"Apache-2.0"
] | null | null | null | from Clusters.models import ClusterDetails
from rest_framework.test import APITestCase
class ClustersAPITestCase(APITestCase):
def setUp(self):
ClusterDetails.objects.create(
cluster_name='alabama',
nodes_count=100
)
def test01_get_method(self):
print('test01_g... | 36.066667 | 82 | 0.602218 |
1ddb27a5956d21d647a3245a8284278ba32be633 | 5,517 | py | Python | falkon/sparse/sparse_ops.py | mohamad-amin/falkon | 581c761b4a4cb7bf6a299613700db8414c419a52 | [
"MIT"
] | 130 | 2020-06-18T08:30:30.000Z | 2022-03-21T15:43:17.000Z | falkon/sparse/sparse_ops.py | mohamad-amin/falkon | 581c761b4a4cb7bf6a299613700db8414c419a52 | [
"MIT"
] | 32 | 2020-06-26T09:24:45.000Z | 2022-03-20T10:37:36.000Z | falkon/sparse/sparse_ops.py | mohamad-amin/falkon | 581c761b4a4cb7bf6a299613700db8414c419a52 | [
"MIT"
] | 17 | 2020-07-13T17:28:02.000Z | 2022-02-15T19:55:40.000Z | from typing import Optional
import torch
from falkon.c_ext import sparse_row_norm_sq, sparse_row_norm
from falkon.utils.tensor_helpers import is_f_contig
from falkon.sparse.sparse_tensor import SparseTensor
from falkon.utils.helpers import check_same_dtype
__all__ = ("sparse_matmul", "sparse_square_norm", "sparse_no... | 30.821229 | 99 | 0.640566 |
1ddb323c58e8afecaab4daf540a9079b640bbae7 | 8,439 | py | Python | examples/gan/lsun_wgan.py | NervanaSystems/ngraph-python | ac032c83c7152b615a9ad129d54d350f9d6a2986 | [
"Apache-2.0"
] | 18 | 2018-03-19T04:16:49.000Z | 2021-02-08T14:44:58.000Z | examples/gan/lsun_wgan.py | rsumner31/ngraph | 5e5c9bb9f24d95aee190b914dd2d44122fc3be53 | [
"Apache-2.0"
] | 2 | 2019-04-16T06:41:49.000Z | 2019-05-06T14:08:13.000Z | examples/gan/lsun_wgan.py | rsumner31/ngraph | 5e5c9bb9f24d95aee190b914dd2d44122fc3be53 | [
"Apache-2.0"
] | 11 | 2018-06-16T15:59:08.000Z | 2021-03-06T00:45:30.000Z | #!/usr/bin/env python
# ******************************************************************************
# Copyright 2017-2018 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
... | 39.806604 | 97 | 0.65138 |
1ddb4688db086b895f1a35bb620fba42b2dc8431 | 7,583 | py | Python | intake_esm/derived.py | Ouranosinc/intake-esm | c39ba18acfb35e7fad1dcf5c0c9807b50800a1c0 | [
"Apache-2.0"
] | 20 | 2019-03-03T22:05:19.000Z | 2020-04-20T23:47:13.000Z | intake_esm/derived.py | Ouranosinc/intake-esm | c39ba18acfb35e7fad1dcf5c0c9807b50800a1c0 | [
"Apache-2.0"
] | 145 | 2019-02-15T04:07:49.000Z | 2020-06-25T19:03:18.000Z | intake_esm/derived.py | Ouranosinc/intake-esm | c39ba18acfb35e7fad1dcf5c0c9807b50800a1c0 | [
"Apache-2.0"
] | 18 | 2019-03-10T15:25:59.000Z | 2020-06-08T09:56:03.000Z | import importlib
import inspect
import typing
import pydantic
import tlz
import xarray as xr
class DerivedVariableError(Exception):
pass
class DerivedVariable(pydantic.BaseModel):
func: typing.Callable
variable: pydantic.StrictStr
query: typing.Dict[pydantic.StrictStr, typing.Union[typing.Any, typi... | 35.938389 | 138 | 0.617434 |
1ddb65c03b24b82e39dbd256d1427d4ef85495b5 | 6,037 | py | Python | tests/test_plasma_parameters.py | hanicinecm/pygmol | 10223e5db46208b7ade1448fc277739e777648d1 | [
"MIT"
] | null | null | null | tests/test_plasma_parameters.py | hanicinecm/pygmol | 10223e5db46208b7ade1448fc277739e777648d1 | [
"MIT"
] | null | null | null | tests/test_plasma_parameters.py | hanicinecm/pygmol | 10223e5db46208b7ade1448fc277739e777648d1 | [
"MIT"
] | null | null | null | import pytest
from pygmol.plasma_parameters import (
PlasmaParametersValidationError,
plasma_parameters_from_dict,
validate_plasma_parameters,
sanitize_power_series,
)
from pygmol.abc import PlasmaParameters
from .resources import DefaultParamsStat, DefaultParamsDyn, DefaultParamsMinimal
@pytest.fix... | 31.773684 | 87 | 0.681299 |
1ddb65ea01131db1ce911e1f8b58a6cdb2321125 | 1,165 | py | Python | stix2validator/codes.py | emmanvg/cti-stix-validator | 0e5e4320d100b1d2a9a5d3f748e1ac6da330c1ea | [
"BSD-3-Clause"
] | null | null | null | stix2validator/codes.py | emmanvg/cti-stix-validator | 0e5e4320d100b1d2a9a5d3f748e1ac6da330c1ea | [
"BSD-3-Clause"
] | null | null | null | stix2validator/codes.py | emmanvg/cti-stix-validator | 0e5e4320d100b1d2a9a5d3f748e1ac6da330c1ea | [
"BSD-3-Clause"
] | null | null | null | """Exit status codes
"""
from six import itervalues
#: Execution finished successfully. All STIX documents were valid for all user-
#: specified validation scenarios.
EXIT_SUCCESS = 0x0
#: Execution finished with fatal system error. Some unhandled system exception
#: was raised during execution.
EXIT_FAILURE = 0x1
... | 27.093023 | 79 | 0.723605 |
1ddb6cff7b7453e62e62b20dd4d8c994ed0fc5c8 | 29,923 | py | Python | ThirdParty/Twisted/twisted/conch/ssh/keys.py | OpenGeoscience/VTK | a373e975b9284a022f43a062ebf5042bb17b4e44 | [
"BSD-3-Clause"
] | 1 | 2021-10-13T01:57:14.000Z | 2021-10-13T01:57:14.000Z | ThirdParty/Twisted/twisted/conch/ssh/keys.py | OpenGeoscience/VTK | a373e975b9284a022f43a062ebf5042bb17b4e44 | [
"BSD-3-Clause"
] | null | null | null | ThirdParty/Twisted/twisted/conch/ssh/keys.py | OpenGeoscience/VTK | a373e975b9284a022f43a062ebf5042bb17b4e44 | [
"BSD-3-Clause"
] | 5 | 2015-10-09T04:12:29.000Z | 2021-12-15T16:57:11.000Z | # -*- test-case-name: twisted.conch.test.test_keys -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Handling of RSA and DSA keys.
Maintainer: U{Paul Swartz}
"""
# base library imports
import base64
import itertools
# external library imports
from Crypto.Cipher import DES3, AES
from Cr... | 35.411834 | 79 | 0.516927 |
1ddb7a8786e0ceddc659f769e9032d77d3bc66e2 | 50,451 | py | Python | Ui_main_heb.py | Vladimir-pa/Degree-Planer | 909cbf58eebaebeb2efe097782dbcd7968ee69f1 | [
"Apache-2.0"
] | 2 | 2020-01-24T19:11:44.000Z | 2020-07-31T17:03:54.000Z | Ui_main_heb.py | Vladimir-pa/Degree-Planer | 909cbf58eebaebeb2efe097782dbcd7968ee69f1 | [
"Apache-2.0"
] | 3 | 2019-07-07T14:05:52.000Z | 2019-07-23T15:14:40.000Z | Ui_main_heb.py | Vladimir-pa/Degree-Planer | 909cbf58eebaebeb2efe097782dbcd7968ee69f1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'hebrew_design.ui'
#
# Created by: PyQt5 UI code generator 5.12.1
#
# WARNING! All changes made in this file will be lost!
import json
from PyQt5 import QtCore, QtGui, QtWidgets
class MenuProxyStyle(QtWidgets.QProxyStyle):
def drawCont... | 58.595819 | 121 | 0.738598 |
1ddb7c0f2874c25704c5d0b8213d8791542a3e22 | 815 | py | Python | web/urls.py | hbc123ht/Django-Speech-Accent-Recognition-demo | 6f0d15f10e15436fcf952f6ceb91f6fd75c09592 | [
"MIT"
] | null | null | null | web/urls.py | hbc123ht/Django-Speech-Accent-Recognition-demo | 6f0d15f10e15436fcf952f6ceb91f6fd75c09592 | [
"MIT"
] | null | null | null | web/urls.py | hbc123ht/Django-Speech-Accent-Recognition-demo | 6f0d15f10e15436fcf952f6ceb91f6fd75c09592 | [
"MIT"
] | null | null | null | """web URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vie... | 35.434783 | 77 | 0.700613 |
1ddb8bcddbb12b7ec113de9559baa3c604cad2bb | 619 | py | Python | csm_web/scheduler/management/commands/createtestdata.py | mudit2103/csm_web | 3b7fd9ca7269ad4cb57bf264cf62a620e02d3780 | [
"MIT"
] | null | null | null | csm_web/scheduler/management/commands/createtestdata.py | mudit2103/csm_web | 3b7fd9ca7269ad4cb57bf264cf62a620e02d3780 | [
"MIT"
] | null | null | null | csm_web/scheduler/management/commands/createtestdata.py | mudit2103/csm_web | 3b7fd9ca7269ad4cb57bf264cf62a620e02d3780 | [
"MIT"
] | null | null | null | from django.core.management import BaseCommand
from scheduler.factories import generate_test_data
class Command(BaseCommand):
help = "Populates database with randomly generated data for testing and creates demo accounts."
def add_arguments(self, parser):
parser.add_argument(
"--complicate... | 34.388889 | 127 | 0.693053 |
1ddbacda52c3e94a0373a3bf2cd28a3f1af1eb45 | 4,259 | py | Python | accounts/serializers.py | fossabot/flaam-api | d11651aa77c4b7c5e26b6443f9699e0a4bec4354 | [
"MIT"
] | 1 | 2022-01-07T04:01:06.000Z | 2022-01-07T04:01:06.000Z | accounts/serializers.py | fossabot/flaam-api | d11651aa77c4b7c5e26b6443f9699e0a4bec4354 | [
"MIT"
] | 26 | 2021-11-14T06:02:59.000Z | 2022-03-29T14:17:39.000Z | accounts/serializers.py | fossabot/flaam-api | d11651aa77c4b7c5e26b6443f9699e0a4bec4354 | [
"MIT"
] | 1 | 2022-01-05T18:51:01.000Z | 2022-01-05T18:51:01.000Z | from django.contrib.auth import get_user_model
from rest_framework import serializers
from rest_framework.exceptions import ValidationError
from .validators import PasswordValidator
UserModel = get_user_model()
class UserSerializer(serializers.ModelSerializer):
"""User serializer"""
class Meta:
mod... | 29.576389 | 86 | 0.637474 |
1ddbbb7d31094eedce9f15b10dd6238566ba15a6 | 3,397 | py | Python | demo/convvae.py | VectorInstitute/vector_cv_tools | 37d5b4c41a83f15554994bf7d19d8d274282ee61 | [
"MIT"
] | 6 | 2021-06-10T03:10:34.000Z | 2021-07-14T19:27:01.000Z | demo/convvae.py | VectorInstitute/vector_cv_tools | 37d5b4c41a83f15554994bf7d19d8d274282ee61 | [
"MIT"
] | null | null | null | demo/convvae.py | VectorInstitute/vector_cv_tools | 37d5b4c41a83f15554994bf7d19d8d274282ee61 | [
"MIT"
] | 1 | 2021-11-28T20:03:50.000Z | 2021-11-28T20:03:50.000Z | """
Contains pieces taken from https://github.com/pytorch/examples/issues/70
and https://github.com/pytorch/examples/tree/master/vae
"""
import torch
import torch.nn as nn
class Decoder(nn.Module):
def __init__(self):
nc = 3
ndf = 128
ngf = 128
nz = 100
super().__init__()... | 32.04717 | 77 | 0.511628 |
1ddbc066c8c5a9095e8b4bcd26d9abea4c6a4d86 | 162 | py | Python | Python/ex008_m_cm_mm.py | maurovasconcelos/Ola-Mundo | 526c6c271fbe916c4f9f22153828e4d8c726a544 | [
"MIT"
] | 1 | 2021-02-16T17:36:53.000Z | 2021-02-16T17:36:53.000Z | Python/ex008_m_cm_mm.py | maurovasconcelos/Ola-Mundo | 526c6c271fbe916c4f9f22153828e4d8c726a544 | [
"MIT"
] | null | null | null | Python/ex008_m_cm_mm.py | maurovasconcelos/Ola-Mundo | 526c6c271fbe916c4f9f22153828e4d8c726a544 | [
"MIT"
] | null | null | null | medida = float(input('Uma distancia em metros: '))
cm = medida * 100
mm = medida * 1000
print('A medida de {}m corresponde a {}cm e {}mm'.format(medida, cm, mm))
| 32.4 | 73 | 0.660494 |
1ddc2c4bf6b43e5655724d9b39bd544a37cf9ad2 | 782 | py | Python | tests/json_nets/test_module_from_json_2.py | penguinmenac3/deeptech | 0c7fb170d62f193dbbb2018f7b8d42f713178bb8 | [
"MIT"
] | 1 | 2020-10-10T10:11:54.000Z | 2020-10-10T10:11:54.000Z | tests/json_nets/test_module_from_json_2.py | penguinmenac3/deeptech | 0c7fb170d62f193dbbb2018f7b8d42f713178bb8 | [
"MIT"
] | null | null | null | tests/json_nets/test_module_from_json_2.py | penguinmenac3/deeptech | 0c7fb170d62f193dbbb2018f7b8d42f713178bb8 | [
"MIT"
] | null | null | null | import unittest
import numpy as np
import torch
import deeptech.model.module_from_json as mfj
from deeptech.model.module_from_json import Module
mfj.WARN_DISABLED_LAYERS = False
class TestModuleFromJSON(unittest.TestCase):
def setUp(self) -> None:
self.module = Module.create_from_file("tests/jso... | 31.28 | 104 | 0.714834 |
1ddc3d002b9bfee05aebfb60e661aa9352ee88fc | 6,894 | py | Python | tests/unit/bellman/agents/background_planning/test_background_planning_agent.py | RL-Gym/bellman | 210c9ff877b38705d1cf1b3ccd0f9f2644ad8d0d | [
"Apache-2.0"
] | 40 | 2021-03-24T10:41:56.000Z | 2022-03-15T09:50:47.000Z | tests/unit/bellman/agents/background_planning/test_background_planning_agent.py | RL-Gym/bellman | 210c9ff877b38705d1cf1b3ccd0f9f2644ad8d0d | [
"Apache-2.0"
] | 12 | 2021-03-25T18:36:27.000Z | 2021-07-27T11:09:34.000Z | tests/unit/bellman/agents/background_planning/test_background_planning_agent.py | RL-Gym/bellman | 210c9ff877b38705d1cf1b3ccd0f9f2644ad8d0d | [
"Apache-2.0"
] | 3 | 2021-04-25T03:18:44.000Z | 2021-11-14T15:54:34.000Z | # Copyright 2021 The Bellman Contributors
#
# 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... | 41.53012 | 98 | 0.789962 |
1ddc536c4f20c5923a2e9c65afaa807c751879d4 | 255 | py | Python | Rotation.py | Zebra/Savanna-Python-SDK | 973f642a13f8c695a1781322ebf804c34cdb1b47 | [
"MIT"
] | 1 | 2021-03-08T06:49:57.000Z | 2021-03-08T06:49:57.000Z | Rotation.py | Zebra/Savanna-Python-SDK | 973f642a13f8c695a1781322ebf804c34cdb1b47 | [
"MIT"
] | 1 | 2022-01-25T16:36:43.000Z | 2022-01-25T16:36:43.000Z | Rotation.py | Zebra/Savanna-Python-SDK | 973f642a13f8c695a1781322ebf804c34cdb1b47 | [
"MIT"
] | 1 | 2020-06-11T14:00:40.000Z | 2020-06-11T14:00:40.000Z | from enum import Enum
"""
Rotation --- Describes image orientation.
@author Dbuhrsmith@zebra.com
"""
class Rotation(Enum):
Normal = "N"
Clockwise = "R"
Inverted = "I"
Counterclockwise = "L"
def get(self):
return self.value | 15 | 41 | 0.627451 |
1ddc635990e04750c9eb9c4cb77a7d448106a2ee | 1,320 | py | Python | sdk/servicebus/azure-servicebus/conftest.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/servicebus/azure-servicebus/conftest.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/servicebus/azure-servicebus/conftest.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # ------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# -------------------------------------------------------------------------
import os
i... | 36.666667 | 108 | 0.652273 |
1ddc894b411c62c6f5ca5831ca1552b7e4d91aeb | 1,885 | py | Python | visualization_utils/vis_stats.py | facebookresearch/Project_FARSI | 12b40e4f16ba7418a0f3b997ad124cdb51f4e7f4 | [
"MIT"
] | 14 | 2021-06-01T16:45:19.000Z | 2022-03-08T20:07:00.000Z | visualization_utils/vis_stats.py | facebookresearch/Project_FARSI | 12b40e4f16ba7418a0f3b997ad124cdb51f4e7f4 | [
"MIT"
] | null | null | null | visualization_utils/vis_stats.py | facebookresearch/Project_FARSI | 12b40e4f16ba7418a0f3b997ad124cdb51f4e7f4 | [
"MIT"
] | 3 | 2021-08-05T16:37:47.000Z | 2022-01-06T00:25:49.000Z | #Copyright (c) Facebook, Inc. and its affiliates.
#This source code is licensed under the MIT license found in the
#LICENSE file in the root directory of this source tree.
from design_utils.design import *
import os
from sys import platform
# ------------------------------
# Functionality:
# visualize all the s... | 55.441176 | 186 | 0.654642 |
1ddcb0eb21ee9117179f4f26afe34247649ee8d3 | 1,944 | py | Python | applications/hw4_4/controllers/api.py | ayeh9/ecommerce_site | 0010dbc2f0d378c449772eb3ed2dfe0cce8b932e | [
"BSD-3-Clause"
] | null | null | null | applications/hw4_4/controllers/api.py | ayeh9/ecommerce_site | 0010dbc2f0d378c449772eb3ed2dfe0cce8b932e | [
"BSD-3-Clause"
] | null | null | null | applications/hw4_4/controllers/api.py | ayeh9/ecommerce_site | 0010dbc2f0d378c449772eb3ed2dfe0cce8b932e | [
"BSD-3-Clause"
] | null | null | null | def get_logged_in_user():
user = None if auth.user is None else auth.user.email
return response.json(dict(user=user))
def get_all_products():
products = db(db.theproduct).select()
for theproduct in products:
reviews = db((db.review.product_id == theproduct.id) & (db.review.rating > 0)).select(d... | 36.679245 | 150 | 0.670782 |
1ddcc00eb084727df27fec6dbfd0ed7cc7963b7f | 5,111 | py | Python | kobo-install/tests/utils.py | OpenOPx/kobotoolbox | ceee7e0740c8c74f33e5d2e36cb2cace0935abee | [
"MIT"
] | null | null | null | kobo-install/tests/utils.py | OpenOPx/kobotoolbox | ceee7e0740c8c74f33e5d2e36cb2cace0935abee | [
"MIT"
] | null | null | null | kobo-install/tests/utils.py | OpenOPx/kobotoolbox | ceee7e0740c8c74f33e5d2e36cb2cace0935abee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import json
from unittest.mock import patch, mock_open
from helpers.config import Config
from helpers.singleton import Singleton
def read_config(overrides=None):
config_dict = dict(Config.get_template())
config_dict['kobodocker_path'] = '/tmp'
if overrides is not None:
co... | 34.073333 | 80 | 0.596752 |
1ddcce8ee55cf441019041704ba9650f0684c95f | 811 | py | Python | manage.py | prathee/ftoutageadmin | edf1bb00bc58282d3f4f396d1517e7813480b388 | [
"CC0-1.0"
] | null | null | null | manage.py | prathee/ftoutageadmin | edf1bb00bc58282d3f4f396d1517e7813480b388 | [
"CC0-1.0"
] | null | null | null | manage.py | prathee/ftoutageadmin | edf1bb00bc58282d3f4f396d1517e7813480b388 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ftoutageadmin.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure tha... | 35.26087 | 77 | 0.644883 |
1ddcd4ba806235d02ffc6e3ce5f1b530cf5980c5 | 2,157 | py | Python | wmtexe/cmi/api.py | csdms/wmt-exe | d1e21537135a2d2c442ae6244427b076803d1254 | [
"MIT"
] | null | null | null | wmtexe/cmi/api.py | csdms/wmt-exe | d1e21537135a2d2c442ae6244427b076803d1254 | [
"MIT"
] | 10 | 2016-02-04T17:55:34.000Z | 2019-03-19T21:10:39.000Z | wmtexe/cmi/api.py | csdms/wmt-exe | d1e21537135a2d2c442ae6244427b076803d1254 | [
"MIT"
] | 1 | 2015-07-29T22:22:46.000Z | 2015-07-29T22:22:46.000Z | #! /usr/bin/env python
from __future__ import print_function
import os
import types
import yaml
from .utils import cd, check_output, system
from .git import git_repo_name, git_clone_or_update, git_repo_sha
_REQUIRED_KEYS = set(['language', 'build', 'includes', 'cflags', 'libs',
'grids'])
_OPTI... | 22.946809 | 72 | 0.621233 |
1ddce1716d1244f64d9e73d613484054f659e8b9 | 1,515 | py | Python | modules/log.py | joinemm/Miso-Bot | e1cd92fe71fbfdd45487e57e495b8640596732d5 | [
"MIT"
] | null | null | null | modules/log.py | joinemm/Miso-Bot | e1cd92fe71fbfdd45487e57e495b8640596732d5 | [
"MIT"
] | null | null | null | modules/log.py | joinemm/Miso-Bot | e1cd92fe71fbfdd45487e57e495b8640596732d5 | [
"MIT"
] | null | null | null | import logging
from time import time
def get_logger(logger_name):
logger = logging.getLogger(logger_name)
if logger.handlers:
return logger
# logger not created yet, assign options
logger.setLevel(level=logging.INFO)
fmt = logging.Formatter(
fmt="{asctime} | {levelname:7} {name:>1... | 26.12069 | 94 | 0.630363 |
1ddd2fe5f69353baa5cbb027af84138404af62f9 | 16,871 | py | Python | oscar/lib/python2.7/site-packages/django/utils/http.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/utils/http.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/utils/http.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import base64
import calendar
import datetime
import re
import sys
import unicodedata
import warnings
from binascii import Error as BinasciiError
from email.utils import formatdate
from django.core.exceptions import TooManyFieldsSent
from django.utils import six
f... | 35.972281 | 96 | 0.626578 |
1ddd5aac1c29ff9e1808cd7ebfc61f5349fce215 | 1,705 | py | Python | predictionserver/servermixins/garbagedaemon.py | microprediction/predictionserver | 817243a4c85aac63995ab3a18cfbdcb01bb07bd0 | [
"MIT"
] | 1 | 2020-12-04T17:59:19.000Z | 2020-12-04T17:59:19.000Z | predictionserver/servermixins/garbagedaemon.py | microprediction/predictionserver | 817243a4c85aac63995ab3a18cfbdcb01bb07bd0 | [
"MIT"
] | null | null | null | predictionserver/servermixins/garbagedaemon.py | microprediction/predictionserver | 817243a4c85aac63995ab3a18cfbdcb01bb07bd0 | [
"MIT"
] | 1 | 2021-03-05T05:03:36.000Z | 2021-03-05T05:03:36.000Z | from predictionserver.servermixins.memoserver import MemoServer
from predictionserver.servermixins.ownershipserver import OwnershipServer
class GarbageDaemon(MemoServer, OwnershipServer):
def __init__(self, **kwargs):
super().__init__(**kwargs)
def admin_garbage_collection(self, fraction=0.1, with_r... | 42.625 | 83 | 0.637537 |
1ddd619bea6a0a79ca21b06aaa3834d1fda1bda8 | 2,109 | py | Python | references/classification/latency_pytorch.py | Mindee/doctr | b9d8feb1b4a2206e4944ef2dea109acc19585074 | [
"Apache-2.0"
] | 628 | 2021-02-13T21:49:37.000Z | 2022-03-31T19:48:57.000Z | references/classification/latency_pytorch.py | Mindee/doctr | b9d8feb1b4a2206e4944ef2dea109acc19585074 | [
"Apache-2.0"
] | 694 | 2021-02-08T15:23:38.000Z | 2022-03-31T07:24:59.000Z | references/classification/latency_pytorch.py | Mindee/doctr | b9d8feb1b4a2206e4944ef2dea109acc19585074 | [
"Apache-2.0"
] | 90 | 2021-04-28T05:39:02.000Z | 2022-03-31T06:48:36.000Z | # Copyright (C) 2021, Mindee.
# This program is licensed under the Apache License version 2.
# See LICENSE or go to <https://www.apache.org/licenses/LICENSE-2.0.txt> for full license details.
"""
Image classification latency benchmark
"""
import argparse
import os
import time
import numpy as np
import torch
os.env... | 32.446154 | 114 | 0.671882 |
1ddd749835385e81887ecd8e36cf2029d0622fa5 | 93 | py | Python | utils/__init__.py | rickgroen/cov-weighting | 64c296679cd37e724a03c6dc107606f7048aec96 | [
"MIT"
] | 26 | 2021-01-05T07:10:31.000Z | 2022-03-23T06:31:00.000Z | utils/__init__.py | rickgroen/cov-weighting | 64c296679cd37e724a03c6dc107606f7048aec96 | [
"MIT"
] | 6 | 2021-04-12T16:27:11.000Z | 2022-02-09T07:00:15.000Z | utils/__init__.py | rickgroen/cov-weighting | 64c296679cd37e724a03c6dc107606f7048aec96 | [
"MIT"
] | 7 | 2021-03-08T09:28:05.000Z | 2022-02-23T07:39:29.000Z | from utils.train_utils import *
from utils.reduce_image_set import RestrictedFilePathCreator
| 31 | 60 | 0.88172 |
1ddd9e4454501ce6bd68cfeb47294894025d20f1 | 5,229 | py | Python | day16.py | FlorianGD/adventofcode_2018 | cfe452b823b8d24a20857becf7974c448cd67f68 | [
"MIT"
] | null | null | null | day16.py | FlorianGD/adventofcode_2018 | cfe452b823b8d24a20857becf7974c448cd67f68 | [
"MIT"
] | null | null | null | day16.py | FlorianGD/adventofcode_2018 | cfe452b823b8d24a20857becf7974c448cd67f68 | [
"MIT"
] | null | null | null | """AoC 2018 Day 16: Chronal Classification"""
import re
from collections import namedtuple
# Part 1
Sample = namedtuple("Sample", ['before', 'instruction', 'after'])
Instruction = namedtuple('Instruction', ['op', 'A', 'B', 'C'])
def read_digits(line):
return [int(i) for i in re.findall(r'(\d+)', line)]
def p... | 25.019139 | 79 | 0.60088 |
1ddda835698488eb20ec9c25ee1b6439e13df99f | 1,020 | py | Python | eddymotion/viz.py | arokem/EddyMotionCorrection | 3eac1547b31b8f42f17fa67a442ccdc8527658c2 | [
"Apache-2.0"
] | null | null | null | eddymotion/viz.py | arokem/EddyMotionCorrection | 3eac1547b31b8f42f17fa67a442ccdc8527658c2 | [
"Apache-2.0"
] | null | null | null | eddymotion/viz.py | arokem/EddyMotionCorrection | 3eac1547b31b8f42f17fa67a442ccdc8527658c2 | [
"Apache-2.0"
] | null | null | null | """Visualization utilities."""
import numpy as np
import nibabel as nb
def plot_dwi(dataobj, affine, gradient=None, **kwargs):
"""Plot a DW map."""
from nilearn.plotting import plot_anat
import matplotlib.pyplot as plt
plt.rcParams.update(
{
"text.usetex": True,
"font.... | 26.842105 | 67 | 0.557843 |
1ddda9cf5a1fdc5e03d790ab6a97f42d46f7839e | 584 | py | Python | cursoemvideoPy/Mundo1/ex022.py | BrCarlini/exPython | 3bed986e5bfa5eae191b6b18306448926aed48fd | [
"MIT"
] | null | null | null | cursoemvideoPy/Mundo1/ex022.py | BrCarlini/exPython | 3bed986e5bfa5eae191b6b18306448926aed48fd | [
"MIT"
] | null | null | null | cursoemvideoPy/Mundo1/ex022.py | BrCarlini/exPython | 3bed986e5bfa5eae191b6b18306448926aed48fd | [
"MIT"
] | null | null | null | print('=========== Análisador de String ===========')
nome_completo = str(input('Digite seu nome completo: ')).strip()
letra_maiuscula = nome_completo.upper()
print(f'Nome em Maiúsculo: {letra_maiuscula}')
letra_minuscula = nome_completo.lower()
print(f'Nome em Minúsculo: {letra_minuscula}')
quantidade_letras = len... | 29.2 | 68 | 0.739726 |
1dddc1056a7945b7b8c09062b3a5a7e36590d1bc | 2,191 | py | Python | tensor2tensor/models/neural_gpu_test.py | vohoaiviet/tensor2tensor | c2bd023ab7fc8ca0f4c4138e955845537d10ca55 | [
"Apache-2.0"
] | 6 | 2017-10-10T13:36:39.000Z | 2021-02-18T07:50:00.000Z | tensor2tensor/models/neural_gpu_test.py | vohoaiviet/tensor2tensor | c2bd023ab7fc8ca0f4c4138e955845537d10ca55 | [
"Apache-2.0"
] | null | null | null | tensor2tensor/models/neural_gpu_test.py | vohoaiviet/tensor2tensor | c2bd023ab7fc8ca0f4c4138e955845537d10ca55 | [
"Apache-2.0"
] | 9 | 2017-07-25T11:29:06.000Z | 2021-06-20T14:01:58.000Z | # Copyright 2017 The Tensor2Tensor Authors.
#
# 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 ... | 34.234375 | 79 | 0.707896 |
1dddcbc9708e95f6f13676443102639f053b7406 | 3,702 | py | Python | experiments/vitchyr/goal_distribution/representation_learning/exps_20_07_15/exp1_sasha_vae_post_refactor.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2020-10-23T14:40:09.000Z | 2020-10-23T14:40:09.000Z | experiments/vitchyr/goal_distribution/representation_learning/exps_20_07_15/exp1_sasha_vae_post_refactor.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/vitchyr/goal_distribution/representation_learning/exps_20_07_15/exp1_sasha_vae_post_refactor.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | 1 | 2021-05-27T20:38:45.000Z | 2021-05-27T20:38:45.000Z | import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.launcher_util import run_experiment
from rlkit.torch.sets.vae_launcher import train_set_vae
if __name__ == '__main__':
variant = dict(
create_vae_kwargs=dict(
latent_dim=128,
use_fancy_architecture=True,
encod... | 29.380952 | 75 | 0.501351 |
1dddf11c27dd99158409d4d5b99b2106238e9ab9 | 2,258 | py | Python | relative_performer/training_utils.py | ExpectationMax/Translational-Equivariant-Performers | c7a55af3b581426512eb4a57d3a13eb20e93fbd6 | [
"MIT"
] | 10 | 2021-02-16T13:44:16.000Z | 2021-07-01T07:07:52.000Z | relative_performer/training_utils.py | lioutasb/Translational-Equivariant-Performers | c7a55af3b581426512eb4a57d3a13eb20e93fbd6 | [
"MIT"
] | null | null | null | relative_performer/training_utils.py | lioutasb/Translational-Equivariant-Performers | c7a55af3b581426512eb4a57d3a13eb20e93fbd6 | [
"MIT"
] | 2 | 2021-02-17T04:30:28.000Z | 2021-06-30T19:59:17.000Z | from torch.optim import Optimizer
from torch.optim.lr_scheduler import LambdaLR
def get_constant_schedule_with_warmup(optimizer: Optimizer, num_warmup_steps: int, last_epoch: int = -1):
"""
Create a schedule with a constant learning rate preceded by a warmup period during which the learning rate
increases... | 41.814815 | 110 | 0.689991 |
1dde3997c01fe18e96ead812f27405b36c0b2fb2 | 16,514 | py | Python | nets/resnet_v2.py | ace19-dev/image-retrieval-tf | ddcf79fcb448189b74fa0cbe6d000091f7a53e8c | [
"MIT"
] | 6 | 2019-08-27T16:12:51.000Z | 2020-04-18T04:38:45.000Z | nets/resnet_v2.py | ace19-dev/image-retrieval-tf | ddcf79fcb448189b74fa0cbe6d000091f7a53e8c | [
"MIT"
] | 4 | 2019-09-15T07:44:58.000Z | 2020-04-21T06:33:55.000Z | nets/resnet_v2.py | ace19-dev/image-retrieval-tf | ddcf79fcb448189b74fa0cbe6d000091f7a53e8c | [
"MIT"
] | 1 | 2019-12-10T14:37:38.000Z | 2019-12-10T14:37:38.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 applicable ... | 47.182857 | 107 | 0.673307 |
1dde48def3a1f23b1ceb6586e96475a2e05ba6ac | 4,697 | py | Python | scripts/sim_env.py | rlworkgroup/metaworlds | be03cfed9890a37b84283c597209b849e8a086cc | [
"MIT"
] | 5 | 2019-02-27T20:55:30.000Z | 2019-08-24T19:24:41.000Z | scripts/sim_env.py | rlworkgroup/metaworlds | be03cfed9890a37b84283c597209b849e8a086cc | [
"MIT"
] | 8 | 2019-02-28T04:07:10.000Z | 2020-01-02T10:54:10.000Z | scripts/sim_env.py | rlworkgroup/metaworlds | be03cfed9890a37b84283c597209b849e8a086cc | [
"MIT"
] | 1 | 2021-09-13T18:35:34.000Z | 2021-09-13T18:35:34.000Z | import argparse
import sys
import time
import gym
import numpy as np
import pygame
from metaworlds.misc.resolve import load_class
def sample_action(lb, ub):
Du = len(lb)
if np.any(np.isinf(lb)) or np.any(np.isinf(ub)):
raise ValueError('Cannot sample unbounded actions')
return np.random.rand(Du)... | 32.393103 | 77 | 0.498403 |
1dde66b0ff8663908189402f2f1e4a8bf3ad6a93 | 3,571 | py | Python | saf/ffm/linear/rhsevaluator.py | dmitry-kabanov/fickettmodel | 255b1e9cae1cfb7a6b914ad61a17288d52215cc4 | [
"MIT"
] | null | null | null | saf/ffm/linear/rhsevaluator.py | dmitry-kabanov/fickettmodel | 255b1e9cae1cfb7a6b914ad61a17288d52215cc4 | [
"MIT"
] | null | null | null | saf/ffm/linear/rhsevaluator.py | dmitry-kabanov/fickettmodel | 255b1e9cae1cfb7a6b914ad61a17288d52215cc4 | [
"MIT"
] | null | null | null | import logging
import numpy as np
from .config import Config
from .solution import Solution
class RHSEvaluator(object):
"""Evaluate the right-hand side for the linearized Fickett's model.
Parameters
----------
config : Config
Configuration object containing problem data.
"""
def _... | 30.521368 | 75 | 0.574909 |
1dde672b2ceacf34cb39ccac77cca2e5985333de | 5,163 | py | Python | 5. analyzing_stack.py | galgodon/auroral_lines | 9c322a93c6d95c672a89a420cc72c52e71663e09 | [
"MIT"
] | null | null | null | 5. analyzing_stack.py | galgodon/auroral_lines | 9c322a93c6d95c672a89a420cc72c52e71663e09 | [
"MIT"
] | null | null | null | 5. analyzing_stack.py | galgodon/auroral_lines | 9c322a93c6d95c672a89a420cc72c52e71663e09 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 16 13:50:31 2019
@author: gerom
"""
#%% Import packages
from astropy.io import fits
import matplotlib.pyplot as plt
import numpy as np
#%% Import data on stacks (created in 4. stacking.py)
stack_1 = fits.open('data/bin_1_stack.fits')
stack_2 = fits.open(... | 31.87037 | 112 | 0.668991 |
1dde6ad6c95ec966b8470843f8e9154c582d728d | 10,497 | py | Python | gaphor/diagram/shapes.py | Xander982/gaphor | b5c55fa18b79b80d9c14ee0cb0ce8a9963e90f86 | [
"Apache-2.0"
] | null | null | null | gaphor/diagram/shapes.py | Xander982/gaphor | b5c55fa18b79b80d9c14ee0cb0ce8a9963e90f86 | [
"Apache-2.0"
] | null | null | null | gaphor/diagram/shapes.py | Xander982/gaphor | b5c55fa18b79b80d9c14ee0cb0ce8a9963e90f86 | [
"Apache-2.0"
] | null | null | null | from math import pi
from typing import List, Optional, Tuple
from gaphas.geometry import Rectangle
from typing_extensions import TypedDict
from gaphor.diagram.text import (
FontStyle,
FontWeight,
TextAlign,
TextDecoration,
VerticalAlign,
text_draw,
text_draw_focus_box,
text_point_in_bo... | 28.917355 | 88 | 0.556254 |
1dde8eed5b1429de93f9c954547cbbd076f7459c | 1,950 | py | Python | rltorch/network/Network.py | Brandon-Rozek/rltorch | cb87105305315c5df4cae91fee0ee54b981bc04b | [
"MIT"
] | null | null | null | rltorch/network/Network.py | Brandon-Rozek/rltorch | cb87105305315c5df4cae91fee0ee54b981bc04b | [
"MIT"
] | null | null | null | rltorch/network/Network.py | Brandon-Rozek/rltorch | cb87105305315c5df4cae91fee0ee54b981bc04b | [
"MIT"
] | null | null | null | import rltorch.log as log
class Network:
"""
Wrapper around model and optimizer in PyTorch to abstract away common use cases.
Parameters
----------
model : nn.Module
A PyTorch nn.Module.
optimizer
A PyTorch opimtizer from torch.optim.
config : dict
A dictionary of con... | 27.857143 | 87 | 0.558462 |
1ddeada21e0bbc08a31affaee47bbe9c490d43de | 8,417 | py | Python | cfbs/validate.py | olehermanse/cfbs | ac504410ab46f39001d3af4e8742da77b04fd1f4 | [
"MIT"
] | 3 | 2021-12-10T12:14:21.000Z | 2022-03-03T13:08:40.000Z | cfbs/validate.py | olehermanse/cfbs | ac504410ab46f39001d3af4e8742da77b04fd1f4 | [
"MIT"
] | 15 | 2021-07-15T12:28:45.000Z | 2022-03-17T08:21:57.000Z | cfbs/validate.py | olehermanse/cfbs | ac504410ab46f39001d3af4e8742da77b04fd1f4 | [
"MIT"
] | 4 | 2021-07-14T14:20:02.000Z | 2021-11-05T13:31:30.000Z | import argparse
import json
import sys
import requests
import re
from cfbs.utils import is_a_commit_hash
class CFBSIndexException(Exception):
def __init__(self, name, message) -> None:
if name is None:
super().__init__("Error in index: " + message)
else:
super().__init__("... | 40.661836 | 88 | 0.593204 |
1ddee3c83a921d5513e2d0a918e3c5c4e82b0303 | 1,438 | py | Python | src/gafaelfawr/storage/transaction.py | lsst-sqre/gafaelfawr | 5d965e9d7901987ef041fd341637d75407b55227 | [
"MIT"
] | null | null | null | src/gafaelfawr/storage/transaction.py | lsst-sqre/gafaelfawr | 5d965e9d7901987ef041fd341637d75407b55227 | [
"MIT"
] | 155 | 2020-05-29T17:21:13.000Z | 2022-03-28T19:55:52.000Z | src/gafaelfawr/storage/transaction.py | lsst-sqre/gafaelfawr | 5d965e9d7901987ef041fd341637d75407b55227 | [
"MIT"
] | 3 | 2021-04-26T18:02:58.000Z | 2022-02-03T01:29:13.000Z | """Manage database transactions."""
from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from types import TracebackType
from typing import Literal, Optional
from sqlalchemy.orm import Session
__all__ = ["Transaction", "TransactionManager"]
class Transaction:
"""R... | 23.193548 | 76 | 0.645341 |
1ddf0e160e12b086191241c7dd6a4a5a42592a2c | 6,074 | py | Python | json_schema2adoc/jsonSchemaAdocGenerator.py | AAFC-BICoE/json-schema2adoc | 1ac8cbda285e20d307bec8a85dc378af60f595ef | [
"MIT"
] | null | null | null | json_schema2adoc/jsonSchemaAdocGenerator.py | AAFC-BICoE/json-schema2adoc | 1ac8cbda285e20d307bec8a85dc378af60f595ef | [
"MIT"
] | null | null | null | json_schema2adoc/jsonSchemaAdocGenerator.py | AAFC-BICoE/json-schema2adoc | 1ac8cbda285e20d307bec8a85dc378af60f595ef | [
"MIT"
] | 4 | 2019-09-17T16:52:05.000Z | 2020-02-10T19:29:48.000Z | '''
schemaAdocGenerator.py
Script used to produce AsciiDoc files from Json Schemas
usage: schemaAdocGenerator.py input output-directory
'''
import os
import argparse
from pathlib import Path
import json
import pdb
def main():
"""Entry Point for the script"""
# Set up CLI arguments
parser = argparse.Ar... | 31.968421 | 116 | 0.65377 |
1ddf42d40b267b5c1579252dbec50eda46381405 | 14,559 | py | Python | bskillskit/skills_writer.py | KentaroAOKI/bskillskit | 0309b82a3f6e51f2e1df5e93a8b1b9b4fac95c67 | [
"Apache-2.0"
] | null | null | null | bskillskit/skills_writer.py | KentaroAOKI/bskillskit | 0309b82a3f6e51f2e1df5e93a8b1b9b4fac95c67 | [
"Apache-2.0"
] | null | null | null | bskillskit/skills_writer.py | KentaroAOKI/bskillskit | 0309b82a3f6e51f2e1df5e93a8b1b9b4fac95c67 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
import json
import logging
from boxsdk import Client
from boxsdk import OAuth2
from .skills_error_enum import SkillsErrorEnum
class SkillsWriter:
"""
SkillsWriter :- A helpful class to write back Metadata Cards for
Topics, Transcripts, Timelines, Errors and Statuses back to ... | 41.597143 | 144 | 0.632255 |
1ddf4d49b06f42ad868231a333c4e7aaaa71be1f | 4,376 | py | Python | data_science/execution_env.py | conducto/demo | fb89f6c978fde37ec4040c72759b83c2044f0a73 | [
"Apache-2.0"
] | 3 | 2020-05-12T22:56:48.000Z | 2020-11-10T04:03:19.000Z | data_science/execution_env.py | conducto/demo | fb89f6c978fde37ec4040c72759b83c2044f0a73 | [
"Apache-2.0"
] | 3 | 2020-04-03T16:15:11.000Z | 2020-06-07T21:25:07.000Z | data_science/execution_env.py | conducto/demo | fb89f6c978fde37ec4040c72759b83c2044f0a73 | [
"Apache-2.0"
] | 3 | 2020-06-07T03:08:51.000Z | 2022-02-18T20:09:27.000Z | """
### **Execution Environment**
Working examples of all flavors of image specification.
An image can be:
* an existing image from Dockerhub or another image registry
* a python image with python requirements
* a dockerfile for full flexibility
Code can be added to an image:
* copy local code
* clone from git
* use ... | 32.902256 | 94 | 0.688757 |
1ddf6b3cf01c84659f925387c93049bbb7a1d90e | 1,578 | py | Python | tests/test_getipaddress.py | smilers/sabnzbd | ed0e5bbf9b963113f4962e7aec297266f19d6615 | [
"MIT",
"PSF-2.0",
"0BSD"
] | 1,354 | 2015-01-02T11:53:23.000Z | 2022-03-30T01:32:46.000Z | tests/test_getipaddress.py | smilers/sabnzbd | ed0e5bbf9b963113f4962e7aec297266f19d6615 | [
"MIT",
"PSF-2.0",
"0BSD"
] | 1,742 | 2015-01-01T20:17:35.000Z | 2022-03-30T21:05:00.000Z | tests/test_getipaddress.py | smilers/sabnzbd | ed0e5bbf9b963113f4962e7aec297266f19d6615 | [
"MIT",
"PSF-2.0",
"0BSD"
] | 410 | 2015-01-24T05:32:46.000Z | 2022-03-20T12:56:49.000Z | #!/usr/bin/python3 -OO
# Copyright 2007-2021 The SABnzbd-Team <team@sabnzbd.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any late... | 33.574468 | 81 | 0.723067 |
1ddfd62d60181be7e09c0ba0eafe8dae468617c3 | 989 | py | Python | bin/Package/PipPackageBase.py | juergenhoetzel/craft | 9d3fe6dc07f2307e8f8212c8981b980a9d2d28fd | [
"BSD-2-Clause"
] | null | null | null | bin/Package/PipPackageBase.py | juergenhoetzel/craft | 9d3fe6dc07f2307e8f8212c8981b980a9d2d28fd | [
"BSD-2-Clause"
] | null | null | null | bin/Package/PipPackageBase.py | juergenhoetzel/craft | 9d3fe6dc07f2307e8f8212c8981b980a9d2d28fd | [
"BSD-2-Clause"
] | null | null | null | from BuildSystem.PipBuildSystem import *
from Package.PackageBase import *
from Packager.PackagerBase import *
from Source.SourceBase import *
class PipPackageBase(PackageBase, SourceBase, PipBuildSystem, PackagerBase):
"""provides a base class for pip packages"""
def __init__(self):
CraftCore.log.de... | 21.977778 | 76 | 0.663296 |
1ddfd8e06df95bba3de08686c191c9b9e9329017 | 2,826 | py | Python | pcstac/pcstac/config.py | developmentseed/planetary-computer-apis | 174db793bfe9f572fff13b04e13bac1005d212fc | [
"MIT"
] | null | null | null | pcstac/pcstac/config.py | developmentseed/planetary-computer-apis | 174db793bfe9f572fff13b04e13bac1005d212fc | [
"MIT"
] | 1 | 2022-01-13T15:51:19.000Z | 2022-01-13T15:51:19.000Z | pcstac/pcstac/config.py | developmentseed/planetary-computer-apis | 174db793bfe9f572fff13b04e13bac1005d212fc | [
"MIT"
] | null | null | null | from functools import lru_cache
from pydantic import BaseModel, BaseSettings, Field
from stac_fastapi.extensions.core import (
FieldsExtension,
FilterExtension,
QueryExtension,
SortExtension,
TokenPaginationExtension,
)
from stac_fastapi.extensions.core.filter.filter import FilterConformanceClasses... | 26.166667 | 79 | 0.716561 |
1ddfddb30f1c92379dd75bf0dab4ac773c61d80c | 2,426 | py | Python | hs_core/tests/api/native/test_delete_resource_file.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 178 | 2015-01-08T23:03:36.000Z | 2022-03-03T13:56:45.000Z | hs_core/tests/api/native/test_delete_resource_file.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 4,125 | 2015-01-01T14:26:15.000Z | 2022-03-31T16:38:55.000Z | hs_core/tests/api/native/test_delete_resource_file.py | hydroshare/hydroshare | bf9888bbe61507aff070b1dfcec2fdec1921468d | [
"BSD-3-Clause"
] | 53 | 2015-03-15T17:56:51.000Z | 2022-03-17T00:32:16.000Z |
import unittest
import os
from django.contrib.auth.models import Group, User
from hs_core import hydroshare
from hs_core.models import ResourceFile, GenericResource
from hs_core.testing import MockIRODSTestCaseMixin
class TestDeleteResourceFile(MockIRODSTestCaseMixin, unittest.TestCase):
def setUp(self):
... | 36.208955 | 86 | 0.619538 |
1ddff6f1f395f17b01414835c5bad2a01c1585ce | 653 | py | Python | setup.py | lffelmann/printWithStyle | 8447ef488f2c8a07f09a8f5da212eaa616828e6f | [
"MIT"
] | 1 | 2021-06-18T19:22:04.000Z | 2021-06-18T19:22:04.000Z | setup.py | lffelmann/printWithStyle | 8447ef488f2c8a07f09a8f5da212eaa616828e6f | [
"MIT"
] | null | null | null | setup.py | lffelmann/printWithStyle | 8447ef488f2c8a07f09a8f5da212eaa616828e6f | [
"MIT"
] | null | null | null | import setuptools
VERSION="0.0.2"
DESCRIPTION="Small library to style print()."
with open("README.md", "r") as fh:
LONG_DESCRIPTION = fh.read()
setuptools.setup(
name="printWithStyle",
version=VERSION,
author="lffelmann",
desription=DESCRIPTION,
long_description=LONG_DESCRIPTION,
long_des... | 27.208333 | 54 | 0.675345 |
1de006867e79f328acf5410011e8f0b874451304 | 31,115 | py | Python | sdk/streamanalytics/azure-mgmt-streamanalytics/azure/mgmt/streamanalytics/aio/operations/_clusters_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/streamanalytics/azure-mgmt-streamanalytics/azure/mgmt/streamanalytics/aio/operations/_clusters_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/streamanalytics/azure-mgmt-streamanalytics/azure/mgmt/streamanalytics/aio/operations/_clusters_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # 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 may ... | 46.233284 | 273 | 0.665306 |
1de02994516f43ff7a27d379b1ae581be07ce306 | 6,254 | py | Python | mplStyle/MplPatchStyle.py | khanfarhan10/mplStyle | f657f54c6c101811b8bf0c44f4b16d4f4926685d | [
"BSD-3-Clause"
] | 39 | 2015-03-08T23:05:01.000Z | 2022-02-07T16:03:35.000Z | mplStyle/MplPatchStyle.py | khanfarhan10/mplStyle | f657f54c6c101811b8bf0c44f4b16d4f4926685d | [
"BSD-3-Clause"
] | null | null | null | mplStyle/MplPatchStyle.py | khanfarhan10/mplStyle | f657f54c6c101811b8bf0c44f4b16d4f4926685d | [
"BSD-3-Clause"
] | 23 | 2015-03-08T19:56:59.000Z | 2021-07-15T15:16:26.000Z | #===========================================================================
#
# Copyright (c) 2014, California Institute of Technology.
# U.S. Government Sponsorship under NASA Contract NAS7-03001 is
# acknowledged. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modific... | 35.134831 | 78 | 0.584906 |
1de038bb4021939686f926ab044f89522ca1924b | 4,194 | py | Python | tests/models/test_LinearRegression.py | Jakondak/differential-privacy-library | c26bab301f2554b52c8bd836b28091f2f2611cd4 | [
"MIT"
] | 1 | 2020-05-03T06:06:44.000Z | 2020-05-03T06:06:44.000Z | tests/models/test_LinearRegression.py | dohmatob/differential-privacy-library | 1a17bf0e3bf7d18d5c19258abbf81c27fd9a5e16 | [
"MIT"
] | null | null | null | tests/models/test_LinearRegression.py | dohmatob/differential-privacy-library | 1a17bf0e3bf7d18d5c19258abbf81c27fd9a5e16 | [
"MIT"
] | 1 | 2022-01-02T11:29:30.000Z | 2022-01-02T11:29:30.000Z | import numpy as np
from unittest import TestCase
from diffprivlib.models.linear_regression import LinearRegression
from diffprivlib.utils import global_seed, PrivacyLeakWarning, DiffprivlibCompatibilityWarning
class TestLinearRegression(TestCase):
def setup_method(self, method):
global_seed(3141592653)
... | 35.243697 | 120 | 0.590129 |
1de05c23a4e61704517e64e3e42980b1b207e223 | 6,034 | py | Python | sma8266a/sma8266a.py | gmos/micropthon | db85bc9644abe39dead04a2db7aa5549b9306617 | [
"Apache-2.0"
] | 4 | 2019-11-15T15:22:50.000Z | 2019-11-25T18:25:42.000Z | sma8266a/sma8266a.py | gmos/micropthon | db85bc9644abe39dead04a2db7aa5549b9306617 | [
"Apache-2.0"
] | null | null | null | sma8266a/sma8266a.py | gmos/micropthon | db85bc9644abe39dead04a2db7aa5549b9306617 | [
"Apache-2.0"
] | 2 | 2020-05-16T09:08:58.000Z | 2021-06-05T08:49:56.000Z | """Library for the Sensemakers Amsterdam ESP8266 based intro board.
"""
from machine import I2C, Pin
from ssd1306 import SSD1306_I2C
from dht import DHT11
import network
import utime
import ubinascii
import ntptime
import machine
class SMABoard:
DHT_PIN = const(5)
SCL_PIN = const(14)
SDA_PI... | 27.935185 | 96 | 0.555519 |
1de0823464e7b33b094b25c0de7ce2d45322118a | 4,550 | py | Python | towhee/tests/engine/test_graph_context.py | sutcalag/towhee | 1ca575ca569bb344773463593292fdd7b0e9e74f | [
"Apache-2.0"
] | 1 | 2021-12-09T09:47:53.000Z | 2021-12-09T09:47:53.000Z | towhee/tests/engine/test_graph_context.py | Nydclky/towhee | 7cad1b64a44ccfedb18f3064dd33e44eac88ac65 | [
"Apache-2.0"
] | null | null | null | towhee/tests/engine/test_graph_context.py | Nydclky/towhee | 7cad1b64a44ccfedb18f3064dd33e44eac88ac65 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Zilliz. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 29.545455 | 74 | 0.57956 |
1de0884e97425a41bf0e854f55d476730ddbe992 | 4,504 | py | Python | spark/cs120_autograder_register.py | BenjaminLiuPenrose/Berkeley-CS-100 | 84fe1633ddaa808ccbf0b5c9f55762e6766c1d3e | [
"BSD-2-Clause"
] | null | null | null | spark/cs120_autograder_register.py | BenjaminLiuPenrose/Berkeley-CS-100 | 84fe1633ddaa808ccbf0b5c9f55762e6766c1d3e | [
"BSD-2-Clause"
] | null | null | null | spark/cs120_autograder_register.py | BenjaminLiuPenrose/Berkeley-CS-100 | 84fe1633ddaa808ccbf0b5c9f55762e6766c1d3e | [
"BSD-2-Clause"
] | null | null | null | # Databricks notebook source exported at Mon, 11 Jul 2016 16:37:17 UTC
# MAGIC %md
# MAGIC <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/4.0/"> <img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/by-nc-nd/4.0/88x31.png"/> </a> <br/> This work is license... | 43.307692 | 409 | 0.729574 |
1de0caa7358462941970e93c47be3d3e46ea5be4 | 3,591 | py | Python | intersight/models/hyperflex_alarm_ref.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/hyperflex_alarm_ref.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | intersight/models/hyperflex_alarm_ref.py | gumpcraca/intersight-python | 780e6703c739f329084beacbbf2ad7a6a2e59b2b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-255
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class HyperflexAlarmRef(object):
"""
NOTE: This cla... | 23.94 | 77 | 0.539126 |
1de0e560afadd3303b0bcda5531ff1f9ac059c47 | 9,724 | py | Python | management_layer/utils.py | hedleyroos/core-management-layer | 2a25bf5fb44fd511b8b2626ec09a4bc05098334c | [
"BSD-3-Clause"
] | null | null | null | management_layer/utils.py | hedleyroos/core-management-layer | 2a25bf5fb44fd511b8b2626ec09a4bc05098334c | [
"BSD-3-Clause"
] | 90 | 2018-01-23T10:30:01.000Z | 2019-01-31T10:53:42.000Z | management_layer/utils.py | hedleyroos/core-management-layer | 2a25bf5fb44fd511b8b2626ec09a4bc05098334c | [
"BSD-3-Clause"
] | 1 | 2021-08-17T14:16:23.000Z | 2021-08-17T14:16:23.000Z | import asyncio
import datetime
import json
import logging
import uuid
from functools import wraps
import time
import access_control.rest
import authentication_service.rest
import user_data_store.rest
from contextlib import contextmanager
from aiohttp.client_exceptions import ClientResponseError, ClientConnectorError,... | 31.674267 | 102 | 0.617133 |
1de0ebb21603be50a4a39a66a2a4aa83cc9324cb | 325 | py | Python | python/q027/q027.py | MatthewTsan/Leetcode | b0705013eea8517ba7742730cd14ea8601b83c70 | [
"Apache-2.0"
] | null | null | null | python/q027/q027.py | MatthewTsan/Leetcode | b0705013eea8517ba7742730cd14ea8601b83c70 | [
"Apache-2.0"
] | null | null | null | python/q027/q027.py | MatthewTsan/Leetcode | b0705013eea8517ba7742730cd14ea8601b83c70 | [
"Apache-2.0"
] | null | null | null | from typing import List
class Solution:
def removeElement(self, nums: List[int], val: int) -> int:
while(val in nums):
nums.remove(val)
return len(nums)
if __name__ == '__main__':
solution = Solution()
listNums = [3,2,2,3]
solution.removeElement(listNums, 2)
print(list... | 23.214286 | 62 | 0.621538 |
1de1047bb85b5561bb1076dcf8709f04e8f823b3 | 1,916 | py | Python | astk/cli/__init__.py | huang-sh/astk | 8837a28b1dc80a43445d5fca8f0972ed4e23449d | [
"BSD-3-Clause"
] | null | null | null | astk/cli/__init__.py | huang-sh/astk | 8837a28b1dc80a43445d5fca8f0972ed4e23449d | [
"BSD-3-Clause"
] | null | null | null | astk/cli/__init__.py | huang-sh/astk | 8837a28b1dc80a43445d5fca8f0972ed4e23449d | [
"BSD-3-Clause"
] | null | null | null |
from .utils import *
from .net import *
from .motif import *
from .gsea import *
from .as_event import *
from .epi import *
from .draw import *
from .config import CustomMultiCommand
@click.group(cls=CustomMultiCommand,
context_settings=dict(help_option_names=['-h', '--help']))
def cli_fun():
pass
##... | 29.476923 | 66 | 0.761482 |
1de10780500f3f94f742fc3a313879803383f2d0 | 26,798 | py | Python | oscar/lib/python2.7/site-packages/django/contrib/contenttypes/fields.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/contrib/contenttypes/fields.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/contrib/contenttypes/fields.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
from collections import defaultdict
from django.contrib.contenttypes.models import ContentType
from django.core import checks
from django.core.exceptions import FieldDoesNotExist, ObjectDoesNotExist
from django.db import DEFAULT_DB_ALIAS, models, router, transaction
fro... | 40.726444 | 111 | 0.584185 |
1de14ddc23c59654c5a68328b6e6f83147741bd3 | 11,179 | py | Python | xpython/execfile.py | rocky/xpython | ce4ed4329cee2af0aab94254276f5a5687dd25f9 | [
"MIT"
] | 1 | 2020-04-28T13:18:13.000Z | 2020-04-28T13:18:13.000Z | xpython/execfile.py | rocky/xbyterun | fde8f8a31ffd3e3c4545d76b4b1edf4b7e0191d9 | [
"MIT"
] | null | null | null | xpython/execfile.py | rocky/xbyterun | fde8f8a31ffd3e3c4545d76b4b1edf4b7e0191d9 | [
"MIT"
] | null | null | null | """Execute files of Python code."""
import os
import os.path as osp
import sys
import tokenize
import mimetypes
from typing import Optional
from xdis import load_module
from xdis.version_info import (
IS_PYPY,
PYTHON_VERSION,
PYTHON_VERSION_TRIPLE,
version_tuple_to_str,
)
from xpython.vm import format... | 32.782991 | 99 | 0.604795 |
1de152535cd5696dd7187c7e50f8c36fb1f6e80e | 12,234 | py | Python | openpype/modules/default_modules/ftrack/ftrack_module.py | yosuperdope/OpenPype | 0c90df97ddb8cda291a4f66d35da58b3deb94a71 | [
"MIT"
] | null | null | null | openpype/modules/default_modules/ftrack/ftrack_module.py | yosuperdope/OpenPype | 0c90df97ddb8cda291a4f66d35da58b3deb94a71 | [
"MIT"
] | null | null | null | openpype/modules/default_modules/ftrack/ftrack_module.py | yosuperdope/OpenPype | 0c90df97ddb8cda291a4f66d35da58b3deb94a71 | [
"MIT"
] | null | null | null | import os
import json
import collections
import openpype
from openpype.modules import OpenPypeModule
from openpype_interfaces import (
ITrayModule,
IPluginPaths,
ITimersManager,
ILaunchHookPaths,
ISettingsChangeListener,
IFtrackEventHandlerPaths
)
from openpype.settings import SaveWarningExc
F... | 33.983333 | 79 | 0.565473 |
1de1545986b7d4c8bbca09913ab6f6e09cd0706e | 2,277 | py | Python | server/framework/db/fields/base.py | tetelevm/OrdeRPG | 5bea9fbaf3fdd84ab14f7e3033e18eead2cf30ab | [
"MIT"
] | null | null | null | server/framework/db/fields/base.py | tetelevm/OrdeRPG | 5bea9fbaf3fdd84ab14f7e3033e18eead2cf30ab | [
"MIT"
] | null | null | null | server/framework/db/fields/base.py | tetelevm/OrdeRPG | 5bea9fbaf3fdd84ab14f7e3033e18eead2cf30ab | [
"MIT"
] | null | null | null | from abc import ABC, ABCMeta
from sqlalchemy.sql.schema import Column
from sqlalchemy.sql.visitors import TraversibleType
from sqlalchemy.sql.type_api import TypeEngine
__all_for_module__ = [
"FieldDefault",
]
__all__ = __all_for_module__ + [
"FieldDefaultMeta",
]
class FieldDefaultMeta(ABCMeta, Traversibl... | 29.192308 | 87 | 0.668863 |
1de15ff29835d4a80c67496202c46df7be7eb6cd | 12,437 | py | Python | fuzzers/018-clbram/top.py | TomKeddie/prjxray | c5c4a2dfd838aadc663212e28321fd1c6f299a3c | [
"ISC"
] | 1 | 2019-05-25T16:50:52.000Z | 2019-05-25T16:50:52.000Z | fuzzers/018-clbram/top.py | TomKeddie/prjxray | c5c4a2dfd838aadc663212e28321fd1c6f299a3c | [
"ISC"
] | null | null | null | fuzzers/018-clbram/top.py | TomKeddie/prjxray | c5c4a2dfd838aadc663212e28321fd1c6f299a3c | [
"ISC"
] | null | null | null | '''
Need coverage for the following:
RAM32X1S_N
RAM32X1D
RAM32M
RAM64X1S_N
RAM64X1D_N
RAM64M
RAM128X1S_N
RAM128X1D
RAM256X1S
SRL16E_N
SRLC32E_N
Note: LUT6 was added to try to simplify reduction, although it might not be needed
'''
import random
random.seed(0)
import os
import re
from prjxray import util
CLBN = 50
pr... | 25.278455 | 106 | 0.43057 |
1de1be23799681df90c09b0db301a771c520cd2a | 9,438 | py | Python | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/api_lib/app/ext_runtimes/loader.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/api_lib/app/ext_runtimes/loader.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/api_lib/app/ext_runtimes/loader.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:09:01.000Z | 2020-07-25T12:09:01.000Z | # 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 required by applicable law or ag... | 33.707143 | 79 | 0.68754 |
1de1c98aea1e2ba184d9910f365ff95ccda48792 | 941 | py | Python | colossalai/registry/__init__.py | rahulgupta9202/ColossalAI | 993088d45eaa032e39cf5959df2a506f0663bc2e | [
"Apache-2.0"
] | 1 | 2022-03-12T04:49:19.000Z | 2022-03-12T04:49:19.000Z | colossalai/registry/__init__.py | rahulgupta9202/ColossalAI | 993088d45eaa032e39cf5959df2a506f0663bc2e | [
"Apache-2.0"
] | null | null | null | colossalai/registry/__init__.py | rahulgupta9202/ColossalAI | 993088d45eaa032e39cf5959df2a506f0663bc2e | [
"Apache-2.0"
] | null | null | null | import torch.distributed.optim as dist_optim
import torch.nn as nn
import torch.optim as optim
import torchvision.models as tv_models
from torchvision.transforms import transforms
from .registry import Registry
LAYERS = Registry('layers', third_party_library=[nn])
LOSSES = Registry('losses')
MODELS = Registry('models... | 39.208333 | 76 | 0.808714 |
1de20d7105ef5297494f2f70ae778f763ce2b39d | 1,622 | py | Python | AlgorithmicTradingAndQuantitativeAnalysis/Examples/69_fxcm.py | enriqueescobar-askida/Kinito.Finance | 5308748b64829ac798a858161f9b4a9e5829db44 | [
"MIT"
] | 2 | 2020-03-04T11:18:38.000Z | 2020-05-10T15:36:42.000Z | AlgorithmicTradingAndQuantitativeAnalysis/Examples/69_fxcm.py | enriqueescobar-askida/Kinito.Finance | 5308748b64829ac798a858161f9b4a9e5829db44 | [
"MIT"
] | 6 | 2020-03-30T16:42:47.000Z | 2021-12-13T20:37:21.000Z | AlgorithmicTradingAndQuantitativeAnalysis/Examples/69_fxcm.py | enriqueescobar-askida/Kinito.Finance | 5308748b64829ac798a858161f9b4a9e5829db44 | [
"MIT"
] | 1 | 2020-04-14T11:26:16.000Z | 2020-04-14T11:26:16.000Z | # =============================================================================
# FXCM API testing
# Author : Mayank Rasu
# Please report bug/issues in the Q&A section
# =============================================================================
import fxcmpy
import time
#initiating API connection and defining trad... | 30.603774 | 99 | 0.639951 |
1de244d16686cbe07ae87e1c247e6e6a1b0c65e1 | 11,952 | py | Python | doc/conf.py | ksunden/sphinx-gallery | 7f26c1a6fc8f53169af2e5fa558d0efbfb32fb4f | [
"BSD-3-Clause"
] | null | null | null | doc/conf.py | ksunden/sphinx-gallery | 7f26c1a6fc8f53169af2e5fa558d0efbfb32fb4f | [
"BSD-3-Clause"
] | null | null | null | doc/conf.py | ksunden/sphinx-gallery | 7f26c1a6fc8f53169af2e5fa558d0efbfb32fb4f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Sphinx-Gallery documentation build configuration file, created by
# sphinx-quickstart on Mon Nov 17 16:01:26 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file... | 33.108033 | 82 | 0.701138 |
1de28846fe2d0a468b0386b4f5a0a590887c90d4 | 4,653 | py | Python | car_following_model/macrosim.py | ucbtrans/sumo-project | a1232cfa6705d79313733ae118777a276536b088 | [
"BSD-2-Clause"
] | 5 | 2017-10-26T23:18:45.000Z | 2021-12-13T08:48:54.000Z | car_following_model/macrosim.py | ucbtrans/sumo-project | a1232cfa6705d79313733ae118777a276536b088 | [
"BSD-2-Clause"
] | null | null | null | car_following_model/macrosim.py | ucbtrans/sumo-project | a1232cfa6705d79313733ae118777a276536b088 | [
"BSD-2-Clause"
] | 3 | 2016-06-14T19:33:22.000Z | 2021-03-23T03:41:31.000Z | '''
Macro-simulation...
'''
import sys
import numpy as np
import matplotlib.pyplot as plt
from Link import Link
import plot_routines as pr
import pickle
def initialize():
'''
Returns array of links, simulation step length in seconds and total simulation time.
'''
dt = 0.05 # seconds
total_t... | 22.157143 | 133 | 0.508059 |
1de28f87f42a2265d3c3c62d4af2165a36199b58 | 167 | py | Python | client/verta/verta/_swagger/_public/modeldb/versioning/api/DatasetApi.py | CaptEmulation/modeldb | 78b10aca553e386554f9740db63466b1cf013a1a | [
"Apache-2.0"
] | 835 | 2017-02-08T20:14:24.000Z | 2020-03-12T17:37:49.000Z | client/verta/verta/_swagger/_public/modeldb/versioning/api/DatasetApi.py | CaptEmulation/modeldb | 78b10aca553e386554f9740db63466b1cf013a1a | [
"Apache-2.0"
] | 651 | 2019-04-18T12:55:07.000Z | 2022-03-31T23:45:09.000Z | client/verta/verta/_swagger/_public/modeldb/versioning/api/DatasetApi.py | CaptEmulation/modeldb | 78b10aca553e386554f9740db63466b1cf013a1a | [
"Apache-2.0"
] | 170 | 2017-02-13T14:49:22.000Z | 2020-02-19T17:59:12.000Z | # THIS FILE IS AUTO-GENERATED. DO NOT EDIT
class DatasetApi:
def __init__(self, client, base_path = "/v1"):
self.client = client
self.base_path = base_path
| 23.857143 | 48 | 0.700599 |
1de2d886a6a22bc93fc658e6f73ed251c88b7ef7 | 492 | py | Python | napalm01.py | sgriffith3/2021-08-30-PYNA | af9bfc595ef0dc2385d7a4751515050b9c6eb56f | [
"MIT"
] | null | null | null | napalm01.py | sgriffith3/2021-08-30-PYNA | af9bfc595ef0dc2385d7a4751515050b9c6eb56f | [
"MIT"
] | null | null | null | napalm01.py | sgriffith3/2021-08-30-PYNA | af9bfc595ef0dc2385d7a4751515050b9c6eb56f | [
"MIT"
] | null | null | null | import sys
from napalm import get_network_driver # import code from NAPALM
print(sys.argv)
input()
if len(sys.argv) != 2:
print("You supplied ", len(sys.argv)-1, " arguments but 1 is needed")
print("getjson.py requires: hostname")
print("example: python3 getjson.py sw-1")
sys.exit()
ip = sys.argv[1]
driver =... | 23.428571 | 71 | 0.711382 |
1de31c8405c66b493a3e0f32f388aad2e389955d | 8,961 | py | Python | sdk/cosmos/azure-cosmos/test/globaldb_mock_tests.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | null | null | null | sdk/cosmos/azure-cosmos/test/globaldb_mock_tests.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | null | null | null | sdk/cosmos/azure-cosmos/test/globaldb_mock_tests.py | pjquirk/azure-sdk-for-python | cbf02ec4f177b96eae1dbbba87c34c2c93880150 | [
"MIT"
] | null | null | null | #The MIT License (MIT)
#Copyright (c) 2014 Microsoft Corporation
#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, mod... | 45.953846 | 174 | 0.75505 |
1de3286cc927ea1c9f27a68057f31062c2bffc60 | 31,957 | py | Python | Backends/scripts/BOSS/modules/filehandling.py | sebhoof/gambit_1.5 | f9a3f788e3331067c555ae1a030420e903c6fdcd | [
"Unlicense"
] | 2 | 2020-09-08T20:05:27.000Z | 2021-04-26T07:57:56.000Z | Backends/scripts/BOSS/modules/filehandling.py | sebhoof/gambit_1.5 | f9a3f788e3331067c555ae1a030420e903c6fdcd | [
"Unlicense"
] | 9 | 2020-10-19T09:56:17.000Z | 2021-05-28T06:12:03.000Z | Backends/scripts/BOSS/modules/filehandling.py | patscott/gambit_1.4 | a50537419918089effc207e8b206489a5cfd2258 | [
"Unlicense"
] | 5 | 2020-09-08T02:23:34.000Z | 2021-03-23T08:48:04.000Z | ######################################
# #
# File handling functions for BOSS #
# #
######################################
from __future__ import print_function
import xml.etree.ElementTree as ET
from collections import OrderedDict
import os
impor... | 36.028185 | 187 | 0.661639 |
1de3507d9184b6a4b0648fe5cdaca46cf271271d | 1,104 | py | Python | hive_plug_play/utils/tools.py | seakintruth/hive-plug-play | 032caed7a0690a58410b3d4e93a1fdecf2009d58 | [
"MIT"
] | 3 | 2021-05-11T07:12:05.000Z | 2021-10-04T04:01:38.000Z | hive_plug_play/utils/tools.py | seakintruth/hive-plug-play | 032caed7a0690a58410b3d4e93a1fdecf2009d58 | [
"MIT"
] | 9 | 2021-06-02T03:43:01.000Z | 2021-07-23T14:52:03.000Z | hive_plug_play/utils/tools.py | seakintruth/hive-plug-play | 032caed7a0690a58410b3d4e93a1fdecf2009d58 | [
"MIT"
] | 1 | 2021-05-24T15:57:20.000Z | 2021-05-24T15:57:20.000Z | import json
HIVE_NODES = [
"https://api.hive.blog", "https://anyx.io",
"https://hive.roelandp.nl", "https://rpc.ausbit.dev", "https://api.pharesim.me",
"https://api.deathwing.me", "https://hive-api.arcange.eu", "https://hived.emre.sh",
"https://api.openhive.network", "https://hived.privex.io", "https:/... | 34.5 | 94 | 0.640399 |
1de350a532fc30e88bcff6dec23ec6015dadffa4 | 8,516 | py | Python | Lib/site-packages/wx-3.0-msw/wx/lib/floatcanvas/Utilities/BBox.py | jickieduan/python27 | c752b552396bbed68d8555080d475718cea2edd0 | [
"bzip2-1.0.6"
] | 1 | 2021-02-13T22:40:50.000Z | 2021-02-13T22:40:50.000Z | Lib/site-packages/wx-3.0-msw/wx/lib/floatcanvas/Utilities/BBox.py | jickieduan/python27 | c752b552396bbed68d8555080d475718cea2edd0 | [
"bzip2-1.0.6"
] | 1 | 2018-07-28T20:07:04.000Z | 2018-07-30T18:28:34.000Z | Lib/site-packages/wx-3.0-msw/wx/lib/floatcanvas/Utilities/BBox.py | jickieduan/python27 | c752b552396bbed68d8555080d475718cea2edd0 | [
"bzip2-1.0.6"
] | 2 | 2019-12-02T01:39:10.000Z | 2021-02-13T22:41:00.000Z | #!/usr/bin/env python
"""
A Bounding Box object and assorted utilities , subclassed from a numpy array
"""
import numpy as N
class BBox(N.ndarray):
"""
A Bounding Box object:
Takes Data as an array. Data is any python sequence that can be turned into a
2x2 numpy array of floats:
[[MinX, M... | 28.105611 | 107 | 0.566581 |
1de3570ec7d8776e747216b0d5b19e2408f1dff3 | 8,732 | py | Python | Scripts/Harvest/General_Harvesting/opencolorado_specific_shapefile_download.py | opencolorado/OpenColorado-Tools-and-Utilities | 3ea986eaf6486267d30a79c4949af09634be4c40 | [
"Apache-2.0"
] | 5 | 2015-08-07T21:50:58.000Z | 2020-11-18T06:01:30.000Z | Scripts/Harvest/General_Harvesting/opencolorado_specific_shapefile_download.py | opencolorado/OpenColorado-Tools-and-Utilities | 3ea986eaf6486267d30a79c4949af09634be4c40 | [
"Apache-2.0"
] | null | null | null | Scripts/Harvest/General_Harvesting/opencolorado_specific_shapefile_download.py | opencolorado/OpenColorado-Tools-and-Utilities | 3ea986eaf6486267d30a79c4949af09634be4c40 | [
"Apache-2.0"
] | 2 | 2015-09-30T22:19:12.000Z | 2018-07-02T20:10:32.000Z | # ---------------------------------------------------------------------------
#
# opencolorado_specific_shapefile_download.py
#
# ---------------------------------------------------------------------------
# Downloads and reprojects all shapefiles from Open Colorado
## Destination SRID = 2232 (NAD83 / Colorado Central ... | 36.232365 | 740 | 0.628607 |
1de3c8401e1272c79ce197d771171a4b9e8a33e6 | 465 | py | Python | app/routes/public.py | RobertoPrevato/Flask-three-template | 00b7dd6dd299a1fd91f08f60007fe09235216096 | [
"MIT"
] | 7 | 2015-11-19T20:45:16.000Z | 2020-04-22T22:18:34.000Z | app/routes/public.py | RobertoPrevato/Flask-three-template | 00b7dd6dd299a1fd91f08f60007fe09235216096 | [
"MIT"
] | null | null | null | app/routes/public.py | RobertoPrevato/Flask-three-template | 00b7dd6dd299a1fd91f08f60007fe09235216096 | [
"MIT"
] | 2 | 2016-10-08T20:09:06.000Z | 2020-04-22T22:18:36.000Z | import json
from flask.ext.babel import gettext
from flask import Blueprint, request, render_template
from app.decorators.security.antiforgery import validate_aft
"""
Defines the routes for the public area.
"""
public = Blueprint("public", __name__)
@public.route("/", methods=["GET"])
def index():
return rend... | 21.136364 | 60 | 0.729032 |
1de3d45daa29aef2ce7456566e3ff3c052a6e9ed | 6,964 | py | Python | tests/app/service/test_callback_rest.py | alphagov-mirror/notifications-api | 4a2e47b118c51f0ad45e87c89521f6087b1fcc2f | [
"MIT"
] | 51 | 2016-04-03T23:36:17.000Z | 2022-03-21T20:04:52.000Z | tests/app/service/test_callback_rest.py | alphagov-mirror/notifications-api | 4a2e47b118c51f0ad45e87c89521f6087b1fcc2f | [
"MIT"
] | 1,335 | 2015-12-15T14:28:50.000Z | 2022-03-30T16:24:27.000Z | tests/app/service/test_callback_rest.py | alphagov-mirror/notifications-api | 4a2e47b118c51f0ad45e87c89521f6087b1fcc2f | [
"MIT"
] | 30 | 2016-01-08T19:05:32.000Z | 2021-12-20T16:37:23.000Z | import uuid
from app.models import ServiceCallbackApi, ServiceInboundApi
from tests.app.db import create_service_callback_api, create_service_inbound_api
def test_create_service_inbound_api(admin_request, sample_service):
data = {
"url": "https://some_service/inbound-sms",
"bearer_token": "some-u... | 34.305419 | 107 | 0.697444 |
1de3ddb209f75f01da59b40bc79fd68c93d1b937 | 4,098 | py | Python | src/controllers/neural_mpc_controller.py | neuromorphs/l2race | ad5271afdd9d81375e45402bbef4a077d4bd45ac | [
"MIT"
] | 12 | 2020-07-21T07:56:48.000Z | 2022-03-17T09:24:58.000Z | src/controllers/neural_mpc_controller.py | neuromorphs/l2race | ad5271afdd9d81375e45402bbef4a077d4bd45ac | [
"MIT"
] | 1 | 2020-09-04T21:56:27.000Z | 2020-09-06T06:00:36.000Z | src/controllers/neural_mpc_controller.py | neuromorphs/l2race | ad5271afdd9d81375e45402bbef4a077d4bd45ac | [
"MIT"
] | 5 | 2020-08-10T16:00:35.000Z | 2022-02-25T15:25:43.000Z | '''
####### README #######
Author: Florian Bolli
This is a MPC controller, that finds trajectories doing the MPPI aproach and predicting trajectories with a neural network
The standalone project can be found here: https://github.com/Florian-Bolli/CommonRoadMPC
Further information can be found in neural_mpc_... | 40.574257 | 195 | 0.693997 |
1de407da1926e2b76c86610fe27a95e65ef315f8 | 14,079 | py | Python | kats/models/metalearner/get_metadata.py | vishalbelsare/Kats | b555e97c84662b8b92b23fd3687c72583e0e9a47 | [
"MIT"
] | null | null | null | kats/models/metalearner/get_metadata.py | vishalbelsare/Kats | b555e97c84662b8b92b23fd3687c72583e0e9a47 | [
"MIT"
] | null | null | null | kats/models/metalearner/get_metadata.py | vishalbelsare/Kats | b555e97c84662b8b92b23fd3687c72583e0e9a47 | [
"MIT"
] | null | null | null | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""A module for computing the meta-data of time series.
This module contains the class for computing the meta-data of time series. The meta... | 41.901786 | 196 | 0.639676 |
1de40e18982acf611d4dcef4d7300928409baeaf | 922 | py | Python | unittest/python/bindings_spatial.py | yDMhaven/pinocchio | fabed17d5ad0dc1c8d251c64cfa656a0215469a5 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2020-04-07T07:23:34.000Z | 2020-04-07T07:23:34.000Z | unittest/python/bindings_spatial.py | yDMhaven/pinocchio | fabed17d5ad0dc1c8d251c64cfa656a0215469a5 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | unittest/python/bindings_spatial.py | yDMhaven/pinocchio | fabed17d5ad0dc1c8d251c64cfa656a0215469a5 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | import unittest
import numpy as np
from numpy.random import rand
import pinocchio as pin
pin.switchToNumpyMatrix()
from pinocchio import skew, unSkew
from test_case import PinocchioTestCase
class TestSpatial(PinocchioTestCase):
def test_skew(self):
v3 = rand(3)
self.assertApprox(v3, unSkew(skew(... | 27.939394 | 83 | 0.579176 |
1de42026e1c73a8122350607e55096bf24e806e7 | 2,130 | py | Python | src/utils/party.py | hirasawaau/discord-bot | 10992ec5f8fd2413cd33e8d8d3e5b43b85562620 | [
"MIT"
] | 8 | 2021-07-11T07:12:57.000Z | 2021-07-21T17:09:29.000Z | src/utils/party.py | hirasawaau/discord-bot | 10992ec5f8fd2413cd33e8d8d3e5b43b85562620 | [
"MIT"
] | 16 | 2021-07-11T08:47:40.000Z | 2021-07-17T09:14:08.000Z | src/utils/party.py | hirasawaau/discord-bot | 10992ec5f8fd2413cd33e8d8d3e5b43b85562620 | [
"MIT"
] | 6 | 2021-07-11T07:13:01.000Z | 2021-12-08T15:50:04.000Z | async def get_players(client, ctx):
players = []
intro_str = 'พิมพ์ **y** เพื่อเข้าร่วมปาร์ตี้\nพิมพ์ **n** เพื่อออกจากปาร์ตี้\nพิมพ์ **done** เพื่อยืนยันปาร์ตี้\nพิมพ์ **cancel** เพื่อยกเลิกการสร้างปาร์นี้'
# ให้ bot ส่งคำแนะนำเข้า text channel
await ctx.send(intro_str)
def check(msg):
ret... | 44.375 | 162 | 0.534272 |
1de42cdeb254d441a65d37979ad7bdadfd33a39d | 4,264 | py | Python | rvsync.py | ngc7293/rvscore | e51f5faf8f2b5cdeed7c0189ea03e3760c2e8fb5 | [
"MIT"
] | null | null | null | rvsync.py | ngc7293/rvscore | e51f5faf8f2b5cdeed7c0189ea03e3760c2e8fb5 | [
"MIT"
] | null | null | null | rvsync.py | ngc7293/rvscore | e51f5faf8f2b5cdeed7c0189ea03e3760c2e8fb5 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
""" Read RVGL time files """
from pathlib import Path
import os
import configparser
import json
import requests
ROOT_FOLDER = os.getcwd()
RV_HDR = b'\x02\x19\x00\x00\x86\x2c\x00\x00\x9c\x4d\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\... | 29.611111 | 172 | 0.539634 |
1de45fe78ce67d06823d39f19254a61b94ed14c1 | 550 | py | Python | src/utils/pose.py | Sloomey/DeepSpace2019 | dda035c0ac100209b03a2ff04d86df09c6de9a85 | [
"MIT"
] | 2 | 2021-12-08T05:02:28.000Z | 2021-12-29T14:47:55.000Z | src/utils/pose.py | Sloomey/DeepSpace2019 | dda035c0ac100209b03a2ff04d86df09c6de9a85 | [
"MIT"
] | 19 | 2019-01-07T01:42:07.000Z | 2019-03-08T05:38:52.000Z | src/utils/pose.py | Sloomey/DeepSpace2019 | dda035c0ac100209b03a2ff04d86df09c6de9a85 | [
"MIT"
] | 7 | 2018-10-29T05:09:50.000Z | 2020-04-16T04:04:18.000Z | from utils import vector2d
class Pose:
"""A simple class to store position (vector),
and orientation (angle)."""
def __init__(self, x=0.0, y=0.0, angle=0.0, pos=None):
if pos == None:
self.pos = vector2d.Vector2D(x, y)
else:
self.pos = pos
self.angle = angl... | 27.5 | 102 | 0.565455 |
1de479989587766b4bcbb433b18d4523d49a186e | 113 | py | Python | src/export_all.py | opennms-forge/report-aux | a605dc1222481b182a0ce2ec32e754940c8f94b2 | [
"MIT"
] | null | null | null | src/export_all.py | opennms-forge/report-aux | a605dc1222481b182a0ce2ec32e754940c8f94b2 | [
"MIT"
] | null | null | null | src/export_all.py | opennms-forge/report-aux | a605dc1222481b182a0ce2ec32e754940c8f94b2 | [
"MIT"
] | null | null | null | # export_all.py
# Easy access to generate PDFs for all node pairs
import export
export.render_all_nodes_pdf()
| 14.125 | 49 | 0.787611 |
1de48269d5bc6d715b3018f33786ec9f56543792 | 812 | py | Python | goods2/migrations/0027_auto_20180628_1457.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | 3 | 2018-10-16T09:36:12.000Z | 2019-04-15T03:12:49.000Z | goods2/migrations/0027_auto_20180628_1457.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | null | null | null | goods2/migrations/0027_auto_20180628_1457.py | huachao2017/goodsdl | 3616d53b90696a97a5d56a064e2a14d484b821d7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-06-28 14:57
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('goods2', '0026_auto_20180625_1833'),
]
operations = [
migrations.AddField(
... | 26.193548 | 63 | 0.583744 |
1de4ad906ad91e6a8970477fce2b673bb46b61ca | 56,049 | py | Python | conanfile.py | bincrafters/conan-boost_base | 06b161a93da699d70d8fe7df162b30e7078a243c | [
"MIT"
] | 1 | 2020-01-30T21:33:28.000Z | 2020-01-30T21:33:28.000Z | conanfile.py | bincrafters/conan-boost_base | 06b161a93da699d70d8fe7df162b30e7078a243c | [
"MIT"
] | 1 | 2019-01-16T22:31:50.000Z | 2019-01-16T22:31:50.000Z | conanfile.py | bincrafters/conan-boost_base | 06b161a93da699d70d8fe7df162b30e7078a243c | [
"MIT"
] | 5 | 2019-04-24T05:49:13.000Z | 2020-01-30T21:36:55.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from conans import ConanFile, tools, load
from conans.util.files import save
from conans.model.conan_file import create_options
import os
import json
import glob
import locale
import subprocess
import sys
boost_conan_mixins = []
class BoostBaseConan(ConanFile):
'''... | 35.273128 | 79 | 0.561901 |
1de4e7e47bf2a535ffa09bd639112829cf62eca6 | 617 | py | Python | chapter10/udp/udp_server.py | yangwawa0323/Learning-Python-Networking-Second-Edition | 5460fe4fb6acc5d0df19bf36e52ac09e9a11eb8b | [
"MIT"
] | 52 | 2018-12-17T19:33:06.000Z | 2022-03-25T18:14:02.000Z | chapter10/udp/udp_server.py | barretthugh/Learning-Python-Networking-Second-Edition | 0f00b8b20c1c85e76754e47113dff8ca9e99d5ca | [
"MIT"
] | null | null | null | chapter10/udp/udp_server.py | barretthugh/Learning-Python-Networking-Second-Edition | 0f00b8b20c1c85e76754e47113dff8ca9e99d5ca | [
"MIT"
] | 38 | 2018-12-18T09:08:43.000Z | 2022-02-06T02:53:05.000Z | #!/usr/bin/env python3
import socket,sys
UDP_IP_ADDRESS = "127.0.0.1"
UDP_PORT = 12345
buffer=4096
socket_server=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) #UDP
socket_server.bind((UDP_IP_ADDRESS,UDP_PORT))
while True:
print("Waiting for client...")
data,address = socket_server.recvfrom(buffer)
data = data.... | 20.566667 | 66 | 0.721232 |
1de4e927fc66e6cd9d73b5a67c792bcae0700839 | 1,945 | py | Python | adaptdl/adaptdl/sched_hints.py | TonyZhanghm/adaptdl | a02684e9146f38ddd3a3b1f4c2b88b68f1633f2e | [
"Apache-2.0"
] | null | null | null | adaptdl/adaptdl/sched_hints.py | TonyZhanghm/adaptdl | a02684e9146f38ddd3a3b1f4c2b88b68f1633f2e | [
"Apache-2.0"
] | null | null | null | adaptdl/adaptdl/sched_hints.py | TonyZhanghm/adaptdl | a02684e9146f38ddd3a3b1f4c2b88b68f1633f2e | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Petuum, Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 33.534483 | 77 | 0.627249 |
1de4fd0cf5a883684054a68cc502f9e7e689e2bc | 3,356 | py | Python | src/amazon.py | kikei/asin-jan-converter | 311f9a4660d3a3da6aa8114094b15d1114223bc1 | [
"MIT"
] | null | null | null | src/amazon.py | kikei/asin-jan-converter | 311f9a4660d3a3da6aa8114094b15d1114223bc1 | [
"MIT"
] | null | null | null | src/amazon.py | kikei/asin-jan-converter | 311f9a4660d3a3da6aa8114094b15d1114223bc1 | [
"MIT"
] | null | null | null | import getopt
import logging
from classes.Cache import Cache
from models import Models
from services.AmazonScraper import AmazonScraper
from utils.common import get_db_instance, get_amazon_scraping_proxy, get_logger
class AmazonSearch(object):
def __init__(self, logger=None):
if logger is None:
self.logge... | 28.201681 | 79 | 0.583135 |
1de50421c785402b7c7752d4aec4ce433233867e | 11,086 | py | Python | scripts/mlwpy.py | PhuongPham1203/Machine-Learning-with-Python-for-Everyone | 350870120b64264d2e19f1a3799d53afb26e003a | [
"BSD-3-Clause"
] | 84 | 2019-09-15T13:50:05.000Z | 2022-03-25T03:54:54.000Z | scripts/mlwpy.py | realElfodd/mlwpy_code | 3f7b900d077377390993ea13df775bf6122955b6 | [
"BSD-3-Clause"
] | 8 | 2020-04-20T15:38:15.000Z | 2021-09-01T18:19:36.000Z | scripts/mlwpy.py | realElfodd/mlwpy_code | 3f7b900d077377390993ea13df775bf6122955b6 | [
"BSD-3-Clause"
] | 78 | 2019-09-15T08:52:29.000Z | 2022-02-06T23:18:14.000Z | # common import abbreviations
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import seaborn as sns
import pandas as pd
import patsy
import itertools as it
import collections as co
import functools as ft
import os.path as osp
import glob
import textwrap
# finally, a better idiom for warni... | 34.110769 | 81 | 0.623489 |
1de5237430e9e21564c67436a70374b34882f2db | 3,152 | py | Python | scripts/python/create_base_dir_wmla.py | Bhaskers-Blu-Org1/power-up | 6dcf088a62ea3c12f605325d702e49636926098e | [
"Apache-2.0"
] | 8 | 2018-06-28T19:12:35.000Z | 2019-06-26T15:04:53.000Z | scripts/python/create_base_dir_wmla.py | open-power-ref-design/cluster-genesis | 53a1db7e86726cf6d1783afaf083c9b7dcabdef8 | [
"Apache-2.0"
] | 58 | 2018-03-22T21:34:29.000Z | 2019-06-24T21:00:06.000Z | scripts/python/create_base_dir_wmla.py | open-power-ref-design/cluster-genesis | 53a1db7e86726cf6d1783afaf083c9b7dcabdef8 | [
"Apache-2.0"
] | 8 | 2018-06-14T19:40:06.000Z | 2019-05-08T09:48:30.000Z | #!/usr/bin/env python
# Copyright 2019 IBM Corp.
#
# 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 require... | 33.892473 | 82 | 0.578997 |
1de55c323189d3c2ef7458fdc8f5f6dbbb9cf108 | 730 | py | Python | igibson/utils/data_utils/ext_object/batch_process_object_dir_hms.py | suresh-guttikonda/iGibson | a69e623058180146466cd52d4bb3c00d1facdacf | [
"MIT"
] | 360 | 2020-04-02T11:12:09.000Z | 2022-03-24T21:46:58.000Z | igibson/utils/data_utils/ext_object/batch_process_object_dir_hms.py | suresh-guttikonda/iGibson | a69e623058180146466cd52d4bb3c00d1facdacf | [
"MIT"
] | 169 | 2020-04-07T21:01:05.000Z | 2022-03-31T10:07:39.000Z | igibson/utils/data_utils/ext_object/batch_process_object_dir_hms.py | suresh-guttikonda/iGibson | a69e623058180146466cd52d4bb3c00d1facdacf | [
"MIT"
] | 94 | 2020-04-09T23:22:17.000Z | 2022-03-17T21:49:03.000Z | import os
import subprocess
dst_folder = "/cvgl2/u/chengshu/atus_dataset/hms"
src_folder = "/cvgl2/u/chengshu/hms_dataset"
def main():
for obj_category in os.listdir(src_folder):
obj_category_folder = os.path.join(src_folder, obj_category)
for object_id in os.listdir(obj_category_folder):
... | 28.076923 | 79 | 0.558904 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.