hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1890294cec41ddecb5e008eb4a051231a2c5d40f | 16,841 | py | Python | kay/lib/babel/messages/pofile.py | Letractively/kay-framework | a4cfabe3497e13c3785e5ec381b9cff11a378df3 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2015-11-05T08:30:09.000Z | 2015-11-05T08:30:09.000Z | kay/lib/babel/messages/pofile.py | ianlewis/kay | 1bf28487dc2a273eaa44d442aec8baa6453240b7 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | kay/lib/babel/messages/pofile.py | ianlewis/kay | 1bf28487dc2a273eaa44d442aec8baa6453240b7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2016-05-23T16:30:15.000Z | 2016-05-23T16:30:15.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2007-2008 Edgewall Software
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://babel.edgewall.org/wiki/License.
#
# This software consists... | 35.30608 | 80 | 0.526453 |
a3e75b36b2dea305f72737b417a7184de554aaa2 | 2,515 | py | Python | yolo/vedanet/network/head/_xception.py | IrisDinge/YoloV3_DOTA | cdfe6375a2323e9ee162e50a46478d8a66529e6c | [
"MIT"
] | 1 | 2019-12-17T09:00:24.000Z | 2019-12-17T09:00:24.000Z | yolo/vedanet/network/head/_xception.py | IrisDinge/Yolov3_DOTA | cdfe6375a2323e9ee162e50a46478d8a66529e6c | [
"MIT"
] | null | null | null | yolo/vedanet/network/head/_xception.py | IrisDinge/Yolov3_DOTA | cdfe6375a2323e9ee162e50a46478d8a66529e6c | [
"MIT"
] | null | null | null | import os
from collections import OrderedDict
import torch
import torch.nn as nn
from .. import layer as vn_layer
__all__ = ['Xception']
class Xception(nn.Module):
def __init__(self, num_classes, in_channels_list, num_anchors_list):
""" Network initialisation
"""
super().__init__()
... | 34.930556 | 99 | 0.518091 |
dfb5c9802c9479d92dc4008083936e04507c5730 | 1,183 | py | Python | tests/server/test_schemas.py | fyalcin/optimade-python-tools | 32e97463b9069b2dfcb0a2a9282a04d889f77d8b | [
"MIT"
] | 31 | 2018-06-15T01:02:31.000Z | 2021-11-30T04:46:21.000Z | tests/server/test_schemas.py | fyalcin/optimade-python-tools | 32e97463b9069b2dfcb0a2a9282a04d889f77d8b | [
"MIT"
] | 1,023 | 2018-11-21T18:34:14.000Z | 2022-03-29T11:48:45.000Z | tests/server/test_schemas.py | fyalcin/optimade-python-tools | 32e97463b9069b2dfcb0a2a9282a04d889f77d8b | [
"MIT"
] | 31 | 2018-06-14T15:56:33.000Z | 2022-02-16T02:54:11.000Z | from optimade.server.schemas import ENTRY_INFO_SCHEMAS, retrieve_queryable_properties
def test_schemas():
"""Test that the default `ENTRY_INFO_SCHEMAS` contain
all the required information about the OPTIMADE properties
after dereferencing.
"""
for entry in ("Structures", "References"):
sc... | 35.848485 | 85 | 0.651733 |
0d3767f97dd73e1502b674b0e7cb7ad011ac12a4 | 411 | py | Python | config.example.py | hemangandhi/lcs | 9dc96ae51b6389a72ee36cb205b4a2372858df1e | [
"MIT"
] | null | null | null | config.example.py | hemangandhi/lcs | 9dc96ae51b6389a72ee36cb205b4a2372858df1e | [
"MIT"
] | null | null | null | config.example.py | hemangandhi/lcs | 9dc96ae51b6389a72ee36cb205b4a2372858df1e | [
"MIT"
] | null | null | null | from datetime import datetime, timezone, timedelta
# uri should contain auth and default database
DB_URI = "mongodb://{}:{}@127.0.0.1:27017/"
DB_USER = "dat boi"
DB_PASSWORD = "dat boi's secret"
DB_COLLECTIONS = {
"users": "users",
"magic links": "magicLinks",
"events": "events"
}
# Json webtoken
JWT_SECR... | 25.6875 | 79 | 0.722628 |
26616e75eb636cb42ad3e95cac13303beef0c5ba | 2,703 | py | Python | plugins/action/device_administration_dictionary_attributes_authorization_info.py | steinzi/ansible-ise | 0add9c8858ed8e0e5e7219fbaf0c936b6d7cc6c0 | [
"MIT"
] | null | null | null | plugins/action/device_administration_dictionary_attributes_authorization_info.py | steinzi/ansible-ise | 0add9c8858ed8e0e5e7219fbaf0c936b6d7cc6c0 | [
"MIT"
] | null | null | null | plugins/action/device_administration_dictionary_attributes_authorization_info.py | steinzi/ansible-ise | 0add9c8858ed8e0e5e7219fbaf0c936b6d7cc6c0 | [
"MIT"
] | null | null | null | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.action import ActionBase
try:
from ansible_collections.ansible.utils.plugins.module_utils.common.argspec_validate import (
AnsibleArgSpecValidator,
)
except ImportError:
ANSIBLE_UTILS_IS_INST... | 33.7875 | 128 | 0.668516 |
845e313e7d7024bed2cdf5ab42a1e9adb9cb409e | 5,343 | py | Python | snorkel/learning/classifier.py | Conengmo/snorkel | 36868e8a84de19b94e1c4b8eceaa64969a61a46b | [
"Apache-2.0"
] | 30 | 2019-08-22T19:27:59.000Z | 2022-03-13T22:03:15.000Z | snorkel/learning/classifier.py | Conengmo/snorkel | 36868e8a84de19b94e1c4b8eceaa64969a61a46b | [
"Apache-2.0"
] | 2 | 2019-08-22T16:51:58.000Z | 2022-03-21T02:59:18.000Z | snorkel/learning/classifier.py | Conengmo/snorkel | 36868e8a84de19b94e1c4b8eceaa64969a61a46b | [
"Apache-2.0"
] | 31 | 2019-08-22T19:28:08.000Z | 2022-03-23T12:50:49.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from builtins import *
import numpy as np
from .utils import MentionScorer
from ..annotations import save_marginals
class Classifier(object):
"""Simple abstract bas... | 40.172932 | 84 | 0.620999 |
b46097aa90b33e13b1cde5f349ccd0af5322006e | 28,883 | py | Python | lte/gateway/python/magma/pipelined/app/inout.py | Aitend/magma | 74fe7b437335728219dfbe54733955bdd652eb60 | [
"BSD-3-Clause"
] | 849 | 2020-07-17T09:15:03.000Z | 2022-03-31T17:11:52.000Z | lte/gateway/python/magma/pipelined/app/inout.py | Aitend/magma | 74fe7b437335728219dfbe54733955bdd652eb60 | [
"BSD-3-Clause"
] | 8,386 | 2020-06-23T23:35:30.000Z | 2022-03-31T23:31:28.000Z | lte/gateway/python/magma/pipelined/app/inout.py | Aitend/magma | 74fe7b437335728219dfbe54733955bdd652eb60 | [
"BSD-3-Clause"
] | 406 | 2020-06-28T17:02:35.000Z | 2022-03-31T22:03:55.000Z | """
Copyright 2020 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | 36.376574 | 113 | 0.583354 |
5e292755799cd294a1d6a559314346f8cec0f8c8 | 10,513 | py | Python | dolphins_recognition_challenge/instance_segmentation/model.py | cro-ai-league/dolphins-recognition-challenge | 38df675dc1dc010ed8cc2ec8d35de702b8d2becc | [
"Apache-2.0"
] | 4 | 2020-12-29T08:38:55.000Z | 2021-04-28T13:17:28.000Z | dolphins_recognition_challenge/instance_segmentation/model.py | cro-ai-league/dolphins-recognition-challenge | 38df675dc1dc010ed8cc2ec8d35de702b8d2becc | [
"Apache-2.0"
] | 3 | 2020-12-19T21:21:46.000Z | 2022-02-26T10:22:17.000Z | dolphins_recognition_challenge/instance_segmentation/model.py | cro-ai-league/dolphins-recognition-challenge | 38df675dc1dc010ed8cc2ec8d35de702b8d2becc | [
"Apache-2.0"
] | 4 | 2020-12-29T08:38:56.000Z | 2021-04-11T12:37:38.000Z | # AUTOGENERATED! DO NOT EDIT! File to edit: notebooks/02_Model.ipynb (unless otherwise specified).
__all__ = ['train_one_epoch', 'show_prediction', 'show_predictions', 'iou_metric_mask_pair',
'iou_metric_matrix_of_example', 'largest_values_in_row_colums', 'iou_metric_example', 'iou_metric',
'show... | 28.724044 | 133 | 0.669742 |
0f23e92f67f8a8aa91e1f9b314ed49fa3fdd3f82 | 3,591 | py | Python | ui/tools.py | liyao001/BioQueue | 2b2c9f023b988fd926a037eb4755f639632b2991 | [
"Apache-2.0"
] | 33 | 2017-03-12T16:26:45.000Z | 2021-04-30T05:37:35.000Z | ui/tools.py | liyao001/BioQueue | 2b2c9f023b988fd926a037eb4755f639632b2991 | [
"Apache-2.0"
] | 6 | 2017-04-21T08:44:47.000Z | 2018-11-11T16:20:22.000Z | ui/tools.py | liyao001/BioQueue | 2b2c9f023b988fd926a037eb4755f639632b2991 | [
"Apache-2.0"
] | 13 | 2017-03-12T16:26:56.000Z | 2020-04-20T05:35:00.000Z | from django.http import JsonResponse, StreamingHttpResponse
from worker.bases import get_config, rand_sig, get_user_folder_size
from django.core.paginator import EmptyPage, PageNotAnInteger
import os
def build_json_protocol(protocol):
import json
"""
response = StreamingHttpResponse(json.dumps(protocol))
... | 27.623077 | 112 | 0.656085 |
2bcc1089dbe90650820577f32ac3690907bb0466 | 887 | py | Python | Python/Numpy/numpy 15 - array filter.py | omkarsutar1255/Python-Data | 169d0c54b23d9dd5a7f1aea41ab385121c3b3c63 | [
"CC-BY-3.0"
] | null | null | null | Python/Numpy/numpy 15 - array filter.py | omkarsutar1255/Python-Data | 169d0c54b23d9dd5a7f1aea41ab385121c3b3c63 | [
"CC-BY-3.0"
] | null | null | null | Python/Numpy/numpy 15 - array filter.py | omkarsutar1255/Python-Data | 169d0c54b23d9dd5a7f1aea41ab385121c3b3c63 | [
"CC-BY-3.0"
] | null | null | null | # getting some elements out of an existing arrays and creating a new array out of them is called filtering.
# in numpy, you filter an array using a boolean index list.
# a boolean index list is a list of booleans corresponding to indexes in the array.
# if value at index is true, that element is contained in filtered a... | 38.565217 | 107 | 0.660654 |
4c3e96da7176e5c47ce69062fa60ff9181695f6d | 11,233 | py | Python | rl/policy/resnet.py | manongbang/snake | ccab9160bce7874957790601e1d06389aa691104 | [
"MIT"
] | null | null | null | rl/policy/resnet.py | manongbang/snake | ccab9160bce7874957790601e1d06389aa691104 | [
"MIT"
] | null | null | null | rl/policy/resnet.py | manongbang/snake | ccab9160bce7874957790601e1d06389aa691104 | [
"MIT"
] | 1 | 2017-12-19T02:08:17.000Z | 2017-12-19T02:08:17.000Z | # coding: utf-8
"""
Copy from https://github.com/raghakot/keras-resnet/blob/master/resnet.py
"""
from __future__ import division
import six
from keras.models import Model
from keras.layers import (
Input,
Activation,
Dense,
Flatten,
)
from keras.layers.convolutional import (
Conv2D,
MaxPool... | 37.949324 | 98 | 0.630197 |
a479dd310be3165b03f5a053215d76af4c247b48 | 2,106 | py | Python | chameleon/legacy/skfeature/function/sparse_learning_based/MCFS.py | diviyat/chameleon | 12c212ef3ecaab73e6b2a4ae378b25495926ad75 | [
"MIT"
] | 2 | 2021-10-21T23:09:00.000Z | 2021-12-14T07:55:43.000Z | chameleon/legacy/skfeature/function/sparse_learning_based/MCFS.py | diviyat/chameleon | 12c212ef3ecaab73e6b2a4ae378b25495926ad75 | [
"MIT"
] | null | null | null | chameleon/legacy/skfeature/function/sparse_learning_based/MCFS.py | diviyat/chameleon | 12c212ef3ecaab73e6b2a4ae378b25495926ad75 | [
"MIT"
] | null | null | null | import scipy
import numpy as np
from sklearn import linear_model
from chameleon.legacy.skfeature.utility.construct_W import construct_W
def mcfs(X, n_selected_features, **kwargs):
"""
This function implements unsupervised feature selection for multi-cluster data.
Input
-----
X: {numpy array}, sha... | 29.25 | 104 | 0.633428 |
e9ccfec83d8e21f37ab29a53705027d1f1cd26e4 | 7,459 | py | Python | tests/test_feature.py | mmgalushka/squids | 2d6e1bbeb89721a2ff232a7031997111c600abb6 | [
"MIT"
] | null | null | null | tests/test_feature.py | mmgalushka/squids | 2d6e1bbeb89721a2ff232a7031997111c600abb6 | [
"MIT"
] | 37 | 2022-01-15T21:42:23.000Z | 2022-02-23T23:43:31.000Z | tests/test_feature.py | mmgalushka/squids | 2d6e1bbeb89721a2ff232a7031997111c600abb6 | [
"MIT"
] | null | null | null | """
Test for the feature read/write functions form `squids/feature.py`.
"""
import numpy as np
import tensorflow as tf
from PIL import Image, ImageDraw
from squids.config import IMAGE_WIDTH, IMAGE_HEIGHT, IMAGE_CHANNELS
from squids.tfrecords.feature import items_to_features, features_to_items
EPS = tf.constant(0.00... | 30.076613 | 79 | 0.558654 |
c012846ce3bf5f5e72eb1551870302ff17295758 | 2,803 | py | Python | configs/common/SysPaths.py | shkim1995/AdvancedArchitecture_gem5_FMTSMT | d4526896f956b4e5383e3dbc82ea581857425df6 | [
"BSD-3-Clause"
] | null | null | null | configs/common/SysPaths.py | shkim1995/AdvancedArchitecture_gem5_FMTSMT | d4526896f956b4e5383e3dbc82ea581857425df6 | [
"BSD-3-Clause"
] | null | null | null | configs/common/SysPaths.py | shkim1995/AdvancedArchitecture_gem5_FMTSMT | d4526896f956b4e5383e3dbc82ea581857425df6 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2006 The Regents of The University of Michigan
# 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 ... | 41.220588 | 75 | 0.706743 |
04f8efe1da558ee27c202c0da782dff8f8f7fd48 | 4,158 | py | Python | pypureclient/flasharray/FA_2_7/models/network_interface_performance.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flasharray/FA_2_7/models/network_interface_performance.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flasharray/FA_2_7/models/network_interface_performance.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.7
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... | 30.573529 | 105 | 0.556037 |
af0743ef352a3315d67ef1e88ffed9bc95ed0d01 | 79,009 | py | Python | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/zabbix_action.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/zabbix_action.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/modules/zabbix_action.py | tr3ck3r/linklight | 5060f624c235ecf46cb62cefcc6bddc6bf8ca3e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_... | 37.374172 | 151 | 0.520434 |
fda6a3d675623428fb5f9e00480b315fad23cb3e | 14,312 | py | Python | neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/extensions/qos.py | tankertyp/openstack-learning | d729672663f170d0138ecf23b3c23df225c1b1b8 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/extensions/qos.py | tankertyp/openstack-learning | d729672663f170d0138ecf23b3c23df225c1b1b8 | [
"Apache-2.0"
] | null | null | null | neutron/plugins/ml2/drivers/ovn/mech_driver/ovsdb/extensions/qos.py | tankertyp/openstack-learning | d729672663f170d0138ecf23b3c23df225c1b1b8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agre... | 43.238671 | 79 | 0.614659 |
c5bbcdf2be16b94236178693c1e9ee9d4ff2e0da | 1,901 | py | Python | qsubpy/qsub.py | illumination-k/qsubpy | 5605155641f972357e55256bf41932ba89f54e00 | [
"MIT"
] | null | null | null | qsubpy/qsub.py | illumination-k/qsubpy | 5605155641f972357e55256bf41932ba89f54e00 | [
"MIT"
] | null | null | null | qsubpy/qsub.py | illumination-k/qsubpy | 5605155641f972357e55256bf41932ba89f54e00 | [
"MIT"
] | null | null | null | import subprocess
from qsubpy.config import read_config
from typing import List
import logging
logger = logging.Logger(__name__)
CONFIG = read_config()
class Qsub:
def __init__(self, test: bool = False):
self.config = read_config()
self.test = test
def sync(self, sh_file):
cmd = se... | 23.469136 | 78 | 0.558127 |
4ca23e01f8e1a64b5fecce333d5f0e546611f9ea | 2,191 | py | Python | algoexpert.io/python/Min_Heap_Construction.py | its-sushant/coding-interview-gym | 140c19cbfe29e0941a6b6e3882d5bfdc5d36589e | [
"MIT"
] | 713 | 2019-11-19T16:11:25.000Z | 2022-03-31T02:27:52.000Z | algoexpert.io/python/Min_Heap_Construction.py | arunsank/coding-interview-gym | 8131e3a82795707e144fe55d765b6c15bdb97306 | [
"MIT"
] | 7 | 2020-01-16T17:07:18.000Z | 2021-11-15T18:24:39.000Z | algoexpert.io/python/Min_Heap_Construction.py | arunsank/coding-interview-gym | 8131e3a82795707e144fe55d765b6c15bdb97306 | [
"MIT"
] | 393 | 2019-11-18T17:55:45.000Z | 2022-03-28T20:26:32.000Z | # https://www.algoexpert.io/questions/Min%20Heap%20Construction
class MinHeap:
def __init__(self, array):
self.heap = self.build_heap(array)
# O(n) time | O(1) space
def build_heap(self, array):
first_parent_index = (len(array) - 2) // 2
for current_index in reversed(range(first_p... | 37.775862 | 98 | 0.603834 |
a8ca9090ff8022dfbb85ed435896bf4702e9bb0e | 5,938 | py | Python | api/api/methods/account/auth.py | kosyachniy/tools | 5c2e3057a82f637586d953825c9b381f5189ec15 | [
"MIT"
] | 5 | 2020-10-20T18:04:14.000Z | 2022-01-09T02:25:59.000Z | api/api/methods/account/auth.py | kosyachniy/tools | 5c2e3057a82f637586d953825c9b381f5189ec15 | [
"MIT"
] | 26 | 2020-01-01T10:10:35.000Z | 2021-11-06T15:20:32.000Z | api/api/methods/account/auth.py | kosyachniy/tools | 5c2e3057a82f637586d953825c9b381f5189ec15 | [
"MIT"
] | 1 | 2020-01-20T20:44:37.000Z | 2020-01-20T20:44:37.000Z | """
The authorization method of the account object of the API
"""
from consys.handlers import process_lower, pre_process_phone, check_phone, \
check_mail, process_password
from consys.errors import ErrorWrong, ErrorAccess
from api.lib import BaseType, validate, report
from api.models.user ... | 24.53719 | 79 | 0.55288 |
7c8d30f1c9ac603563a87af77da3bf8e5b8ff0ec | 3,231 | py | Python | atrope/smime.py | alvarolopez/atrope | 296df251dfd84c13fbd9df8fb8954451481cde50 | [
"Apache-2.0"
] | 1 | 2016-05-18T11:46:14.000Z | 2016-05-18T11:46:14.000Z | atrope/smime.py | alvarolopez/atrope | 296df251dfd84c13fbd9df8fb8954451481cde50 | [
"Apache-2.0"
] | 7 | 2015-01-28T10:07:55.000Z | 2018-06-11T15:37:00.000Z | atrope/smime.py | alvarolopez/atrope | 296df251dfd84c13fbd9df8fb8954451481cde50 | [
"Apache-2.0"
] | 3 | 2016-12-01T13:57:38.000Z | 2021-07-13T08:10:12.000Z | # -*- coding: utf-8 -*-
# Copyright 2014 Alvaro Lopez Garcia
#
# 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 ... | 36.303371 | 79 | 0.576911 |
90eb32a287f14811616a8643ef8329ee8b305b31 | 765 | py | Python | scaaml/capture/scope/__init__.py | kralka/scaaml | f47e028dad6bc74eb480cbfae83724c1057caf39 | [
"Apache-2.0"
] | null | null | null | scaaml/capture/scope/__init__.py | kralka/scaaml | f47e028dad6bc74eb480cbfae83724c1057caf39 | [
"Apache-2.0"
] | null | null | null | scaaml/capture/scope/__init__.py | kralka/scaaml | f47e028dad6bc74eb480cbfae83724c1057caf39 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 38.25 | 74 | 0.781699 |
93ab5da0f6cac3c0e40e9667b400da4c7651c53e | 239 | py | Python | find-second-maximum-number-in-a-list.py | nabin-info/hackerrank.com | da66a470d2e97a093821bfe41eb233d51784b9cc | [
"MIT"
] | null | null | null | find-second-maximum-number-in-a-list.py | nabin-info/hackerrank.com | da66a470d2e97a093821bfe41eb233d51784b9cc | [
"MIT"
] | null | null | null | find-second-maximum-number-in-a-list.py | nabin-info/hackerrank.com | da66a470d2e97a093821bfe41eb233d51784b9cc | [
"MIT"
] | null | null | null | #!/usr/bin/python
import sys
N = int(raw_input().strip())
M = {}
for i in range(N):
L = str(raw_input().strip()).split(" ")
M[L[0]] = map(float, L[1:])
M = 0
if M == 0:
M = v
elif v < M:
break
print v
| 11.95 | 43 | 0.472803 |
d7499a65a464a703fbd222ce8d107c8b56bad589 | 1,841 | py | Python | api/sms/views.py | klebed/esdc-ce | 2c9e4591f344247d345a83880ba86777bb794460 | [
"Apache-2.0"
] | 97 | 2016-11-15T14:44:23.000Z | 2022-03-13T18:09:15.000Z | api/sms/views.py | klebed/esdc-ce | 2c9e4591f344247d345a83880ba86777bb794460 | [
"Apache-2.0"
] | 334 | 2016-11-17T19:56:57.000Z | 2022-03-18T10:45:53.000Z | api/sms/views.py | klebed/esdc-ce | 2c9e4591f344247d345a83880ba86777bb794460 | [
"Apache-2.0"
] | 33 | 2017-01-02T16:04:13.000Z | 2022-02-07T19:20:24.000Z | from logging import getLogger
from api.sms.utils import get_current_service
from api.sms.exceptions import InvalidSMSInput, SMSSendFailed
from vms.models import DefaultDc
__all__ = ('internal_send',)
logger = getLogger(__name__)
def internal_send(phone, message):
"""
Function for actual sending message via... | 35.403846 | 106 | 0.655622 |
3cc807c9e63196fed1a3a536a533e17d52166948 | 619 | py | Python | code_examples/basic_functions/pcolormesh.py | ezcitron/BasemapTutorial | 0db9248b430d39518bdfdb25d713145be4eb966a | [
"CC0-1.0"
] | 99 | 2015-01-14T21:20:48.000Z | 2022-01-25T10:38:37.000Z | code_examples/basic_functions/pcolormesh.py | ezcitron/BasemapTutorial | 0db9248b430d39518bdfdb25d713145be4eb966a | [
"CC0-1.0"
] | 1 | 2017-08-31T07:02:20.000Z | 2017-08-31T07:02:20.000Z | code_examples/basic_functions/pcolormesh.py | ezcitron/BasemapTutorial | 0db9248b430d39518bdfdb25d713145be4eb966a | [
"CC0-1.0"
] | 68 | 2015-01-14T21:21:01.000Z | 2022-01-29T14:53:38.000Z |
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
from osgeo import gdal
from numpy import linspace
from numpy import meshgrid
map = Basemap(projection='tmerc',
lat_0=0, lon_0=3,
llcrnrlon=1.819757266426611,
llcrnrlat=41.583851612359275,
... | 22.107143 | 44 | 0.66559 |
fe6233507e6954c640851a443fe9f83f5ba4fd02 | 462 | py | Python | python/abc/abc_register.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/abc/abc_register.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/abc/abc_register.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | import abc
from abc_base import PluginBase
class LocalBaseClass:
pass
@PluginBase.register
class RegisterImplementation(LocalBaseClass):
def load(self, input):
return input.read()
def save(self, output, data):
return output.write(data)
if __name__ == "__main__":
... | 22 | 73 | 0.692641 |
7fa647dfd449fa01092af2b4c3c1c0ba4bdacb88 | 7,812 | py | Python | test/e2e/test_003_get.py | uhliarik/mod_h2 | 6c10342bea8d731756b33d35bd42a3a5c99cd995 | [
"Apache-2.0"
] | null | null | null | test/e2e/test_003_get.py | uhliarik/mod_h2 | 6c10342bea8d731756b33d35bd42a3a5c99cd995 | [
"Apache-2.0"
] | null | null | null | test/e2e/test_003_get.py | uhliarik/mod_h2 | 6c10342bea8d731756b33d35bd42a3a5c99cd995 | [
"Apache-2.0"
] | null | null | null | import re
import pytest
from h2_conf import HttpdConf
class TestStore:
@pytest.fixture(autouse=True, scope='class')
def _class_scope(self, env):
HttpdConf(env).add_vhost_cgi(
proxy_self=True, h2proxy_self=True
).add_vhost_test1(
proxy_self=True, h2proxy_self=True
... | 36.166667 | 94 | 0.56042 |
b20b98d8703f71eb7de976a307b14ca3f45d979f | 7,351 | py | Python | backUp/jdUA.py | lllrrr2/jd-3 | 8bebb6ec6540fc67b1196132910939264bfe6123 | [
"MIT"
] | 354 | 2021-09-05T12:08:43.000Z | 2022-02-07T10:28:55.000Z | backUp/jdUA.py | lllrrr2/jd-3 | 8bebb6ec6540fc67b1196132910939264bfe6123 | [
"MIT"
] | 30 | 2021-09-07T04:00:46.000Z | 2022-02-06T07:51:08.000Z | backUp/jdUA.py | lllrrr2/jd-3 | 8bebb6ec6540fc67b1196132910939264bfe6123 | [
"MIT"
] | 235 | 2021-09-03T07:52:52.000Z | 2022-02-07T11:20:08.000Z | import os
import random
import re
# UA
USER_AGENTS = [
"jdapp;android;10.0.2;10;network/wifi;Mozilla/5.0 (Linux; Android 10; ONEPLUS A5010 Build/QKQ1.191014.012; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/77.0.3865.120 MQQBrowser/6.2 TBS/045230 Mobile Safari/537.36",
"jdapp;iPhone;10.0.2;14.... | 150.020408 | 251 | 0.738403 |
0116fd5c485c096d5cf8e0e66f4a0927b7d53fea | 18,480 | py | Python | restkit/client.py | krisb78/restkit | 71efc96260a9d426581e9c2c2e7543f1b95c7109 | [
"MIT"
] | null | null | null | restkit/client.py | krisb78/restkit | 71efc96260a9d426581e9c2c2e7543f1b95c7109 | [
"MIT"
] | null | null | null | restkit/client.py | krisb78/restkit | 71efc96260a9d426581e9c2c2e7543f1b95c7109 | [
"MIT"
] | 1 | 2019-04-28T11:04:14.000Z | 2019-04-28T11:04:14.000Z | # -*- coding: utf-8 -
#
# This file is part of restkit released under the MIT license.
# See the NOTICE for more information.
import base64
import errno
import logging
import os
import time
import socket
import ssl
import traceback
import types
import urllib.parse
try:
from http_parser.http import (
Ht... | 35.47025 | 101 | 0.548539 |
572a61cff90eccb33d8a607900841dae8d0fe9bc | 9,466 | py | Python | integration_tests/test_environment.py | storgashov/contrib-python-qubell-client | 9409c051ee4f4a7bef696dccc01edf3137affdf4 | [
"Apache-2.0"
] | null | null | null | integration_tests/test_environment.py | storgashov/contrib-python-qubell-client | 9409c051ee4f4a7bef696dccc01edf3137affdf4 | [
"Apache-2.0"
] | null | null | null | integration_tests/test_environment.py | storgashov/contrib-python-qubell-client | 9409c051ee4f4a7bef696dccc01edf3137affdf4 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2013 Qubell Inc., http://qubell.com
#
# 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 agr... | 40.110169 | 110 | 0.672407 |
0bf45e632c98a4624cc1897b51bcfb129123f995 | 1,426 | py | Python | generate_docs.py | csm10495/errgrep | e8612dfae10d257682abf67dc9cb7018c9a40441 | [
"MIT"
] | null | null | null | generate_docs.py | csm10495/errgrep | e8612dfae10d257682abf67dc9cb7018c9a40441 | [
"MIT"
] | null | null | null | generate_docs.py | csm10495/errgrep | e8612dfae10d257682abf67dc9cb7018c9a40441 | [
"MIT"
] | null | null | null | '''
script to create docs
'''
import os
import pathlib
import re
import shutil
import subprocess
import sys
def add_usage_info_to_readme():
'''
This is specific for errgrep. It will add output from errgrep --help to README.md
'''
MARKER='\n[CLI_OUTPUT_MARKER]::\n'
output = subpro... | 25.017544 | 86 | 0.575035 |
2f72693d6e0bba21b1de6706f743f7bb4a57d9d8 | 182 | py | Python | neo/detector/urls.py | MLH-Fellowship/neo-detection | b6efdc31505cd0ed7c8098217851a02cc48d4385 | [
"MIT"
] | 4 | 2021-06-08T03:58:57.000Z | 2022-01-05T04:23:19.000Z | neo/detector/urls.py | MLH-Fellowship/neo-detection | b6efdc31505cd0ed7c8098217851a02cc48d4385 | [
"MIT"
] | 2 | 2020-10-07T01:48:33.000Z | 2020-10-07T17:24:19.000Z | neo/detector/urls.py | MLH-Fellowship/neo-detection | b6efdc31505cd0ed7c8098217851a02cc48d4385 | [
"MIT"
] | null | null | null |
from django.urls import path
from .views import browse
from .views import news
urlpatterns = [
path("browse/", browse, name="browse"),
path("news/", news, name="news"),
] | 20.222222 | 43 | 0.664835 |
d2a26537845b23914ceab5be37086feaeaa6cdf5 | 1,241 | py | Python | Baselines/mtsc_knn/DistanceMeasures.py | JingweiZuo/SMATE | d3e847038d9b7fb2bc08b3720b93f80b934e538d | [
"MIT"
] | 11 | 2021-04-21T08:32:21.000Z | 2022-02-28T06:12:10.000Z | Baselines/mtsc_knn/DistanceMeasures.py | SMATE2021/SMATE | d3e847038d9b7fb2bc08b3720b93f80b934e538d | [
"MIT"
] | 1 | 2022-02-24T10:38:46.000Z | 2022-02-24T10:38:46.000Z | Baselines/mtsc_knn/DistanceMeasures.py | SMATE2021/SMATE | d3e847038d9b7fb2bc08b3720b93f80b934e538d | [
"MIT"
] | null | null | null | from tslearn.metrics import dtw
import numpy as np
def DTW_D(mts1, mts2):
'''
Dimension-dependent DTW measure
:param mts1: array, shape=(L, D), L is MTS' length, D is MTS' dimension size
:param mts2: array, shape=(L, D)
:return: DTW-D score
'''
return dtw(mts1, mts2)
def DTW_I(mts1, mt... | 26.404255 | 80 | 0.605963 |
ebdf8bc9c2b4365b83cf1056db6ee10952509430 | 3,685 | py | Python | ImageResizer/SingleImageScaling.py | Vinodkumarsn2/PythonProjects | d37b817ddf802e7ced50390e4583eb1421057034 | [
"MIT"
] | null | null | null | ImageResizer/SingleImageScaling.py | Vinodkumarsn2/PythonProjects | d37b817ddf802e7ced50390e4583eb1421057034 | [
"MIT"
] | null | null | null | ImageResizer/SingleImageScaling.py | Vinodkumarsn2/PythonProjects | d37b817ddf802e7ced50390e4583eb1421057034 | [
"MIT"
] | null | null | null | #With GUI Support. Input the Image and enter the value to rescale the image.
from tkinter import *
from tkinter.filedialog import *
from tkinter import messagebox
from PIL import Image
#-------------------------------------------------------------------------------------------------
root = Tk()
root.title("Ima... | 49.133333 | 132 | 0.577476 |
05c432ce8d05565d0de45dd17b4697f14e216312 | 19,308 | py | Python | src/object_detection/inputs.py | Tobias-Fischer/ros_people_object_detection_tensorflow | 2a0af311b4eef55c053bd2349e1dff10abe1f32a | [
"Apache-2.0"
] | null | null | null | src/object_detection/inputs.py | Tobias-Fischer/ros_people_object_detection_tensorflow | 2a0af311b4eef55c053bd2349e1dff10abe1f32a | [
"Apache-2.0"
] | null | null | null | src/object_detection/inputs.py | Tobias-Fischer/ros_people_object_detection_tensorflow | 2a0af311b4eef55c053bd2349e1dff10abe1f32a | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 43.981777 | 80 | 0.737777 |
935a5bb1a96d6da40a3fa92709d1da4b32988dcd | 12,589 | py | Python | docs/conf.py | simp/NIST-800-18-SSP_Template | 511afe27aadbe48acb274a4264e6981592aeb6c1 | [
"Apache-2.0"
] | 6 | 2018-02-04T20:16:58.000Z | 2021-05-30T21:07:12.000Z | docs/conf.py | simp/NIST-800-18-SSP_Template | 511afe27aadbe48acb274a4264e6981592aeb6c1 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | simp/NIST-800-18-SSP_Template | 511afe27aadbe48acb274a4264e6981592aeb6c1 | [
"Apache-2.0"
] | 3 | 2017-12-29T20:30:50.000Z | 2019-05-22T08:13:28.000Z | # -*- coding: utf-8 -*-
#
# 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
# auto-generated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
from __futu... | 32.445876 | 112 | 0.697831 |
b2c6df13c5260294d32f25f2d45a5ea2d9868cd8 | 19,923 | py | Python | intersight/model/terraform_executor.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 5 | 2021-12-16T15:13:32.000Z | 2022-03-29T16:09:54.000Z | intersight/model/terraform_executor.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 4 | 2022-01-25T19:05:51.000Z | 2022-03-29T20:18:37.000Z | intersight/model/terraform_executor.py | CiscoDevNet/intersight-python | 04b721f37c3044646a91c185c7259edfb991557a | [
"Apache-2.0"
] | 2 | 2020-07-07T15:01:08.000Z | 2022-01-31T04:27:35.000Z | """
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advan... | 56.439093 | 1,678 | 0.640165 |
21c34aa2d643b4e739bb5844a6cc779ccb1d4e94 | 4,805 | py | Python | selfdrive/controls/lib/longcontrol.py | guoxixu/openpilot | 141c3466f10ea160198ab456824438a17bea7588 | [
"MIT"
] | 3 | 2021-12-31T06:29:20.000Z | 2022-02-12T10:13:11.000Z | selfdrive/controls/lib/longcontrol.py | guoxixu/openpilot | 141c3466f10ea160198ab456824438a17bea7588 | [
"MIT"
] | 1 | 2022-02-27T14:38:59.000Z | 2022-02-27T14:38:59.000Z | selfdrive/controls/lib/longcontrol.py | guoxixu/openpilot | 141c3466f10ea160198ab456824438a17bea7588 | [
"MIT"
] | 5 | 2022-03-24T16:18:47.000Z | 2022-03-30T02:18:49.000Z | from cereal import car
from common.numpy_fast import clip, interp
from common.realtime import DT_CTRL
from selfdrive.controls.lib.pid import PIController
from selfdrive.controls.lib.drive_helpers import CONTROL_N
from selfdrive.modeld.constants import T_IDXS
LongCtrlState = car.CarControl.Actuators.LongControlState
#... | 40.378151 | 150 | 0.705931 |
98db5785173fe7877060e2b3d66cda6728a82b0c | 1,073 | py | Python | tests/sentry/api/endpoints/test_group_integration_details.py | cloudbuy/sentry | 08d7c0ccf9e9fe92147d18c1fdcad1832532e264 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/api/endpoints/test_group_integration_details.py | cloudbuy/sentry | 08d7c0ccf9e9fe92147d18c1fdcad1832532e264 | [
"BSD-3-Clause"
] | null | null | null | tests/sentry/api/endpoints/test_group_integration_details.py | cloudbuy/sentry | 08d7c0ccf9e9fe92147d18c1fdcad1832532e264 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from sentry.models import ExternalIssue, GroupLink, Integration
from sentry.testutils import APITestCase
class GroupIntegrationDetailsTest(APITestCase):
def test_simple(self):
self.login_as(user=self.user)
org = self.organization
group = self.create_... | 30.657143 | 83 | 0.628145 |
57626c01bd99fa61d06c64788845eae048f60eec | 134 | py | Python | web/__init__.py | rebryk/SPbAU-IR | 15ef67b49617cc6b67d69ecba5e2585ea56a52b7 | [
"MIT"
] | null | null | null | web/__init__.py | rebryk/SPbAU-IR | 15ef67b49617cc6b67d69ecba5e2585ea56a52b7 | [
"MIT"
] | null | null | null | web/__init__.py | rebryk/SPbAU-IR | 15ef67b49617cc6b67d69ecba5e2585ea56a52b7 | [
"MIT"
] | null | null | null | from flask import Flask
from flask_bootstrap import Bootstrap
app = Flask(__name__)
Bootstrap(app)
import web.page
__all__ = "app"
| 13.4 | 37 | 0.783582 |
13d26c6a0ca600ef665f4bc33dd21bf27f182979 | 245 | py | Python | src/applications/task304/tests.py | SergeyNazarovSam/SergeyPythonfirst | fd2bddf1f5ba28c6802be921177917f369f7ef2e | [
"MIT"
] | 2 | 2020-12-17T20:19:21.000Z | 2020-12-22T12:46:43.000Z | src/applications/task304/tests.py | alexander-sidorov/tms-z43 | 61ecd204f5de4e97ff0300f6ef91c36c2bcda31c | [
"MIT"
] | 4 | 2021-04-20T08:40:30.000Z | 2022-02-10T07:50:30.000Z | src/applications/task304/tests.py | SergeyNazarovSam/SergeyPythonfirst | fd2bddf1f5ba28c6802be921177917f369f7ef2e | [
"MIT"
] | 1 | 2021-02-10T06:42:19.000Z | 2021-02-10T06:42:19.000Z | from django.test import TestCase
class TestTask304Test(TestCase):
def test_index(self):
resp = self.client.get("/tasks/304/")
self.assertEqual(resp.status_code, 200)
self.assertIn("text/html", resp["Content-Type"])
| 27.222222 | 56 | 0.677551 |
2d3833df9ec6af8f0dc254509812b3a69376ee04 | 2,024 | py | Python | G-suite_sort.py | MartenSkogh/EWB-tools | 82f17829bc0d1ca0d370858291c8b763029e7913 | [
"MIT"
] | null | null | null | G-suite_sort.py | MartenSkogh/EWB-tools | 82f17829bc0d1ca0d370858291c8b763029e7913 | [
"MIT"
] | null | null | null | G-suite_sort.py | MartenSkogh/EWB-tools | 82f17829bc0d1ca0d370858291c8b763029e7913 | [
"MIT"
] | null | null | null | #! /usr/bin/env/python3
# -*- encding:utf-8 -*-
import datetime
from pprint import pprint
from operator import itemgetter
filename = "userdata.csv"
updated_emails_file = "emails_to_update.txt"
outpufilename = "updated_users.csv"
fields = ['first name',
'last name',
'email adress',
'p... | 30.666667 | 84 | 0.551877 |
bf5dc18bb91563b81c29494eb5fec8ace28b1bb2 | 2,440 | py | Python | api.py | DjangoUnchained-CRUD/python | 895b6d1b4e26f51fbd7cad45d56a39effac3a4ff | [
"MIT"
] | null | null | null | api.py | DjangoUnchained-CRUD/python | 895b6d1b4e26f51fbd7cad45d56a39effac3a4ff | [
"MIT"
] | null | null | null | api.py | DjangoUnchained-CRUD/python | 895b6d1b4e26f51fbd7cad45d56a39effac3a4ff | [
"MIT"
] | null | null | null | import requests
import math
import random
print('#################################')
print('######### MOVIE TRIVIA ##########')
print('#################################')
print('\n')
class MyGame:
score = 0
# end of MyGame
def get_popular_actors(strict):
if strict:
random_page = int(math.ceil((MyGam... | 23.238095 | 113 | 0.614754 |
75fbdec65891ab386b701203fbab29060d963e5c | 345 | py | Python | server/messenger/__init__.py | coll-gate/collgate | 8c2ff1c59adda2bf318040f588c05263317a2812 | [
"MIT"
] | 2 | 2017-07-04T16:19:09.000Z | 2019-08-16T04:54:47.000Z | server/messenger/__init__.py | coll-gate/collgate | 8c2ff1c59adda2bf318040f588c05263317a2812 | [
"MIT"
] | null | null | null | server/messenger/__init__.py | coll-gate/collgate | 8c2ff1c59adda2bf318040f588c05263317a2812 | [
"MIT"
] | 1 | 2018-04-13T08:28:09.000Z | 2018-04-13T08:28:09.000Z | # -*- coding: utf-8; -*-
#
# @file __init__.py
# @brief Connector to the messenger service
# @author Frédéric SCHERMA (INRA UMR1095)
# @date 2017-10-06
# @copyright Copyright (c) 2017 INRA/CIRAD
# @license MIT (see LICENSE file)
# @details
# Application Config for startup and more...
default_app_config = __name__ + '... | 26.538462 | 57 | 0.715942 |
1525bd6798aa8e15f442e0144ac1d314b7ab6cba | 103,890 | py | Python | GPS_vis_env/Lib/site-packages/qtconsole/console_widget.py | morekeng/GPS-visualization-Python | c07fd3128e94b10699bf12b0418ec8ef476755da | [
"MIT"
] | 1 | 2022-01-28T00:03:19.000Z | 2022-01-28T00:03:19.000Z | GPS_vis_env/Lib/site-packages/qtconsole/console_widget.py | morekeng/GPS-visualization-Python | c07fd3128e94b10699bf12b0418ec8ef476755da | [
"MIT"
] | null | null | null | GPS_vis_env/Lib/site-packages/qtconsole/console_widget.py | morekeng/GPS-visualization-Python | c07fd3128e94b10699bf12b0418ec8ef476755da | [
"MIT"
] | 1 | 2021-11-23T00:49:26.000Z | 2021-11-23T00:49:26.000Z | """An abstract base class for console-type widgets."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from functools import partial
import os
import os.path
import re
import sys
from textwrap import dedent
import time
from unicodedata import category
import webbro... | 40.725206 | 132 | 0.582145 |
4cc752b1443c40bc76fd8e35e47662d37f0426d3 | 51,298 | py | Python | senlin/tests/unit/engine/test_node.py | openstack/senlin | 390779ca1e08f819683e79993696f945f1c0393e | [
"Apache-2.0"
] | 45 | 2015-10-18T02:56:50.000Z | 2022-03-01T15:28:02.000Z | senlin/tests/unit/engine/test_node.py | openstack/senlin | 390779ca1e08f819683e79993696f945f1c0393e | [
"Apache-2.0"
] | 2 | 2019-04-26T10:44:47.000Z | 2020-12-16T19:45:34.000Z | senlin/tests/unit/engine/test_node.py | openstack/senlin | 390779ca1e08f819683e79993696f945f1c0393e | [
"Apache-2.0"
] | 45 | 2015-10-19T02:35:57.000Z | 2021-09-28T09:01:42.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed unde... | 42.116585 | 79 | 0.617529 |
c4365c3d47e887fa9ba8f0715c81db0b0884f9b5 | 4,738 | py | Python | sacn/messages/sync_packet_test.py | mthespian/sacn | 21b68ed8da0099e99aa96fb9c65407705e70991b | [
"MIT"
] | 26 | 2017-11-18T15:32:48.000Z | 2021-10-17T17:05:06.000Z | sacn/messages/sync_packet_test.py | mthespian/sacn | 21b68ed8da0099e99aa96fb9c65407705e70991b | [
"MIT"
] | 26 | 2017-11-27T17:16:09.000Z | 2022-01-03T08:09:33.000Z | sacn/messages/sync_packet_test.py | mthespian/sacn | 21b68ed8da0099e99aa96fb9c65407705e70991b | [
"MIT"
] | 21 | 2017-11-27T19:10:25.000Z | 2022-01-08T23:22:39.000Z | # This file is under MIT license. The license file can be obtained in the root directory of this module.
import pytest
from sacn.messages.sync_packet import SyncPacket
from sacn.messages.general_test import property_number_range_check
def test_constructor():
# positive tests
cid = tuple(range(0, 16))
syn... | 35.893939 | 121 | 0.647953 |
30cf376da7262bfa2f17fd213b162ad2b610552b | 2,064 | py | Python | rlberry/wrappers/rescale_reward.py | riccardodv/rlberry | 8bb03772cda1e13c57de0e1da7bc7356a3014cfb | [
"MIT"
] | 86 | 2020-11-20T21:02:27.000Z | 2022-03-07T14:57:40.000Z | rlberry/wrappers/rescale_reward.py | riccardodv/rlberry | 8bb03772cda1e13c57de0e1da7bc7356a3014cfb | [
"MIT"
] | 103 | 2020-11-17T12:31:21.000Z | 2022-03-28T13:46:16.000Z | rlberry/wrappers/rescale_reward.py | riccardodv/rlberry | 8bb03772cda1e13c57de0e1da7bc7356a3014cfb | [
"MIT"
] | 20 | 2020-11-23T01:47:50.000Z | 2022-03-25T07:45:24.000Z | import numpy as np
from rlberry.envs import Wrapper
class RescaleRewardWrapper(Wrapper):
"""
Rescale the reward function to a bounded range.
Parameters
----------
reward_range: tuple (double, double)
tuple with the desired reward range, which needs to be bounded.
"""
def __init__... | 34.983051 | 76 | 0.555717 |
1fd06f49560e1ce1881b799a62a542d4d0f5f093 | 11,396 | py | Python | core/src/autogluon/core/scheduler/hyperband_promotion.py | RuohanW/autogluon | fa349db5e75a18cd3af7d9d3f1064eb34e92aca1 | [
"Apache-2.0"
] | 1 | 2021-03-18T23:35:55.000Z | 2021-03-18T23:35:55.000Z | core/src/autogluon/core/scheduler/hyperband_promotion.py | RuohanW/autogluon | fa349db5e75a18cd3af7d9d3f1064eb34e92aca1 | [
"Apache-2.0"
] | null | null | null | core/src/autogluon/core/scheduler/hyperband_promotion.py | RuohanW/autogluon | fa349db5e75a18cd3af7d9d3f1064eb34e92aca1 | [
"Apache-2.0"
] | 2 | 2021-02-13T04:41:33.000Z | 2021-07-10T07:14:59.000Z | import logging
import heapq
import copy
from .hyperband_stopping import RungEntry
logger = logging.getLogger(__name__)
class PromotionRungSystem(object):
"""
Implements both the promotion and stopping logic for an asynchronous
variant of Hyperband, known as ASHA:
https://arxiv.org/abs/1810.05934
... | 43.166667 | 117 | 0.612671 |
85873f58d3817a6fc700fa4d53d7468d2b855cff | 1,962 | py | Python | src/models/tests/test_evolving_benchmarks.py | cseveriano/evolving_clustering | 50dd2b4e38ee11aba9382f1a8e04f530b7c9c949 | [
"MIT"
] | 5 | 2018-11-16T21:04:11.000Z | 2020-12-04T22:09:23.000Z | src/models/tests/test_evolving_benchmarks.py | cseveriano/evolving_clustering | 50dd2b4e38ee11aba9382f1a8e04f530b7c9c949 | [
"MIT"
] | null | null | null | src/models/tests/test_evolving_benchmarks.py | cseveriano/evolving_clustering | 50dd2b4e38ee11aba9382f1a8e04f530b7c9c949 | [
"MIT"
] | 1 | 2020-12-09T02:25:49.000Z | 2020-12-09T02:25:49.000Z | from sklearn import preprocessing
from evolving import EvolvingClustering
from evolving.util import Metrics, load_dataset
import matplotlib.pyplot as plt
from time import time as time
from benchmarks.denstream.DenStream import DenStream
cmap = plt.cm.get_cmap('rainbow')
#X, y = load_dataset.load_dataset("s2")
#X, y =... | 29.727273 | 88 | 0.641182 |
dc6be200ad10edd06acced8e795d5b655551c0e2 | 1,034 | py | Python | indico/modules/legal/views.py | jgrigera/indico | b5538f2755bc38a02313d079bac831ee3dfb44ab | [
"MIT"
] | 1 | 2018-11-12T21:29:26.000Z | 2018-11-12T21:29:26.000Z | indico/modules/legal/views.py | jgrigera/indico | b5538f2755bc38a02313d079bac831ee3dfb44ab | [
"MIT"
] | 9 | 2020-09-08T09:25:57.000Z | 2022-01-13T02:59:05.000Z | indico/modules/legal/views.py | jgrigera/indico | b5538f2755bc38a02313d079bac831ee3dfb44ab | [
"MIT"
] | 3 | 2020-07-20T09:09:44.000Z | 2020-10-19T00:29:49.000Z | # This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from indico.modules.admin.views import WPAdmin
from indico.util.i... | 27.210526 | 70 | 0.763056 |
66c9a93b738042b0d2dc0d6637f68fd5b41d1343 | 1,054 | py | Python | bmf/sentry.py | badmofo/bmf-python | 7258b34829af935b46b9fc4e75a8d510de7478c6 | [
"MIT"
] | null | null | null | bmf/sentry.py | badmofo/bmf-python | 7258b34829af935b46b9fc4e75a8d510de7478c6 | [
"MIT"
] | null | null | null | bmf/sentry.py | badmofo/bmf-python | 7258b34829af935b46b9fc4e75a8d510de7478c6 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# this is actually a standard logging handler and not a bottle plugin
import bottle
from raven.handlers.logging import SentryHandler
from raven.utils.wsgi import get_headers, get_environ
def get_bottle_request_data():
if 'REQUEST_METHOD' in bottle.request.environ:
body = bottle.request.... | 37.642857 | 75 | 0.629981 |
db135bda35a49f2bc8e4469b7c515ca3e5d67ab4 | 3,070 | py | Python | functii.py | opreageorges/Python-and-SQL | b77d04b83e0c971dda9ef688fa0604a952871061 | [
"Unlicense"
] | null | null | null | functii.py | opreageorges/Python-and-SQL | b77d04b83e0c971dda9ef688fa0604a952871061 | [
"Unlicense"
] | null | null | null | functii.py | opreageorges/Python-and-SQL | b77d04b83e0c971dda9ef688fa0604a952871061 | [
"Unlicense"
] | null | null | null | import cx_Oracle
def checktableexist(nume_tabel):
connexiune = cx_Oracle.connect('####/####@####/#####')
c = connexiune.cursor()
try:
c.execute('select * from ' + nume_tabel)
connexiune.close()
return True
except:
connexiune.close()
return False
... | 34.494382 | 155 | 0.504235 |
6606101fa5d173fbeb5937d8fbc96c8008f80bf4 | 302 | py | Python | video/app1/serializers.py | Eeyhan/Vengine | 6cef4b086ebcf0dfe6581c737b4137aa2bfc4cae | [
"MIT"
] | null | null | null | video/app1/serializers.py | Eeyhan/Vengine | 6cef4b086ebcf0dfe6581c737b4137aa2bfc4cae | [
"MIT"
] | null | null | null | video/app1/serializers.py | Eeyhan/Vengine | 6cef4b086ebcf0dfe6581c737b4137aa2bfc4cae | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Author : Eeyhan
# @File : serializers.py
from rest_framework import serializers
from app1 import models
class VideoSerializer(serializers.ModelSerializer):
"""影视表"""
class Meta:
model = models.VideoInfo
fields = '__all__'
| 18.875 | 51 | 0.662252 |
69175300bf4e8b75fd5e688e23d5f9c26e9292cb | 10,103 | py | Python | authentication/views.py | dasari810/BookmyTable | f9b14a145a93552cced9caed3ea50438ce72d8f0 | [
"MIT"
] | null | null | null | authentication/views.py | dasari810/BookmyTable | f9b14a145a93552cced9caed3ea50438ce72d8f0 | [
"MIT"
] | 2 | 2020-11-20T10:16:18.000Z | 2020-11-20T13:52:43.000Z | authentication/views.py | dasari810/BookmyTable | f9b14a145a93552cced9caed3ea50438ce72d8f0 | [
"MIT"
] | 1 | 2020-11-20T08:16:02.000Z | 2020-11-20T08:16:02.000Z | from django.shortcuts import render , redirect
from django.contrib import auth
from django.contrib import messages
from django.contrib.auth.models import User
from django.core.validators import validate_email
from django.core.exceptions import ValidationError
from django.contrib.auth.decorators import login_required
fr... | 43.360515 | 238 | 0.603385 |
229b7c95dc981a8fe5b06eb9b4ba0d1098911675 | 6,673 | py | Python | test/functional/txn_doublespend.py | wolfoxonly/scn | 21265f628420b8984b04dcbb05710ecc3ddd1666 | [
"MIT"
] | null | null | null | test/functional/txn_doublespend.py | wolfoxonly/scn | 21265f628420b8984b04dcbb05710ecc3ddd1666 | [
"MIT"
] | null | null | null | test/functional/txn_doublespend.py | wolfoxonly/scn | 21265f628420b8984b04dcbb05710ecc3ddd1666 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The StarChain Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet accounts properly when there is a double-spend conflict."""
from test_framework.test... | 46.340278 | 111 | 0.606324 |
3bc1cc51cbc2f35d57a01a47d2cfdbf4bb12bdf4 | 3,238 | py | Python | rock-paper-scissors-game.py | GhasemMatoo/Mini_project.Tkinter | 9aec05caf69d3dbda6bd403de50b190fc2021cf6 | [
"MIT"
] | null | null | null | rock-paper-scissors-game.py | GhasemMatoo/Mini_project.Tkinter | 9aec05caf69d3dbda6bd403de50b190fc2021cf6 | [
"MIT"
] | null | null | null | rock-paper-scissors-game.py | GhasemMatoo/Mini_project.Tkinter | 9aec05caf69d3dbda6bd403de50b190fc2021cf6 | [
"MIT"
] | null | null | null | # import modules
from tkinter import *
from tkinter import messagebox
from functools import partial
import random
import os
#----------------------------function--ALL------
##------------------------------F_Rest_os cod---
def Reset():
os.execl(sys.executable, sys.executable, *sys.argv)
#------------------------... | 33.381443 | 80 | 0.498765 |
f427894a5fb403a3561219763c396cb3040af8c6 | 12,586 | py | Python | tests/oauth/test_oauth.py | OpenLMIS-Angola/superset-patchup | b20a56b274fb4b2f5f765e5d91c290a28bccf635 | [
"Apache-2.0"
] | null | null | null | tests/oauth/test_oauth.py | OpenLMIS-Angola/superset-patchup | b20a56b274fb4b2f5f765e5d91c290a28bccf635 | [
"Apache-2.0"
] | null | null | null | tests/oauth/test_oauth.py | OpenLMIS-Angola/superset-patchup | b20a56b274fb4b2f5f765e5d91c290a28bccf635 | [
"Apache-2.0"
] | null | null | null | """
This module tests oauth
"""
from unittest.mock import MagicMock, patch, call
from superset import app
from superset_patchup.oauth import AuthOAuthView, CustomSecurityManager
class TestOauth:
"""
Class to test the oauth module
"""
def test_get_oauth_redirect_url_when_not_set(self):
"""
... | 36.693878 | 79 | 0.627125 |
08dedc2dda13944cada50a54ff3e69a10ad73192 | 3,292 | py | Python | marketplace/couchbase-byol.py | couchbase-partners/couchbase-google-deployment-manager | 0ef5d79410410be23c8c69184e4b3d7f668a5d6c | [
"Apache-2.0"
] | 11 | 2018-03-16T20:05:29.000Z | 2020-11-20T14:21:14.000Z | marketplace/couchbase-byol.py | couchbase-partners/couchbase-google-deployment-manager | 0ef5d79410410be23c8c69184e4b3d7f668a5d6c | [
"Apache-2.0"
] | 36 | 2017-04-26T23:32:50.000Z | 2019-03-05T11:36:01.000Z | marketplace/couchbase-byol.py | couchbase-partners/couchbase-google-deployment-manager | 0ef5d79410410be23c8c69184e4b3d7f668a5d6c | [
"Apache-2.0"
] | 9 | 2017-07-20T10:39:40.000Z | 2021-06-23T22:05:23.000Z | import naming
def GenerateConfig(context):
license = 'byol'
config={}
config['resources'] = []
config['outputs'] = []
couchbaseUsername='couchbase'
couchbasePassword = GeneratePassword()
config['outputs'].append({
'name': 'couchbaseUsername',
'value': couchbaseUsername
... | 30.766355 | 95 | 0.562576 |
f7031a7684f35f0454e3dca92a763da2ae157341 | 1,774 | py | Python | homophily_structural_balance/plotting/plot_positive_edge_density.py | robertjankowski/reproducing-dl-papers | 01ad85eac333b87358b3d2e2276292333cacf0e0 | [
"Apache-2.0"
] | 2 | 2021-06-06T09:45:33.000Z | 2021-06-07T20:00:33.000Z | homophily_structural_balance/plotting/plot_positive_edge_density.py | robertjankowski/reproducing-dl-papers | 01ad85eac333b87358b3d2e2276292333cacf0e0 | [
"Apache-2.0"
] | null | null | null | homophily_structural_balance/plotting/plot_positive_edge_density.py | robertjankowski/reproducing-dl-papers | 01ad85eac333b87358b3d2e2276292333cacf0e0 | [
"Apache-2.0"
] | 2 | 2021-06-03T01:40:28.000Z | 2021-06-07T06:56:18.000Z | import numpy as np
import matplotlib.pyplot as plt
import argparse
def extract_name(word: str):
return word.split('=')[-1]
def extract_info(filename: str):
filename_splitted = filename.split('_')
assert len(filename_splitted) == 7
p = float(extract_name(filename_splitted[1]))
iterations = int(ex... | 31.678571 | 118 | 0.678692 |
6513ece8a53c774c1157f86dd4cf107c84e53aa6 | 5,448 | py | Python | tridesclous/gui/tests/test_cataloguewindow.py | jpgill86/tridesclous | 08a2369aa7373dd11e063c4a509648bb873ce58b | [
"MIT"
] | null | null | null | tridesclous/gui/tests/test_cataloguewindow.py | jpgill86/tridesclous | 08a2369aa7373dd11e063c4a509648bb873ce58b | [
"MIT"
] | null | null | null | tridesclous/gui/tests/test_cataloguewindow.py | jpgill86/tridesclous | 08a2369aa7373dd11e063c4a509648bb873ce58b | [
"MIT"
] | null | null | null | from tridesclous import *
import pyqtgraph as pg
from matplotlib import pyplot
# run test_catalogueconstructor.py before this
import pytest
from tridesclous.tests.testingtools import ON_CI_CLOUD, setup_catalogue
def setup_module():
dirname = 'test_cataloguewindow'
setup_catalogue(dirname, dataset_name='ol... | 25.577465 | 88 | 0.696402 |
c8be6df8e4ecd288625de5fa60d4ffb065dcd016 | 16,584 | py | Python | python/ray/tests/test_metrics_agent.py | willfrey/ray | 288a81b42ef0186ab4db33b30191614a7bdb69f6 | [
"Apache-2.0"
] | 1 | 2019-06-19T02:23:43.000Z | 2019-06-19T02:23:43.000Z | python/ray/tests/test_metrics_agent.py | willfrey/ray | 288a81b42ef0186ab4db33b30191614a7bdb69f6 | [
"Apache-2.0"
] | 73 | 2021-09-25T07:11:39.000Z | 2022-03-26T07:10:59.000Z | python/ray/tests/test_metrics_agent.py | willfrey/ray | 288a81b42ef0186ab4db33b30191614a7bdb69f6 | [
"Apache-2.0"
] | 1 | 2019-09-24T16:24:49.000Z | 2019-09-24T16:24:49.000Z | import json
import pathlib
from pprint import pformat
import os
from unittest.mock import MagicMock
import pytest
import ray
from ray.autoscaler._private.constants import AUTOSCALER_METRIC_PORT
from ray.ray_constants import PROMETHEUS_SERVICE_DISCOVERY_FILE
from ray._private.metrics_agent import PrometheusServiceDisc... | 33.50303 | 88 | 0.677219 |
a32c67f0125508947051104ad5e03af4015ce55f | 8,910 | py | Python | Chapter10/10_deep_learning/04_framework_profile/pytorch/RN50v1.5/image_classification/resnet.py | feitang0/Learn-CUDA-Programming | 24f4a861464fc07baafc4171e040430ad3d811c6 | [
"MIT"
] | 405 | 2019-10-10T04:24:50.000Z | 2022-03-30T06:19:53.000Z | Chapter10/10_deep_learning/04_framework_profile/pytorch/RN50v1.5/image_classification/resnet.py | shanliwa1/Learn-CUDA-Programming | c53f7de28fddeff45a3b4d9f3081000f8d1228e6 | [
"MIT"
] | 11 | 2019-10-15T18:10:55.000Z | 2022-02-10T06:03:51.000Z | Chapter10/10_deep_learning/04_framework_profile/pytorch/RN50v1.5/image_classification/resnet.py | shanliwa1/Learn-CUDA-Programming | c53f7de28fddeff45a3b4d9f3081000f8d1228e6 | [
"MIT"
] | 130 | 2019-10-08T13:55:05.000Z | 2022-03-28T04:36:48.000Z | import math
import torch
import torch.nn as nn
import numpy as np
__all__ = ['ResNet', 'build_resnet', 'resnet_versions', 'resnet_configs']
# ResNetBuilder {{{
class ResNetBuilder(object):
def __init__(self, version, config):
self.config = config
self.L = sum(version['layers'])
self.M = ... | 31.045296 | 81 | 0.554658 |
6acf4ff4d4a14005465bc8660b57cf12b3e3c7e8 | 1,707 | py | Python | config/wsgi.py | mtzirkel/2scoops | 2bb11756d7ab2b9f881ffc3758b118057c82d393 | [
"MIT"
] | null | null | null | config/wsgi.py | mtzirkel/2scoops | 2bb11756d7ab2b9f881ffc3758b118057c82d393 | [
"MIT"
] | null | null | null | config/wsgi.py | mtzirkel/2scoops | 2bb11756d7ab2b9f881ffc3758b118057c82d393 | [
"MIT"
] | null | null | null | """
WSGI config for 2scoops project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` ... | 46.135135 | 79 | 0.801406 |
22f066d4917874769e4d889f21c86f149bcd38ec | 702 | py | Python | 04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/exercise_76.py | ptyadana/python-dojo | 98c7234b84f0afea99a091c7198342d66bbdff5b | [
"MIT"
] | 3 | 2020-06-01T04:17:18.000Z | 2020-12-18T03:05:55.000Z | 04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/exercise_76.py | ptyadana/python-dojo | 98c7234b84f0afea99a091c7198342d66bbdff5b | [
"MIT"
] | 1 | 2020-04-25T08:01:59.000Z | 2020-04-25T08:01:59.000Z | 04.100 Python Exercises Evaluate and Improve Your Skills - AS/Exercise 76-100/exercise_76.py | ptyadana/python-dojo | 98c7234b84f0afea99a091c7198342d66bbdff5b | [
"MIT"
] | 7 | 2020-04-26T10:02:36.000Z | 2021-06-08T05:12:46.000Z | #print the script in the expected output
# Today is Wednesday, December 28, 2016
# Hint: http://strftime.org/
# Answer:
import datetime
print(datetime.datetime.now().strftime('Today is %A, %B %d, %Y '))
# Explanation:
# We're using datetime standard module here which supplies classes to manipulate dates and times.
... | 50.142857 | 115 | 0.737892 |
68049f380a18ef9c8410a3b8843e3b1ce6f74ef1 | 243,630 | py | Python | juju/client/_client7.py | xavpaice/python-libjuju | fd1438c4e8e0b8548d5e7071b393af16556df084 | [
"Apache-2.0"
] | null | null | null | juju/client/_client7.py | xavpaice/python-libjuju | fd1438c4e8e0b8548d5e7071b393af16556df084 | [
"Apache-2.0"
] | null | null | null | juju/client/_client7.py | xavpaice/python-libjuju | fd1438c4e8e0b8548d5e7071b393af16556df084 | [
"Apache-2.0"
] | null | null | null | # DO NOT CHANGE THIS FILE! This file is auto-generated by facade.py.
# Changes will be overwritten/lost when the file is regenerated.
from juju.client.facade import Type, ReturnMapping
from juju.client._definitions import *
class CloudFacade(Type):
name = 'Cloud'
version = 7
schema = {'definitions': ... | 56.304599 | 154 | 0.366466 |
81cf62680ce20edbb6251585cb3119a46c7208f4 | 2,594 | py | Python | source/fit_ell.py | SriramKodey/Automated_Localized_Strain_Analysis | f965bcb68b39aca64e846d1730839915c14caeae | [
"MIT"
] | 2 | 2021-10-05T09:49:35.000Z | 2021-10-05T09:50:45.000Z | source/fit_ell.py | SriramKodey/Automated_Localized_Strain_Analysis | f965bcb68b39aca64e846d1730839915c14caeae | [
"MIT"
] | null | null | null | source/fit_ell.py | SriramKodey/Automated_Localized_Strain_Analysis | f965bcb68b39aca64e846d1730839915c14caeae | [
"MIT"
] | null | null | null | import numpy as np
import math
class ellipse_var:
def __init__(self, phi, X0_in, Y0_in, long_axis, short_axis):
self.phi = phi
self.X0_in = X0_in
self.Y0_in = Y0_in
self.long_axis = long_axis
self.short_axis = short_axis
def fit_ellipse(x, y, axis_handle):
... | 24.942308 | 98 | 0.479954 |
c12a520660449a3c939a9eca011a7cb02609c9e8 | 2,588 | py | Python | classification/imaterialist_challenge_furniture_2018/configs/train/train_retinanet101_cls_only.py | vfdev-5/ignite-examples | fb15b59e2b159e1e2bc4628f8756055e9154f5c8 | [
"MIT"
] | 11 | 2018-04-07T17:49:58.000Z | 2022-03-15T07:18:18.000Z | classification/imaterialist_challenge_furniture_2018/configs/train/train_retinanet101_cls_only.py | vfdev-5/ignite-examples | fb15b59e2b159e1e2bc4628f8756055e9154f5c8 | [
"MIT"
] | null | null | null | classification/imaterialist_challenge_furniture_2018/configs/train/train_retinanet101_cls_only.py | vfdev-5/ignite-examples | fb15b59e2b159e1e2bc4628f8756055e9154f5c8 | [
"MIT"
] | null | null | null | # Basic training configuration file
from torch.optim import Adam
from torch.optim.lr_scheduler import MultiStepLR
from torchvision.transforms import RandomHorizontalFlip, Compose
from torchvision.transforms import RandomResizedCrop, RandomAffine, RandomApply
from torchvision.transforms import ColorJitter, ToTensor, Nor... | 28.755556 | 83 | 0.654173 |
b409869396c449fb39c856fa5ccf5dde4de872e8 | 589 | py | Python | build-all.py | jacobrosenthal/atsamd | a46a0e450b21a8881d30acec1a3e4cffb2dd2bfa | [
"Apache-2.0",
"MIT"
] | 2 | 2019-12-26T11:54:27.000Z | 2020-08-30T21:54:25.000Z | build-all.py | jacobrosenthal/atsamd | a46a0e450b21a8881d30acec1a3e4cffb2dd2bfa | [
"Apache-2.0",
"MIT"
] | null | null | null | build-all.py | jacobrosenthal/atsamd | a46a0e450b21a8881d30acec1a3e4cffb2dd2bfa | [
"Apache-2.0",
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import yaml
import shlex
import subprocess
travis = yaml.safe_load(open('.travis.yml', 'r'))
for env in travis['env']:
words = shlex.split(env)
d = {}
for word in words:
key_value = word.split('=', 1)
d[key_value[0]] = key_value[1]
crate_dir = d["CRATE"]
cmd = [
'carg... | 16.361111 | 49 | 0.651952 |
0258b749a26b16d8f9deed49635bb88ab139bfd3 | 1,029 | py | Python | tests/test_references.py | PASTAplus/metapype-eml | af6fff93899a25fc011e339ece41a34b0a235656 | [
"Apache-2.0"
] | 3 | 2018-07-20T18:41:06.000Z | 2020-10-06T18:47:18.000Z | tests/test_references.py | PASTAplus/metapype-eml | af6fff93899a25fc011e339ece41a34b0a235656 | [
"Apache-2.0"
] | 29 | 2018-08-14T03:32:22.000Z | 2022-02-04T21:01:48.000Z | tests/test_references.py | PASTAplus/metapype-eml | af6fff93899a25fc011e339ece41a34b0a235656 | [
"Apache-2.0"
] | 4 | 2020-03-30T02:38:30.000Z | 2021-10-04T13:14:37.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:Mod: test_references
:Synopsis:
:Author:
servilla
:Created:
2/24/21
"""
import os
import daiquiri
import tests
import metapype.eml.names as names
import metapype.eml.references as references
import metapype.eml.validate as validate
import metapype.model.m... | 21.893617 | 67 | 0.704568 |
b07a42462ddc2681bff4c9560c56f56ccae5bbc8 | 1,809 | py | Python | dynamic_programming/iterating_through_submasks.py | TeddyFirman/Algorithm_Python | edbd50a97a62c2beb2a187e4c411c677aa43115e | [
"MIT"
] | null | null | null | dynamic_programming/iterating_through_submasks.py | TeddyFirman/Algorithm_Python | edbd50a97a62c2beb2a187e4c411c677aa43115e | [
"MIT"
] | null | null | null | dynamic_programming/iterating_through_submasks.py | TeddyFirman/Algorithm_Python | edbd50a97a62c2beb2a187e4c411c677aa43115e | [
"MIT"
] | null | null | null | """
Author : Syed Faizan (3rd Year Student IIIT Pune)
github : faizan2700
You are given a bitmask m and you want to efficiently iterate through all of
its submasks. The mask s is submask of m if only bits that were included in
bitmask are set
"""
from __future__ import annotations
def list_of_submasks(mask:... | 28.714286 | 86 | 0.625207 |
328eef2421b2ea0728ee1c43ee826ca0ec56ebda | 9,425 | py | Python | Scripts/Convert_Signals/solarconversionfunctions.py | DTU-ELMA/European_Dataset | 8fb79c61274c95277edc8ee7f60e724e5cc1e0f4 | [
"Apache-2.0"
] | 6 | 2018-04-04T16:00:21.000Z | 2022-02-22T09:44:47.000Z | Scripts/Convert_Signals/solarconversionfunctions.py | DTU-ELMA/European_Dataset | 8fb79c61274c95277edc8ee7f60e724e5cc1e0f4 | [
"Apache-2.0"
] | 3 | 2015-08-17T11:25:23.000Z | 2015-11-24T23:38:48.000Z | Scripts/Convert_Signals/solarconversionfunctions.py | DTU-ELMA/European_Dataset | 8fb79c61274c95277edc8ee7f60e724e5cc1e0f4 | [
"Apache-2.0"
] | 4 | 2017-07-05T01:51:54.000Z | 2020-11-29T13:50:47.000Z |
from __future__ import print_function
import numpy
from numpy import zeros,log,cos,sin,tan,sqrt,abs,arcsin,arccos,ones
from math import pi
import datetime
import sys
def dayNum(utcTime):
year = utcTime.year;
#leapyear = (year%4 == 0 and (year%100 != 0 or year%400 == 0));
startofyear = datetime.datetime(year,1,1);... | 34.39781 | 253 | 0.705889 |
ebc2135e5c555592a8a19ceb725ca9a5d66b62ac | 3,606 | py | Python | code/analysis/calculate_rmse.py | miniminisu/dcgan-code-cu-foam-3D | 9b7e4b184da33fa259ab42f28d9d3d77fe28bd3e | [
"MIT"
] | 1 | 2021-07-29T07:41:46.000Z | 2021-07-29T07:41:46.000Z | code/analysis/calculate_rmse.py | miniminisu/dcgan-code-cu-foam-3D | 9b7e4b184da33fa259ab42f28d9d3d77fe28bd3e | [
"MIT"
] | 1 | 2021-09-28T16:25:04.000Z | 2021-09-28T16:25:04.000Z | code/analysis/calculate_rmse.py | miniminisu/dcgan-code-cu-foam-3D | 9b7e4b184da33fa259ab42f28d9d3d77fe28bd3e | [
"MIT"
] | null | null | null | import os
import tifffile
from skimage.metrics import mean_squared_error, normalized_root_mse
import numpy as np
import matplotlib.pyplot as plt
fake_root_path = 'mse_data/fake_64'
real_root_path = 'mse_data/real_64'
compared_root_path = 'compared/copperfoam_0.tiff'
fake_image_names = os.listdir(fake_root_path)
real_i... | 39.195652 | 100 | 0.736828 |
5fd98db82af4e645ee2e2b83137efe9524fbbe49 | 291 | py | Python | api/admin.py | rukbotto/reviews-django | 28ff12a490d160b76ca75f5cc450fc7556996962 | [
"MIT"
] | null | null | null | api/admin.py | rukbotto/reviews-django | 28ff12a490d160b76ca75f5cc450fc7556996962 | [
"MIT"
] | null | null | null | api/admin.py | rukbotto/reviews-django | 28ff12a490d160b76ca75f5cc450fc7556996962 | [
"MIT"
] | 1 | 2018-09-06T18:52:33.000Z | 2018-09-06T18:52:33.000Z | from django.contrib import admin
from api.models import Review
class ReviewAdmin(admin.ModelAdmin):
list_display = ('title', 'rating', 'company', 'reviewer')
list_filter = ('rating',)
search_fields = ['title', 'company', 'reviewer']
admin.site.register(Review, ReviewAdmin)
| 22.384615 | 61 | 0.707904 |
0f14256f4be7720ecea03ece6c619ca47148accf | 2,639 | py | Python | agsconfig/services/custom_get_capabilities_extension_mixin.py | christopherblanchfield/agsconfig | 71efbea61122ab9de35db2d4d20faa47a6a18fac | [
"BSD-3-Clause"
] | null | null | null | agsconfig/services/custom_get_capabilities_extension_mixin.py | christopherblanchfield/agsconfig | 71efbea61122ab9de35db2d4d20faa47a6a18fac | [
"BSD-3-Clause"
] | null | null | null | agsconfig/services/custom_get_capabilities_extension_mixin.py | christopherblanchfield/agsconfig | 71efbea61122ab9de35db2d4d20faa47a6a18fac | [
"BSD-3-Clause"
] | null | null | null | """This module contains the Custom Get Capabilities extension mixin"""
# Python 2/3 compatibility
# pylint: disable=wildcard-import,unused-wildcard-import,wrong-import-order,wrong-import-position
from __future__ import (absolute_import, division, print_function, unicode_literals)
from future.builtins.disabled import *... | 41.888889 | 246 | 0.520652 |
afa199b5c41799902452f90945eecc4793c4a3dc | 11,947 | py | Python | platform/egl/detect.py | bawr/godot | 50d393f7510e45bcf7858b1866eee935a3d541a1 | [
"MIT",
"Apache-2.0",
"CC-BY-4.0",
"Unlicense"
] | null | null | null | platform/egl/detect.py | bawr/godot | 50d393f7510e45bcf7858b1866eee935a3d541a1 | [
"MIT",
"Apache-2.0",
"CC-BY-4.0",
"Unlicense"
] | null | null | null | platform/egl/detect.py | bawr/godot | 50d393f7510e45bcf7858b1866eee935a3d541a1 | [
"MIT",
"Apache-2.0",
"CC-BY-4.0",
"Unlicense"
] | null | null | null | import os
import platform
import sys
from methods import get_compiler_version, using_gcc, using_clang
def is_active():
return True
def get_name():
return "EGL"
def can_build():
if os.name != "posix" or sys.platform == "darwin":
return False
pkg_error = os.system("pkg-config --version > /d... | 37.102484 | 276 | 0.60308 |
0eb62482dcb49a599d54bf2fe3585b95ff14e5a6 | 28,467 | py | Python | Chapter03/Banking/DBN/base_models.py | tongni1975/Deep-Learning-with-TensorFlow-Second-Edition | 6964bf3bf11c1b38113a0459b4d1a9dac416ed39 | [
"MIT"
] | 73 | 2017-10-27T22:44:32.000Z | 2021-12-25T18:37:51.000Z | Chapter03/Banking/DBN/base_models.py | tongni1975/Deep-Learning-with-TensorFlow-Second-Edition | 6964bf3bf11c1b38113a0459b4d1a9dac416ed39 | [
"MIT"
] | 3 | 2019-04-14T03:15:36.000Z | 2020-07-03T12:05:03.000Z | Chapter03/Banking/DBN/base_models.py | tongni1975/Deep-Learning-with-TensorFlow-Second-Edition | 6964bf3bf11c1b38113a0459b4d1a9dac416ed39 | [
"MIT"
] | 72 | 2017-11-06T07:08:01.000Z | 2021-11-25T09:00:28.000Z | from abc import ABCMeta, abstractmethod
import numpy as np
from scipy.stats import truncnorm
from sklearn.base import BaseEstimator, TransformerMixin, ClassifierMixin, RegressorMixin
from activations import SigmoidActivationFunction, ReLUActivationFunction
from utils import batch_generator
class BaseModel(object):
... | 38.468919 | 120 | 0.610813 |
87422206071a738dc18140e3bb5c164e80e0a040 | 18,587 | py | Python | stable_baselines3/ppo/policies.py | mc-o/stable-baselines3 | 257a40ef4bd08d2ec2cd2d64b4c842fb36ceafa9 | [
"MIT"
] | null | null | null | stable_baselines3/ppo/policies.py | mc-o/stable-baselines3 | 257a40ef4bd08d2ec2cd2d64b4c842fb36ceafa9 | [
"MIT"
] | null | null | null | stable_baselines3/ppo/policies.py | mc-o/stable-baselines3 | 257a40ef4bd08d2ec2cd2d64b4c842fb36ceafa9 | [
"MIT"
] | null | null | null | from typing import Optional, List, Tuple, Callable, Union, Dict, Type, Any
from functools import partial
import gym
import torch as th
import torch.nn as nn
import numpy as np
from stable_baselines3.common.policies import (BasePolicy, register_policy, MlpExtractor,
creat... | 50.784153 | 115 | 0.613762 |
511aa57c3f07249578805529c7b51f6af20e1780 | 3,096 | py | Python | rocket_releaser/shas.py | 15five/rocket_releaser | 3afb9eeb701eaf19934e5516fc1baab0cd414387 | [
"MIT"
] | 2 | 2020-12-16T05:17:43.000Z | 2022-03-31T08:22:21.000Z | rocket_releaser/shas.py | 15five/rocket_releaser | 3afb9eeb701eaf19934e5516fc1baab0cd414387 | [
"MIT"
] | 2 | 2020-12-15T17:18:07.000Z | 2021-05-05T21:57:31.000Z | rocket_releaser/shas.py | 15five/rocket_releaser | 3afb9eeb701eaf19934e5516fc1baab0cd414387 | [
"MIT"
] | 1 | 2021-02-02T09:18:34.000Z | 2021-02-02T09:18:34.000Z | import subprocess
import logging
from os import path
from typing import List
import re
logger = logging.getLogger(__name__)
def branch_exists(repo_dir: str, branch_name: str):
try:
base_args = ["git", f'--git-dir={path.join(repo_dir, ".git")}']
subprocess.check_call(
base_args + ["sho... | 31.917526 | 127 | 0.574289 |
8d5af8473d6e1147d9b6815956d0c11f917c0833 | 3,079 | py | Python | nova/api/openstack/placement/objects/user.py | lixiaoy1/nova | 357b8b38e88300948bb2e07d1bbaabd1e9d7b60e | [
"Apache-2.0"
] | 2 | 2021-10-11T04:56:25.000Z | 2022-02-16T08:49:29.000Z | nova/api/openstack/placement/objects/user.py | woraser/nova | fc3890667e4971e3f0f35ac921c2a6c25f72adec | [
"Apache-2.0"
] | 132 | 2017-03-27T11:31:52.000Z | 2022-03-30T08:45:02.000Z | nova/api/openstack/placement/objects/user.py | woraser/nova | fc3890667e4971e3f0f35ac921c2a6c25f72adec | [
"Apache-2.0"
] | 8 | 2017-03-27T07:50:38.000Z | 2020-02-14T16:55:56.000Z | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# d... | 33.107527 | 78 | 0.701526 |
e8efd3dfa51a341be8c5006626c8e24dfcfa9672 | 1,697 | py | Python | python/advent_2016_1a.py | dmi-try/ruby-etudes | c4e5ab8048c342805e8255f8598e177dffcfd59d | [
"Apache-2.0"
] | null | null | null | python/advent_2016_1a.py | dmi-try/ruby-etudes | c4e5ab8048c342805e8255f8598e177dffcfd59d | [
"Apache-2.0"
] | null | null | null | python/advent_2016_1a.py | dmi-try/ruby-etudes | c4e5ab8048c342805e8255f8598e177dffcfd59d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Solution for http://adventofcode.com/2016/
instruction = "R3, L5, R1, R2, L5, R2, R3, L2, L5, R5, L4, L3, R5, L1, R3, R4, R1, L3, R3, L2, L5, L2, R4, R5, R5, L4, L3, L3, R4, R4, R5, L5, L3, R2, R2, L3, L4, L5, R1, R3, L3, R2, L3, R5, L194, L2, L5, R2, R1, R1, L1, L5, L4, R4, R2, R2, L4, L1, R2... | 41.390244 | 704 | 0.490866 |
5d62e6082e0ae44f1e7d57644c4974392b26c5d1 | 16,581 | py | Python | rsatoolbox/model/fitter.py | Remi-Gau/rsatoolbox | 2b4b57fa4cee9d9b819c43ac0436278c696e2402 | [
"MIT"
] | null | null | null | rsatoolbox/model/fitter.py | Remi-Gau/rsatoolbox | 2b4b57fa4cee9d9b819c43ac0436278c696e2402 | [
"MIT"
] | null | null | null | rsatoolbox/model/fitter.py | Remi-Gau/rsatoolbox | 2b4b57fa4cee9d9b819c43ac0436278c696e2402 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Parameter fitting methods for models
"""
import numpy as np
import scipy.optimize as opt
import scipy.sparse
from rsatoolbox.rdm import compare
from rsatoolbox.util.matrix import get_v
from rsatoolbox.util.pooling import pool_rdm
from rsatoolbox.util.rdm_utils import ... | 38.740654 | 79 | 0.635245 |
c3555a882d6982fd75485aee2525e80635ddda98 | 3,370 | py | Python | tensorflow/examples/how_tos/reading_data/convert_to_records.py | ankush-me/tensorflow | ec7f37e40fedb23435bfb7e28668e5fa63ff52f3 | [
"Apache-2.0"
] | 2 | 2017-10-14T09:13:27.000Z | 2017-10-26T18:34:28.000Z | tensorflow/examples/how_tos/reading_data/convert_to_records.py | kiliczsh/tensorflow | f49aca4532c155597c669cf2189f211cafbebf96 | [
"Apache-2.0"
] | null | null | null | tensorflow/examples/how_tos/reading_data/convert_to_records.py | kiliczsh/tensorflow | f49aca4532c155597c669cf2189f211cafbebf96 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 31.203704 | 80 | 0.680712 |
62837bdb89ec966939a736da5b121131da95bc71 | 926 | py | Python | test/common/json/config_schemas_test_data/test_http_conn_network_filter_schema.py | kainz/envoy | f4972084c06ef4e8f657bd4a405d93d5de92f1f4 | [
"Apache-2.0"
] | 91 | 2018-11-24T05:33:58.000Z | 2022-03-16T05:58:05.000Z | test/common/json/config_schemas_test_data/test_http_conn_network_filter_schema.py | kainz/envoy | f4972084c06ef4e8f657bd4a405d93d5de92f1f4 | [
"Apache-2.0"
] | 11 | 2019-06-02T23:50:17.000Z | 2022-02-04T23:58:56.000Z | test/common/json/config_schemas_test_data/test_http_conn_network_filter_schema.py | kainz/envoy | f4972084c06ef4e8f657bd4a405d93d5de92f1f4 | [
"Apache-2.0"
] | 18 | 2018-11-24T10:35:29.000Z | 2021-04-22T07:22:10.000Z | from util import get_blob
from util import true, false
HTTP_CONN_NETWORK_FILTER_BLOB = {
"idle_timeout_s": 300,
"stat_prefix": "router",
"use_remote_address": true,
"server_name": "envoy-123",
"access_log": [],
"tracing": {
"request_headers_for_tags": [
"x-source"
],... | 21.534884 | 53 | 0.514039 |
7ccba2cd20d1510f959095982d58ac47e5c9a467 | 5,038 | py | Python | lambda/us-east-1_Numbers_Trivia/ask_sdk_model/interfaces/audioplayer/playback_started_request.py | Techievena/Numbers_Trivia | e86daaf7e7bc2c80c703c8496daea6317e986204 | [
"MIT"
] | 1 | 2019-02-04T21:07:06.000Z | 2019-02-04T21:07:06.000Z | lambda/us-east-1_Numbers_Trivia/ask_sdk_model/interfaces/audioplayer/playback_started_request.py | Techievena/Numbers_Trivia | e86daaf7e7bc2c80c703c8496daea6317e986204 | [
"MIT"
] | 9 | 2020-03-24T16:32:57.000Z | 2022-03-11T23:37:22.000Z | lambda/us-east-1_Numbers_Trivia/ask_sdk_model/interfaces/audioplayer/playback_started_request.py | Techievena/Numbers_Trivia | e86daaf7e7bc2c80c703c8496daea6317e986204 | [
"MIT"
] | null | null | null | # coding: utf-8
#
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file
# except in compliance with the License. A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "lice... | 37.044118 | 182 | 0.625844 |
ec7310c50181c80c28651e29f6292586b47704e6 | 11,433 | py | Python | userbot/modules/pmpermit.py | ferryumay/OpenUserBot | d259a55f6d1ac01ba5015b83751dc30548a7aa98 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 1 | 2020-04-09T01:11:33.000Z | 2020-04-09T01:11:33.000Z | userbot/modules/pmpermit.py | ferryumay/OpenUserBot | d259a55f6d1ac01ba5015b83751dc30548a7aa98 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/pmpermit.py | ferryumay/OpenUserBot | d259a55f6d1ac01ba5015b83751dc30548a7aa98 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
""" Userbot module for keeping control who PM you. """
from telethon.tl.functions.contacts import BlockRequest, Unbloc... | 38.494949 | 99 | 0.581125 |
a6e881aa810b9ac8632014c477236eed33eb066a | 9,215 | py | Python | EEG_Lightning/dassl/engine/da/heterogeneous/old_dan.py | mcd4874/NeurIPS_competition | 4df1f222929e9824a55c9c4ae6634743391b0fe9 | [
"MIT"
] | 23 | 2021-10-14T02:31:06.000Z | 2022-01-25T16:26:44.000Z | EEG_Lightning/dassl/engine/da/heterogeneous/old_dan.py | mcd4874/NeurIPS_competition | 4df1f222929e9824a55c9c4ae6634743391b0fe9 | [
"MIT"
] | null | null | null | EEG_Lightning/dassl/engine/da/heterogeneous/old_dan.py | mcd4874/NeurIPS_competition | 4df1f222929e9824a55c9c4ae6634743391b0fe9 | [
"MIT"
] | 1 | 2022-03-05T06:54:11.000Z | 2022-03-05T06:54:11.000Z | from dassl.engine import TRAINER_REGISTRY
from dassl.engine.trainer import TrainerMultiAdaptation
from dassl.data import DataManager
from dassl.utils import MetricMeter
from torch.utils.data import Dataset as TorchDataset
from dassl.optim import build_optimizer, build_lr_scheduler
from dassl.utils import count_num_para... | 44.95122 | 115 | 0.643625 |
16a7287414b34cbd41d759ae59b35a7d6dda5790 | 2,368 | py | Python | model.py | susomena/TrafficConvnet | b292533bb3b1cb815c92ec99a2082783e27d0398 | [
"MIT"
] | 1 | 2019-04-30T14:49:20.000Z | 2019-04-30T14:49:20.000Z | model.py | susomena/TrafficConvnet | b292533bb3b1cb815c92ec99a2082783e27d0398 | [
"MIT"
] | null | null | null | model.py | susomena/TrafficConvnet | b292533bb3b1cb815c92ec99a2082783e27d0398 | [
"MIT"
] | 1 | 2020-02-17T14:54:40.000Z | 2020-02-17T14:54:40.000Z | from __future__ import print_function
from __future__ import division
import tensorflow as tf
import tensorflow.contrib.slim as slim
def residual_block(feature_maps, x, previous_x, scope, is_training, reuse):
a = slim.conv2d(x, feature_maps, [3, 3], [1, 1], activation_fn=None, scope=scope + '_1')
a = slim.ba... | 50.382979 | 103 | 0.632179 |
deab75026a8411ac6f02b0e9f5672b51e198c081 | 6,836 | py | Python | userbot/modules/misc/mirror.py | ZJRDroid/PaperplaneRemix | b41dffad17cce076f174a3fb36f0aeba1177cefa | [
"MIT"
] | null | null | null | userbot/modules/misc/mirror.py | ZJRDroid/PaperplaneRemix | b41dffad17cce076f174a3fb36f0aeba1177cefa | [
"MIT"
] | null | null | null | userbot/modules/misc/mirror.py | ZJRDroid/PaperplaneRemix | b41dffad17cce076f174a3fb36f0aeba1177cefa | [
"MIT"
] | 1 | 2019-12-21T03:44:42.000Z | 2019-12-21T03:44:42.000Z | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.c (the "License");
# you may not use this file except in compliance with the License.
#
# The entire source code is OSSRPL except
# 'download, uploadir, uploadas, upload' which is MPL
# License: MPL and OSSR... | 32.398104 | 93 | 0.632241 |
096d8ba395605f5506d6e1c5f504f1e1b06fdde8 | 1,709 | py | Python | sentinel/helpers/session.py | allagog0x01/sentwg | 52285ecf2b03c30a78901a29a7af96c8ab5764c8 | [
"Apache-2.0"
] | null | null | null | sentinel/helpers/session.py | allagog0x01/sentwg | 52285ecf2b03c30a78901a29a7af96c8ab5764c8 | [
"Apache-2.0"
] | null | null | null | sentinel/helpers/session.py | allagog0x01/sentwg | 52285ecf2b03c30a78901a29a7af96c8ab5764c8 | [
"Apache-2.0"
] | null | null | null | from ..config import DEFAULT_GAS
from ..cosmos import call as cosmos_call
from ..db import db
from ..node import add_tx
from ..node import node
from ..node import update_session
from ..vpn import disconnect_client
def update_session_status(pub_key, status):
_ = db.clients.find_one_and_update({
'pub_key': ... | 33.509804 | 99 | 0.541252 |
538d3015dcc09699558fdb177ca0706f6652822d | 1,128 | py | Python | ids_examples.py | LukasSliacky/Articles | 4807466bca62c9baa4b64db68e588a169463650f | [
"MIT"
] | null | null | null | ids_examples.py | LukasSliacky/Articles | 4807466bca62c9baa4b64db68e588a169463650f | [
"MIT"
] | null | null | null | ids_examples.py | LukasSliacky/Articles | 4807466bca62c9baa4b64db68e588a169463650f | [
"MIT"
] | null | null | null | from kivy.app import App
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
from random import choice
Builder.load_string('''
<MyCustomLayout1>:
Button:
id: mybutton
text: "Goto 2"
on_release: app.sm.current = "s... | 17.625 | 69 | 0.64273 |
7c473040e08c4b8807e553ce706c758c3baad0fc | 393 | py | Python | cffi/build.py | CuckooEXE/golay | 41aaf9346a527811a401d3cdc6b0664fe59c1bbb | [
"MIT"
] | null | null | null | cffi/build.py | CuckooEXE/golay | 41aaf9346a527811a401d3cdc6b0664fe59c1bbb | [
"MIT"
] | null | null | null | cffi/build.py | CuckooEXE/golay | 41aaf9346a527811a401d3cdc6b0664fe59c1bbb | [
"MIT"
] | null | null | null | """
build.py: Build the CFFI library
Author: Axel Persinger
License: MIT License
"""
"""
Imported Libraries
cffi - C Foreign Function Interface
"""
import cffi
if __name__ == '__main__':
ffibuilder = cffi.FFI()
ffibuilder.cdef("""
int add(int, int);
""")
ffibuilder.set_source("py... | 15.72 | 77 | 0.633588 |
e87f8f2abc39a158b60cd3102745d58f4df45cfa | 753 | py | Python | tests/parsers/test_parser_encrypt_extracts.py | tableau/tabcmd | a6a44795b2568933505dfc8c443ee16542c9e4c0 | [
"MIT"
] | 3 | 2022-02-15T03:07:51.000Z | 2022-03-09T13:14:52.000Z | tests/parsers/test_parser_encrypt_extracts.py | tableau/tabcmd | a6a44795b2568933505dfc8c443ee16542c9e4c0 | [
"MIT"
] | 57 | 2022-01-31T22:33:17.000Z | 2022-03-28T22:05:53.000Z | tests/parsers/test_parser_encrypt_extracts.py | tableau/tabcmd | a6a44795b2568933505dfc8c443ee16542c9e4c0 | [
"MIT"
] | 2 | 2022-02-23T23:05:35.000Z | 2022-03-03T21:32:53.000Z | import unittest
from tabcmd.commands.extracts.encrypt_extracts_command import EncryptExtracts
from .common_setup import *
commandname = "encryptextracts"
class EncryptExtractsParserTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.parser_under_test = initialize_test_pieces(commandname, ... | 32.73913 | 84 | 0.755644 |
3d30459898bad4a6d6aa73355840f3060e3087a7 | 310 | py | Python | engine/csvcheck.py | laranea/SocialExpressApp | 66d0823c602ce447996a6e1ae7ad0058391f6384 | [
"MIT"
] | null | null | null | engine/csvcheck.py | laranea/SocialExpressApp | 66d0823c602ce447996a6e1ae7ad0058391f6384 | [
"MIT"
] | null | null | null | engine/csvcheck.py | laranea/SocialExpressApp | 66d0823c602ce447996a6e1ae7ad0058391f6384 | [
"MIT"
] | null | null | null | import csv
import sys
f = open('abnamro1.csv', 'rt')
try:
reader = csv.reader(f)
rownr = 1
for row in reader:
if rownr == 1:
i = 0
for el in row:
print i, el
i = i + 1
rownr = rownr + 1
finally:
f.close() | 18.235294 | 30 | 0.419355 |
67392595fab77189df35ac98376b827e60e86004 | 461 | py | Python | matches/migrations/0020_auto_20190403_1603.py | ebaymademepoor/django_milestone_project_myTeam | 95d503e2c303b9525e9eaff2e08340f6e9f1987b | [
"ADSL"
] | null | null | null | matches/migrations/0020_auto_20190403_1603.py | ebaymademepoor/django_milestone_project_myTeam | 95d503e2c303b9525e9eaff2e08340f6e9f1987b | [
"ADSL"
] | 5 | 2020-06-05T19:45:53.000Z | 2022-03-11T23:41:23.000Z | matches/migrations/0020_auto_20190403_1603.py | Deirdre18/django_milestone_project_myTeam | 0555105f65076214087cfed73802470652dd1dcd | [
"ADSL"
] | 2 | 2019-04-30T11:08:14.000Z | 2019-07-24T20:04:50.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-04-03 16:03
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('matches', '0019_performancerating'),
]
operations = [
migrations.RenameField(
... | 21.952381 | 46 | 0.635575 |
05fbf67980bc392257c6769fa61e8657557f427b | 8,373 | py | Python | google-cloud-sdk/.install/.backup/lib/surface/compute/instances/delete.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/surface/compute/instances/delete.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/.install/.backup/lib/surface/compute/instances/delete.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:09:01.000Z | 2020-07-25T12:09:01.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... | 38.059091 | 89 | 0.677774 |
e3c1f0d9e88790248f963f3689166b435d110a5a | 1,146 | py | Python | programming/leetcode/linkedLists/mergeTwoSortedLists/MergeTwoSortedLists.py | vamsitallapudi/Coderefer-Python-Projects | a7acc682251661e296c64533f4a85d47e6eedda2 | [
"Apache-2.0"
] | 1 | 2021-01-03T06:42:58.000Z | 2021-01-03T06:42:58.000Z | programming/leetcode/linkedLists/mergeTwoSortedLists/MergeTwoSortedLists.py | vamsitallapudi/Coderefer-Python-Projects | a7acc682251661e296c64533f4a85d47e6eedda2 | [
"Apache-2.0"
] | null | null | null | programming/leetcode/linkedLists/mergeTwoSortedLists/MergeTwoSortedLists.py | vamsitallapudi/Coderefer-Python-Projects | a7acc682251661e296c64533f4a85d47e6eedda2 | [
"Apache-2.0"
] | null | null | null | # Definition for singly-linked list.
class ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
def mergeTwoLists(self, l1: ListNode, l2: ListNode) -> ListNode:
if not l1 and not l2:
return l1
if not l1:
return ... | 21.622642 | 68 | 0.442408 |
e6d1b16e9fcda2e187577a9e71cba27c548f56a2 | 390 | py | Python | code_examples/chapter8/allergen_flag.py | trungnghiahoang96/RobustPython | dafb95d801dff2c8ff7856ba46d3c052d54e0033 | [
"MIT"
] | 39 | 2020-12-01T20:52:13.000Z | 2022-03-19T00:56:12.000Z | code_examples/chapter8/allergen_flag.py | trungnghiahoang96/RobustPython | dafb95d801dff2c8ff7856ba46d3c052d54e0033 | [
"MIT"
] | null | null | null | code_examples/chapter8/allergen_flag.py | trungnghiahoang96/RobustPython | dafb95d801dff2c8ff7856ba46d3c052d54e0033 | [
"MIT"
] | 10 | 2021-05-18T18:29:32.000Z | 2022-02-26T13:54:06.000Z | from enum import auto, Flag
class Allergen(Flag):
FISH = auto()
SHELLFISH = auto()
TREE_NUTS = auto()
PEANUTS = auto()
GLUTEN = auto()
SOY = auto()
DAIRY = auto()
SEAFOOD = FISH | SHELLFISH
ALL_NUTS = TREE_NUTS | PEANUTS
allergens = Allergen.FISH | Allergen.SHELLFISH
assert repr(a... | 21.666667 | 49 | 0.651282 |
0074212973bba5f62b3632750114c93c278b302b | 1,341 | py | Python | carto/mapper/heart.py | wallarelvo/SmallCartography | 007e621386eb86d904fefef3f518b1d5f1dc7fe6 | [
"Apache-2.0"
] | null | null | null | carto/mapper/heart.py | wallarelvo/SmallCartography | 007e621386eb86d904fefef3f518b1d5f1dc7fe6 | [
"Apache-2.0"
] | null | null | null | carto/mapper/heart.py | wallarelvo/SmallCartography | 007e621386eb86d904fefef3f518b1d5f1dc7fe6 | [
"Apache-2.0"
] | null | null | null |
import threading
import requests
import time
class Heart(object):
def __init__(self, name, host, port, ns_host, ns_port, wait_time):
self.name = name
self.host = host
self.port = port
self.ns_host = ns_host
self.ns_port = ns_port
self.wait_time = wait_time
... | 23.946429 | 70 | 0.52349 |
1b2ca0410b75d7847bda5054f1e22bfff8a0c0e5 | 2,927 | py | Python | indico/modules/events/sessions/models/legacy_mapping.py | bkmgit/indico | d77ee121e35880a416b9b05e6098ea912d870b5c | [
"MIT"
] | 1 | 2021-06-11T20:02:10.000Z | 2021-06-11T20:02:10.000Z | indico/modules/events/sessions/models/legacy_mapping.py | bkmgit/indico | d77ee121e35880a416b9b05e6098ea912d870b5c | [
"MIT"
] | null | null | null | indico/modules/events/sessions/models/legacy_mapping.py | bkmgit/indico | d77ee121e35880a416b9b05e6098ea912d870b5c | [
"MIT"
] | null | null | null | # This file is part of Indico.
# Copyright (C) 2002 - 2022 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from indico.core.db import db
from indico.util.string import format_repr
class LegacySessionMapping(db.M... | 25.232759 | 112 | 0.600615 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.