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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d50d09be964fed96ded93d4b9480fb3e7612a245 | 4,672 | py | Python | lbrynet/schema/proto/source_pb2.py | Leopere/lbry | af43b21ef6a5de5ce1fee21425bea6f8d6bf335f | [
"MIT"
] | null | null | null | lbrynet/schema/proto/source_pb2.py | Leopere/lbry | af43b21ef6a5de5ce1fee21425bea6f8d6bf335f | [
"MIT"
] | null | null | null | lbrynet/schema/proto/source_pb2.py | Leopere/lbry | af43b21ef6a5de5ce1fee21425bea6f8d6bf335f | [
"MIT"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: lbrynet/schema/proto/source.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import ... | 33.134752 | 460 | 0.745505 |
d50d18887d88fd4d9c6e42ef3da26414bc22af05 | 1,999 | py | Python | venv/Lib/site-packages/pyrogram/raw/types/privacy_key_profile_photo.py | D1ne2021/jjhhhjj | a090da30983b3ef276dfe4cef2ded4526f36002a | [
"MIT"
] | 2 | 2021-12-13T07:09:55.000Z | 2022-01-12T12:15:20.000Z | venv/Lib/site-packages/pyrogram/raw/types/privacy_key_profile_photo.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/privacy_key_profile_photo.py | hoangkiet1906/Botcie_ver1 | c133b915edde06dac690a7dc6ca160f6792fc4c8 | [
"MIT"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2021 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 31.234375 | 103 | 0.634317 |
d50d2ba32441f27d122fc25d6c5b0b8d12d8ae72 | 903 | py | Python | migrations/versions/120_usage_table.py | alphagov/notify-api | 16dbafbad69e5bb179ba4b2202a7afa299c88d61 | [
"MIT"
] | 12 | 2015-10-06T08:58:28.000Z | 2016-08-08T17:51:29.000Z | migrations/versions/120_usage_table.py | gds-attic/notify-api | 16dbafbad69e5bb179ba4b2202a7afa299c88d61 | [
"MIT"
] | 1 | 2015-10-27T12:01:26.000Z | 2015-10-27T12:01:26.000Z | migrations/versions/120_usage_table.py | gds-attic/notify-api | 16dbafbad69e5bb179ba4b2202a7afa299c88d61 | [
"MIT"
] | 3 | 2016-05-31T17:40:15.000Z | 2021-04-10T20:03:33.000Z | """empty message
Revision ID: 120_usage_table
Revises: 110_add_restricted_to_service
Create Date: 2015-10-26 14:03:04.008629
"""
# revision identifiers, used by Alembic.
revision = '120_usage_table'
down_revision = '110_add_restricted_to_service'
from alembic import op
import sqlalchemy as sa
def upgrade():
#... | 26.558824 | 63 | 0.688815 |
d50d41cb2bfd37daba9537fb76e68df1a4b99cd6 | 706 | py | Python | tests/test_c2023.py | atollk/flake8-multiline-conditionals-comprehensions | 7843a0dc970502b4752726d6a52e114e743be50b | [
"MIT"
] | 1 | 2020-06-24T06:15:44.000Z | 2020-06-24T06:15:44.000Z | tests/test_c2023.py | atollk/flake8-multiline-conditionals-comprehensions | 7843a0dc970502b4752726d6a52e114e743be50b | [
"MIT"
] | null | null | null | tests/test_c2023.py | atollk/flake8-multiline-conditionals-comprehensions | 7843a0dc970502b4752726d6a52e114e743be50b | [
"MIT"
] | null | null | null | from tests.util import BaseTest
class Test_C2023(BaseTest):
def error_code(self) -> str:
return "C2023"
def test_pass_1(self):
code = """
foo = (1 if True else 0)
"""
result = self.run_flake8(code, True)
assert result == []
def test_fail_1(self):
c... | 22.774194 | 51 | 0.498584 |
d50d46af659b018b0fb7f9b44826ad5c3b426b29 | 8,675 | py | Python | socialapp/views.py | ntkleynhans/socialapp | 612de6b21d73b3f4591711852cc178711b9886c1 | [
"BSD-3-Clause"
] | null | null | null | socialapp/views.py | ntkleynhans/socialapp | 612de6b21d73b3f4591711852cc178711b9886c1 | [
"BSD-3-Clause"
] | null | null | null | socialapp/views.py | ntkleynhans/socialapp | 612de6b21d73b3f4591711852cc178711b9886c1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render, get_object_or_404
from django.http import HttpResponseRedirect
from django.urls import reverse
from django import forms
from django.utils import timezone
from django.contrib.auth.models import User
from django.contrib.... | 40.162037 | 154 | 0.656138 |
d50d79902cf3d80f04c4991ab4842118d62e5f86 | 2,106 | py | Python | CS/CSC148/labs/lab2/point.py | jerrysun103/uoft | 6264583d27c7db94596d29c73804e6d9155de191 | [
"MIT"
] | null | null | null | CS/CSC148/labs/lab2/point.py | jerrysun103/uoft | 6264583d27c7db94596d29c73804e6d9155de191 | [
"MIT"
] | null | null | null | CS/CSC148/labs/lab2/point.py | jerrysun103/uoft | 6264583d27c7db94596d29c73804e6d9155de191 | [
"MIT"
] | null | null | null | class Point:
""""
A two-dimensional point
Attributes:
===========
@type x: float
units to right of origin
@type y: float
units above origin
"""
def __init__(self, x, y):
"""
Create a new Point self that is x units to the right,
and y units above,... | 21.71134 | 61 | 0.465337 |
d50dc8fb9d9f5043c5133f8c228a2aa3262a89d3 | 2,617 | py | Python | webapp/app/routes.py | Jinchu/covid-plotter | 17fd3fc4f7a4e135cc79204ec3b7cdff90b9ff8f | [
"MIT"
] | null | null | null | webapp/app/routes.py | Jinchu/covid-plotter | 17fd3fc4f7a4e135cc79204ec3b7cdff90b9ff8f | [
"MIT"
] | null | null | null | webapp/app/routes.py | Jinchu/covid-plotter | 17fd3fc4f7a4e135cc79204ec3b7cdff90b9ff8f | [
"MIT"
] | null | null | null | from flask import render_template, url_for
from app import app
from app.forms import CountryForm
from config import STATIC_CONT
import fetchPatientData
import visualizeData
@app.route('/covid', methods=['GET', 'POST'])
def covid():
countryForm = CountryForm()
return render_template('index.html', title='Home... | 30.788235 | 96 | 0.676729 |
d50dd9b4da84f3740912b719679941f36e315f15 | 3,883 | py | Python | flexget/plugins/output/notify_xmpp.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | 1 | 2018-05-02T21:14:50.000Z | 2018-05-02T21:14:50.000Z | flexget/plugins/output/notify_xmpp.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | null | null | null | flexget/plugins/output/notify_xmpp.py | sillygreen89/Flexget | 60f24ab0dda7b94c87ba43451921c50c3cef391f | [
"MIT"
] | null | null | null | from __future__ import unicode_literals, division, absolute_import
from builtins import * # pylint: disable=unused-import, redefined-builtin
import logging
from flexget import plugin
from flexget.event import event
from flexget.utils.template import RenderError, render_from_task
from flexget.config_schema import one... | 35.623853 | 118 | 0.58563 |
d50dfa3ab7c1abca346b8759044ea49cfc8a11bc | 142,437 | py | Python | covid_data.py | porames/covidthailand | b7aa1f7c7bb0b77cccb7678f1d3932d895e5ccca | [
"CC-BY-4.0"
] | null | null | null | covid_data.py | porames/covidthailand | b7aa1f7c7bb0b77cccb7678f1d3932d895e5ccca | [
"CC-BY-4.0"
] | null | null | null | covid_data.py | porames/covidthailand | b7aa1f7c7bb0b77cccb7678f1d3932d895e5ccca | [
"CC-BY-4.0"
] | null | null | null | import datetime
import functools
import dateutil
from dateutil.parser import parse as d
from dateutil.relativedelta import relativedelta
from itertools import chain, islice
import json
import os
import re
import copy
import codecs
import shutil
import time
from bs4 import BeautifulSoup
import camelot
import numpy as n... | 46.245779 | 418 | 0.593947 |
d50e3b87908d0499a5a93735ec1c8322d076f909 | 3,359 | py | Python | nerlogparser/grammar/bluegenelog.py | studiawan/nerlogparser | 4dc3d955f735ea5496557ee76378a38b5746e425 | [
"Apache-2.0"
] | 5 | 2018-12-20T00:51:30.000Z | 2022-02-08T17:38:33.000Z | nerlogparser/grammar/bluegenelog.py | studiawan/nerlogparser | 4dc3d955f735ea5496557ee76378a38b5746e425 | [
"Apache-2.0"
] | 1 | 2022-02-16T08:49:51.000Z | 2022-02-17T02:19:01.000Z | nerlogparser/grammar/bluegenelog.py | studiawan/nerlogparser | 4dc3d955f735ea5496557ee76378a38b5746e425 | [
"Apache-2.0"
] | 8 | 2020-03-20T11:10:16.000Z | 2022-01-28T16:46:15.000Z | import os
import csv
from pyparsing import Word, alphas, Combine, nums, Regex, ParseException
from collections import OrderedDict
class BlueGeneLog(object):
def __init__(self, dataset):
self.dataset = dataset
self.bluegenelog_grammar = self.__get_bluegenelog_grammar()
@staticmethod
def __... | 33.929293 | 115 | 0.572492 |
d50e4112cdce2420e3e80275b1b90ff2918e96c1 | 2,627 | py | Python | python/orca/src/bigdl/orca/learn/trigger.py | sgwhat/BigDL | 25b402666fbb26b0bc18fc8100e9a00469844778 | [
"Apache-2.0"
] | null | null | null | python/orca/src/bigdl/orca/learn/trigger.py | sgwhat/BigDL | 25b402666fbb26b0bc18fc8100e9a00469844778 | [
"Apache-2.0"
] | null | null | null | python/orca/src/bigdl/orca/learn/trigger.py | sgwhat/BigDL | 25b402666fbb26b0bc18fc8100e9a00469844778 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2016 The BigDL 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 to in ... | 33.253165 | 92 | 0.679482 |
d50e99f20da1fc1c2484ff3dcb67c0f97f8a0842 | 2,238 | py | Python | interface_meta.py | rnd0101/python-interfaces-example | 7b685f69b1b7517eddba2fc762a1b92520068d3f | [
"MIT"
] | null | null | null | interface_meta.py | rnd0101/python-interfaces-example | 7b685f69b1b7517eddba2fc762a1b92520068d3f | [
"MIT"
] | null | null | null | interface_meta.py | rnd0101/python-interfaces-example | 7b685f69b1b7517eddba2fc762a1b92520068d3f | [
"MIT"
] | null | null | null | """
Define our interface metaclass here
"""
from __future__ import annotations
import inspect
import warnings
from abc import ABCMeta
def is_valid_interface_subclass(cls, subclass, attr):
cls_attr = getattr(cls, attr, None)
if not hasattr(subclass, attr):
return f"Attribute {attr!r} of {cls.__name__!... | 36.096774 | 109 | 0.674263 |
d50eb6af1e0e424d34726ea1f9fa2b3e568af4ca | 1,818 | py | Python | tuskar_ui/test/formset_table_tests.py | rdo-management/tuskar-ui | 513f0da17bc4714d8c93209dd71c1f52c2713a8b | [
"Apache-2.0"
] | 1 | 2015-02-19T12:23:23.000Z | 2015-02-19T12:23:23.000Z | tuskar_ui/test/formset_table_tests.py | rdo-management/tuskar-ui | 513f0da17bc4714d8c93209dd71c1f52c2713a8b | [
"Apache-2.0"
] | null | null | null | tuskar_ui/test/formset_table_tests.py | rdo-management/tuskar-ui | 513f0da17bc4714d8c93209dd71c1f52c2713a8b | [
"Apache-2.0"
] | null | null | null | #
# 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
# ... | 31.344828 | 78 | 0.624312 |
d50ec685efb976db587df1735a3a242bf7510485 | 288 | py | Python | nnet/metrics.py | tyburam/deep-learning-with-python | add954cba8a851e948e84a5b3024d81c1415206c | [
"MIT"
] | null | null | null | nnet/metrics.py | tyburam/deep-learning-with-python | add954cba8a851e948e84a5b3024d81c1415206c | [
"MIT"
] | null | null | null | nnet/metrics.py | tyburam/deep-learning-with-python | add954cba8a851e948e84a5b3024d81c1415206c | [
"MIT"
] | 1 | 2019-10-18T07:26:01.000Z | 2019-10-18T07:26:01.000Z | import numpy as np
class MetricsFactory:
def build(self, names):
metrics = []
for name in names:
if name == 'accuracy':
metrics.append(accuracy)
return metrics
def accuracy(predicted, target):
return np.mean(predicted==target) | 24 | 40 | 0.600694 |
d50ed0d276f09d2e647aa0604cb006c2a0830fe7 | 4,478 | py | Python | conda_env/cli/main_update.py | cswartzvi/conda | b2e0ed6b6119b7623d8f64c47d4d04f56e9cf137 | [
"BSD-3-Clause"
] | null | null | null | conda_env/cli/main_update.py | cswartzvi/conda | b2e0ed6b6119b7623d8f64c47d4d04f56e9cf137 | [
"BSD-3-Clause"
] | null | null | null | conda_env/cli/main_update.py | cswartzvi/conda | b2e0ed6b6119b7623d8f64c47d4d04f56e9cf137 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from argparse import RawDescriptionHelpFormatter
import os
import sys
import textwrap
from conda.cli.conda_argparse import add_parser_json, add_parser_prefix, \
add_parser_experimental_solver
from conda.core.prefix_d... | 33.17037 | 93 | 0.650737 |
d50f1321beca5011c4ff4f8c5668681408342da4 | 3,960 | py | Python | experiments/ashvin/icml2020/point/offpolicy/sac1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/point/offpolicy/sac1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icml2020/point/offpolicy/sac1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | """
AWR + SAC from demo experiment
"""
from rlkit.demos.source.dict_to_mdp_path_loader import DictToMDPPathLoader
from rlkit.launchers.experiments.awac.awac_rl import experiment, process_args
import rlkit.misc.hyperparameter as hyp
from rlkit.launchers.arglauncher import run_variants
from rlkit.torch.sac.policies im... | 30 | 89 | 0.559343 |
d50f20dd0873b14d6142e50e4a2a57bee3cc21f5 | 18,067 | py | Python | tests/tree_xml_parser_reg_text_tests.py | cfpb/regulations-parser | 9b6e1ab2dbec93a915eb6da9a2d88c723b9ac424 | [
"CC0-1.0"
] | 36 | 2015-01-05T21:17:36.000Z | 2020-04-28T21:02:55.000Z | tests/tree_xml_parser_reg_text_tests.py | DalavanCloud/regulations-parser | 9b6e1ab2dbec93a915eb6da9a2d88c723b9ac424 | [
"CC0-1.0"
] | 49 | 2015-01-28T15:54:25.000Z | 2018-08-20T20:20:08.000Z | tests/tree_xml_parser_reg_text_tests.py | DalavanCloud/regulations-parser | 9b6e1ab2dbec93a915eb6da9a2d88c723b9ac424 | [
"CC0-1.0"
] | 23 | 2015-01-28T15:34:18.000Z | 2021-02-20T10:53:34.000Z | # vim: set encoding=utf-8
from unittest import TestCase
from lxml import etree
from mock import patch
from regparser.tree.xml_parser import reg_text
class RegTextTest(TestCase):
def test_build_from_section_intro_text(self):
xml = u"""
<SECTION>
<SECTNO>§ 8675.309</SECTNO>
... | 38.277542 | 79 | 0.528754 |
d50f26f34d7989dd25585681abdf2a3df9934ba2 | 756 | py | Python | tree/pretty_print.py | AnshulPatni/Algorithms | c8bcfb86d50f68041921e5140f01821ac12d9521 | [
"MIT"
] | 1 | 2018-04-11T10:32:45.000Z | 2018-04-11T10:32:45.000Z | tree/pretty_print.py | AnshulPatni/Algorithms | c8bcfb86d50f68041921e5140f01821ac12d9521 | [
"MIT"
] | null | null | null | tree/pretty_print.py | AnshulPatni/Algorithms | c8bcfb86d50f68041921e5140f01821ac12d9521 | [
"MIT"
] | null | null | null | # a -> Adam -> Book -> 4
# b -> Bill -> Computer -> 5
# -> TV -> 6
# Jill -> Sports -> 1
# c -> Bill -> Sports -> 3
# d -> Adam -> Computer -> 3
# Quin -> Computer -> 3
# e -> Quin -> Book -> 5
# -> TV -> 2
# f -> Adam -> Computer -> 7
from __future__ import print_function
def treePrint(... | 32.869565 | 83 | 0.52381 |
d50f287147bae714cbf8b86aef7a5144c7f459ae | 512 | py | Python | violas_client/lbrtypes/account_config/resources/vasp.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | null | null | null | violas_client/lbrtypes/account_config/resources/vasp.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | null | null | null | violas_client/lbrtypes/account_config/resources/vasp.py | violas-core/violas-client | e8798f7d081ac218b78b81fd7eb2f8da92631a16 | [
"MIT"
] | 1 | 2022-01-05T06:49:42.000Z | 2022-01-05T06:49:42.000Z | from violas_client.canoser import Struct, Uint64
from violas_client.move_core_types.move_resource import MoveResource
from violas_client.lbrtypes.account_config.constants import AccountAddress
class ParentVASP(Struct, MoveResource):
MODULE_NAME = "VASP"
STRUCT_NAME = "ParentVASP"
_fields = [
("num... | 23.272727 | 74 | 0.724609 |
d50f40705187c13d50718960ef888818ecd19c2a | 5,184 | py | Python | sample/relu.py | TheLampshady/tensor_tutorial | a5665d05ce7fdefa4975081847ac34d44756a3d0 | [
"MIT"
] | 2 | 2018-04-19T19:33:43.000Z | 2019-03-12T05:59:52.000Z | sample/relu.py | TheLampshady/tensor_tutorial | a5665d05ce7fdefa4975081847ac34d44756a3d0 | [
"MIT"
] | null | null | null | sample/relu.py | TheLampshady/tensor_tutorial | a5665d05ce7fdefa4975081847ac34d44756a3d0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from os.path import basename, splitext, join
import tensorflow as tf
from tensorflow.examples.tutorials.mnist import input_data as mnist_data
from tensor_functions import bias_variable, weight_variable, build_mnist_embeddings, embedding_initializer
def run():
"""
Example 3
Multila... | 30.315789 | 111 | 0.59973 |
d50f6d7d4ad78dd3dad130b392003b4934a01d15 | 2,367 | py | Python | Python3/Books/Douson/chapter05/hangman.py | neon1ks/Study | 5d40171cf3bf5e8d3a95539e91f5afec54d1daf3 | [
"MIT"
] | null | null | null | Python3/Books/Douson/chapter05/hangman.py | neon1ks/Study | 5d40171cf3bf5e8d3a95539e91f5afec54d1daf3 | [
"MIT"
] | null | null | null | Python3/Books/Douson/chapter05/hangman.py | neon1ks/Study | 5d40171cf3bf5e8d3a95539e91f5afec54d1daf3 | [
"MIT"
] | null | null | null | # Hangman Game
#
# The classic game of Hangman. The computer picks a random word
# and the player wrong to guess it, one letter at a time. If the player
# can't guess the word in time, the little stick figure gets hanged.
# imports
import random
# constants
HANGMAN = (
"""
------
| |
|
|
|
|
|
|
|
-----... | 14.701863 | 78 | 0.432193 |
d50f810f9e3fbd7aae97f9e77c5263d7c80cd48b | 117 | py | Python | abc/225/A.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | 2 | 2022-01-22T07:56:58.000Z | 2022-01-24T00:29:37.000Z | abc/225/A.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | abc/225/A.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | import itertools
S = list(input())
cnt = dict()
for v in itertools.permutations(S):
cnt[v] = 1
print(len(cnt))
| 13 | 35 | 0.649573 |
d50f9a75eef55edeb66f217b2f128aa13283ed54 | 1,307 | py | Python | raw/day13/part1.py | aesdeef/advent-of-code-2021 | 4561bcf12ac03d360f5b28c48ef80134f97613b9 | [
"MIT"
] | 2 | 2021-12-03T06:18:27.000Z | 2021-12-06T11:28:33.000Z | raw/day13/part1.py | aesdeef/advent-of-code-2021 | 4561bcf12ac03d360f5b28c48ef80134f97613b9 | [
"MIT"
] | null | null | null | raw/day13/part1.py | aesdeef/advent-of-code-2021 | 4561bcf12ac03d360f5b28c48ef80134f97613b9 | [
"MIT"
] | null | null | null | import re
from collections import Counter
from itertools import chain, count
# READ THE ENTIRE DESCRIPTION FIRST
INPUT_FILE = "../../input/13.txt"
# INPUT_FILE = "test.txt"
with open(INPUT_FILE) as f:
pts, flds = f.read().split("\n\n")
points = set()
for line in pts.split("\n"):
a, b = line.split(",")
p... | 21.080645 | 41 | 0.547819 |
d50fadc5205a6841522d1546f4d2b6ec7b604c5e | 2,119 | py | Python | utils/parser/fasta.py | legumeinfo/CoNekT | 709a4980cfa255cafd456b268e274db2b4b1f5fb | [
"MIT"
] | 14 | 2018-08-20T03:07:21.000Z | 2021-11-04T11:15:31.000Z | utils/parser/fasta.py | mutwil/CoNekT | f4a4496a87d14b15bcf587975b31a2edc24c6bf7 | [
"MIT"
] | 9 | 2018-07-17T15:30:47.000Z | 2021-07-05T13:11:54.000Z | utils/parser/fasta.py | mutwil/CoNekT | f4a4496a87d14b15bcf587975b31a2edc24c6bf7 | [
"MIT"
] | 3 | 2019-08-05T09:16:34.000Z | 2019-12-04T23:59:28.000Z | import sys
import gzip
class Fasta:
def __init__(self):
self.sequences = {}
def remove_subset(self, length):
"""
Removes a set of sequences and returns those as a subset
:param length: number of sequences to remove
:return: Fasta object with the sequences removed from... | 28.253333 | 84 | 0.522416 |
d50fce3896f401d2fcd35f2a8ed61e500e0ab82e | 21,590 | py | Python | respy/tests/test_f2py.py | boryana-ilieva/respy | c3f600eefbb54d4f34ae2cc1e52d4d32c03ba0dc | [
"MIT"
] | null | null | null | respy/tests/test_f2py.py | boryana-ilieva/respy | c3f600eefbb54d4f34ae2cc1e52d4d32c03ba0dc | [
"MIT"
] | null | null | null | respy/tests/test_f2py.py | boryana-ilieva/respy | c3f600eefbb54d4f34ae2cc1e52d4d32c03ba0dc | [
"MIT"
] | 1 | 2020-10-31T19:40:22.000Z | 2020-10-31T19:40:22.000Z | import statsmodels.api as sm
from scipy.stats import norm
import numpy as np
import pytest
import scipy
import sys
import os
from respy.python.solve.solve_auxiliary import get_predictions
from codes.auxiliary import write_interpolation_grid
from codes.random_init import generate_init
from respy.python.shared.shared_... | 39.981481 | 222 | 0.668087 |
d50ff929b5c40c365c7380fe347578eb5d552ca8 | 4,649 | py | Python | Lessons/source/set_test.py | natepill/CS-1.3-Class-Repo | 62798c1e101cb312e42321ba514794b61ef23ba2 | [
"MIT"
] | null | null | null | Lessons/source/set_test.py | natepill/CS-1.3-Class-Repo | 62798c1e101cb312e42321ba514794b61ef23ba2 | [
"MIT"
] | 3 | 2019-05-17T01:27:55.000Z | 2019-05-18T20:20:14.000Z | Lessons/source/set_test.py | natepill/CS-1.3-Class-Repo | 62798c1e101cb312e42321ba514794b61ef23ba2 | [
"MIT"
] | null | null | null | from set import Set
import unittest
class SetTest(unittest.TestCase):
def test_init(self):
s = Set()
assert s.size() == 0
def test_init_with_list(self):
s = Set(['Person1', 'Person2', 'Person3'])
assert s.contains('Person3') == True
assert s.size() == 3
def test_c... | 35.48855 | 69 | 0.573242 |
d50ffb36ab0b24785784b9bb53e4cc8b25cd124a | 830 | py | Python | cloudmesh/provisioner/system_info.py | JulienPalard/cloudmesh | 1759b88daef3a13917492d028fdabe08f03ca996 | [
"Apache-2.0"
] | null | null | null | cloudmesh/provisioner/system_info.py | JulienPalard/cloudmesh | 1759b88daef3a13917492d028fdabe08f03ca996 | [
"Apache-2.0"
] | 4 | 2021-06-08T20:20:08.000Z | 2022-03-11T23:30:22.000Z | cloudmesh/provisioner/system_info.py | JulienPalard/cloudmesh | 1759b88daef3a13917492d028fdabe08f03ca996 | [
"Apache-2.0"
] | null | null | null | from fabric.api import *
from fabric.context_managers import settings
@task
def memory_usage():
run('free -m')
def main():
hosts = 'localhost,india.futuregrid.org'
with settings(host_string=hosts):
memory_usage()
if __name__ == '__main__':
memory_usage()
'''
class SystemInfo:
def __i... | 23.055556 | 117 | 0.649398 |
d510133e11a2f880727331105632340392c6e051 | 2,191 | py | Python | tests/test_function.py | Nico34000/parking_mtp | 4574f563ca49259c700969751623f73639018859 | [
"Unlicense"
] | null | null | null | tests/test_function.py | Nico34000/parking_mtp | 4574f563ca49259c700969751623f73639018859 | [
"Unlicense"
] | null | null | null | tests/test_function.py | Nico34000/parking_mtp | 4574f563ca49259c700969751623f73639018859 | [
"Unlicense"
] | null | null | null | import unittest
import requests
from mock import patch
from tests import url_exists
from backend.function.dict_url import dict_url
from backend.function.parse_xml import xml_parse_url, create_dict
class BasicTest(unittest.TestCase):
def test_dict_url(self):
res = {'Antigone': 'https://data.mon... | 45.645833 | 108 | 0.650388 |
d5101b79866a0aacfdf5353158f0299658890e26 | 168 | py | Python | apps/homes/__init__.py | tuanquanghpvn/flask-intro | 4dbc6bfbbdee13bc601b7ba8f10ede3635a2cfaf | [
"MIT"
] | null | null | null | apps/homes/__init__.py | tuanquanghpvn/flask-intro | 4dbc6bfbbdee13bc601b7ba8f10ede3635a2cfaf | [
"MIT"
] | null | null | null | apps/homes/__init__.py | tuanquanghpvn/flask-intro | 4dbc6bfbbdee13bc601b7ba8f10ede3635a2cfaf | [
"MIT"
] | null | null | null | from flask import Blueprint
homes_bluesrprints = Blueprint('homes', __name__, template_folder='templates', static_folder='static', url_prefix='/')
from . import views | 33.6 | 118 | 0.785714 |
d51033c043958267a5995ad341c3ce686e559a65 | 3,943 | py | Python | napari/benchmarks/benchmark_labels_layer.py | mkitti/napari | 4e954d30b5a1b70c5e495db1b8f48a3bdda1ff86 | [
"BSD-3-Clause"
] | 1 | 2021-04-04T21:25:04.000Z | 2021-04-04T21:25:04.000Z | napari/benchmarks/benchmark_labels_layer.py | mkitti/napari | 4e954d30b5a1b70c5e495db1b8f48a3bdda1ff86 | [
"BSD-3-Clause"
] | 1 | 2020-10-15T19:31:09.000Z | 2020-10-15T19:39:33.000Z | napari/benchmarks/benchmark_labels_layer.py | mkitti/napari | 4e954d30b5a1b70c5e495db1b8f48a3bdda1ff86 | [
"BSD-3-Clause"
] | null | null | null | # See "Writing benchmarks" in the asv docs for more information.
# https://asv.readthedocs.io/en/latest/writing_benchmarks.html
# or the napari documentation on benchmarking
# https://github.com/napari/napari/blob/master/docs/BENCHMARKS.md
import numpy as np
from napari.layers import Labels
class Labels2DSuite:
... | 28.572464 | 75 | 0.60842 |
d5103a9b8c272d8bc6f6142b8c7d2b64a349fdbb | 166 | py | Python | oscar/lib/python2.7/site-packages/faker/providers/ssn/ru_RU/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/faker/providers/ssn/ru_RU/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/faker/providers/ssn/ru_RU/__init__.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | # coding=utf-8
from __future__ import unicode_literals
from .. import Provider as SsnProvider
class Provider(SsnProvider):
ssn_formats = ("############",)
| 23.714286 | 40 | 0.674699 |
d5104160069f2b27e3fd3dce97c3e0e45795d81e | 1,140 | py | Python | hackerrank/python/Algorithms/02_Implementation/09_BonAppetit/solution.py | edlabao/cs-practice | 44b94e71f063a663b6c98a5da2f0066764d01a38 | [
"MIT"
] | null | null | null | hackerrank/python/Algorithms/02_Implementation/09_BonAppetit/solution.py | edlabao/cs-practice | 44b94e71f063a663b6c98a5da2f0066764d01a38 | [
"MIT"
] | null | null | null | hackerrank/python/Algorithms/02_Implementation/09_BonAppetit/solution.py | edlabao/cs-practice | 44b94e71f063a663b6c98a5da2f0066764d01a38 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Problem: https://www.hackerrank.com/challenges/the-hurdle-race/problem
Level: Easy
Max Score: 15
"""
def solve(n, k, b, ar):
# Initialize the return answer which will be the amount that Anna was
# overcharged.
answer = 0
# Determine what Anna really owes by iterating thru ... | 23.265306 | 78 | 0.592105 |
d51077f9ad39c075fe360f15392119261990f5e5 | 4,218 | py | Python | modules_th/create_embeddings.py | ThesisSlayers/thesis | 415645db943103c06dcc17e5349d1d4f8fd365cc | [
"Apache-2.0"
] | null | null | null | modules_th/create_embeddings.py | ThesisSlayers/thesis | 415645db943103c06dcc17e5349d1d4f8fd365cc | [
"Apache-2.0"
] | 2 | 2021-05-20T22:03:22.000Z | 2021-09-28T05:38:44.000Z | modules_th/create_embeddings.py | ThesisSlayers/thesis | 415645db943103c06dcc17e5349d1d4f8fd365cc | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: 11_create_embeddings.ipynb (unless otherwise specified).
__all__ = ['initialize_tensors', 'iterate_over_videos', 'iterator_over_frames', 'snippet_is_ready', 'batch_is_ready',
'get_and_save_embs', 'Snippet', 'fr_is_anomaly', 'add_snip_to_batch', 'create_embeddings'... | 37.660714 | 181 | 0.669986 |
d510a20fd1beb02da1085f2c288f756577e1bc7e | 24 | py | Python | mi/dataset/driver/flort_dj/__init__.py | rmanoni/mi-dataset | c1012a0cd8f2ea075e008cdd1ab291ed54f44d43 | [
"BSD-2-Clause"
] | 1 | 2018-09-14T23:28:29.000Z | 2018-09-14T23:28:29.000Z | mi/dataset/driver/flort_dj/__init__.py | rmanoni/mi-dataset | c1012a0cd8f2ea075e008cdd1ab291ed54f44d43 | [
"BSD-2-Clause"
] | 33 | 2017-04-25T19:53:45.000Z | 2022-03-18T17:42:18.000Z | mi/dataset/driver/flort_dj/__init__.py | rmanoni/mi-dataset | c1012a0cd8f2ea075e008cdd1ab291ed54f44d43 | [
"BSD-2-Clause"
] | 31 | 2015-03-04T01:01:09.000Z | 2020-10-28T14:42:12.000Z | __author__ = 'myersos'
| 12 | 23 | 0.708333 |
d510c5073bbf0fd1e13fc3fc68363438d6c9375f | 5,622 | py | Python | PythonProjects/97-Throwaway-202020-SOLUTION/libs/rosebot_touch_sensor.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | PythonProjects/97-Throwaway-202020-SOLUTION/libs/rosebot_touch_sensor.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | PythonProjects/97-Throwaway-202020-SOLUTION/libs/rosebot_touch_sensor.py | much2mutch/csse120-public | 4f862a6deb7a5373fb5723fb2a23e4042e4d4157 | [
"MIT"
] | null | null | null | """
THROW-AWAY Capstone Project. If you mess up this THROW-AWAY project,
** no worries. **
It lets you practice skills & concepts needed for the REAL Capstone Project.
This module contains a TouchSensor class that contains methods
relevant to a physical Touch Sensor plugged into a port.
Authors: Your professor... | 43.581395 | 79 | 0.457666 |
d510dfbd37123d820aa4bc6561cbd75abdce3c8b | 1,070 | py | Python | program/benchmarking/evaluator.py | Waszker/Bioinformatics | 90f99ae67a71093d68dd970f5eb776928f71ff9b | [
"MIT"
] | null | null | null | program/benchmarking/evaluator.py | Waszker/Bioinformatics | 90f99ae67a71093d68dd970f5eb776928f71ff9b | [
"MIT"
] | null | null | null | program/benchmarking/evaluator.py | Waszker/Bioinformatics | 90f99ae67a71093d68dd970f5eb776928f71ff9b | [
"MIT"
] | null | null | null | class SimpleEvaluator:
"""
SimpleEvaluator is a simple class for evaluating (assigning scores to) benchmarked methods.
"""
def __init__(self):
pass
def get_score(self, proper_answer, answer, completion_time):
"""
Evaluates answer given by the tested method.
In Simpl... | 46.521739 | 116 | 0.693458 |
d510f76e39294b736b6ff48cfd98202da2627e42 | 5,559 | py | Python | adversarial_black_box/generate_annotations.py | Mctigger/adversarial-object-segmentation | 3f633f068bbb71c7ef459cf8528738ccbbbe36a1 | [
"MIT"
] | null | null | null | adversarial_black_box/generate_annotations.py | Mctigger/adversarial-object-segmentation | 3f633f068bbb71c7ef459cf8528738ccbbbe36a1 | [
"MIT"
] | null | null | null | adversarial_black_box/generate_annotations.py | Mctigger/adversarial-object-segmentation | 3f633f068bbb71c7ef459cf8528738ccbbbe36a1 | [
"MIT"
] | 1 | 2021-09-19T18:38:45.000Z | 2021-09-19T18:38:45.000Z | import os
import sys
sys.path.append('modules/pytorch_mask_rcnn')
#sys.path.append('modules/cocoapi/PythonAPI/pycocotools')
import skimage.io
import coco
from pycococreatortools import pycococreatortools
import model as modellib
import json
import torch
import matplotlib.pyplot as plt
import visualize
# Show detect... | 33.896341 | 107 | 0.653175 |
d5110a633f4334dec14156fb07daf02ffcd7617d | 9,699 | py | Python | Lib/test/test_urllibnet.py | vic/pysano | bcfd0522711efaaacf68821b831674b0ff48b6a1 | [
"PSF-2.0"
] | 4 | 2016-04-02T00:01:50.000Z | 2017-07-13T02:11:04.000Z | Lib/test/test_urllibnet.py | vic/pysano | bcfd0522711efaaacf68821b831674b0ff48b6a1 | [
"PSF-2.0"
] | null | null | null | Lib/test/test_urllibnet.py | vic/pysano | bcfd0522711efaaacf68821b831674b0ff48b6a1 | [
"PSF-2.0"
] | null | null | null | import unittest
from test import support
import contextlib
import socket
import urllib.request
import sys
import os
import email.message
import time
support.requires('network')
class URLTimeoutTest(unittest.TestCase):
# XXX this test doesn't seem to test anything useful.
TIMEOUT = 30.0
def setUp(self)... | 42.539474 | 86 | 0.608413 |
d5111600f70701de430a51f8a75c3c465c2f2c6d | 692 | py | Python | src/command_modules/azure-cli-billing/azure/cli/command_modules/billing/__init__.py | v-Ajnava/azure-cli | febec631d79bfca151e84267b5b409594bad598e | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-billing/azure/cli/command_modules/billing/__init__.py | v-Ajnava/azure-cli | febec631d79bfca151e84267b5b409594bad598e | [
"MIT"
] | 3 | 2021-03-26T00:48:20.000Z | 2022-03-29T22:05:39.000Z | src/command_modules/azure-cli-billing/azure/cli/command_modules/billing/__init__.py | v-Ajnava/azure-cli | febec631d79bfca151e84267b5b409594bad598e | [
"MIT"
] | 1 | 2017-12-28T04:51:44.000Z | 2017-12-28T04:51:44.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 46.133333 | 110 | 0.573699 |
d51120f56b4595cd6643d3437603be97d1f92969 | 754 | py | Python | bluegraph/backends/gensim/__init__.py | BlueBrain/BlueGraph | 7a7df9c97d01d7ebfa77cf911f187b18e2d6dc02 | [
"Apache-2.0"
] | 25 | 2021-04-09T09:57:10.000Z | 2022-02-09T14:26:55.000Z | bluegraph/backends/gensim/__init__.py | BlueBrain/BlueGraph | 7a7df9c97d01d7ebfa77cf911f187b18e2d6dc02 | [
"Apache-2.0"
] | 39 | 2021-04-09T08:23:28.000Z | 2021-11-10T08:35:59.000Z | bluegraph/backends/gensim/__init__.py | BlueBrain/BlueGraph | 7a7df9c97d01d7ebfa77cf911f187b18e2d6dc02 | [
"Apache-2.0"
] | 3 | 2021-07-30T19:00:24.000Z | 2022-03-16T21:01:48.000Z | # BlueGraph: unifying Python framework for graph analytics and co-occurrence analysis.
# Copyright 2020-2021 Blue Brain Project / EPFL
# 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 a... | 47.125 | 87 | 0.751989 |
d511211854977e7011e77891e9076ceb9219f016 | 3,208 | py | Python | ongoing/prescriptors/domax/domax_prescriptor.py | bradyneal/covid-xprize-comp | d515f58b009a0a3e2421bc83e7ac893f3c3a1ece | [
"Apache-2.0"
] | null | null | null | ongoing/prescriptors/domax/domax_prescriptor.py | bradyneal/covid-xprize-comp | d515f58b009a0a3e2421bc83e7ac893f3c3a1ece | [
"Apache-2.0"
] | null | null | null | ongoing/prescriptors/domax/domax_prescriptor.py | bradyneal/covid-xprize-comp | d515f58b009a0a3e2421bc83e7ac893f3c3a1ece | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
import os
from ongoing.prescriptors.base import BasePrescriptor, NPI_COLUMNS, NPI_MAX_VALUES
import ongoing.prescriptors.base as base
NUM_PRESCRIPTIONS = 1#10
class DoMax (BasePrescriptor):
def __init__(self, seed=base.SEED):
super().__init__(seed=seed)
def fit... | 40.1 | 129 | 0.59788 |
d5113c2897b4f154daa25218b1b7b2236e240a1f | 2,519 | py | Python | leetcode_python/Array/add-to-array-form-of-integer.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Array/add-to-array-form-of-integer.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Array/add-to-array-form-of-integer.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | """
989. Add to Array-Form of Integer
Easy
The array-form of an integer num is an array representing its digits in left to right order.
For example, for num = 1321, the array form is [1,3,2,1].
Given num, the array-form of an integer, and an integer k, return the array-form of the integer num + k.
Example 1:
In... | 25.19 | 104 | 0.55657 |
d51180590e6a65ce4fdee7e13c49d031113a26bf | 1,885 | py | Python | tests/tls12/test_tls12_SecureRenegotiation.py | timb-machine-mirrors/tlsmate | 1313161b9170311f466a3a43b3d84797cecc0291 | [
"MIT"
] | null | null | null | tests/tls12/test_tls12_SecureRenegotiation.py | timb-machine-mirrors/tlsmate | 1313161b9170311f466a3a43b3d84797cecc0291 | [
"MIT"
] | null | null | null | tests/tls12/test_tls12_SecureRenegotiation.py | timb-machine-mirrors/tlsmate | 1313161b9170311f466a3a43b3d84797cecc0291 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Implements a class to be used for unit testing.
"""
import pathlib
import logging
from tests.cipher_suite_tester import CipherSuiteTester
from tlsmate import tls
from tlsmate import msg
from tlsmate.tlssuite import TlsLibrary
class TestCase(CipherSuiteTester):
"""Class used for tests wi... | 31.416667 | 83 | 0.634483 |
d51185dd09db04723a94fe23fa946c61822d41a2 | 478 | py | Python | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/examples/circuitplayground_tap_red_led.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 75 | 2017-08-17T18:00:28.000Z | 2022-03-30T00:37:20.000Z | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/examples/circuitplayground_tap_red_led.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 65 | 2017-08-02T02:06:54.000Z | 2022-03-21T22:45:08.000Z | adafruit_circuitpython_libs/adafruit-circuitpython-bundle-py-20210214/examples/circuitplayground_tap_red_led.py | jacoblb64/pico_rgb_keypad_hid | 3251ca6a98ef86d9f98c54f639c4d61810601a0b | [
"MIT"
] | 64 | 2017-09-15T21:05:50.000Z | 2022-02-10T06:20:45.000Z | # SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
"""This example turns on the little red LED and prints to the serial console when you double-tap
the Circuit Playground!"""
import time
from adafruit_circuitplayground import cp
# Change to 1 for detecting a single-tap!
cp.d... | 25.157895 | 96 | 0.707113 |
d5118686e83ea0d7b31feb16a1547ef49c174afd | 17,146 | py | Python | remo/voting/forms.py | acidburn0zzz/remo | caa7adc40928d7f83475cf4bd78f8d609967bc87 | [
"BSD-3-Clause"
] | 1 | 2018-04-05T13:29:30.000Z | 2018-04-05T13:29:30.000Z | remo/voting/forms.py | acidburn0zzz/remo | caa7adc40928d7f83475cf4bd78f8d609967bc87 | [
"BSD-3-Clause"
] | 3 | 2021-03-20T05:31:34.000Z | 2021-06-10T23:43:06.000Z | remo/voting/forms.py | Acidburn0zzz/remo | caa7adc40928d7f83475cf4bd78f8d609967bc87 | [
"BSD-3-Clause"
] | null | null | null | import happyforms
from django import forms
from django.db.models import Q
from django.contrib.auth.models import Group, User
from django.core.exceptions import ValidationError
from django.db.models import F
from django.forms.models import BaseInlineFormSet, inlineformset_factory
from django.utils.timezone import now, ... | 35.720833 | 97 | 0.590225 |
d511a9237d2c22fc7c3f2f08daefaac6eac10b77 | 1,709 | py | Python | st2common/st2common/persistence/rbac.py | magiceses/st2 | a048ba92a8a1a5d272f277bf8fab0951df903306 | [
"Apache-2.0"
] | null | null | null | st2common/st2common/persistence/rbac.py | magiceses/st2 | a048ba92a8a1a5d272f277bf8fab0951df903306 | [
"Apache-2.0"
] | 2 | 2020-03-04T08:33:36.000Z | 2020-03-04T08:34:14.000Z | st2common/st2common/persistence/rbac.py | magiceses/st2 | a048ba92a8a1a5d272f277bf8fab0951df903306 | [
"Apache-2.0"
] | null | null | null | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | 28.483333 | 74 | 0.753657 |
d511d5404a14ee8042808423cfa8f7f798639371 | 5,577 | py | Python | toydata/figure_scripts/analysis_utils_toy_data.py | iosonofabio/FitnessInference | 3de97a9301733ac9e47ebc78f4e76f7530ccb538 | [
"MIT"
] | 11 | 2015-08-24T05:20:56.000Z | 2021-08-13T13:58:31.000Z | toydata/figure_scripts/analysis_utils_toy_data.py | iosonofabio/FitnessInference | 3de97a9301733ac9e47ebc78f4e76f7530ccb538 | [
"MIT"
] | 3 | 2015-08-24T04:43:25.000Z | 2021-07-06T00:33:44.000Z | toydata/figure_scripts/analysis_utils_toy_data.py | iosonofabio/FitnessInference | 3de97a9301733ac9e47ebc78f4e76f7530ccb538 | [
"MIT"
] | 3 | 2019-08-30T18:52:49.000Z | 2021-06-15T06:47:04.000Z | #!/ebio/ag-neher/share/programs/bin/python2.7
#
#script provdies functions used to load and process the flu prediction data
#
import numpy as np
from scipy.stats import scoreatpercentile
import glob,os
def load_prediction_data_dir(dir_name, prefix,L, return_mean = True):
predictions = {}
normalized_predictions... | 49.794643 | 145 | 0.574323 |
d511dfbab6b582f960cf382ecb061057864b4829 | 1,412 | py | Python | LDA/helper_function_LDA.py | dadiasahil94/Machine-Learning-Improvement | b7492755c01e2b16e7939672ee5de8a8326f4094 | [
"MIT"
] | null | null | null | LDA/helper_function_LDA.py | dadiasahil94/Machine-Learning-Improvement | b7492755c01e2b16e7939672ee5de8a8326f4094 | [
"MIT"
] | null | null | null | LDA/helper_function_LDA.py | dadiasahil94/Machine-Learning-Improvement | b7492755c01e2b16e7939672ee5de8a8326f4094 | [
"MIT"
] | null | null | null | import matplotlib.pyplot
import pylab
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
def TRANSPOSE_1DMATRIX(matrix):
"Returns Transpose of a vector"
return (matrix[:, None]).T
def FEATURE_MATRIX_FROM_FILE(file_name):
''' Return the feature matrix from a file '''
#open the file
open... | 23.932203 | 78 | 0.575779 |
d511e2fce61a675325e00005baba2b28cd6600a5 | 20,911 | py | Python | contrib/performance/loadtest/test_sim.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | 1 | 2017-02-18T19:22:19.000Z | 2017-02-18T19:22:19.000Z | contrib/performance/loadtest/test_sim.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | contrib/performance/loadtest/test_sim.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | ##
# Copyright (c) 2011-2015 Apple 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 l... | 35.263069 | 124 | 0.573669 |
d512574e77b62dc72cf8333a23d608a54620fda1 | 23,145 | py | Python | delfin/drivers/huawei/oceanstor/oceanstor.py | noelmcloughlin/delfin | 6dfa9bdb86d850410c82201f6fa621b4e5ea2917 | [
"Apache-2.0"
] | null | null | null | delfin/drivers/huawei/oceanstor/oceanstor.py | noelmcloughlin/delfin | 6dfa9bdb86d850410c82201f6fa621b4e5ea2917 | [
"Apache-2.0"
] | 3 | 2020-05-23T03:24:56.000Z | 2020-06-06T02:24:27.000Z | delfin/drivers/huawei/oceanstor/oceanstor.py | noelmcloughlin/delfin | 6dfa9bdb86d850410c82201f6fa621b4e5ea2917 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The SODA 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 to in wri... | 38.833893 | 79 | 0.52897 |
d5126695bf611875574610f0350f8c3323d61c51 | 4,545 | py | Python | SoftLayer/CLI/server/detail.py | briancline/softlayer-python | 679fb62ba2db095f0177f9d9488ff4a80c3b7387 | [
"MIT"
] | null | null | null | SoftLayer/CLI/server/detail.py | briancline/softlayer-python | 679fb62ba2db095f0177f9d9488ff4a80c3b7387 | [
"MIT"
] | null | null | null | SoftLayer/CLI/server/detail.py | briancline/softlayer-python | 679fb62ba2db095f0177f9d9488ff4a80c3b7387 | [
"MIT"
] | null | null | null | """Get details for a hardware device."""
# :license: MIT, see LICENSE for more details.
import SoftLayer
from SoftLayer.CLI import environment
from SoftLayer.CLI import formatting
from SoftLayer.CLI import helpers
from SoftLayer import utils
import click
@click.command()
@click.argument('identifier')
@click.option(... | 36.95122 | 79 | 0.60264 |
d5126b31918d203c793894d0039a77c522bbdd4f | 695 | py | Python | src/command_modules/azure-cli-keyvault/azure/cli/command_modules/keyvault/__init__.py | v-Ajnava/azure-cli | febec631d79bfca151e84267b5b409594bad598e | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-keyvault/azure/cli/command_modules/keyvault/__init__.py | v-Ajnava/azure-cli | febec631d79bfca151e84267b5b409594bad598e | [
"MIT"
] | 3 | 2021-03-26T00:48:20.000Z | 2022-03-29T22:05:39.000Z | src/command_modules/azure-cli-keyvault/azure/cli/command_modules/keyvault/__init__.py | v-Ajnava/azure-cli | febec631d79bfca151e84267b5b409594bad598e | [
"MIT"
] | 1 | 2017-12-28T04:51:44.000Z | 2017-12-28T04:51:44.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 46.333333 | 111 | 0.57554 |
d5126e70127df1dc38177538afb1fbe7d35c4fad | 1,239 | py | Python | DailyCodingProblem/139_Google_Create_Peekable_Iterator.py | RafayAK/CodingPrep | 718eccb439db0f6e727806964766a40e8234c8a9 | [
"MIT"
] | 5 | 2019-09-07T17:31:17.000Z | 2022-03-05T09:59:46.000Z | DailyCodingProblem/139_Google_Create_Peekable_Iterator.py | RafayAK/CodingPrep | 718eccb439db0f6e727806964766a40e8234c8a9 | [
"MIT"
] | null | null | null | DailyCodingProblem/139_Google_Create_Peekable_Iterator.py | RafayAK/CodingPrep | 718eccb439db0f6e727806964766a40e8234c8a9 | [
"MIT"
] | 2 | 2019-09-07T17:31:24.000Z | 2019-10-28T16:10:52.000Z | """
Given an iterator with methods next() and hasNext(), create a wrapper iterator, PeekableInterface,
which also implements peek(). peek shows the next element that would be returned on next().
Here is the interface:
class PeekableInterface(object):
def __init__(self, iterator):
pass
def peek(self):... | 22.125 | 98 | 0.627926 |
d5127a32aee34a0cac7c5fbeed2a2ae1155636c6 | 3,270 | py | Python | tests/tests/test_fields/test_mixins.py | intellineers/django-bridger | ed097984a99df7da40a4d01bd00c56e3c6083056 | [
"BSD-3-Clause"
] | 2 | 2020-03-17T00:53:23.000Z | 2020-07-16T07:00:33.000Z | tests/tests/test_fields/test_mixins.py | intellineers/django-bridger | ed097984a99df7da40a4d01bd00c56e3c6083056 | [
"BSD-3-Clause"
] | 76 | 2019-12-05T01:15:57.000Z | 2021-09-07T16:47:27.000Z | tests/tests/test_fields/test_mixins.py | intellineers/django-bridger | ed097984a99df7da40a4d01bd00c56e3c6083056 | [
"BSD-3-Clause"
] | 1 | 2020-02-05T15:09:47.000Z | 2020-02-05T15:09:47.000Z | import pytest
from rest_framework.exceptions import ValidationError
from rest_framework.fields import Field
from bridger.serializers.fields.mixins import BridgerSerializerFieldMixin
from ...models import ModelTest
class TestListField:
def setup_method(self):
class TestSubClass(BridgerSerializerFieldMixi... | 36.741573 | 109 | 0.635168 |
d512df9b1d80091c07fff7899daa548a136502a8 | 7,992 | py | Python | SciPy2016/VTKUtil.py | simpeg/simpegExamples | 38b8064fb854d809f72b7f1ca8b8096bca696af1 | [
"MIT"
] | 1 | 2021-08-07T13:46:54.000Z | 2021-08-07T13:46:54.000Z | SciPy2016/VTKUtil.py | simpeg/simpegExamples | 38b8064fb854d809f72b7f1ca8b8096bca696af1 | [
"MIT"
] | 1 | 2016-07-27T22:20:36.000Z | 2016-07-27T22:20:36.000Z | SciPy2016/VTKUtil.py | simpeg/simpegExamples | 38b8064fb854d809f72b7f1ca8b8096bca696af1 | [
"MIT"
] | null | null | null | # paperVTKUtil
# Functions used to make figure for the papers.
import numpy as np, sys, vtk, os, vtk.util.numpy_support as npsup
import time, matplotlib as mpl, gc
# from scipy.stats._support import unique as uniqueRows
def addAxes(screenSize,ren,xRange,yRange,zRange,axesBounds):
axes2 = vtk.vtkCubeAxesActor()
... | 34.899563 | 123 | 0.66967 |
d512e613edeb014da894b506d6219d6af2b8beed | 1,679 | py | Python | trax/optimizers/rms_prop.py | yakovkeselman/trax | 615432bbc58ffb5bdf83a771e8f8b470995456db | [
"Apache-2.0"
] | 1 | 2020-09-10T11:37:10.000Z | 2020-09-10T11:37:10.000Z | trax/optimizers/rms_prop.py | ZachT1711/trax | a0a3dd8d49e53fc48bb24cc08c10a8a53517e7bc | [
"Apache-2.0"
] | null | null | null | trax/optimizers/rms_prop.py | ZachT1711/trax | a0a3dd8d49e53fc48bb24cc08c10a8a53517e7bc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 The Trax 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 a... | 32.921569 | 90 | 0.702799 |
d512ece771974331efdd324f6e16d21ea99d915a | 2,712 | py | Python | cell.py | sjm446/aMAZEd | 38789f9898097991b19e686fd76ef4abd5bfe94c | [
"MIT"
] | 9 | 2017-06-19T01:30:01.000Z | 2022-01-14T22:48:57.000Z | cell.py | sjm446/aMAZEd | 38789f9898097991b19e686fd76ef4abd5bfe94c | [
"MIT"
] | 1 | 2019-05-22T06:52:34.000Z | 2019-05-22T06:52:34.000Z | cell.py | sjm446/aMAZEd | 38789f9898097991b19e686fd76ef4abd5bfe94c | [
"MIT"
] | 1 | 2021-04-30T13:55:50.000Z | 2021-04-30T13:55:50.000Z | """
Grid cell definition
MIT License
Copyright (c) 2017 Gaurav Mathur
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, m... | 30.818182 | 82 | 0.645649 |
d5131c8da7ce934692b4117c42a3931e61c5e47e | 23,843 | py | Python | sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/aio/operations/_data_flow_debug_session_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/aio/operations/_data_flow_debug_session_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/datafactory/azure-mgmt-datafactory/azure/mgmt/datafactory/aio/operations/_data_flow_debug_session_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# 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) AutoRe... | 45.851923 | 217 | 0.673028 |
d5135b8140c3e9a4eefddfce5426f3429125d583 | 929 | py | Python | tests/integration/dashboard/test_nav.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | tests/integration/dashboard/test_nav.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | tests/integration/dashboard/test_nav.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | from django.test import TestCase
from oscar.apps.dashboard.menu import get_nodes
from oscar.core.compat import get_user_model
User = get_user_model()
class TestCategory(TestCase):
def setUp(self):
self.staff_user = User.objects.create_user('staff', 'staff@example.com',
... | 33.178571 | 81 | 0.561895 |
d5135f6a3329b05e5db1093524c73ef4676a7c7f | 1,398 | py | Python | savu/test/travis/plugin_tests/fitter_tests/unregistered/reproduce_fit_test.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 39 | 2015-03-30T14:03:42.000Z | 2022-03-16T16:50:33.000Z | savu/test/travis/plugin_tests/fitter_tests/unregistered/reproduce_fit_test.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 670 | 2015-02-11T11:08:09.000Z | 2022-03-21T09:27:57.000Z | savu/test/travis/plugin_tests/fitter_tests/unregistered/reproduce_fit_test.py | elainehoml/Savu | e4772704606f71d6803d832084e10faa585e7358 | [
"Apache-2.0"
] | 54 | 2015-02-13T14:09:52.000Z | 2022-01-24T13:57:09.000Z | # Copyright 2014 Diamond Light Source Ltd.
#
# 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 t... | 33.285714 | 88 | 0.73319 |
d5136ba0e332229add88383d92ed6496723dd7f3 | 2,117 | py | Python | Cappellari/voronoi_2d_binning_example.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 1 | 2021-11-25T16:11:56.000Z | 2021-11-25T16:11:56.000Z | Cappellari/voronoi_2d_binning_example.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 6 | 2020-02-17T13:44:43.000Z | 2020-06-25T15:35:05.000Z | Cappellari/voronoi_2d_binning_example.py | Hoseung/pyRamAn | f9386fa5a9f045f98590039988d3cd50bc488dc2 | [
"MIT"
] | 1 | 2021-11-25T16:11:56.000Z | 2021-11-25T16:11:56.000Z | #!/usr/bin/env python
"""
Copyright (C) 2003-2014, Michele Cappellari
E-mail: michele.cappellari_at_physics.ox.ac.uk
V1.0.0: Michele Cappellari, Vicenza, 13 February 2003
V1.0.1: Use astro library routines to read and write files.
MC, Leiden, 24 July 2003
V2.0.0: Translated from IDL into Python. M... | 35.283333 | 99 | 0.648087 |
d51373353a86686d68a94633236b178a121fd52c | 17,944 | py | Python | sdk/core/azure-core/azure/core/pipeline/transport/base.py | OlhaTkachenko/azure-sdk-for-python | 0e43638457cc0c44d4a5e4a287fb4e53674b3231 | [
"MIT"
] | null | null | null | sdk/core/azure-core/azure/core/pipeline/transport/base.py | OlhaTkachenko/azure-sdk-for-python | 0e43638457cc0c44d4a5e4a287fb4e53674b3231 | [
"MIT"
] | null | null | null | sdk/core/azure-core/azure/core/pipeline/transport/base.py | OlhaTkachenko/azure-sdk-for-python | 0e43638457cc0c44d4a5e4a287fb4e53674b3231 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), ... | 36.620408 | 127 | 0.606331 |
d5138cefa40c8b9614ed5e3930dee24494db97af | 3,136 | py | Python | features/steps/descriptors_are_drawn_to_the_display.py | tonyroberts/project-tetra-display | ada1169d3884e61c06e90fe50a9886b50564c7dd | [
"MIT"
] | 4 | 2020-07-29T09:18:16.000Z | 2021-05-19T22:31:23.000Z | features/steps/descriptors_are_drawn_to_the_display.py | tonyroberts/project-tetra-display | ada1169d3884e61c06e90fe50a9886b50564c7dd | [
"MIT"
] | 44 | 2020-07-29T09:12:07.000Z | 2021-07-04T01:50:57.000Z | features/steps/descriptors_are_drawn_to_the_display.py | tonyroberts/project-tetra-display | ada1169d3884e61c06e90fe50a9886b50564c7dd | [
"MIT"
] | 4 | 2020-07-31T20:02:47.000Z | 2021-05-14T08:48:38.000Z | from behave import given, when, then
import math
import os
from tetra_constants import DESCRIPTORS, DESCRIPTORS_HTML, NUMBER_OF_PATIENTS
@given("a file named {file} exists in {static_directory}")
def step_impl(context, file, static_directory):
try:
with open(static_directory + file):
pass
... | 41.813333 | 78 | 0.669005 |
d5139200feea287b32024bbb0e9b96e12af6a0c0 | 8,990 | py | Python | tests/test_lib_logging.py | kusanagi/kusanagi-sdk-python | 4fd6843f39fa271afc7588b5ec58e7758b09fd61 | [
"MIT"
] | 1 | 2022-02-24T19:02:28.000Z | 2022-02-24T19:02:28.000Z | tests/test_lib_logging.py | jeronimoalbi/kusanagi-sdk-python | 4fd6843f39fa271afc7588b5ec58e7758b09fd61 | [
"MIT"
] | null | null | null | tests/test_lib_logging.py | jeronimoalbi/kusanagi-sdk-python | 4fd6843f39fa271afc7588b5ec58e7758b09fd61 | [
"MIT"
] | 1 | 2021-05-16T17:40:21.000Z | 2021-05-16T17:40:21.000Z | # Python 3 SDK for the KUSANAGI(tm) framework (http://kusanagi.io)
# Copyright (c) 2016-2021 KUSANAGI S.L. All rights reserved.
#
# Distributed under the MIT license.
#
# For the full copyright and license information, please view the LICENSE
# file that was distributed with this source code.
import logging
def test_... | 30.06689 | 78 | 0.691101 |
d513be75f708cb57aa8a713a6b2cfc080231ae96 | 5,848 | py | Python | test/vanilla/legacy/AcceptanceTests/asynctests/test_xms_error.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 35 | 2018-04-03T12:15:53.000Z | 2022-03-11T14:03:34.000Z | test/vanilla/legacy/AcceptanceTests/asynctests/test_xms_error.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 652 | 2017-08-28T22:44:41.000Z | 2022-03-31T21:20:31.000Z | test/vanilla/legacy/AcceptanceTests/asynctests/test_xms_error.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 29 | 2017-08-28T20:57:01.000Z | 2022-03-11T14:03:38.000Z | # --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), ... | 43.318519 | 137 | 0.70725 |
d514267a0232a0900f9c0120454e41932a4439eb | 1,292 | py | Python | test/test_inline_response2005.py | pallavigopi/esper-client-py | f7e71d3f25a5d91f35628b414e8abe9e6849d316 | [
"Apache-2.0"
] | null | null | null | test/test_inline_response2005.py | pallavigopi/esper-client-py | f7e71d3f25a5d91f35628b414e8abe9e6849d316 | [
"Apache-2.0"
] | null | null | null | test/test_inline_response2005.py | pallavigopi/esper-client-py | f7e71d3f25a5d91f35628b414e8abe9e6849d316 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Esper APIs
OpenAPI spec version: 1.0.0
Contact: developer@esper.io
---------------------------------------------------------
Copyright 2019 Shoonya Enterprises Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Yo... | 24.377358 | 75 | 0.722136 |
d5145642c187075680681c1648ff2c93cd61b446 | 548 | py | Python | werobot/tests/test_logger.py | shenglihu/WeRoBot | 6fd376e3055d0c132720ebe8cc5d442072a2171b | [
"MIT"
] | 1,904 | 2018-04-26T02:05:13.000Z | 2022-03-31T11:38:46.000Z | werobot/tests/test_logger.py | shenglihu/WeRoBot | 6fd376e3055d0c132720ebe8cc5d442072a2171b | [
"MIT"
] | 422 | 2018-05-02T14:56:00.000Z | 2022-03-29T00:20:01.000Z | werobot/tests/test_logger.py | shenglihu/WeRoBot | 6fd376e3055d0c132720ebe8cc5d442072a2171b | [
"MIT"
] | 393 | 2018-04-28T15:02:09.000Z | 2022-03-25T16:24:16.000Z | import time
import logging
from werobot.logger import enable_pretty_logging, _LogFormatter
def get_new_logger():
return logging.getLogger(str(time.time()))
def test_logger_level():
for level in ('debug', 'info', 'warning', 'error'):
logger = get_new_logger()
enable_pretty_logging(logger, le... | 24.909091 | 66 | 0.720803 |
d5147774a7e8900bafcafc7464a6c7e71f642e9f | 10,537 | py | Python | lib/datasets/imdb.py | yjy941124/PPR-FCN | 1eba5515b37e7b32413efdf14bb0c22a2e46fee9 | [
"MIT"
] | 20 | 2017-10-16T18:12:51.000Z | 2021-12-23T02:34:20.000Z | lib/datasets/imdb.py | yjy941124/PPR-FCN | 1eba5515b37e7b32413efdf14bb0c22a2e46fee9 | [
"MIT"
] | 1 | 2018-11-10T04:59:48.000Z | 2021-01-21T04:51:31.000Z | lib/datasets/imdb.py | yjy941124/PPR-FCN | 1eba5515b37e7b32413efdf14bb0c22a2e46fee9 | [
"MIT"
] | 5 | 2017-10-17T00:54:42.000Z | 2018-04-08T15:09:40.000Z | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
import os
import os.path as osp
import PIL
from utils.cython_bbox impor... | 39.025926 | 113 | 0.528898 |
d5148e685a92e1c28f8776d27a9424fd47502581 | 4,350 | py | Python | main.py | xinhecuican/tiny-face-tensor-flow | 03287b0d86e7d1332a61c1b22793655e41d01cca | [
"MIT"
] | null | null | null | main.py | xinhecuican/tiny-face-tensor-flow | 03287b0d86e7d1332a61c1b22793655e41d01cca | [
"MIT"
] | null | null | null | main.py | xinhecuican/tiny-face-tensor-flow | 03287b0d86e7d1332a61c1b22793655e41d01cca | [
"MIT"
] | null | null | null | import argparse
import os
import os.path as osp
import time
from torch.backends import cudnn
import torch
from torch import optim
from torchvision import transforms
import trainer
from DataLoaderX import DataLoaderX
from data_prefetcher import data_prefetcher
from datasets import get_dataloader
from models.EdgeNet imp... | 39.189189 | 103 | 0.658161 |
d514a88c14600d59da423bea9d598846766739fd | 1,951 | py | Python | examples/tkinter_gui.py | ttracx/ChatterBot | ec6cb0ae09304ddac7bef9c3dcf9b148b7568d76 | [
"BSD-3-Clause"
] | 1 | 2016-05-21T21:26:15.000Z | 2016-05-21T21:26:15.000Z | examples/tkinter_gui.py | ttracx/ChatterBot | ec6cb0ae09304ddac7bef9c3dcf9b148b7568d76 | [
"BSD-3-Clause"
] | null | null | null | examples/tkinter_gui.py | ttracx/ChatterBot | ec6cb0ae09304ddac7bef9c3dcf9b148b7568d76 | [
"BSD-3-Clause"
] | null | null | null | import Tkinter as tk
import ttk as ttk
import ScrolledText
import time
from chatterbot import ChatBot
class TkinterGUIExample(tk.Tk):
def __init__( self, *args, **kwargs ):
'''
Create & set window variables.
'''
tk.Tk.__init__( self, *args, **kwargs )
self.chatbot = ChatB... | 31.467742 | 112 | 0.61917 |
d514b5988ead77ce35049ea13a860b48052eb2cc | 32 | py | Python | networks/__init__.py | naivete5656/WSISPDR | 1dc4d1bf24a6ebf7efd3c75d3f1a9edbe849d38b | [
"MIT"
] | 37 | 2019-10-09T09:42:24.000Z | 2022-03-29T09:57:29.000Z | networks/__init__.py | naivete5656/WSISPDR | 1dc4d1bf24a6ebf7efd3c75d3f1a9edbe849d38b | [
"MIT"
] | 4 | 2020-02-26T06:49:02.000Z | 2021-10-17T16:29:24.000Z | networks/__init__.py | naivete5656/WSISPDR | 1dc4d1bf24a6ebf7efd3c75d3f1a9edbe849d38b | [
"MIT"
] | 4 | 2019-10-18T07:34:30.000Z | 2020-04-10T03:35:34.000Z | from .network_model import UNet
| 16 | 31 | 0.84375 |
d514c1df779d5429d2d81a90b48d63e0b17c3164 | 1,227 | py | Python | web-frontend-demo/flask_example.py | Jack-Shen/fwd_python_api | d9fd0dfb0dfb6eb8755058028ebe2a09e4835442 | [
"MIT"
] | null | null | null | web-frontend-demo/flask_example.py | Jack-Shen/fwd_python_api | d9fd0dfb0dfb6eb8755058028ebe2a09e4835442 | [
"MIT"
] | null | null | null | web-frontend-demo/flask_example.py | Jack-Shen/fwd_python_api | d9fd0dfb0dfb6eb8755058028ebe2a09e4835442 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, flash, request
import sys
import json
import os
#set up network
network = 137407
#define network here
###########################
import logging
import sys
sys.path.append("..")
import fwd_json
from fwd_json import fwdApi
try:
username = os.environ['fwd_saas_user']
... | 26.673913 | 115 | 0.660147 |
d514c9fa1e1c74fbce5255ffeae3e8f084ad3f38 | 998 | py | Python | config/settings_template.py | project-nichijou/spider-common | ad7344ec156a9fe6fdd143aaf4d3435b19271ed8 | [
"MIT"
] | null | null | null | config/settings_template.py | project-nichijou/spider-common | ad7344ec156a9fe6fdd143aaf4d3435b19271ed8 | [
"MIT"
] | null | null | null | config/settings_template.py | project-nichijou/spider-common | ad7344ec156a9fe6fdd143aaf4d3435b19271ed8 | [
"MIT"
] | 1 | 2021-07-11T13:49:58.000Z | 2021-07-11T13:49:58.000Z | # whether auto update the local saved cookies
COOKIES_AUTO_UPDATE = True
# whether use debug mode for cookies
COOKIES_DEBUG = True
# database settings
DATABASE_CONFIG = {
'host': 'your_host',
'user': 'your_user',
'password': 'your_password',
'port': 3306,
'database': 'bangumi'
}
# request headers
HEADERS = {
'... | 32.193548 | 149 | 0.670341 |
d515447b5dd95803ad117a8a94ea83418a40cf4f | 1,241 | py | Python | pml/supervised/decision_trees/__init__.py | ashadhaz/pml | 8d9261c8885a82d795c89de23f53ff7d05ef9495 | [
"MIT"
] | 2 | 2018-03-21T16:26:16.000Z | 2020-10-27T02:45:11.000Z | pml/supervised/decision_trees/__init__.py | ashadhaz/pml | 8d9261c8885a82d795c89de23f53ff7d05ef9495 | [
"MIT"
] | null | null | null | pml/supervised/decision_trees/__init__.py | ashadhaz/pml | 8d9261c8885a82d795c89de23f53ff7d05ef9495 | [
"MIT"
] | 4 | 2015-02-25T16:19:05.000Z | 2021-02-06T06:36:46.000Z | # Copyright (C) 2012 David Rusk
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distr... | 45.962963 | 79 | 0.77357 |
d5157859af8b398da8c589f60c81c47b7db28334 | 2,484 | py | Python | continual_learning/lr_multiplier.py | YifanQie/Deep_Learning_for_Manufacturing | 9ba19e41f69c561b04b8573ab9c52c0969f45bfd | [
"MIT"
] | 27 | 2019-10-31T15:16:13.000Z | 2022-03-29T03:56:57.000Z | continual_learning/lr_multiplier.py | YifanQie/Deep_Learning_for_Manufacturing | 9ba19e41f69c561b04b8573ab9c52c0969f45bfd | [
"MIT"
] | 4 | 2020-03-25T14:18:04.000Z | 2022-02-10T00:34:58.000Z | continual_learning/lr_multiplier.py | YifanQie/Deep_Learning_for_Manufacturing | 9ba19e41f69c561b04b8573ab9c52c0969f45bfd | [
"MIT"
] | 7 | 2020-02-23T22:12:37.000Z | 2021-12-08T20:14:41.000Z | from tensorflow.keras.optimizers import Optimizer
from tensorflow.keras.utils import get_custom_objects
class LearningRateMultiplier(Optimizer):
"""Optimizer wrapper for per layer learning rate.
This wrapper is used to add per layer learning rates by
providing per layer factors which are multiplied with t... | 39.428571 | 79 | 0.662641 |
d515b826843db15fad4ccda2f2b8e368c9b79b32 | 3,270 | py | Python | packages/python/pyfora/worker/Worker.py | ufora/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 571 | 2015-11-05T20:07:07.000Z | 2022-01-24T22:31:09.000Z | packages/python/pyfora/worker/Worker.py | timgates42/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 218 | 2015-11-05T20:37:55.000Z | 2021-05-30T03:53:50.000Z | packages/python/pyfora/worker/Worker.py | timgates42/ufora | 04db96ab049b8499d6d6526445f4f9857f1b6c7e | [
"Apache-2.0",
"CC0-1.0",
"MIT",
"BSL-1.0",
"BSD-3-Clause"
] | 40 | 2015-11-07T21:42:19.000Z | 2021-05-23T03:48:19.000Z | # Copyright 2016 Ufora Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 34.421053 | 112 | 0.655046 |
d515ec23f58d7622f24ca46ad1afa0a9b02a9829 | 5,588 | py | Python | tests/st/ops/ascend/vector/test_fused_minimum_or_maximum_grad_001.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | tests/st/ops/ascend/vector/test_fused_minimum_or_maximum_grad_001.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | tests/st/ops/ascend/vector/test_fused_minimum_or_maximum_grad_001.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.000Z | # Copyright 2019 Huawei Technologies Co., Ltd
#
# 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... | 55.88 | 136 | 0.590909 |
d5161c3f859cf3b662cd3ac06de7428f585c7535 | 3,409 | py | Python | scyllaso/common.py | bhalevy/scylla-stress-orchestrator | 89fb3f55a48af69bf0ea6d694b97fd4185503100 | [
"Apache-2.0"
] | 3 | 2021-04-06T16:06:41.000Z | 2021-10-05T09:53:11.000Z | scyllaso/common.py | bhalevy/scylla-stress-orchestrator | 89fb3f55a48af69bf0ea6d694b97fd4185503100 | [
"Apache-2.0"
] | 32 | 2021-04-19T08:01:27.000Z | 2021-12-08T12:38:44.000Z | scyllaso/common.py | bhalevy/scylla-stress-orchestrator | 89fb3f55a48af69bf0ea6d694b97fd4185503100 | [
"Apache-2.0"
] | 5 | 2021-05-18T18:12:38.000Z | 2021-12-29T08:36:43.000Z | import os
import yaml
import subprocess
import time
from datetime import datetime
from scyllaso.ssh import SSH
from scyllaso.util import run_parallel
def load_yaml(*files):
result = {}
l = []
for file in files:
l.append(file)
l.reverse()
for file in l:
with open(file) as f:
... | 38.738636 | 126 | 0.60751 |
d51640630a768d9075285cd8102ac38543f6fd48 | 3,206 | py | Python | .local/lib/python/termsaverlib/screen/programmer.py | kran0/dotfiles | 17d302ea49cca3718243ba9d94e068d2d96ce669 | [
"MIT"
] | null | null | null | .local/lib/python/termsaverlib/screen/programmer.py | kran0/dotfiles | 17d302ea49cca3718243ba9d94e068d2d96ce669 | [
"MIT"
] | null | null | null | .local/lib/python/termsaverlib/screen/programmer.py | kran0/dotfiles | 17d302ea49cca3718243ba9d94e068d2d96ce669 | [
"MIT"
] | null | null | null | ###############################################################################
#
# file: programmer.py
#
# Purpose: refer to module documentation for details
#
# Note: This file is part of Termsaver application, and should not be used
# or executed separately.
#
#####################################... | 34.473118 | 79 | 0.637867 |
d5164366fdad9128503b54fa3eca72a12d9c9955 | 3,802 | py | Python | gui/fdafileviewer.py | dblanchet/pyfda | 594e9b4575b065fd16f2defc007e5100e5f11a26 | [
"Unlicense"
] | 1 | 2015-08-05T09:02:06.000Z | 2015-08-05T09:02:06.000Z | gui/fdafileviewer.py | dblanchet/pyfda | 594e9b4575b065fd16f2defc007e5100e5f11a26 | [
"Unlicense"
] | null | null | null | gui/fdafileviewer.py | dblanchet/pyfda | 594e9b4575b065fd16f2defc007e5100e5f11a26 | [
"Unlicense"
] | null | null | null | # -+- encoding: utf-8 -+-
try:
import Tkinter as tk
except ImportError:
import tkinter as tk
try:
from tkFileDialog import askopenfilename
except ImportError:
from tkinter.filedialog import askopenfilename
from gui.fdaflightlist import FdaFlightList
from gui.fdaflightview import FdaFlightView
from gu... | 30.416 | 75 | 0.648606 |
d516484bce141131cf0605f34afd1017d6ae98f8 | 1,764 | py | Python | Python/priorityQueue/PriorityQueueDemo.py | MatteoEsposito/ProgettoInItinereII-IngegneriaDegliAlgoritmi- | c37543d2bc1919d0cdad98dbc018eaf65f221cdf | [
"MIT"
] | null | null | null | Python/priorityQueue/PriorityQueueDemo.py | MatteoEsposito/ProgettoInItinereII-IngegneriaDegliAlgoritmi- | c37543d2bc1919d0cdad98dbc018eaf65f221cdf | [
"MIT"
] | null | null | null | Python/priorityQueue/PriorityQueueDemo.py | MatteoEsposito/ProgettoInItinereII-IngegneriaDegliAlgoritmi- | c37543d2bc1919d0cdad98dbc018eaf65f221cdf | [
"MIT"
] | null | null | null | from PQ_Dheap import PQ_DHeap
from PQbinaryHeap import PQbinaryHeap
from PQbinomialHeap import PQbinomialHeap
from time import time
from random import randrange
def testPQ1(pqType, collection, d=None):
"""Definisce il test da svolgere sulle code con priorita'.
Collection sara' una lista del tipo:[ (elem,key)... | 30.413793 | 75 | 0.619048 |
d5168d11b662c926e136e10fd7540a4e4b8b20b6 | 8,609 | py | Python | createCustomStandard.py | aws-samples/aws-audit-manager-custom-frameworks | 8aa6aaae941df23ebe651041800d9c93b3273b03 | [
"MIT-0"
] | 9 | 2021-07-11T00:35:12.000Z | 2022-02-15T23:18:38.000Z | createCustomStandard.py | QPC-database/aws-audit-manager-custom-frameworks | 24d9662748a0c4c557250211edc6323c0ada18c2 | [
"MIT-0"
] | null | null | null | createCustomStandard.py | QPC-database/aws-audit-manager-custom-frameworks | 24d9662748a0c4c557250211edc6323c0ada18c2 | [
"MIT-0"
] | 2 | 2021-07-07T18:51:29.000Z | 2021-07-11T00:35:13.000Z | # Core python packages
import logging
# 3rd party packages - see requirements.txt
import boto3
import botocore.exceptions
# src python
from utils import *
# Create custom assessment framework in Audit Manager
def create_custom_framework(
custom_report_name: str = None,
description: str = None,
... | 41.995122 | 96 | 0.578232 |
d5168ee1aea3394027a755e3049a1a2628976dc6 | 9,554 | py | Python | diploshic/makeFeatureVecsForSingleMs_ogSHIC.py | peterdfields/diploSHIC | b204cc71a946be6093fab0336599ceecff04d651 | [
"MIT"
] | 21 | 2018-02-03T16:30:15.000Z | 2020-06-03T12:01:28.000Z | diploshic/makeFeatureVecsForSingleMs_ogSHIC.py | peterdfields/diploSHIC | b204cc71a946be6093fab0336599ceecff04d651 | [
"MIT"
] | 23 | 2018-05-15T01:59:53.000Z | 2020-06-02T20:04:26.000Z | diploshic/makeFeatureVecsForSingleMs_ogSHIC.py | peterdfields/diploSHIC | b204cc71a946be6093fab0336599ceecff04d651 | [
"MIT"
] | 10 | 2018-08-26T15:05:25.000Z | 2020-04-13T08:07:20.000Z | import sys
import allel
import random
import numpy as np
import diploshic.msTools as msTools
import diploshic.fvTools as fvTools
import time
"""usage example
python makeFeatureVecsForSingleMsFileDiploid.py /san/data/dan/simulations/discoal_multipopStuff/spatialSVMSims/trainingSets/equilibNeut.msout.gz 110000 11 /san/d... | 34.243728 | 374 | 0.622566 |
d516b142667063b22ea7fd1fef392281603157e2 | 2,738 | py | Python | webhook_telegram_bot/database/models.py | toolen/webhook-telegram-bot | c2ef4e7a6cf0f78c0341d3d645e516440596569f | [
"MIT"
] | null | null | null | webhook_telegram_bot/database/models.py | toolen/webhook-telegram-bot | c2ef4e7a6cf0f78c0341d3d645e516440596569f | [
"MIT"
] | 1 | 2022-02-01T18:18:28.000Z | 2022-02-01T18:18:28.000Z | webhook_telegram_bot/database/models.py | toolen/webhook-telegram-bot | c2ef4e7a6cf0f78c0341d3d645e516440596569f | [
"MIT"
] | null | null | null | """This file contains independent database models."""
from __future__ import annotations
from typing import Any, Callable, Generator, List, Optional, Type, Union
from bson import ObjectId
from pydantic import BaseModel, Field
class PydanticObjectId(ObjectId): # type: ignore
"""This class provide pydantic compa... | 27.108911 | 78 | 0.6187 |
d516dc08620fcc04e97403656c37fb1b90ffaae3 | 356 | py | Python | src/models/ModelTrain.py | IUS-CS/s22-project-breakneck | 80d462e375256a44d83d16a187b423c32b0496d4 | [
"MIT"
] | null | null | null | src/models/ModelTrain.py | IUS-CS/s22-project-breakneck | 80d462e375256a44d83d16a187b423c32b0496d4 | [
"MIT"
] | 2 | 2022-03-08T21:32:31.000Z | 2022-03-28T05:37:36.000Z | src/models/ModelTrain.py | IUS-CS/s22-project-breakneck | 80d462e375256a44d83d16a187b423c32b0496d4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Feb 21 17:48:10 2022
"""
from AutoEncoder import auto_encoder_train
from GAN32 import gan32_train
from GAN64 import gan64_train
from tensorflow.keras import backend as K
K.clear_session()
#train auto encoder
#auto_encoder_train(20, 3000)
#train GAN32
gan32_train(20, 1000)
... | 16.952381 | 42 | 0.758427 |
d5170ad2036f9a5dc3d748298b8edd068d42dea3 | 5,219 | py | Python | dataprep/clean/clean_es_referenciacatastral.py | Waterpine/dataprep-1 | 4032acb1d1f2c413d4cb000d17e8ffa611315f9f | [
"MIT"
] | 1,229 | 2019-12-21T02:58:59.000Z | 2022-03-30T08:12:33.000Z | dataprep/clean/clean_es_referenciacatastral.py | Waterpine/dataprep-1 | 4032acb1d1f2c413d4cb000d17e8ffa611315f9f | [
"MIT"
] | 680 | 2019-12-19T06:09:23.000Z | 2022-03-31T04:15:25.000Z | dataprep/clean/clean_es_referenciacatastral.py | Waterpine/dataprep-1 | 4032acb1d1f2c413d4cb000d17e8ffa611315f9f | [
"MIT"
] | 170 | 2020-01-08T03:27:26.000Z | 2022-03-20T20:42:55.000Z | """
Clean and validate a DataFrame column containing Spanish real state ids.
"""
# pylint: disable=too-many-lines, too-many-arguments, too-many-branches
from typing import Any, Union
from operator import itemgetter
import dask.dataframe as dd
import numpy as np
import pandas as pd
from stdnum.es import referenciacata... | 32.018405 | 99 | 0.634796 |
d51710fe4023525b8b3fdd8eafd885a2444df5db | 4,259 | py | Python | examples/rotating_frame_condensate/with_extra_vortices/run.py | chrisjbillington/parpde | 4f882cbbb9ad6c57814e4422e9ba063fa27886a0 | [
"BSD-2-Clause"
] | null | null | null | examples/rotating_frame_condensate/with_extra_vortices/run.py | chrisjbillington/parpde | 4f882cbbb9ad6c57814e4422e9ba063fa27886a0 | [
"BSD-2-Clause"
] | null | null | null | examples/rotating_frame_condensate/with_extra_vortices/run.py | chrisjbillington/parpde | 4f882cbbb9ad6c57814e4422e9ba063fa27886a0 | [
"BSD-2-Clause"
] | null | null | null | # Example file that finds the groundstate of a condensate in a rotating frame.
# Takes quite some time to run so you can just stop it when you run out of
# patience and run the plotting script.
# Run with 'mpirun -n <N CPUs> python run.py'
from __future__ import division, print_function
import sys
sys.path.insert(0, ... | 37.359649 | 103 | 0.623855 |
d517340097541f8f6516d24692dee01a7d3ae23a | 2,266 | py | Python | solutions/day18.py | rds504/AoC-2021 | a96bcdc941144dcd4b6d9c5192b4e659a1f5950f | [
"MIT"
] | null | null | null | solutions/day18.py | rds504/AoC-2021 | a96bcdc941144dcd4b6d9c5192b4e659a1f5950f | [
"MIT"
] | null | null | null | solutions/day18.py | rds504/AoC-2021 | a96bcdc941144dcd4b6d9c5192b4e659a1f5950f | [
"MIT"
] | null | null | null | from copy import deepcopy
from functools import reduce
from itertools import permutations
from tools.general import load_strings
def parse_sailfish_num(num_str):
# Snailfish numbers use a Python-style notation, so we can just avert our eyes and...
return eval(num_str)
def try_explode(number, ancestors=None):
... | 23.122449 | 90 | 0.576346 |
d5178e620171130d36aa64b52a2399e4bd5b3911 | 132 | py | Python | bflib/monsters/insects/base.py | ChrisLR/BasicDungeonRL | b293d40bd9a0d3b7aec41b5e1d58441165997ff1 | [
"MIT"
] | 3 | 2017-10-28T11:28:38.000Z | 2018-09-12T09:47:00.000Z | bflib/monsters/insects/base.py | ChrisLR/BasicDungeonRL | b293d40bd9a0d3b7aec41b5e1d58441165997ff1 | [
"MIT"
] | null | null | null | bflib/monsters/insects/base.py | ChrisLR/BasicDungeonRL | b293d40bd9a0d3b7aec41b5e1d58441165997ff1 | [
"MIT"
] | null | null | null | from bflib.monsters import listing
from bflib.monsters.base import Monster
@listing.register_type
class Insect(Monster):
pass
| 16.5 | 39 | 0.80303 |
d517aed68723e88ef9384d995f18e7a51b42d76f | 1,189 | py | Python | office365/teams/chatMessage.py | wreiner/Office365-REST-Python-Client | 476bbce4f5928a140b4f5d33475d0ac9b0783530 | [
"MIT"
] | null | null | null | office365/teams/chatMessage.py | wreiner/Office365-REST-Python-Client | 476bbce4f5928a140b4f5d33475d0ac9b0783530 | [
"MIT"
] | null | null | null | office365/teams/chatMessage.py | wreiner/Office365-REST-Python-Client | 476bbce4f5928a140b4f5d33475d0ac9b0783530 | [
"MIT"
] | null | null | null | from office365.entity import Entity
from office365.runtime.client_value_collection import ClientValueCollection
from office365.runtime.resource_path import ResourcePath
from office365.teams.chatMessageAttachment import ChatMessageAttachment
class ChatMessage(Entity):
@property
def attachments(self):
... | 31.289474 | 99 | 0.682086 |
d517c3be074b80f5704fdaaafb263a060b3ea9c8 | 687 | py | Python | tutorial/spiders/going-spider.py | johannott/horses_scraper | 7d65b845c7ba97cfd969dfe75fffa978655ac46f | [
"MIT"
] | null | null | null | tutorial/spiders/going-spider.py | johannott/horses_scraper | 7d65b845c7ba97cfd969dfe75fffa978655ac46f | [
"MIT"
] | null | null | null | tutorial/spiders/going-spider.py | johannott/horses_scraper | 7d65b845c7ba97cfd969dfe75fffa978655ac46f | [
"MIT"
] | null | null | null | import scrapy
from scrapy.loader import ItemLoader
from tutorial.items import TrackItem
class GoingSpider(scrapy.Spider):
name = "going"
start_urls = [
'http://maps.turftrax.co.uk/latestgoingreport.asp?course=Cheltenham'
]
def parse(self, response):
going = response.css('td.... | 28.625 | 76 | 0.631732 |
d517e5474d4cba3ed1db60f32c4441e32bb11be2 | 300 | py | Python | cloudmesh_job/command_job.py | cloudmesh/pbs | 6cc56f499afccf519616a6fef75705c5f5b4af6e | [
"Apache-2.0"
] | 4 | 2016-03-30T08:22:19.000Z | 2020-09-08T14:52:05.000Z | cloudmesh_job/command_job.py | cloudmesh/pbs | 6cc56f499afccf519616a6fef75705c5f5b4af6e | [
"Apache-2.0"
] | 3 | 2021-03-19T22:57:11.000Z | 2021-03-25T22:14:37.000Z | cloudmesh_job/command_job.py | cloudmesh/pbs | 6cc56f499afccf519616a6fef75705c5f5b4af6e | [
"Apache-2.0"
] | 4 | 2015-05-18T23:53:04.000Z | 2015-08-22T17:10:40.000Z | from cloudmesh_job.cm_jobdb import JobDB
class CommandJob(object):
@classmethod
def start(cls):
db = JobDB()
db.start()
Console.ok("job server start")
@classmethod
def stop(cls):
db = JobDB()
db.stop()
Console.ok("job server stop")
| 17.647059 | 40 | 0.573333 |
d517f8208219d8b1bba9af3cd291b52ce94bb543 | 2,273 | py | Python | adapters/pox/ext/debugger/elt/of_01_debug/proxy_controller.py | ARCCN/elt | 3bf4e6cc0c7abbe442d6513ed294e956143c3bea | [
"BSD-3-Clause"
] | 1 | 2016-07-14T14:45:56.000Z | 2016-07-14T14:45:56.000Z | adapters/pox/ext/debugger/elt/of_01_debug/proxy_controller.py | ARCCN/elt | 3bf4e6cc0c7abbe442d6513ed294e956143c3bea | [
"BSD-3-Clause"
] | null | null | null | adapters/pox/ext/debugger/elt/of_01_debug/proxy_controller.py | ARCCN/elt | 3bf4e6cc0c7abbe442d6513ed294e956143c3bea | [
"BSD-3-Clause"
] | null | null | null | from ..database import DatabaseClient
from ..debuggers import FlowTableController, FakeDebugger
from ..logger import LogClient
from ..util import app_logging
log = app_logging.getLogger('ProxyController')
class ProxyController(object):
"""
Main class for debugging CompetitionErrors and error localization.
... | 32.942029 | 75 | 0.597448 |
d5180875628eda2281bd4b3350fe7c3c5f787c93 | 9,144 | py | Python | drmaa/wrappers.py | dfornika/drmaa-python | 3023bec6533315a8b6d8cbd30b785c8793b41c85 | [
"BSD-3-Clause"
] | 79 | 2015-03-01T15:19:58.000Z | 2022-01-14T08:58:55.000Z | drmaa/wrappers.py | dfornika/drmaa-python | 3023bec6533315a8b6d8cbd30b785c8793b41c85 | [
"BSD-3-Clause"
] | 61 | 2015-04-08T07:10:34.000Z | 2021-10-06T10:24:23.000Z | drmaa/wrappers.py | drmaa-python/drmaa-python | ed6b926074d730f6fc37505360f65b8b79e8797f | [
"BSD-3-Clause"
] | 33 | 2015-04-04T10:22:08.000Z | 2021-07-22T13:15:51.000Z | # -----------------------------------------------------------
# Copyright (C) 2009 StatPro Italia s.r.l.
#
# StatPro Italia
# Via G. B. Vico 4
# I-20123 Milano
# ITALY
#
# phone: +39 02 96875 1
# fax: +39 02 96875 605
#
# email: info@riskmap.net
#
# This program is distributed in the hope that it will be
# ... | 39.584416 | 82 | 0.750547 |
d5187552dd2faa0f8c5ec31c662d96b98e5aea83 | 1,024 | py | Python | nicos_virt_mlz/panda/setups/special/watchdog.py | mlz-ictrl/nicos | a6de0bc194ba42e3dc04a033713b41b5499ba8e1 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 12 | 2019-11-06T15:40:36.000Z | 2022-01-01T16:23:00.000Z | nicos_virt_mlz/panda/setups/special/watchdog.py | ess-dmsc/nicos | 755d61d403ff7123f804c45fc80c7ff4d762993b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 91 | 2020-08-18T09:20:26.000Z | 2022-02-01T11:07:14.000Z | nicos_virt_mlz/panda/setups/special/watchdog.py | mlz-ictrl/nicos | a6de0bc194ba42e3dc04a033713b41b5499ba8e1 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 6 | 2020-01-11T10:52:30.000Z | 2022-02-25T12:35:23.000Z | description = 'setup for the NICOS watchdog'
group = 'special'
# The entries in this list are dictionaries. Possible keys:
#
# 'setup' -- setup that must be loaded (default '' to mean all setups)
# 'condition' -- condition for warning (a Python expression where cache keys
# can be used: t_value stands for t/value e... | 30.117647 | 80 | 0.657227 |
d518a45089e73f0172ae787447c8dee96b0756b4 | 12,171 | py | Python | hubspot3/base.py | Cobliteam/hubspot3 | 9a93a2938ca6b5ac065d722ed076df05d4377c80 | [
"MIT"
] | null | null | null | hubspot3/base.py | Cobliteam/hubspot3 | 9a93a2938ca6b5ac065d722ed076df05d4377c80 | [
"MIT"
] | 1 | 2021-10-21T13:45:44.000Z | 2021-10-21T13:47:39.000Z | hubspot3/base.py | Cobliteam/hubspot3 | 9a93a2938ca6b5ac065d722ed076df05d4377c80 | [
"MIT"
] | null | null | null | """
base hubspot client class
"""
import http.client
import json
import logging
import time
import traceback
import urllib.request
import urllib.parse
import urllib.error
import zlib
from typing import List, Union
from hubspot3 import utils
from hubspot3.utils import force_utf8
from hubspot3.error import (
HubspotB... | 33.902507 | 98 | 0.533646 |
d518e30692a1fb8a710b30b4610c3161ba438d6c | 7,195 | py | Python | monoport/lib/modeling/MonoPortNet.py | ArshdeepSahni/MonoPort | a67fdc02b4fb45b3cc187aa4ae34053574d0383c | [
"Unlicense"
] | 1 | 2021-01-15T09:42:29.000Z | 2021-01-15T09:42:29.000Z | monoport/lib/modeling/MonoPortNet.py | ArshdeepSahni/MonoPort | a67fdc02b4fb45b3cc187aa4ae34053574d0383c | [
"Unlicense"
] | null | null | null | monoport/lib/modeling/MonoPortNet.py | ArshdeepSahni/MonoPort | a67fdc02b4fb45b3cc187aa4ae34053574d0383c | [
"Unlicense"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from .geometry import index, orthogonal, perspective
from .normalizers import *
from .backbones import *
from .heads import *
class MonoPortNet(nn.Module):
def __init__(self, opt_net):
"""The geometry network
Arguments:
... | 34.261905 | 118 | 0.586935 |
d518fc0b6d3fbe9796fe42f738e3aa0db6dc98b2 | 1,562 | py | Python | morphomatics_med/manifold/__init__.py | MATHplus-Young-Academy/P3-Morph-Scoring | 0e2ba66cf28e30525b22706cc50d23b9de09a58a | [
"Apache-2.0"
] | 1 | 2022-03-16T20:15:16.000Z | 2022-03-16T20:15:16.000Z | morphomatics_med/manifold/__init__.py | MATHplus-Young-Academy/P3-Morph-Scoring | 0e2ba66cf28e30525b22706cc50d23b9de09a58a | [
"Apache-2.0"
] | null | null | null | morphomatics_med/manifold/__init__.py | MATHplus-Young-Academy/P3-Morph-Scoring | 0e2ba66cf28e30525b22706cc50d23b9de09a58a | [
"Apache-2.0"
] | null | null | null | ################################################################################
# #
# This file is part of the Morphomatics library #
# see https://github.com/morphomatics/morphomatics ... | 41.105263 | 80 | 0.483355 |
d51913ba26242f9a54dd54019e688fbfc4ded062 | 13,973 | py | Python | alipay/aop/api/domain/AlipayFincoreComplianceSignListApplyModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayFincoreComplianceSignListApplyModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayFincoreComplianceSignListApplyModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.PeopleOpenApiDTO import PeopleOpenApiDTO
from alipay.aop.api.domain.SignApproveOpenApiDTO import SignApproveOpenApiDTO
from alipay.aop.api.domain.SignFileOpenApiDTO import SignFileO... | 35.554707 | 96 | 0.600372 |
d51931c06917c2bd9c882b21e54a47f877cce169 | 4,019 | py | Python | test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/requiredoptional/aio/_auto_rest_required_optional_test_service.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 35 | 2018-04-03T12:15:53.000Z | 2022-03-11T14:03:34.000Z | test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/requiredoptional/aio/_auto_rest_required_optional_test_service.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 652 | 2017-08-28T22:44:41.000Z | 2022-03-31T21:20:31.000Z | test/vanilla/legacy/Expected/AcceptanceTests/RequiredOptional/requiredoptional/aio/_auto_rest_required_optional_test_service.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 29 | 2017-08-28T20:57:01.000Z | 2022-03-11T14:03:38.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 ... | 44.164835 | 106 | 0.694949 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.