hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | 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 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a121293dfbdfc6387178bb484e2ea480fca7d027 | 2,504 | py | Python | config_args.py | wenting-zhao/cs6741_replication | fbd8275793c5d2b097458c68bc3bba00144665aa | [
"MIT"
] | null | null | null | config_args.py | wenting-zhao/cs6741_replication | fbd8275793c5d2b097458c68bc3bba00144665aa | [
"MIT"
] | null | null | null | config_args.py | wenting-zhao/cs6741_replication | fbd8275793c5d2b097458c68bc3bba00144665aa | [
"MIT"
] | null | null | null | import os.path as path
import os
def get_args(parser):
parser.add_argument('--dataset', type=str, required=True)
parser.add_argument("--data_dir", type=str, required=True)
parser.add_argument("--output_dir", type=str)
parser.add_argument('--encoder', type=str, choices=['lstm', 'average'], required=Tr... | 45.527273 | 124 | 0.703674 |
b1abc9e7b1923d2e56f452c6891ddaa959d95b40 | 24,247 | py | Python | src/main/python/apache/aurora/client/commands/core.py | wickman/incubator-aurora | 9906d217093568ed4c9cfe620862818f15ce4150 | [
"Apache-2.0"
] | null | null | null | src/main/python/apache/aurora/client/commands/core.py | wickman/incubator-aurora | 9906d217093568ed4c9cfe620862818f15ce4150 | [
"Apache-2.0"
] | null | null | null | src/main/python/apache/aurora/client/commands/core.py | wickman/incubator-aurora | 9906d217093568ed4c9cfe620862818f15ce4150 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2013 Apache Software Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 36.6823 | 100 | 0.717037 |
71bd1bdce05637c200f5ac627256ed7614659638 | 2,044 | py | Python | fugue_analytics/metrics/sources/slack.py | kvnkho/fugue-analytics | 7a8aee2cadd9d91291a71b78de3d367f936ea2ba | [
"Apache-2.0"
] | null | null | null | fugue_analytics/metrics/sources/slack.py | kvnkho/fugue-analytics | 7a8aee2cadd9d91291a71b78de3d367f936ea2ba | [
"Apache-2.0"
] | null | null | null | fugue_analytics/metrics/sources/slack.py | kvnkho/fugue-analytics | 7a8aee2cadd9d91291a71b78de3d367f936ea2ba | [
"Apache-2.0"
] | null | null | null | from prefect import get_run_logger, task
import os
import requests as re
from fugue_analytics.utilities.postgres import execute_query
import pandas as pd
import json
from datetime import date, datetime
@task(retries = 3)
def get_slack_member_count() -> pd.DataFrame:
"""
Slack doesn't seem to have an API to get... | 36.5 | 124 | 0.655088 |
fdf2d3e57c7678254175e02eef8f7afa1e8a6946 | 6,971 | py | Python | Lib/idlelib/idle_test/test_text.py | djaldave/laevad-python-2.7.18 | df9aac191d554295db45d638e528880a9ab9a3ec | [
"bzip2-1.0.6"
] | 42 | 2018-12-12T01:00:59.000Z | 2022-03-27T07:32:29.000Z | Lib/idlelib/idle_test/test_text.py | djaldave/laevad-python-2.7.18 | df9aac191d554295db45d638e528880a9ab9a3ec | [
"bzip2-1.0.6"
] | 13 | 2020-11-06T13:50:45.000Z | 2022-01-25T07:17:37.000Z | Lib/idlelib/idle_test/test_text.py | djaldave/laevad-python-2.7.18 | df9aac191d554295db45d638e528880a9ab9a3ec | [
"bzip2-1.0.6"
] | 8 | 2020-11-14T04:30:26.000Z | 2021-01-16T17:55:19.000Z | # Test mock_tk.Text class against tkinter.Text class by running same tests with both.
import unittest
from test.test_support import requires
from _tkinter import TclError
class TextTest(object):
hw = 'hello\nworld' # usual initial insert after initialization
hwn = hw+'\n' # \n present at initializ... | 30.574561 | 86 | 0.491178 |
740b83b2de4a7ef2eabbb70f29acc28011adf3a7 | 1,902 | py | Python | car_autohome/car_autohome/pipelines.py | aircov/Scrapy_ImagePipeline_Spider | d0bbf78ddda8031da836c0b9eb8a487f7151c1be | [
"MIT"
] | 4 | 2018-12-15T01:51:25.000Z | 2019-02-13T14:18:36.000Z | car_autohome/car_autohome/pipelines.py | aircov/Scrapy_ImagePipeline_Spider | d0bbf78ddda8031da836c0b9eb8a487f7151c1be | [
"MIT"
] | null | null | null | car_autohome/car_autohome/pipelines.py | aircov/Scrapy_ImagePipeline_Spider | d0bbf78ddda8031da836c0b9eb8a487f7151c1be | [
"MIT"
] | 1 | 2019-09-07T17:49:45.000Z | 2019-09-07T17:49:45.000Z | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
import re
from scrapy import Request
from scrapy.exceptions import DropItem
from scrapy.pipelines.images import ImagesPipeline
... | 27.565217 | 65 | 0.625657 |
ba99479a817b83768bf349a92215c38680824b47 | 1,546 | py | Python | src/models_trajGRU/utils.py | inoue0406/adversarial-nowcasting | 431f6bc4b7d731e85ca52f1bf81638b31c4be17e | [
"MIT"
] | 2 | 2021-03-09T06:15:07.000Z | 2022-03-03T15:40:18.000Z | src/models_trajGRU/utils.py | inoue0406/regional-analysis-paper | 672b16d3a3178e258a6057ebf2d89ed7cf4311c1 | [
"MIT"
] | null | null | null | src/models_trajGRU/utils.py | inoue0406/regional-analysis-paper | 672b16d3a3178e258a6057ebf2d89ed7cf4311c1 | [
"MIT"
] | null | null | null | import numpy as np
from torch import nn
from collections import OrderedDict
def make_layers(block):
layers = []
for layer_name, v in block.items():
if 'pool' in layer_name:
layer = nn.MaxPool2d(kernel_size=v[0], stride=v[1],
padding=v[2])
laye... | 44.171429 | 102 | 0.539457 |
dee048cc52e4d3b1b410257d880daf38902e105f | 4,273 | py | Python | azure-quantum/tests/unit/test_authentication.py | microsoft/qdk-python | d91a3a670174de5270f6ac11f9dc51af7270bb4e | [
"MIT"
] | 53 | 2021-01-21T23:38:09.000Z | 2022-03-29T16:34:42.000Z | azure-quantum/tests/unit/test_authentication.py | microsoft/qdk-python | d91a3a670174de5270f6ac11f9dc51af7270bb4e | [
"MIT"
] | 152 | 2021-01-23T07:01:49.000Z | 2022-03-31T19:43:21.000Z | azure-quantum/tests/unit/test_authentication.py | microsoft/qdk-python | d91a3a670174de5270f6ac11f9dc51af7270bb4e | [
"MIT"
] | 47 | 2021-01-30T20:15:46.000Z | 2022-03-25T23:35:28.000Z | #!/bin/env python
# -*- coding: utf-8 -*-
##
# test_authentication.py: Checks correctness of azure.quantum._authentication module.
##
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
##
import json
import os
from pathlib import Path
import time
import pytest
from unittest.m... | 43.161616 | 109 | 0.662766 |
39d9d5240a8bf8a65d9ee7421d6f9c740e4ce6c6 | 5,837 | py | Python | torchkge/evaluation/triplet_classification.py | MacOS/torchkge | 89ed724368f3a5279c0f79c6ba1f948ed2a5696f | [
"BSD-3-Clause"
] | 248 | 2019-04-03T10:04:43.000Z | 2022-03-30T13:01:51.000Z | torchkge/evaluation/triplet_classification.py | MacOS/torchkge | 89ed724368f3a5279c0f79c6ba1f948ed2a5696f | [
"BSD-3-Clause"
] | 52 | 2019-04-04T05:54:35.000Z | 2022-03-02T17:18:15.000Z | torchkge/evaluation/triplet_classification.py | MacOS/torchkge | 89ed724368f3a5279c0f79c6ba1f948ed2a5696f | [
"BSD-3-Clause"
] | 41 | 2019-06-05T08:08:00.000Z | 2022-03-26T09:18:05.000Z | # -*- coding: utf-8 -*-
"""
Copyright TorchKGE developers
@author: Armand Boschin <aboschin@enst.fr>
"""
from torch import zeros, cat
from ..data_structures import SmallKG
from ..sampling import PositionalNegativeSampler
from ..utils import DataLoader
class TripletClassificationEvaluator(object):
"""Evaluate pe... | 34.952096 | 79 | 0.602707 |
429b64ec389521d82f48774d374dde223009d732 | 4,514 | py | Python | docs/source/conf.py | harrywang/oauthenticator | ae4b260c9bbcc66040fd55ff1b14c8f2fc9346e4 | [
"BSD-3-Clause"
] | 1 | 2021-04-17T07:21:29.000Z | 2021-04-17T07:21:29.000Z | docs/source/conf.py | harrywang/oauthenticator | ae4b260c9bbcc66040fd55ff1b14c8f2fc9346e4 | [
"BSD-3-Clause"
] | 1 | 2022-02-21T19:13:12.000Z | 2022-02-21T19:13:12.000Z | docs/source/conf.py | harrywang/oauthenticator | ae4b260c9bbcc66040fd55ff1b14c8f2fc9346e4 | [
"BSD-3-Clause"
] | 2 | 2021-04-12T15:10:41.000Z | 2021-04-23T13:42:41.000Z | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or module... | 29.89404 | 80 | 0.659947 |
d776ab07b30f03032fed349062c3c68dbb8fcf07 | 453,350 | py | Python | test/onnx/test_pytorch_onnx_onnxruntime.py | xuhancn/pytorch | 5c7d916c3d287f6c86f4d59ca1e2b8cc4cd9cd3e | [
"Intel"
] | null | null | null | test/onnx/test_pytorch_onnx_onnxruntime.py | xuhancn/pytorch | 5c7d916c3d287f6c86f4d59ca1e2b8cc4cd9cd3e | [
"Intel"
] | null | null | null | test/onnx/test_pytorch_onnx_onnxruntime.py | xuhancn/pytorch | 5c7d916c3d287f6c86f4d59ca1e2b8cc4cd9cd3e | [
"Intel"
] | null | null | null | # Owner(s): ["module: onnx"]
import copy
import io
import itertools
import os
import random
import unittest
from collections import OrderedDict
from typing import Dict, List, Optional, Tuple, Union
import model_defs.word_language_model as word_language_model
import numpy as np
import onnx
import onnxruntime
import to... | 35.249981 | 120 | 0.540454 |
d391cc4647e3e439d312c3407ed3fdc964c5c6fd | 3,481 | py | Python | cli/plot1D_evolution.py | hannes-holey/hans | 9604eedd70d54f3d4e2058fbc5b911e92e005e4f | [
"MIT"
] | 1 | 2022-02-03T09:31:24.000Z | 2022-02-03T09:31:24.000Z | cli/plot1D_evolution.py | hannes-holey/hans | 9604eedd70d54f3d4e2058fbc5b911e92e005e4f | [
"MIT"
] | 6 | 2022-02-03T09:24:24.000Z | 2022-02-07T09:25:16.000Z | cli/plot1D_evolution.py | hannes-holey/hans | 9604eedd70d54f3d4e2058fbc5b911e92e005e4f | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
MIT License
Copyright 2021 Hannes Holey
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, modi... | 38.252747 | 128 | 0.652399 |
eed46449f4612bdd29e734bb8244717c03115bf6 | 2,386 | py | Python | autograd_optim_curve.py | shizuo-kaji/demo_autograd | ad3de6ec5c30780eef985f360c24005331642533 | [
"MIT"
] | 1 | 2020-03-08T23:53:30.000Z | 2020-03-08T23:53:30.000Z | autograd_optim_curve.py | shizuo-kaji/demo_autograd | ad3de6ec5c30780eef985f360c24005331642533 | [
"MIT"
] | null | null | null | autograd_optim_curve.py | shizuo-kaji/demo_autograd | ad3de6ec5c30780eef985f360c24005331642533 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
## autograd+scipy demo for optimising curves
#%%
import autograd.numpy as np
from autograd import grad, jacobian, hessian
from scipy.optimize import minimize,NonlinearConstraint,LinearConstraint
import matplotlib.pyplot as plt
#%% squared sum of the segment length
def total_length(X):
x=np.r... | 32.243243 | 135 | 0.668483 |
f79ac1842e56dc34e7c1e23eef7124c614ccbc9a | 17,586 | py | Python | examples/pytorch/graphsage/experimental/train_dist_unsupervised.py | yzh119/dgl | 6a7c1eb2323383739585259c70c8b9065ca95d1e | [
"Apache-2.0"
] | 2 | 2020-07-24T19:26:51.000Z | 2021-08-21T21:04:11.000Z | examples/pytorch/graphsage/experimental/train_dist_unsupervised.py | yzh119/dgl | 6a7c1eb2323383739585259c70c8b9065ca95d1e | [
"Apache-2.0"
] | null | null | null | examples/pytorch/graphsage/experimental/train_dist_unsupervised.py | yzh119/dgl | 6a7c1eb2323383739585259c70c8b9065ca95d1e | [
"Apache-2.0"
] | null | null | null | import os
os.environ['DGLBACKEND']='pytorch'
from multiprocessing import Process
import argparse, time, math
import numpy as np
from functools import wraps
import tqdm
import sklearn.linear_model as lm
import sklearn.metrics as skm
import dgl
from dgl import DGLGraph
from dgl.data import register_data_args, load_data
... | 42.892683 | 160 | 0.6396 |
a452e82334ec8afe9c77d97df93577f902af7935 | 63,692 | py | Python | gpiozero/output_devices.py | MarcoGorelli/gpiozero | 39b2eaccfb8283324f0188df7f2164ed9bd230ec | [
"BSD-3-Clause"
] | null | null | null | gpiozero/output_devices.py | MarcoGorelli/gpiozero | 39b2eaccfb8283324f0188df7f2164ed9bd230ec | [
"BSD-3-Clause"
] | null | null | null | gpiozero/output_devices.py | MarcoGorelli/gpiozero | 39b2eaccfb8283324f0188df7f2164ed9bd230ec | [
"BSD-3-Clause"
] | null | null | null | # GPIO Zero: a library for controlling the Raspberry Pi's GPIO pins
# Copyright (c) 2016-2019 Andrew Scheller <github@loowis.durge.org>
# Copyright (c) 2015-2019 Dave Jones <dave@waveform.org.uk>
# Copyright (c) 2015-2019 Ben Nuttall <ben@bennuttall.com>
# Copyright (c) 2019 tuftii <3215045+tuftii@users.noreply.github.... | 35.072687 | 99 | 0.605759 |
ac21fc5be5189a6cb91e747faf0560f9cb8a4def | 303 | py | Python | Beginner/Countdown Timer/countdown.py | kaar07/Python-Projects | 5ab8211c69f7fc5dedf19862a4377b4182411a55 | [
"Apache-2.0"
] | 6 | 2021-04-20T06:15:41.000Z | 2021-05-07T17:58:19.000Z | Beginner/Countdown Timer/countdown.py | kaar07/Python-Projects | 5ab8211c69f7fc5dedf19862a4377b4182411a55 | [
"Apache-2.0"
] | 11 | 2021-05-15T12:09:09.000Z | 2022-03-12T00:57:46.000Z | Beginner/Countdown Timer/countdown.py | kaar07/Python-Projects | 5ab8211c69f7fc5dedf19862a4377b4182411a55 | [
"Apache-2.0"
] | 5 | 2021-05-19T07:40:18.000Z | 2021-09-25T11:11:59.000Z | import time
def countdown(_t):
while _t:
minutes, seconds = divmod(_t, 60)
timer = '{:02d}:{:02d}'.format(minutes, seconds)
print(timer, end="\r")
time.sleep(1)
_t -= 1
print('Time\'s Up!!')
t = input("Enter the time in seconds: ")
countdown(int(t))
| 17.823529 | 56 | 0.544554 |
8fd8a4d0343b547a8d02a845ccf624167ff3f0a5 | 409 | py | Python | ferien/__init__.py | HazardDede/ferien-api | d4659790a9ccfa75cb117b629aac9380c6c6a0e5 | [
"MIT"
] | 4 | 2020-02-18T12:55:27.000Z | 2021-07-30T14:29:07.000Z | ferien/__init__.py | HazardDede/ferien-api | d4659790a9ccfa75cb117b629aac9380c6c6a0e5 | [
"MIT"
] | 3 | 2020-06-22T15:11:50.000Z | 2020-09-10T20:45:07.000Z | ferien/__init__.py | HazardDede/ferien-api | d4659790a9ccfa75cb117b629aac9380c6c6a0e5 | [
"MIT"
] | 2 | 2020-09-07T12:44:23.000Z | 2021-04-15T07:59:49.000Z | """ferien-api public members."""
from .sync_ import (
state_codes,
all_vacations,
state_vacations,
current_vacation,
next_vacation
)
from .async_ import (
all_vacations_async,
state_vacations_async
)
__all__ = [
'state_codes',
'all_vacations',
'all_vacations_async',
'curr... | 15.730769 | 32 | 0.674817 |
5031c27a053f2ff2483033162e9a829d517889d5 | 927 | py | Python | tests/xml/test_userElement.py | plivo/plivo-python | 81d1ec08bbdaad4eeec907bea2529d44af1e9f16 | [
"MIT"
] | 42 | 2015-01-16T07:56:16.000Z | 2021-08-20T04:45:39.000Z | tests/xml/test_userElement.py | plivo/plivo-python | 81d1ec08bbdaad4eeec907bea2529d44af1e9f16 | [
"MIT"
] | 70 | 2015-01-30T04:11:04.000Z | 2022-03-29T21:04:55.000Z | tests/xml/test_userElement.py | plivo/plivo-python | 81d1ec08bbdaad4eeec907bea2529d44af1e9f16 | [
"MIT"
] | 65 | 2015-04-10T22:17:57.000Z | 2021-06-06T13:09:31.000Z | from unittest import TestCase
from plivo import plivoxml
from tests import PlivoXmlTestCase
class UserElementTest(TestCase, PlivoXmlTestCase):
def test_set_methods(self):
expected_response = '<Response><Dial><User sendDigits="wwww2410" sendOnPreanswer="true" ' \
'sipHeaders="h... | 34.333333 | 102 | 0.647249 |
35f221dfd2b7ac80521b69697ba55aba6619624d | 1,175 | py | Python | tensor2tensor/bin/translate_joint.py | cgebe/tensor2tensor | 8e2389021643774f81a3af643e55a856896aef5c | [
"Apache-2.0"
] | null | null | null | tensor2tensor/bin/translate_joint.py | cgebe/tensor2tensor | 8e2389021643774f81a3af643e55a856896aef5c | [
"Apache-2.0"
] | null | null | null | tensor2tensor/bin/translate_joint.py | cgebe/tensor2tensor | 8e2389021643774f81a3af643e55a856896aef5c | [
"Apache-2.0"
] | 1 | 2018-07-26T18:31:58.000Z | 2018-07-26T18:31:58.000Z | import os
TRANSLATE_PROBLEMS = [
"translate_csde_legal32k",
#"translate_csen_legal32k",
#"translate_cses_legal32k",
#"translate_csfr_legal32k",
#"translate_csit_legal32k",
#"translate_cssv_legal32k",
"translate_deen_legal32k",
#"translate_dees_legal32k",
#"translate_defr_legal32k",
... | 26.704545 | 210 | 0.68766 |
928b5b45805b5ec3a984bcaeffb70b3f504c1d21 | 1,846 | py | Python | graph/dijkstra2.py | TennielMiao/uab-contest-tools | 675da96f8ad40533e2402cc2c19b00275fd33e4e | [
"MIT"
] | 4 | 2018-01-29T21:35:06.000Z | 2018-02-17T03:25:44.000Z | graph/dijkstra2.py | TennielMiao/uab-contest-tools | 675da96f8ad40533e2402cc2c19b00275fd33e4e | [
"MIT"
] | null | null | null | graph/dijkstra2.py | TennielMiao/uab-contest-tools | 675da96f8ad40533e2402cc2c19b00275fd33e4e | [
"MIT"
] | null | null | null | import math
import heapq
class Node:
def __init__(self, name, distance=math.inf, prev=None):
self.name = name
self.distance = distance
self.prev = prev
def __gt__(self, other):
return self.distance > other.distance
def __lt__(self, other):
return self.distance < o... | 22.240964 | 71 | 0.567172 |
cc7ca89edbc80697a22c307a68cbf0c53e4d0a9e | 62,760 | py | Python | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/third_party/appengine/datastore/datastore_pbs.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/third_party/appengine/datastore/datastore_pbs.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/third_party/appengine/datastore/datastore_pbs.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:09:01.000Z | 2020-07-25T12:09:01.000Z | # !/usr/bin/python2.4 # pylint: disable=g-unknown-interpreter
#
# Copyright 2013 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... | 36.298438 | 84 | 0.704222 |
f368eebfe6bf29fe1dc0c0cefb40068da9bb8491 | 220 | py | Python | _draft/x_7_5-c.py | ofl/kuku2 | 7247fb1862d917d23258ebe7a93dca5939433225 | [
"MIT"
] | null | null | null | _draft/x_7_5-c.py | ofl/kuku2 | 7247fb1862d917d23258ebe7a93dca5939433225 | [
"MIT"
] | 1 | 2021-11-13T08:03:04.000Z | 2021-11-13T08:03:04.000Z | _draft/x_7_5-c.py | ofl/kuku2 | 7247fb1862d917d23258ebe7a93dca5939433225 | [
"MIT"
] | null | null | null | # x_7_5
#
#
import re
text_1 = 'ももさん'
text_2 = 'ももたろさん'
a = r'もも.*さん'
b = r'もも.+さん'
print(bool(re.match(a, text_1)))
print(bool(re.match(a, text_2)))
print(bool(re.match(b, text_1)))
print(bool(re.match(b, text_2)))
| 12.941176 | 32 | 0.631818 |
cf5684d859e38932f55c117bc86aa0a9f73d2f1e | 356 | py | Python | Exercises/Exercise2EspecialParameters.py | davidavg/OOP_Python | ca4e8376a50b9c81b5ac18c466bd8d147bdbe679 | [
"MIT"
] | null | null | null | Exercises/Exercise2EspecialParameters.py | davidavg/OOP_Python | ca4e8376a50b9c81b5ac18c466bd8d147bdbe679 | [
"MIT"
] | null | null | null | Exercises/Exercise2EspecialParameters.py | davidavg/OOP_Python | ca4e8376a50b9c81b5ac18c466bd8d147bdbe679 | [
"MIT"
] | null | null | null | '''
Created on Aug 13, 2018
@author: david avalos
'''
class Calculator:
def __init__(self, a, b):
self.a = a
self.b = b
def addition(self):
print(self.a+self.b)
def subtraction(self):
print(self.a-self.b)
obj = Calculator(5,2)
obj.addition()
obj.... | 14.833333 | 29 | 0.511236 |
b19d012e18327e9821be1dcb646b2e9193ec47f5 | 4,301 | py | Python | functions/pairing.py | saulius-lipkevicius/Transformed_GA | 599bbcd93f7e59417586606e04945d860447b2c3 | [
"MIT"
] | null | null | null | functions/pairing.py | saulius-lipkevicius/Transformed_GA | 599bbcd93f7e59417586606e04945d860447b2c3 | [
"MIT"
] | null | null | null | functions/pairing.py | saulius-lipkevicius/Transformed_GA | 599bbcd93f7e59417586606e04945d860447b2c3 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from sklearn.utils import shuffle
import argparse
import os
pd.options.mode.chained_assignment = None # default='warn'
parser = argparse.ArgumentParser(description='Breeder acquires new aptamers...')
parser.add_argument("--p", "--path_initial_aptamers"
,... | 34.96748 | 135 | 0.601721 |
ee42d55efee551b7bc9cc93e9d51c60ffe056fc7 | 3,098 | py | Python | arakat-core/examples/demo/SimpleExample.py | sopaoglu/arakat | efa32fcc93076801cad24ab850ecdf9048a824e8 | [
"Apache-2.0"
] | 23 | 2018-08-18T17:32:40.000Z | 2021-10-05T22:57:06.000Z | arakat-core/examples/demo/SimpleExample.py | sopaoglu/arakat | efa32fcc93076801cad24ab850ecdf9048a824e8 | [
"Apache-2.0"
] | 23 | 2018-09-22T08:47:07.000Z | 2021-08-04T07:08:34.000Z | arakat-core/examples/demo/SimpleExample.py | sopaoglu/arakat | efa32fcc93076801cad24ab850ecdf9048a824e8 | [
"Apache-2.0"
] | 22 | 2018-08-17T10:33:31.000Z | 2021-10-05T22:57:07.000Z | from src.pipeline_generator.generators import PipelineGenerator
data={
"graph":{
"nodes": {
"node1":
{
"id": "node1",
"parent": "task1",
"name": "Batch Read from CSV",
"category": 0,
"node_id": 47,
... | 35.609195 | 130 | 0.428018 |
aa1d71029c68cc182a8dd3338a23085fa6c2514b | 15,656 | py | Python | buildozer/targets/ios.py | pavelsof/buildozer | 4333b9c0480aa339f9eccfa82a5a02f4ebc81198 | [
"MIT"
] | null | null | null | buildozer/targets/ios.py | pavelsof/buildozer | 4333b9c0480aa339f9eccfa82a5a02f4ebc81198 | [
"MIT"
] | null | null | null | buildozer/targets/ios.py | pavelsof/buildozer | 4333b9c0480aa339f9eccfa82a5a02f4ebc81198 | [
"MIT"
] | null | null | null | '''
iOS target, based on kivy-ios project
'''
import sys
if sys.platform != 'darwin':
raise NotImplementedError('Windows platform not yet working for Android')
import plistlib
from buildozer import BuildozerCommandException
from buildozer.target import Target, no_config
from os.path import join, basename, expandu... | 38.561576 | 101 | 0.584568 |
97e3697051b7427e68dbe6844f86b01cdbbba969 | 2,403 | py | Python | algorithms/backtrack/find_words.py | liyang101010/algorithms_lee | 5ef8260f99f66be4a015dafcc71110bb679b7769 | [
"MIT"
] | 1 | 2020-03-08T13:33:24.000Z | 2020-03-08T13:33:24.000Z | algorithms/backtrack/find_words.py | osbreeno/algorithms_lee | 5ef8260f99f66be4a015dafcc71110bb679b7769 | [
"MIT"
] | null | null | null | algorithms/backtrack/find_words.py | osbreeno/algorithms_lee | 5ef8260f99f66be4a015dafcc71110bb679b7769 | [
"MIT"
] | null | null | null | """
Given a matrix of words and a list of words to search,
return a list of words that exists in the board
This is Word Search II on LeetCode
board = [
['o','a','a','n'],
['e','t','a','e'],
['i','h','k','r'],
['i','f','l','v']
]
words = ["oath","pea","eat","rain"]
"""
de... | 32.472973 | 76 | 0.5335 |
273da9995de0498bd7579202c87581cb8528f48a | 524 | py | Python | api/posts/migrations/0002_post_activity.py | Juangr1803/Foro-AgrodatAI | a8f23afd32d2ec60d25a03c97f5f353fd0ef5e0b | [
"MIT"
] | 1 | 2021-04-19T16:13:39.000Z | 2021-04-19T16:13:39.000Z | api/posts/migrations/0002_post_activity.py | Juangr1803/Foro-AgrodatAI | a8f23afd32d2ec60d25a03c97f5f353fd0ef5e0b | [
"MIT"
] | null | null | null | api/posts/migrations/0002_post_activity.py | Juangr1803/Foro-AgrodatAI | a8f23afd32d2ec60d25a03c97f5f353fd0ef5e0b | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2020-12-12 16:32
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('activities', '0001_initial'),
('posts', '0001_initial'),
]
operations = [
migrations.AddField(
... | 24.952381 | 130 | 0.629771 |
2a24bad68d43732959883e348e64378dd0ec9929 | 27,295 | py | Python | tests/examples/minlplib/no7_ar25_1.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | 2 | 2021-07-03T13:19:10.000Z | 2022-02-06T10:48:13.000Z | tests/examples/minlplib/no7_ar25_1.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | 1 | 2021-07-04T14:52:14.000Z | 2021-07-15T10:17:11.000Z | tests/examples/minlplib/no7_ar25_1.py | ouyang-w-19/decogo | 52546480e49776251d4d27856e18a46f40c824a1 | [
"MIT"
] | null | null | null | # MINLP written by GAMS Convert at 04/21/18 13:52:38
#
# Equation counts
# Total E G L N X C B
# 270 2 2 266 0 0 0 0
#
# Variable counts
# x b i s1s s2s sc ... | 40.258112 | 115 | 0.599267 |
98c58b5f2ed33bad0c9f8f884e7cfaf461c99dab | 1,278 | py | Python | dashboard_queue.py | gnott/elife-bot | 584c315d15d1289e0d2c27c28aaaae31174812e4 | [
"MIT"
] | null | null | null | dashboard_queue.py | gnott/elife-bot | 584c315d15d1289e0d2c27c28aaaae31174812e4 | [
"MIT"
] | null | null | null | dashboard_queue.py | gnott/elife-bot | 584c315d15d1289e0d2c27c28aaaae31174812e4 | [
"MIT"
] | null | null | null | import boto.sqs
from boto.sqs.message import Message
import json
import uuid
def send_message(message, settings):
conn = boto.sqs.connect_to_region(settings.sqs_region,
aws_access_key_id=settings.aws_access_key_id,
aws_secret_access_key=s... | 28.4 | 95 | 0.626761 |
fbd781706eeb6c2365f86afed31d97868a4e54b2 | 821 | py | Python | config.py | Duncanian/Book-A-Meal-1 | d700b90a07f2412d5d93a381f9153b3f1ddc1838 | [
"MIT"
] | 1 | 2018-05-06T06:12:24.000Z | 2018-05-06T06:12:24.000Z | config.py | Duncanian/Book-A-Meal-1 | d700b90a07f2412d5d93a381f9153b3f1ddc1838 | [
"MIT"
] | 1 | 2018-06-13T05:19:13.000Z | 2018-06-13T05:19:13.000Z | config.py | lennykioko/Book-A-Meal | d700b90a07f2412d5d93a381f9153b3f1ddc1838 | [
"MIT"
] | 2 | 2018-04-19T10:30:40.000Z | 2018-07-27T07:04:19.000Z | """Contains various settings for each process of development
"""
from os import getenv
class Config(object):
"""Base class with all the fundamental config variables"""
DEBUG = False
TESTING = False
SQLALCHEMY_TRACK_MODIFICATIONS = True
SECRET_KEY = getenv('SECRET_KEY')
class TestingConfig(Config... | 27.366667 | 64 | 0.744214 |
80fdf3b67b9656e459f310ffa7a0239a2726e958 | 5,979 | py | Python | FMPasteBoxAppDelegate.py | karstenw/FMPasteBox | c84aa860401051ed369d8559afa83f572a2bd729 | [
"BSD-2-Clause"
] | 2 | 2021-07-14T10:07:13.000Z | 2021-11-14T17:59:18.000Z | FMPasteBoxAppDelegate.py | karstenw/FMPasteBox | c84aa860401051ed369d8559afa83f572a2bd729 | [
"BSD-2-Clause"
] | null | null | null | FMPasteBoxAppDelegate.py | karstenw/FMPasteBox | c84aa860401051ed369d8559afa83f572a2bd729 | [
"BSD-2-Clause"
] | null | null | null | #
# FMPasteBoxAppDelegate.py
# FMPasteBox
#
import sys
import os
import pprint
pp = pprint.pprint
import pdb
kwlog = True
import objc
import Foundation
NSObject = Foundation.NSObject
NSMutableDictionary = Foundation.NSMutableDictionary
NSData = Foundation.NSData
import AppKit
NSWindowController = AppKit.NSWindo... | 33.589888 | 87 | 0.635223 |
f8bae8154f987f13f2eab78834d68219b33fd5f0 | 342 | py | Python | socialcrawl/networks/tasks.py | enterstudio/socialcrawl | 8ad0081db3eafe96132291e579984e504c48021f | [
"MIT"
] | 13 | 2015-03-04T22:34:28.000Z | 2021-12-26T06:27:21.000Z | socialcrawl/networks/tasks.py | MrMugiwara/socialcrawl | 8ad0081db3eafe96132291e579984e504c48021f | [
"MIT"
] | 2 | 2017-01-28T21:45:53.000Z | 2018-08-05T10:58:15.000Z | socialcrawl/networks/tasks.py | enterstudio/socialcrawl | 8ad0081db3eafe96132291e579984e504c48021f | [
"MIT"
] | 4 | 2016-09-19T20:29:34.000Z | 2020-07-24T18:04:00.000Z | from celery import task
from socialcrawl.clients.crawler import CachedTwitterClient, CachedFacebookClient
CLIENTS = {
'twitter': CachedTwitterClient(),
'facebook': CachedFacebookClient(),
}
@task()
def fetch(username, network):
data = CLIENTS[network].fetch_profile(username)
CLIENTS[network].save_pr... | 22.8 | 81 | 0.75731 |
9feea1c6fc05c33f505917effcd1dc38a9c176f5 | 1,358 | py | Python | azure-mgmt-resource/azure/mgmt/resource/policy/v2017_06_01_preview/models/__init__.py | v-Ajnava/azure-sdk-for-python | a1f6f80eb5869c5b710e8bfb66146546697e2a6f | [
"MIT"
] | 4 | 2016-06-17T23:25:29.000Z | 2022-03-30T22:37:45.000Z | azure/mgmt/resource/policy/v2017_06_01_preview/models/__init__.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure/mgmt/resource/policy/v2017_06_01_preview/models/__init__.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 3 | 2016-05-03T20:49:46.000Z | 2017-10-05T21:05:27.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 ... | 34.820513 | 76 | 0.709131 |
7dc854b7b709d8ffa6053f5b35d8c88b4341ff6d | 422 | py | Python | osf/migrations/0119_add_asset_perms.py | gaybro8777/osf.io | 30408511510a40bc393565817b343ef5fd76ab14 | [
"Apache-2.0"
] | 628 | 2015-01-15T04:33:22.000Z | 2022-03-30T06:40:10.000Z | osf/migrations/0119_add_asset_perms.py | gaybro8777/osf.io | 30408511510a40bc393565817b343ef5fd76ab14 | [
"Apache-2.0"
] | 4,712 | 2015-01-02T01:41:53.000Z | 2022-03-30T14:18:40.000Z | osf/migrations/0119_add_asset_perms.py | Johnetordoff/osf.io | de10bf249c46cede04c78f7e6f7e352c69e6e6b5 | [
"Apache-2.0"
] | 371 | 2015-01-12T16:14:08.000Z | 2022-03-31T18:58:29.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-07-16 17:04
from django.db import migrations
def noop(*args):
# This migration used to update admin permissions
# This is now handled by the post_migrate signal
pass
class Migration(migrations.Migration):
dependencies = [
('osf', ... | 21.1 | 53 | 0.656398 |
836abda861e50d7f700a2fa518ffc0f2a3086b4d | 856 | py | Python | handyman/transform.py | gfleetwood/handyman | c3d4a8d7fe87536bb8c9b8f8ba0fce7b1f7feade | [
"MIT"
] | 3 | 2019-04-04T18:05:13.000Z | 2020-12-13T14:55:32.000Z | handyman/transform.py | gfleetwood/handyman | c3d4a8d7fe87536bb8c9b8f8ba0fce7b1f7feade | [
"MIT"
] | null | null | null | handyman/transform.py | gfleetwood/handyman | c3d4a8d7fe87536bb8c9b8f8ba0fce7b1f7feade | [
"MIT"
] | 1 | 2021-11-20T08:26:03.000Z | 2021-11-20T08:26:03.000Z | def impute_scale_data(df):
'''
Imputes missing values with the median for numeric features and the mode for categorical ones,
and then scales the numeric features by subtracting the mean and dividing by the standard deviation.
'''
imputer_num = sk_pp.Imputer(strategy = 'median')
df.loc[:... | 38.909091 | 104 | 0.658879 |
17ff164013e36878e093dd45a4a852e6709e57d2 | 9,551 | py | Python | src/bvcf.py | shtoneyan/Basset | b6c7f8995bb4f8fc37eccf3ee0f78478beef51d7 | [
"MIT"
] | 248 | 2015-10-06T12:30:53.000Z | 2022-02-02T20:30:34.000Z | src/bvcf.py | Deepstatsanalysis/Basset | 18753ad9ff5a46291021a0fa1abaad037b6f64f0 | [
"MIT"
] | 51 | 2015-10-08T04:57:41.000Z | 2021-08-12T19:53:04.000Z | src/bvcf.py | Deepstatsanalysis/Basset | 18753ad9ff5a46291021a0fa1abaad037b6f64f0 | [
"MIT"
] | 120 | 2015-10-15T00:49:44.000Z | 2022-02-16T21:17:17.000Z | #!/usr/bin/env python
from __future__ import print_function
from optparse import OptionParser
import sys
import numpy as np
import pandas as pd
import pysam
from dna_io import dna_one_hot
################################################################################
# bvcf.py
#
# Methods and classes to support .vc... | 30.514377 | 161 | 0.594179 |
5fc391770926dd7ef11862edd1950309e8023dff | 1,041 | py | Python | tests/test_x509_parser.py | jcrowgey/x5092json | 97dcc266d5db3b4b487613621121c69aa5714a74 | [
"BSD-3-Clause"
] | 15 | 2019-01-11T23:43:23.000Z | 2022-01-04T07:19:23.000Z | tests/test_x509_parser.py | jcrowgey/x5092json | 97dcc266d5db3b4b487613621121c69aa5714a74 | [
"BSD-3-Clause"
] | 10 | 2019-01-17T17:14:59.000Z | 2021-04-26T11:38:14.000Z | tests/test_x509_parser.py | jcrowgey/x5092json | 97dcc266d5db3b4b487613621121c69aa5714a74 | [
"BSD-3-Clause"
] | 8 | 2019-01-16T21:48:34.000Z | 2021-09-03T10:59:42.000Z | import json
import os
from x5092json import x509parser
from base64 import b64decode
from collections import OrderedDict
import pytest
TEST_DIR = os.path.abspath(os.path.dirname(__file__))
test_data = json.load(
open(os.path.join(TEST_DIR, "test_data.json")),
object_pairs_hook=OrderedDict,
)
@pytest.mark.para... | 29.742857 | 72 | 0.738713 |
8fc7e49d2de8d461467153a60994f91c1e497b32 | 1,247 | py | Python | google/ads/googleads/v9/services/types/language_constant_service.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v9/services/types/language_constant_service.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v9/services/types/language_constant_service.py | JakobSteixner/google-ads-python | df2b802cc7e78295a4ece21cc7ef3787cd35dab0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 31.175 | 128 | 0.732959 |
c55385e45c67b7c46504ddf3a77de7b04b43472d | 298 | py | Python | flask_monitoringdashboard/test/test_factory.py | jlane9/Flask-MonitoringDashboard | b989bcf8f870ccd9141210eb4b2b8f716873c4fe | [
"MIT"
] | null | null | null | flask_monitoringdashboard/test/test_factory.py | jlane9/Flask-MonitoringDashboard | b989bcf8f870ccd9141210eb4b2b8f716873c4fe | [
"MIT"
] | null | null | null | flask_monitoringdashboard/test/test_factory.py | jlane9/Flask-MonitoringDashboard | b989bcf8f870ccd9141210eb4b2b8f716873c4fe | [
"MIT"
] | null | null | null | import unittest
from flask_monitoringdashboard.test.utils import get_test_app
class TestFactory(unittest.TestCase):
def test_factory(self):
"""
Create multiple applications and verify that the app doesn't break.
"""
get_test_app()
get_test_app()
| 21.285714 | 79 | 0.674497 |
5e507193aa1ff19da31e7cb65a0df99aca3578b3 | 11,733 | py | Python | mne/viz/tests/test_ica.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | null | null | null | mne/viz/tests/test_ica.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | null | null | null | mne/viz/tests/test_ica.py | fmamashli/mne-python | 52f064415e7c9fa8fe243d22108dcdf3d86505b9 | [
"BSD-3-Clause"
] | null | null | null | # Authors: Denis Engemann <denis.engemann@gmail.com>
# Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: Simplified BSD
import os.path as op
import numpy as np
from numpy.testing import assert_equal, assert_array_equal
import pytest
import matplotlib.pyplot as plt
from mne import read_events, Ep... | 36.437888 | 79 | 0.646212 |
7f71db1db8b1e52248516329621ba95d1fb384fc | 9,968 | py | Python | tests/quick.py | wfarah/frbpoppy | e575c49e6b4a69015a66d3f38a3459e0ffe4eb05 | [
"MIT"
] | null | null | null | tests/quick.py | wfarah/frbpoppy | e575c49e6b4a69015a66d3f38a3459e0ffe4eb05 | [
"MIT"
] | null | null | null | tests/quick.py | wfarah/frbpoppy | e575c49e6b4a69015a66d3f38a3459e0ffe4eb05 | [
"MIT"
] | null | null | null | """Use standard populations to speed up calculation times."""
import os
from frbpoppy import CosmicPopulation, SurveyPopulation, paths, unpickle
class StandardCosmicPops:
"""docstring for StandardCosmicPop."""
def __init__(self, sort, size, alpha, gamma):
"""Quickly get standard populations.
... | 36.512821 | 77 | 0.408407 |
b3f7621a7c65d2b785c0656972d7e82720316b91 | 3,193 | py | Python | tests/sinks/test_tcp_client.py | 02strich/aws-embedded-metrics-python | 4c5718e580dfb12529673a6b54810adfbfd54242 | [
"Apache-2.0"
] | 130 | 2019-11-18T19:39:55.000Z | 2022-03-28T09:56:25.000Z | tests/sinks/test_tcp_client.py | 02strich/aws-embedded-metrics-python | 4c5718e580dfb12529673a6b54810adfbfd54242 | [
"Apache-2.0"
] | 50 | 2019-11-18T22:22:33.000Z | 2022-02-06T11:03:31.000Z | tests/sinks/test_tcp_client.py | 02strich/aws-embedded-metrics-python | 4c5718e580dfb12529673a6b54810adfbfd54242 | [
"Apache-2.0"
] | 23 | 2019-11-19T00:06:41.000Z | 2021-12-09T02:01:40.000Z | from aws_embedded_metrics.sinks.tcp_client import TcpClient
from urllib.parse import urlparse
import socket
import threading
import time
import logging
log = logging.getLogger(__name__)
test_host = '0.0.0.0'
test_port = 9999
endpoint = urlparse("tcp://0.0.0.0:9999")
message = "_16-Byte-String_".encode('utf-8')
def ... | 25.141732 | 71 | 0.614156 |
44d26f6e69f1d65abe3a51be089a256b96af1ec2 | 6,030 | py | Python | research/audioset/vggish/vggish_inference_demo.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | 1 | 2019-09-11T09:41:11.000Z | 2019-09-11T09:41:11.000Z | research/audioset/vggish/vggish_inference_demo.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"Apache-2.0"
] | null | null | null | research/audioset/vggish/vggish_inference_demo.py | vincentcheny/models | afb1a59fc1bc792ac72d1a3e22e2469020529788 | [
"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 ... | 39.155844 | 81 | 0.672305 |
2cfc8eec823afc3bc34963aad8f715d2b0e9cbe8 | 25,605 | py | Python | intersight/apis/storage_controller_api.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 21 | 2018-03-29T14:20:35.000Z | 2021-10-13T05:11:41.000Z | intersight/apis/storage_controller_api.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 14 | 2018-01-30T15:45:46.000Z | 2022-02-23T14:23:21.000Z | intersight/apis/storage_controller_api.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 18 | 2018-01-03T15:09:56.000Z | 2021-07-16T02:21:54.000Z | # coding: utf-8
"""
Cisco Intersight OpenAPI specification.
The Cisco Intersight OpenAPI specification.
OpenAPI spec version: 1.0.9-1461
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import sys
import os
import re
# python 2 and p... | 50.70297 | 819 | 0.618864 |
7f724e97aec13316f245dea848e69fd3bd7513af | 1,620 | py | Python | tenant_handler/datastore/__init__.py | turnbros/tbc-api | 888fddd11c8a4a0af66b1a9823df924ace2ba37d | [
"Apache-2.0"
] | null | null | null | tenant_handler/datastore/__init__.py | turnbros/tbc-api | 888fddd11c8a4a0af66b1a9823df924ace2ba37d | [
"Apache-2.0"
] | null | null | null | tenant_handler/datastore/__init__.py | turnbros/tbc-api | 888fddd11c8a4a0af66b1a9823df924ace2ba37d | [
"Apache-2.0"
] | null | null | null | import json
from tenant_handler.tenant import Tenant
class TenantStore(object):
def __init__(self):
self._tenant_store = {}
def get_tenant_names(self):
return list(self._tenant_store.keys())
def get_tenant(self, tenant_name) -> Tenant:
tenant = self._tenant_store.get(tenant_name)
if tenant is ... | 29.454545 | 68 | 0.72284 |
1dd2cbce0f6a861ffa740931b6023f60dc1a5e4e | 6,591 | py | Python | neutron/agent/firewall.py | hashsos/hashcloudos-neutron | 76ec5ca105043be6bf7220b5c5684190ddf14952 | [
"Apache-2.0"
] | null | null | null | neutron/agent/firewall.py | hashsos/hashcloudos-neutron | 76ec5ca105043be6bf7220b5c5684190ddf14952 | [
"Apache-2.0"
] | null | null | null | neutron/agent/firewall.py | hashsos/hashcloudos-neutron | 76ec5ca105043be6bf7220b5c5684190ddf14952 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012, Nachi Ueno, NTT MCL, 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
#
# Unles... | 31.6875 | 79 | 0.676832 |
8af310b03d28d08eab13d96bf6f9dc6f83dce365 | 1,131 | py | Python | lib/galaxy/model/migrate/versions/0110_add_dataset_uuid.py | yvanlebras/galaxy | 6b8489ca866825bcdf033523120a8b24ea6e6342 | [
"CC-BY-3.0"
] | null | null | null | lib/galaxy/model/migrate/versions/0110_add_dataset_uuid.py | yvanlebras/galaxy | 6b8489ca866825bcdf033523120a8b24ea6e6342 | [
"CC-BY-3.0"
] | 2 | 2017-05-18T16:12:55.000Z | 2022-03-08T12:08:43.000Z | lib/galaxy/model/migrate/versions/0110_add_dataset_uuid.py | yvanlebras/galaxy | 6b8489ca866825bcdf033523120a8b24ea6e6342 | [
"CC-BY-3.0"
] | null | null | null | """
Add UUID column to dataset table
"""
import logging
from sqlalchemy import (
Column,
MetaData,
Table,
)
from galaxy.model.custom_types import UUIDType
log = logging.getLogger(__name__)
dataset_uuid_column = Column("uuid", UUIDType, nullable=True)
def upgrade(migrate_engine):
print(__doc__)
... | 24.586957 | 74 | 0.697613 |
1a74ab65f85a89cc481c27d2090b18f637b8c75f | 999 | py | Python | norfair/utils.py | pdd-999/norfair | 83ff3fdae973707d8fc569d270e15badbe4a4619 | [
"BSD-3-Clause"
] | 1 | 2021-12-30T09:02:44.000Z | 2021-12-30T09:02:44.000Z | norfair/utils.py | pdd-999/norfair | 83ff3fdae973707d8fc569d270e15badbe4a4619 | [
"BSD-3-Clause"
] | null | null | null | norfair/utils.py | pdd-999/norfair | 83ff3fdae973707d8fc569d270e15badbe4a4619 | [
"BSD-3-Clause"
] | 1 | 2022-03-29T03:07:54.000Z | 2022-03-29T03:07:54.000Z | import numpy as np
import time
def validate_points(points: np.array) -> np.array:
# If the user is tracking only a single point, reformat it slightly.
if points.shape == (2,):
points = points[np.newaxis, ...]
elif len(points.shape) == 1:
print("The point(s) need to be in (x, y) formats ", p... | 29.382353 | 72 | 0.592593 |
d54d12efc859724baf0adb2fdda176133c3d225a | 5,033 | py | Python | loky/backend/popen_loky_win32.py | pierreglaser/loky | 71d37c73e0013ce9008fe7356c677917f8800af1 | [
"BSD-3-Clause"
] | null | null | null | loky/backend/popen_loky_win32.py | pierreglaser/loky | 71d37c73e0013ce9008fe7356c677917f8800af1 | [
"BSD-3-Clause"
] | null | null | null | loky/backend/popen_loky_win32.py | pierreglaser/loky | 71d37c73e0013ce9008fe7356c677917f8800af1 | [
"BSD-3-Clause"
] | null | null | null | import os
import sys
from pickle import load
from multiprocessing import process, util
from . import spawn
from . import reduction
from .context import get_spawning_popen, set_spawning_popen
if sys.platform == "win32":
# Avoid import error by code introspection tools such as test runners
# trying to import th... | 32.681818 | 85 | 0.591695 |
adbd97703dce2956265dc424cb1905e4b9ed2524 | 773 | py | Python | cpoll_cppsp/setup.py | lightyeare/FrameworkBenchmarks | 40489856a0480c85227993d91de7d66e9224f8b4 | [
"BSD-3-Clause"
] | 1 | 2015-01-28T07:11:03.000Z | 2015-01-28T07:11:03.000Z | cpoll_cppsp/setup.py | lightyeare/FrameworkBenchmarks | 40489856a0480c85227993d91de7d66e9224f8b4 | [
"BSD-3-Clause"
] | null | null | null | cpoll_cppsp/setup.py | lightyeare/FrameworkBenchmarks | 40489856a0480c85227993d91de7d66e9224f8b4 | [
"BSD-3-Clause"
] | null | null | null | import subprocess
import sys
import os
import setup_util
def start(args, logfile, errfile):
setup_util.replace_text("cpoll_cppsp/www/connectioninfo.H", "\\#define BENCHMARK_DB_HOST \".*\"", "#define BENCHMARK_DB_HOST \"" + args.database_host + "\"")
subprocess.check_call("make", shell=True, cwd="cpoll_cppsp", std... | 38.65 | 159 | 0.698577 |
7d4dad6a92e46dcc6ca30dfd6a7d13cbb2bcd55c | 312 | py | Python | project/manage.py | riotkit-org/docker-django-wiki | e65cdb07b14a06e2fc690260b6553376630783ed | [
"MIT"
] | 9 | 2019-08-23T04:32:21.000Z | 2021-12-07T21:55:32.000Z | project/manage.py | riotkit-org/docker-django-wiki | e65cdb07b14a06e2fc690260b6553376630783ed | [
"MIT"
] | 1 | 2020-04-21T13:55:17.000Z | 2020-04-22T17:51:20.000Z | project/manage.py | riotkit-org/docker-django-wiki | e65cdb07b14a06e2fc690260b6553376630783ed | [
"MIT"
] | 3 | 2020-03-18T00:19:37.000Z | 2020-11-08T18:27:08.000Z | #!/usr/bin/env python
from __future__ import absolute_import, unicode_literals
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "wikiproject.settings")
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| 24 | 75 | 0.794872 |
2324d425115bc85e1395f91e28c338cfe7221c7e | 644 | py | Python | acme/agents/jax/__init__.py | novatig/acme | 7774e4a22519d8b05951320864e5308974eaad2a | [
"Apache-2.0"
] | 2,650 | 2020-06-01T16:31:25.000Z | 2022-03-31T07:32:41.000Z | acme/agents/jax/__init__.py | novatig/acme | 7774e4a22519d8b05951320864e5308974eaad2a | [
"Apache-2.0"
] | 199 | 2020-06-02T01:09:09.000Z | 2022-03-31T17:11:20.000Z | acme/agents/jax/__init__.py | novatig/acme | 7774e4a22519d8b05951320864e5308974eaad2a | [
"Apache-2.0"
] | 344 | 2020-06-01T16:45:21.000Z | 2022-03-30T11:15:09.000Z | # python3
# Copyright 2018 DeepMind Technologies Limited. 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 re... | 37.882353 | 74 | 0.759317 |
000d3cd418c131da1a9a532589c58eb6634db3cf | 3,461 | py | Python | bindings/python/ensmallen/datasets/string/microlunatussoli.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/microlunatussoli.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/microlunatussoli.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Microlunatus soli.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protein asso... | 32.961905 | 223 | 0.676683 |
4661b58c6cbc7dbbf74da979b0580cb0412042ac | 13,610 | py | Python | tests/io/test_sql.py | ANA-POTJE/kedro | cba5f4577e17d51346c719da0fa12bb784acffc8 | [
"Apache-2.0"
] | null | null | null | tests/io/test_sql.py | ANA-POTJE/kedro | cba5f4577e17d51346c719da0fa12bb784acffc8 | [
"Apache-2.0"
] | null | null | null | tests/io/test_sql.py | ANA-POTJE/kedro | cba5f4577e17d51346c719da0fa12bb784acffc8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 QuantumBlack Visual Analytics Limited
#
# 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
#
# THE SOFTWARE IS PROVIDED "AS IS", WIT... | 42.664577 | 88 | 0.695151 |
d4e1aa888f4ef91750786901fa793520229ccba0 | 25,567 | py | Python | pook/mock.py | qiao-meng-zefr/pook | 0637f22ed90bc865f2793a49fa51d44b0689a4b5 | [
"MIT"
] | null | null | null | pook/mock.py | qiao-meng-zefr/pook | 0637f22ed90bc865f2793a49fa51d44b0689a4b5 | [
"MIT"
] | null | null | null | pook/mock.py | qiao-meng-zefr/pook | 0637f22ed90bc865f2793a49fa51d44b0689a4b5 | [
"MIT"
] | null | null | null | import re
import functools
from furl import furl
from inspect import isfunction, ismethod
from .decorators import fluent
from .response import Response
from .constants import TYPES
from .request import Request
from .matcher import MatcherEngine
from .helpers import trigger_methods
from .exceptions import PookExpiredMo... | 29.798368 | 79 | 0.577385 |
2a129fa5630ad5e214432273c36f2e8d6d386c57 | 30,944 | py | Python | tests/unit/compile/test_serialization.py | ethan-asapp/flambe | 70257167058c7b82ee39f74167a6161bd264ad18 | [
"MIT"
] | null | null | null | tests/unit/compile/test_serialization.py | ethan-asapp/flambe | 70257167058c7b82ee39f74167a6161bd264ad18 | [
"MIT"
] | null | null | null | tests/unit/compile/test_serialization.py | ethan-asapp/flambe | 70257167058c7b82ee39f74167a6161bd264ad18 | [
"MIT"
] | null | null | null | import pytest
import tempfile
from collections import abc, OrderedDict
import os
import torch
import dill
import mock
from ruamel.yaml.compat import StringIO
from ruamel.yaml import YAML
from typing import Mapping, Any, Optional
# from flambe.compile import yaml
from flambe import Component, save_state_to_file, load... | 35.163636 | 370 | 0.650885 |
ffc6f683fcf9781b23e01bc925af097eac266215 | 546 | py | Python | dataset.py | aurelienserre/samestats | 91a4471e8e85cff198b206ec9a36883811215596 | [
"BSD-3-Clause"
] | null | null | null | dataset.py | aurelienserre/samestats | 91a4471e8e85cff198b206ec9a36883811215596 | [
"BSD-3-Clause"
] | null | null | null | dataset.py | aurelienserre/samestats | 91a4471e8e85cff198b206ec9a36883811215596 | [
"BSD-3-Clause"
] | null | null | null | import torch
import torch.nn as nn
from torch.nn.parameter import Parameter
class Dataset(nn.Module):
"""Module for representing the points of the data set."""
def __init__(self, points):
"""Initializes the Dataset module with the given points
:points: (np.array or torch.Tensor) points of t... | 23.73913 | 65 | 0.663004 |
6b94dc083177a8a7307dfad8df32da9d04c2150d | 4,610 | py | Python | 02_model_training.py | tum-fml/dofos | 85556764353c15c5b7ae3088a135de8e96d1021e | [
"CC0-1.0"
] | null | null | null | 02_model_training.py | tum-fml/dofos | 85556764353c15c5b7ae3088a135de8e96d1021e | [
"CC0-1.0"
] | null | null | null | 02_model_training.py | tum-fml/dofos | 85556764353c15c5b7ae3088a135de8e96d1021e | [
"CC0-1.0"
] | null | null | null | # ######################################################################################################################
#
# Skript zum antrainieren von Mustererkennungsmodellen.
#
# Datenbank mit Mustern zu den einzelnen Betriebsvorgängen muss vorhanden sein.
#
# #######################################################... | 33.405797 | 120 | 0.55141 |
5d535200e7549ca3e8a85332ceb9b4a4f83e874e | 2,777 | py | Python | projects/PartialReID/partialreid/dsr_evaluation.py | lb-y/fast-reid | ec500abc94bf69774f3f6c2e4848edacb0d6761b | [
"Apache-2.0"
] | 1 | 2021-05-31T01:34:36.000Z | 2021-05-31T01:34:36.000Z | projects/PartialReID/partialreid/dsr_evaluation.py | lb-y/fast-reid | ec500abc94bf69774f3f6c2e4848edacb0d6761b | [
"Apache-2.0"
] | null | null | null | projects/PartialReID/partialreid/dsr_evaluation.py | lb-y/fast-reid | ec500abc94bf69774f3f6c2e4848edacb0d6761b | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
"""
@author: liaoxingyu
@contact: sherlockliao01@gmail.com
"""
import copy
import logging
from collections import OrderedDict
import numpy as np
import torch
import torch.nn.functional as F
from fastreid.evaluation.evaluator import DatasetEvaluator
from fastreid.evaluation.rank import evaluate_rank... | 33.865854 | 113 | 0.651422 |
1e63db39ad3c237fb1d06e7c50e04023a8e528a3 | 2,386 | py | Python | contracts/tests/test_fee_bank_contract.py | agatsoh/shutter | d8b99f8c3e9863838eeef935ffdd90dc8e9b1d5b | [
"MIT"
] | 13 | 2021-07-23T21:03:57.000Z | 2022-03-29T19:38:07.000Z | contracts/tests/test_fee_bank_contract.py | derekbar90/shutter | 27ff92ca3e7d80213d01821886f6bc8a10f81239 | [
"MIT"
] | 22 | 2021-04-12T09:02:12.000Z | 2021-06-16T06:26:37.000Z | contracts/tests/test_fee_bank_contract.py | derekbar90/shutter | 27ff92ca3e7d80213d01821886f6bc8a10f81239 | [
"MIT"
] | 3 | 2021-08-06T20:17:59.000Z | 2021-12-08T20:04:13.000Z | from typing import Any
from typing import Sequence
import brownie
import pytest
from brownie.network.account import Account
@pytest.fixture
def depositor(accounts: Sequence[Account]) -> Account:
return accounts[1]
@pytest.fixture
def receiver(accounts: Sequence[Account]) -> Account:
return accounts[2]
de... | 32.684932 | 94 | 0.672674 |
611517a6170b22927e5da06a3c9453942c17621b | 545 | py | Python | filekeep/xml.py | goncalomb/filekeep | 653de1b8c859cb3ec2e7203259125989f3618f56 | [
"MIT"
] | null | null | null | filekeep/xml.py | goncalomb/filekeep | 653de1b8c859cb3ec2e7203259125989f3618f56 | [
"MIT"
] | null | null | null | filekeep/xml.py | goncalomb/filekeep | 653de1b8c859cb3ec2e7203259125989f3618f56 | [
"MIT"
] | null | null | null | import xml.etree.ElementTree as ET
import xml.dom.minidom as minidom
def read(path):
root = ET.parse(path).getroot()
for elem in root.iter('*'):
if elem.text != None and elem.text.strip() == "":
elem.text = None
if elem.tail != None and elem.tail.strip() == "":
elem.tail... | 30.277778 | 77 | 0.59633 |
f3d9a9ad120b2fd74a5172a6279ac0c9ac56bea9 | 5,230 | py | Python | python/100daysofpython/r1d8_data_structures.py | juancarlosqr/datascience | 2e4d78365b059a3e501e988bee53970ac0d718fc | [
"MIT"
] | null | null | null | python/100daysofpython/r1d8_data_structures.py | juancarlosqr/datascience | 2e4d78365b059a3e501e988bee53970ac0d718fc | [
"MIT"
] | null | null | null | python/100daysofpython/r1d8_data_structures.py | juancarlosqr/datascience | 2e4d78365b059a3e501e988bee53970ac0d718fc | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
def run_list():
''''''
print('\nlists')
# shopping list
shop = ['apple', 'mango', 'carrot', 'banana']
print(1, 'i have', len(shop), 'items')
print(2, 'the items are', end=' ')
for item in shop:
print(item, end=' ')
print()
print(3, 'adding rice')
... | 29.217877 | 151 | 0.616635 |
d9c59d46731da16d7c7e03fb2e55c5a23c3cc848 | 1,929 | py | Python | test/test_cnnf_host_audit.py | hi-artem/twistlock-py | 9888e905f5b9d3cc00f9b84244588c0992f8e4f4 | [
"RSA-MD"
] | null | null | null | test/test_cnnf_host_audit.py | hi-artem/twistlock-py | 9888e905f5b9d3cc00f9b84244588c0992f8e4f4 | [
"RSA-MD"
] | null | null | null | test/test_cnnf_host_audit.py | hi-artem/twistlock-py | 9888e905f5b9d3cc00f9b84244588c0992f8e4f4 | [
"RSA-MD"
] | null | null | null | # coding: utf-8
"""
Prisma Cloud Compute API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 21.04.439
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_impor... | 29.676923 | 124 | 0.589943 |
24e942bfac7339e544024cdb7a182f18b91ff4b0 | 4,133 | py | Python | configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/crowdpose/res101_crowdpose_320x256.py | nightfuryyy/mmpose | 910d9e31dd9d46e3329be1b7567e6309d70ab64c | [
"Apache-2.0"
] | 1,775 | 2020-07-10T01:20:01.000Z | 2022-03-31T16:31:50.000Z | configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/crowdpose/res101_crowdpose_320x256.py | KHB1698/mmpose | 93c3a742c540dfb4ca515ad545cef705a07d90b4 | [
"Apache-2.0"
] | 1,021 | 2020-07-11T11:40:24.000Z | 2022-03-31T14:32:26.000Z | configs/body/2d_kpt_sview_rgb_img/topdown_heatmap/crowdpose/res101_crowdpose_320x256.py | KHB1698/mmpose | 93c3a742c540dfb4ca515ad545cef705a07d90b4 | [
"Apache-2.0"
] | 477 | 2020-07-11T11:27:51.000Z | 2022-03-31T09:42:25.000Z | _base_ = ['../../../../_base_/datasets/crowdpose.py']
log_level = 'INFO'
load_from = None
resume_from = None
dist_params = dict(backend='nccl')
workflow = [('train', 1)]
checkpoint_config = dict(interval=10)
evaluation = dict(interval=10, metric='mAP')
optimizer = dict(
type='Adam',
lr=5e-4,
)
optimizer_config... | 28.701389 | 79 | 0.633922 |
19860ba37fc7699d145a2fc92d3a627b018c790e | 397 | py | Python | disposable_emails/contrib/django/__init__.py | maxmalysh/disposable-emails | f4772ec3badb8d6df2d64d265fa9c3b2d982bb09 | [
"MIT"
] | 3 | 2017-05-05T02:00:13.000Z | 2019-12-06T15:22:58.000Z | disposable_emails/contrib/django/__init__.py | maxmalysh/disposable-emails | f4772ec3badb8d6df2d64d265fa9c3b2d982bb09 | [
"MIT"
] | null | null | null | disposable_emails/contrib/django/__init__.py | maxmalysh/disposable-emails | f4772ec3badb8d6df2d64d265fa9c3b2d982bb09 | [
"MIT"
] | null | null | null | from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from disposable_emails import is_disposable_email, extract_domain
def disposable_validator(value):
if is_disposable_email(value):
raise ValidationError(
_('%(value)s is a blacklisted emai... | 33.083333 | 65 | 0.732997 |
23c9f09cdde78e48b1c8bd19b4d107ee1574c800 | 31 | py | Python | src/__init__.py | mancaf/planetarium | 507fe252778d3c5143b522193cf25c7fdb2412aa | [
"MIT"
] | null | null | null | src/__init__.py | mancaf/planetarium | 507fe252778d3c5143b522193cf25c7fdb2412aa | [
"MIT"
] | null | null | null | src/__init__.py | mancaf/planetarium | 507fe252778d3c5143b522193cf25c7fdb2412aa | [
"MIT"
] | null | null | null | from . import core, gui, parse
| 15.5 | 30 | 0.709677 |
b22a10d1d99899bbb8ec94d5103377a392c7849a | 1,824 | py | Python | core/gui/elements.py | ranjian0/triggered_python | bcd95da3e82b384f9e1274c90af000986d2bad18 | [
"MIT"
] | null | null | null | core/gui/elements.py | ranjian0/triggered_python | bcd95da3e82b384f9e1274c90af000986d2bad18 | [
"MIT"
] | null | null | null | core/gui/elements.py | ranjian0/triggered_python | bcd95da3e82b384f9e1274c90af000986d2bad18 | [
"MIT"
] | null | null | null | import pyglet as pg
class LabelElement(pg.text.Label):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.anchor_y = "top"
self.anchor_x = "left"
def update_batch(self, batch, group):
self.batch = batch
layout = pg.text.layout
self.top... | 29.419355 | 86 | 0.618969 |
4af8331f007e6be5a1475039f2fc2f615a90df90 | 5,527 | py | Python | tempest/services/compute/json/images_client.py | queria/my-tempest | a9cdee0201bb956c7502fd372dab467b056ba67f | [
"Apache-2.0"
] | null | null | null | tempest/services/compute/json/images_client.py | queria/my-tempest | a9cdee0201bb956c7502fd372dab467b056ba67f | [
"Apache-2.0"
] | null | null | null | tempest/services/compute/json/images_client.py | queria/my-tempest | a9cdee0201bb956c7502fd372dab467b056ba67f | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 37.856164 | 79 | 0.637778 |
7a017ef2a6640c77f846412cef08139ee5f1db44 | 672 | py | Python | examples/cursor_v1_1.py | haleelsada/tweepy | 22d47d9ae0e06a0c7d34a3871c2ea89ef71ac45c | [
"MIT"
] | null | null | null | examples/cursor_v1_1.py | haleelsada/tweepy | 22d47d9ae0e06a0c7d34a3871c2ea89ef71ac45c | [
"MIT"
] | null | null | null | examples/cursor_v1_1.py | haleelsada/tweepy | 22d47d9ae0e06a0c7d34a3871c2ea89ef71ac45c | [
"MIT"
] | null | null | null | import tweepy
consumer_key = ""
consumer_secret = ""
access_token = ""
access_token_secret = ""
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
api = tweepy.API(auth)
# The app can only retrieve fixed number of objects per
# request, with pagination... | 28 | 74 | 0.700893 |
dca200ab30789415540e9a485f0749fcce23cfbe | 1,353 | py | Python | briskGenerator/brisk.py | itssmutnuri/AugPy | 2bf5639700ae60efbf375017a70400fa486f862f | [
"MIT"
] | 6 | 2019-10-12T06:58:32.000Z | 2021-04-01T17:38:17.000Z | briskGenerator/brisk.py | muralikrishnarar/AugPy | 2bf5639700ae60efbf375017a70400fa486f862f | [
"MIT"
] | 1 | 2020-10-27T15:09:08.000Z | 2020-10-27T18:49:09.000Z | briskGenerator/brisk.py | muralikrishnarar/AugPy | 2bf5639700ae60efbf375017a70400fa486f862f | [
"MIT"
] | 3 | 2019-10-12T07:00:21.000Z | 2021-02-14T01:25:23.000Z | #source: https://www.andreasjakl.com/basics-of-ar-anchors-keypoints-feature-detection/
import cv2
# 1. Load the original image
img = cv2.imread('reference/cover.jpg')
# 2. Create BRISK algorithm
# OpenCV default threshold = 30, octaves = 3
# Using 4 octaves as cited as typical value by the original paper by Leuten... | 41 | 93 | 0.761271 |
04b4a8c2449b6d0b5abd8fb47fd50c4c396aeebf | 7,409 | py | Python | libcloud/dns/drivers/softlayer.py | carletes/libcloud | 6be31b9d57b4a94d91320d4c33e94071759fa876 | [
"Apache-2.0"
] | 3 | 2015-09-11T15:42:16.000Z | 2021-05-12T01:10:05.000Z | libcloud/dns/drivers/softlayer.py | carletes/libcloud | 6be31b9d57b4a94d91320d4c33e94071759fa876 | [
"Apache-2.0"
] | null | null | null | libcloud/dns/drivers/softlayer.py | carletes/libcloud | 6be31b9d57b4a94d91320d4c33e94071759fa876 | [
"Apache-2.0"
] | 3 | 2016-02-08T23:38:18.000Z | 2019-11-05T00:31:34.000Z | # Licensed to the Apache Software Foundation (ASF) 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 ... | 34.621495 | 77 | 0.565933 |
f36288f4f4fb0c31d4e9725f56bf1190a29aa98f | 19,050 | py | Python | kivy/clock.py | sirpercival/kivy | 29ef854a200e6764aae60ea29324379c69d271a3 | [
"MIT"
] | 1 | 2020-02-24T19:03:54.000Z | 2020-02-24T19:03:54.000Z | kivy/clock.py | sirpercival/kivy | 29ef854a200e6764aae60ea29324379c69d271a3 | [
"MIT"
] | null | null | null | kivy/clock.py | sirpercival/kivy | 29ef854a200e6764aae60ea29324379c69d271a3 | [
"MIT"
] | null | null | null | '''
Clock object
============
The :class:`Clock` object allows you to schedule a function call in the
future; once or repeatedly at specified intervals::
def my_callback(dt):
pass
# call my_callback every 0.5 seconds
Clock.schedule_interval(my_callback, 0.5)
# call my_callback in 5 seconds
... | 31.909548 | 79 | 0.610184 |
ed0b5145ce3b1b1c4056e823032565f1afe8b0a7 | 6,151 | py | Python | ocellaris/solver_parts/boundary_conditions/neumann.py | TormodLandet/Ocellaris | 6b4b2515fb881b1ed8d8fd8d8c23a8e1990ada58 | [
"Apache-2.0"
] | 1 | 2017-11-07T12:19:44.000Z | 2017-11-07T12:19:44.000Z | ocellaris/solver_parts/boundary_conditions/neumann.py | TormodLandet/Ocellaris | 6b4b2515fb881b1ed8d8fd8d8c23a8e1990ada58 | [
"Apache-2.0"
] | null | null | null | ocellaris/solver_parts/boundary_conditions/neumann.py | TormodLandet/Ocellaris | 6b4b2515fb881b1ed8d8fd8d8c23a8e1990ada58 | [
"Apache-2.0"
] | 2 | 2018-05-02T17:17:01.000Z | 2019-03-11T13:09:40.000Z | # Copyright (C) 2015-2019 Tormod Landet
# SPDX-License-Identifier: Apache-2.0
import dolfin
from . import register_boundary_condition, BoundaryConditionCreator
from ocellaris.utils import CodedExpression, OcellarisCppExpression
DEFAULT_ENFORCE_ZERO_FLUX = False
class OcellarisNeumannBC(object):
def __init__(
... | 39.178344 | 96 | 0.654203 |
cb6faaf5785cc042e204cb50723f7b675fc18e21 | 4,785 | py | Python | tools/j2objc/j2objc_header_map.py | Dyryamo/bazel | c60eb5d324da4d81f6be93f442ac6d7576741e8e | [
"Apache-2.0"
] | null | null | null | tools/j2objc/j2objc_header_map.py | Dyryamo/bazel | c60eb5d324da4d81f6be93f442ac6d7576741e8e | [
"Apache-2.0"
] | 3 | 2017-07-10T13:18:04.000Z | 2018-08-30T19:29:46.000Z | tools/j2objc/j2objc_header_map.py | Dyryamo/bazel | c60eb5d324da4d81f6be93f442ac6d7576741e8e | [
"Apache-2.0"
] | 1 | 2022-01-12T18:08:14.000Z | 2022-01-12T18:08:14.000Z | #!/usr/bin/python2.7
# Copyright 2017 The Bazel 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 req... | 36.807692 | 80 | 0.712226 |
066b46d94e4cf92724f0a51ad876ed84f6d0cbe2 | 176 | py | Python | Exercicio_12.py | Matheus2037/Exercicio_LP_1B | 7fab8246e999d7dde0ddb96f2a4ca45216c229d0 | [
"MIT"
] | null | null | null | Exercicio_12.py | Matheus2037/Exercicio_LP_1B | 7fab8246e999d7dde0ddb96f2a4ca45216c229d0 | [
"MIT"
] | null | null | null | Exercicio_12.py | Matheus2037/Exercicio_LP_1B | 7fab8246e999d7dde0ddb96f2a4ca45216c229d0 | [
"MIT"
] | null | null | null | salario = float(input("Digite o seu salário: "))
nsalario = (salario * 1.15)
print("O seu salario antigo era de {}, após o aumento será de {:.2f}" .format(salario, nsalario)) | 35.2 | 97 | 0.681818 |
fbb68af7bb9122ad2f7f51ff0b09e6093590353d | 36 | py | Python | venv/Lib/site-packages/PyQt4Enhanced/__init__.py | TEDxVienna/continuum | 85cefbc274fc59e2059c313bc0d3b9b93a34ba6d | [
"MIT"
] | null | null | null | venv/Lib/site-packages/PyQt4Enhanced/__init__.py | TEDxVienna/continuum | 85cefbc274fc59e2059c313bc0d3b9b93a34ba6d | [
"MIT"
] | null | null | null | venv/Lib/site-packages/PyQt4Enhanced/__init__.py | TEDxVienna/continuum | 85cefbc274fc59e2059c313bc0d3b9b93a34ba6d | [
"MIT"
] | null | null | null | from .main import QEMatplotlibWidget | 36 | 36 | 0.888889 |
682fe23c493bdf681d92d2b130c8c9057915bd85 | 379 | py | Python | hatter_orm/config.py | ndrwpvlv/hatter_orm | b358c8858a93eaf60b41e8b81940b6348d78bf68 | [
"MIT"
] | 2 | 2020-01-08T13:03:26.000Z | 2021-07-15T12:33:45.000Z | hatter_orm/config.py | ndrwpvlv/hatter_orm | b358c8858a93eaf60b41e8b81940b6348d78bf68 | [
"MIT"
] | null | null | null | hatter_orm/config.py | ndrwpvlv/hatter_orm | b358c8858a93eaf60b41e8b81940b6348d78bf68 | [
"MIT"
] | null | null | null | import sys
class Config:
PYTHON_MAJOR_VERSION = sys.version_info[0]
PYTHON_MINOR_VERSION = sys.version_info[1]
SQL_RESPONSE_LIMIT = 1844674407370955161
PRAGMA_SCRIPT = {
'foreign_key': 'PRAGMA foreign_keys = "1";\n',
'auto_vacuum': 'PRAGMA auto_vacuum = 0;',
}
JOIN_TYPES = ['LE... | 27.071429 | 54 | 0.649077 |
f8376dc891d30308ea62637ba33cdbb54ce84f2e | 297 | py | Python | Interview Based/Leader_in_array.py | nane121/HacktoberFest2020 | 29eb99754ee93f643d4b0bd7e18570079e718d59 | [
"MIT"
] | 25 | 2020-10-01T05:44:04.000Z | 2020-10-30T17:30:26.000Z | Interview Based/Leader_in_array.py | nane121/HacktoberFest2020 | 29eb99754ee93f643d4b0bd7e18570079e718d59 | [
"MIT"
] | 14 | 2020-10-01T09:32:47.000Z | 2020-11-05T16:17:12.000Z | Interview Based/Leader_in_array.py | nane121/HacktoberFest2020 | 29eb99754ee93f643d4b0bd7e18570079e718d59 | [
"MIT"
] | 143 | 2020-10-01T05:47:04.000Z | 2021-10-03T04:25:42.000Z | # -*- coding: utf-8 -*-
#7
#63 70 80 33 33 47 20
#
#Its Correct output is:
#80 47 20
#
#And Your Code's output is:
#70 80 47 20
N=int(input())
l=[]
A=[]
for i in range(0,N):
l.append((input()))
for i in range(0,N-1):
if(l[i]<l[i+1]):
A.append(l[i+1])
A.append(l[N-1])
print(A)
| 11 | 27 | 0.538721 |
095bdc779f385acbc4c0731cfd0a357c6253a003 | 6,351 | py | Python | trio/_path.py | guilledk/trio | d09c21df3ffe401ee4314d869d82a886bd776e3c | [
"Apache-2.0",
"MIT"
] | null | null | null | trio/_path.py | guilledk/trio | d09c21df3ffe401ee4314d869d82a886bd776e3c | [
"Apache-2.0",
"MIT"
] | null | null | null | trio/_path.py | guilledk/trio | d09c21df3ffe401ee4314d869d82a886bd776e3c | [
"Apache-2.0",
"MIT"
] | null | null | null | from functools import wraps, partial
import os
import types
import pathlib
import trio
from trio._util import async_wraps, SubclassingDeprecatedIn_v0_15_0
# re-wrap return value from methods that return new instances of pathlib.Path
def rewrap_path(value):
if isinstance(value, pathlib.Path):
value = Path... | 30.980488 | 80 | 0.638167 |
3e8caec344f79e03010c4a44621e89341ecbeb97 | 3,750 | py | Python | src/model/MIM/MIM.py | dreaming-coder/DeepLab | 3020544e2f9e139dde7bd04f6ff59e6f44d49c6e | [
"Apache-2.0"
] | 3 | 2021-05-31T09:25:59.000Z | 2022-03-10T08:09:51.000Z | src/model/MIM/MIM.py | dreaming-coder/DeepLab | 3020544e2f9e139dde7bd04f6ff59e6f44d49c6e | [
"Apache-2.0"
] | 1 | 2021-09-26T16:37:39.000Z | 2021-09-28T00:43:05.000Z | src/model/MIM/MIM.py | dreaming-coder/DeepLab | 3020544e2f9e139dde7bd04f6ff59e6f44d49c6e | [
"Apache-2.0"
] | null | null | null | r"""
Memory In Memory 的实现,出自论文《Memory In Memory: A Predictive Neural Network for Learning Higher-Order
Non-Stationarity from Spatiotemporal Dynamics》
"""
from typing import List
from torch import nn, Tensor
import torch
from MIMBlock import MIMBlock
from SpatiotemporalLSTM import SpatiotemporalLSTM
__all__ = ["MIM"]
... | 34.40367 | 109 | 0.5712 |
7ca64f8bd25f6eee29ceb284774bae2e59c2abd2 | 1,225 | py | Python | ciphey/basemods/Resources/cipheydists.py | blackcat-917/Ciphey | d24deea87cec2dea2e04ec3859b9e77e121d192a | [
"MIT"
] | 1 | 2021-11-28T17:55:04.000Z | 2021-11-28T17:55:04.000Z | ciphey/basemods/Resources/cipheydists.py | ScarlettHoefler/Ciphey | f7d21ce0993eeff0b53cec8717dfbd8f8419f8f5 | [
"MIT"
] | 10 | 2021-06-14T08:22:45.000Z | 2022-03-18T04:17:05.000Z | ciphey/basemods/Resources/cipheydists.py | ScarlettHoefler/Ciphey | f7d21ce0993eeff0b53cec8717dfbd8f8419f8f5 | [
"MIT"
] | 1 | 2020-10-05T17:35:00.000Z | 2020-10-05T17:35:00.000Z | from functools import lru_cache
from typing import Any, Dict, Optional, Set
import cipheydists
import loguru
from ciphey.iface import (
Config,
Distribution,
ParamSpec,
ResourceLoader,
Translation,
WordList,
registry,
)
@registry.register_multi(WordList, Distribution, Translation)
class ... | 26.630435 | 86 | 0.653878 |
e53c69c4c869faf44d91c6dda380d2c56fcd4237 | 11,367 | py | Python | familydoctor/DUrlConsumer.py | i2it/XYWYCrawler | 01d848f77690bfafff1fdc28efb09b6c0e9e11bc | [
"MIT"
] | 1 | 2020-04-11T04:20:33.000Z | 2020-04-11T04:20:33.000Z | familydoctor/DUrlConsumer.py | i2it/XYWYCrawler | 01d848f77690bfafff1fdc28efb09b6c0e9e11bc | [
"MIT"
] | null | null | null | familydoctor/DUrlConsumer.py | i2it/XYWYCrawler | 01d848f77690bfafff1fdc28efb09b6c0e9e11bc | [
"MIT"
] | 1 | 2020-04-11T03:55:01.000Z | 2020-04-11T03:55:01.000Z | #! /usr/bin/python
import traceback
from datetime import datetime
import gevent
from gevent import monkey
from common.DBHandler import MySQL
from common.DBHandler import Redis
from common.IOHandler import FileIO
from common.IOHandler import NetworkIO
monkey.patch_all()
def getAllInfo(dbkey):
urlPool = Redis()... | 50.52 | 119 | 0.544295 |
5960088035b5df4aefdc1abf2b6dd9894a0c53be | 5,978 | py | Python | estimators.py | RakitinDen/pytorch-recursive-gumbel-max-trick | 44f9854020e727946a074a6e53b20dd593f96cc1 | [
"Apache-2.0"
] | 20 | 2021-12-03T13:20:17.000Z | 2022-03-20T18:58:06.000Z | estimators.py | RakitinDen/pytorch-recursive-gumbel-max-trick | 44f9854020e727946a074a6e53b20dd593f96cc1 | [
"Apache-2.0"
] | null | null | null | estimators.py | RakitinDen/pytorch-recursive-gumbel-max-trick | 44f9854020e727946a074a6e53b20dd593f96cc1 | [
"Apache-2.0"
] | null | null | null | # Estimators are partially based on the "estimators.py" from the following repositories:
# https://github.com/agadetsky/pytorch-pl-variance-reduction
# https://github.com/sdrobert/pydrobert-pytorch
import torch
def uniform_to_exp(logits, uniform=None, enable_grad=False):
'''
Converts a tensor of independent u... | 36.674847 | 119 | 0.666109 |
876ea23897293976ed6d4c89dc0ac3f3913fd93a | 1,155 | py | Python | medium/python/c0090_173_binary-search-tree-iterator/00_leetcode_0090.py | drunkwater/leetcode | 8cc4a07763e71efbaedb523015f0c1eff2927f60 | [
"Ruby"
] | null | null | null | medium/python/c0090_173_binary-search-tree-iterator/00_leetcode_0090.py | drunkwater/leetcode | 8cc4a07763e71efbaedb523015f0c1eff2927f60 | [
"Ruby"
] | null | null | null | medium/python/c0090_173_binary-search-tree-iterator/00_leetcode_0090.py | drunkwater/leetcode | 8cc4a07763e71efbaedb523015f0c1eff2927f60 | [
"Ruby"
] | 3 | 2018-02-09T02:46:48.000Z | 2021-02-20T08:32:03.000Z | # DRUNKWATER TEMPLATE(add description and prototypes)
# Question Title and Description on leetcode.com
# Function Declaration and Function Prototypes on leetcode.com
#173. Binary Search Tree Iterator
#Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.
#... | 33 | 118 | 0.641558 |
b0bff1143e8fc07382e4e4d809b36b296a3f453c | 240 | py | Python | Python/flipping-an-image.py | kuanhungchen/leetcode-practice | b75e773ada60b685da1576ae5f2234b70bc27842 | [
"CNRI-Python"
] | 1 | 2020-04-29T06:19:44.000Z | 2020-04-29T06:19:44.000Z | Python/flipping-an-image.py | kuanhungchen/leetcode-practice | b75e773ada60b685da1576ae5f2234b70bc27842 | [
"CNRI-Python"
] | null | null | null | Python/flipping-an-image.py | kuanhungchen/leetcode-practice | b75e773ada60b685da1576ae5f2234b70bc27842 | [
"CNRI-Python"
] | null | null | null | class Solution:
def flipAndInvertImage(self, A):
A = [A[i][::-1] for i in range(len(A))]
for i in range(len(A)):
for j in range(len(A[0])):
A[i][j] = 1 if A[i][j] == 0 else 0
return A
| 30 | 50 | 0.4625 |
1cb593459c122137ee104ce6867fdfaa0bba92a1 | 9,448 | py | Python | baseStation/src/context/remote.py | olgam4/design3 | 6e05d123a24deae7dda646df535844a158ef5cc0 | [
"WTFPL"
] | null | null | null | baseStation/src/context/remote.py | olgam4/design3 | 6e05d123a24deae7dda646df535844a158ef5cc0 | [
"WTFPL"
] | null | null | null | baseStation/src/context/remote.py | olgam4/design3 | 6e05d123a24deae7dda646df535844a158ef5cc0 | [
"WTFPL"
] | null | null | null | import tkinter as tk
from tkinter import ttk
from application.domain.application import Application
from application.infrastructure.applicationWorker import ApplicationWorker
from application.infrastructure.chargeStationWatcher import ChargeStationWatcher
from application.infrastructure.robotWatcher import RobotWatche... | 61.350649 | 116 | 0.771804 |
7ad76b4f807d84cf8f6796168fc87a7ecbe4fd01 | 2,890 | py | Python | src/function_approx.py | AI-Gio/LunarLander | 867425223a186bc0dd3378e3bd2888cd525d2834 | [
"MIT"
] | null | null | null | src/function_approx.py | AI-Gio/LunarLander | 867425223a186bc0dd3378e3bd2888cd525d2834 | [
"MIT"
] | null | null | null | src/function_approx.py | AI-Gio/LunarLander | 867425223a186bc0dd3378e3bd2888cd525d2834 | [
"MIT"
] | null | null | null | import tensorflow.compat.v1 as tf
from keras.models import Sequential
from keras.layers import Dense
import numpy as np
import warnings
tf.disable_v2_behavior()
warnings.filterwarnings("ignore", category=UserWarning)
class FunctionApprox:
"""
The network class of the simulation. Used as to create a policy net... | 34 | 98 | 0.634602 |
1fe662bc730b692cd872c696bb2f433c2dc69d6a | 1,791 | py | Python | CondTools/Ecal/python/copyFgrGroup_cfg.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 3 | 2018-08-24T19:10:26.000Z | 2019-02-19T11:45:32.000Z | CondTools/Ecal/python/copyFgrGroup_cfg.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 7 | 2016-07-17T02:34:54.000Z | 2019-08-13T07:58:37.000Z | CondTools/Ecal/python/copyFgrGroup_cfg.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 5 | 2018-08-21T16:37:52.000Z | 2020-01-09T13:33:17.000Z | import FWCore.ParameterSet.Config as cms
import CondTools.Ecal.conddb_init as conddb_init
import CondTools.Ecal.db_credentials as auth
process = cms.Process("ProcessOne")
process.MessageLogger = cms.Service("MessageLogger",
debugModules = cms.untracked.vstring('*'),
cout = cms.untracked.PSet(
threshol... | 31.982143 | 71 | 0.707984 |
819ebcfae70128c9cf852d04ce102d22fb6d1b7a | 473 | py | Python | Lib/site-packages/plotly/validators/scatter/_uid.py | tytanya/my-first-blog | 2b40adb0816c3546e90ad6ca1e7fb50d924c1536 | [
"bzip2-1.0.6"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/validators/scatter/_uid.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 6 | 2021-03-18T22:27:08.000Z | 2022-03-11T23:40:50.000Z | plotly/validators/scatter/_uid.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | import _plotly_utils.basevalidators
class UidValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name='uid', parent_name='scatter', **kwargs):
super(UidValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
anim=kwar... | 31.533333 | 75 | 0.627907 |
fa2b9bceb9806774fde46881674df156f4a7885c | 587 | py | Python | rowingdata/painsled_desktop_plot.py | sanderroosendaal/rowingdata | efd8aa1566a926f11fb3f6b5b340665bc26028c4 | [
"MIT"
] | 4 | 2017-04-24T15:20:46.000Z | 2021-02-12T23:03:29.000Z | build/lib/rowingdata/painsled_desktop_plot.py | sanderroosendaal/rowingdata | efd8aa1566a926f11fb3f6b5b340665bc26028c4 | [
"MIT"
] | 38 | 2016-11-02T07:57:50.000Z | 2022-01-22T13:25:14.000Z | build/lib/rowingdata/painsled_desktop_plot.py | sanderroosendaal/rowingdata | efd8aa1566a926f11fb3f6b5b340665bc26028c4 | [
"MIT"
] | 6 | 2017-01-19T21:39:46.000Z | 2021-11-16T14:48:58.000Z | #! /usr/bin/python
from __future__ import absolute_import
from __future__ import print_function
from . import rowingdata
from sys import argv
def main():
readFile=argv[1]
try:
rowerFile=argv[2]
except IndexError:
rowerFile="defaultrower.txt"
rower=rowingdata.getrower(rowerFile)
o... | 18.935484 | 73 | 0.708688 |
89289ced29c3cba555d674e90d5616a41995d742 | 24,861 | py | Python | lib/galaxy/datatypes/text.py | uio-bmi/galaxy-graph-peak-caller | 0e0e8e9bd6d461a4e25b49cea2e6753043f747e0 | [
"CC-BY-3.0"
] | 2 | 2017-10-23T14:44:12.000Z | 2018-01-14T10:37:28.000Z | lib/galaxy/datatypes/text.py | uio-bmi/galaxy-graph-peak-caller | 0e0e8e9bd6d461a4e25b49cea2e6753043f747e0 | [
"CC-BY-3.0"
] | 30 | 2016-10-20T15:35:12.000Z | 2018-10-02T15:59:54.000Z | lib/galaxy/datatypes/text.py | uio-bmi/galaxy-graph-peak-caller | 0e0e8e9bd6d461a4e25b49cea2e6753043f747e0 | [
"CC-BY-3.0"
] | 4 | 2017-06-12T09:54:31.000Z | 2019-03-15T12:02:39.000Z | # -*- coding: utf-8 -*-
""" Clearing house for generic text datatypes that are not XML or tabular.
"""
import gzip
import json
import logging
import os
import re
import subprocess
import tempfile
from six.moves import shlex_quote
from galaxy.datatypes.data import get_file_peek, Text
from galaxy.datatypes.metadata im... | 43.311847 | 182 | 0.560315 |
64dbb6604ce1a311b1b8d1d483df704678a0a6fe | 695 | py | Python | django_pages/site/__init__.py | lunemec/django-pages | caed40f9275919b81417924550e7bcfdc7c5ffbf | [
"BSD-3-Clause"
] | 3 | 2015-11-24T02:30:48.000Z | 2018-11-01T10:10:24.000Z | django_pages/site/__init__.py | lunemec/django-pages | caed40f9275919b81417924550e7bcfdc7c5ffbf | [
"BSD-3-Clause"
] | 1 | 2015-04-18T16:37:36.000Z | 2015-04-18T16:37:36.000Z | django_pages/site/__init__.py | lunemec/django-pages | caed40f9275919b81417924550e7bcfdc7c5ffbf | [
"BSD-3-Clause"
] | 2 | 2015-11-24T02:01:00.000Z | 2019-04-09T15:33:56.000Z | # -*- encoding: utf-8 -*-
from ..common.errors import ConfigurationError
from .models import Site, Script
def get_site():
"""
checks for site with pk=1
@return Site object
@raises ConfigurationError
"""
try:
site = Site.objects.get(pk=1)
return site
except Site.DoesNotEx... | 23.166667 | 141 | 0.667626 |
dd61b51e35060ad9721104c25ccb8cb5c9280e12 | 803 | py | Python | pony_barn/settings/base_settings.py | ericholscher/pony_barn | 8294a816c1db81582b135e71d670d18295718f4e | [
"MIT"
] | 3 | 2015-05-19T02:50:05.000Z | 2015-11-08T11:35:27.000Z | pony_barn/settings/base_settings.py | ericholscher/pony_barn | 8294a816c1db81582b135e71d670d18295718f4e | [
"MIT"
] | null | null | null | pony_barn/settings/base_settings.py | ericholscher/pony_barn | 8294a816c1db81582b135e71d670d18295718f4e | [
"MIT"
] | null | null | null | import os
DEBUG = False
TEMPLATE_DEBUG = DEBUG
ADMINS = ( )
CUR_DIR = os.path.dirname(os.path.abspath(__file__))
{% if db_engine %}
DATABASE_ENGINE = '{{ db_engine }}'
{% endif %}
{% if db_name %}
DATABASE_NAME = '{{ db_name }}'
{% endif %}
{% if db_pass %}
DATABASE_PASSWORD = '{{ db_pass }}'
{% endif %}
{% if db_use... | 18.25 | 52 | 0.631382 |
74cc99dea2d3271134e39e2621b8183df99be6f9 | 1,820 | py | Python | azure-graphrbac/azure/graphrbac/models/password_credential.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | azure-graphrbac/azure/graphrbac/models/password_credential.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | azure-graphrbac/azure/graphrbac/models/password_credential.py | HydAu/AzureSDKForPython | 5cbe34e9e0b8ea1faacc9f205633ccc0b885c0f3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft and contributors. 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 ... | 35.686275 | 80 | 0.629121 |
d7b59866b224a4818f90369f22b4c9758bf1f069 | 9,669 | py | Python | lib/model/rpn/tracking_proposal_target_layer.py | Feynman27/pytorch-detect-rfcn | 33cc264306be841ffaf997c4c458ca9ac2329378 | [
"MIT"
] | 32 | 2018-10-10T10:17:06.000Z | 2021-08-18T11:07:51.000Z | lib/model/rpn/tracking_proposal_target_layer.py | Feynman27/pytorch-detect-rfcn | 33cc264306be841ffaf997c4c458ca9ac2329378 | [
"MIT"
] | 9 | 2018-10-12T01:54:51.000Z | 2020-11-22T07:36:19.000Z | lib/model/rpn/tracking_proposal_target_layer.py | Feynman27/pytorch-detect-rfcn | 33cc264306be841ffaf997c4c458ca9ac2329378 | [
"MIT"
] | 4 | 2019-03-08T15:55:08.000Z | 2019-08-28T10:36:15.000Z | from __future__ import absolute_import
# --------------------------------------------------------
# Faster R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick and Sean Bell
# --------------------------------------------------------
# ---------------... | 49.331633 | 112 | 0.626952 |
7052e92e02cf6fe3cc4f48c66958e958f28dd0b7 | 2,338 | py | Python | eclcli/bare/v2/port.py | shimisho/eclcli | a1f55ec9c6a0849c8b2100ddb8938a3bee141100 | [
"Apache-2.0"
] | null | null | null | eclcli/bare/v2/port.py | shimisho/eclcli | a1f55ec9c6a0849c8b2100ddb8938a3bee141100 | [
"Apache-2.0"
] | null | null | null | eclcli/bare/v2/port.py | shimisho/eclcli | a1f55ec9c6a0849c8b2100ddb8938a3bee141100 | [
"Apache-2.0"
] | null | null | null | from eclcli.common import command
from eclcli.bare import bare_utils
from eclcli.common import utils
class ListPort(command.Lister):
"""List all nic physical ports for a server"""
def get_parser(self, prog_name):
parser = super(ListPort, self).get_parser(prog_name)
parser.add_argument(
... | 30.763158 | 82 | 0.555603 |
8255933e2a61a376235c2de08e90c66a11149a02 | 3,670 | py | Python | huaweicloud-sdk-apig/huaweicloudsdkapig/v2/model/delete_environment_v2_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-apig/huaweicloudsdkapig/v2/model/delete_environment_v2_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-apig/huaweicloudsdkapig/v2/model/delete_environment_v2_request.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class DeleteEnvironmentV2Request:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict):... | 26.214286 | 79 | 0.563488 |
8e168f00b63a1e58442e6d98826a4f1f40e206dc | 1,883 | py | Python | functions_legacy/BackwardSelection.py | dpopadic/arpmRes | ddcc4de713b46e3e9dcb77cc08c502ce4df54f76 | [
"MIT"
] | 6 | 2021-04-10T13:24:30.000Z | 2022-03-26T08:20:42.000Z | functions_legacy/BackwardSelection.py | dpopadic/arpmRes | ddcc4de713b46e3e9dcb77cc08c502ce4df54f76 | [
"MIT"
] | null | null | null | functions_legacy/BackwardSelection.py | dpopadic/arpmRes | ddcc4de713b46e3e9dcb77cc08c502ce4df54f76 | [
"MIT"
] | 6 | 2019-08-13T22:02:17.000Z | 2022-02-09T17:49:12.000Z | import matplotlib.pyplot as plt
import numpy as np
from numpy import max as npmax
from numpy import zeros, where, mod, ceil
from scipy.misc import comb
plt.style.use('seaborn')
def BackwardSelection(v,data,objective,step=1,k_min=1):
# Backward stepwise routine for n_-choose-k selection problems
# INPUTS
... | 28.104478 | 96 | 0.560276 |
833f6930f7f410f1483d4f3df7a2da55725149d7 | 4,942 | py | Python | services/web/server/src/simcore_service_webserver/studies_dispatcher/_users.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | 25 | 2018-04-13T12:44:12.000Z | 2022-03-12T15:01:17.000Z | services/web/server/src/simcore_service_webserver/studies_dispatcher/_users.py | colinRawlings/osparc-simcore | bf2f18d5bc1e574d5f4c238d08ad15156184c310 | [
"MIT"
] | 2,553 | 2018-01-18T17:11:55.000Z | 2022-03-31T16:26:40.000Z | services/web/server/src/simcore_service_webserver/studies_dispatcher/_users.py | odeimaiz/osparc-simcore | 71c2fc58dcfe067487dcd75cb70298a4d6237e97 | [
"MIT"
] | 20 | 2018-01-18T19:45:33.000Z | 2022-03-29T07:08:47.000Z | """ Users management
Keeps functionality that couples with the following app modules
- users,
- login
- security
- resource_manager
"""
import logging
from typing import Dict, Optional
from aiohttp import web
from aioredlock import Aioredlock
from pydantic import BaseModel
from ..login.cfg import g... | 33.167785 | 135 | 0.677256 |
336980b47a33312c08a6f9a32e6002d76f3f15e7 | 800 | py | Python | tests/test_GitHubUtils.py | Prodigysov/pyutil | d8faa7196ce3f9f156b49d088c97d93d25c2ec20 | [
"Apache-2.0"
] | null | null | null | tests/test_GitHubUtils.py | Prodigysov/pyutil | d8faa7196ce3f9f156b49d088c97d93d25c2ec20 | [
"Apache-2.0"
] | null | null | null | tests/test_GitHubUtils.py | Prodigysov/pyutil | d8faa7196ce3f9f156b49d088c97d93d25c2ec20 | [
"Apache-2.0"
] | null | null | null | import os
import unittest
from github.GithubException import GithubException
from pyutil import GitHubUtils
from .TestSupport import TestSupport
class test_GitHubUtils(unittest.TestCase):
def test_search_repos_with_username(self):
test_user = "google"
test_repos_1 = GitHubUtils.search_repos("use... | 30.769231 | 109 | 0.72 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.