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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
30f7860eea7a2c05715f990ac8a52cf2da776594 | 62 | py | Python | code/abc114_a_03.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | 3 | 2019-08-16T16:55:48.000Z | 2021-04-11T10:21:40.000Z | code/abc114_a_03.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | null | null | null | code/abc114_a_03.py | KoyanagiHitoshi/AtCoder | 731892543769b5df15254e1f32b756190378d292 | [
"MIT"
] | null | null | null | x=input()
if x in "753":
print("YES")
else:
print("NO") | 12.4 | 16 | 0.532258 |
fb2ac63f9cdde1a014d4f8fed5001bf9b9074564 | 12,636 | py | Python | digits/utils/caffe_tf_pb2.py | hieuvodoi/digits_7 | cfd94b01a147c26a23cdb7dd4160da09eadb2c42 | [
"BSD-3-Clause"
] | null | null | null | digits/utils/caffe_tf_pb2.py | hieuvodoi/digits_7 | cfd94b01a147c26a23cdb7dd4160da09eadb2c42 | [
"BSD-3-Clause"
] | null | null | null | digits/utils/caffe_tf_pb2.py | hieuvodoi/digits_7 | cfd94b01a147c26a23cdb7dd4160da09eadb2c42 | [
"BSD-3-Clause"
] | null | null | null | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: caffe_tf.proto
import sys
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from... | 43.12628 | 1,041 | 0.656062 |
fc9cda9c9af822307cd235b16bfc93ad285a52f1 | 10,971 | py | Python | catapult_build/dev_server.py | Scopetta197/catapult | 9cbc959a8a88460f71473794bdc92e39d6b3ee0d | [
"BSD-3-Clause"
] | null | null | null | catapult_build/dev_server.py | Scopetta197/catapult | 9cbc959a8a88460f71473794bdc92e39d6b3ee0d | [
"BSD-3-Clause"
] | null | null | null | catapult_build/dev_server.py | Scopetta197/catapult | 9cbc959a8a88460f71473794bdc92e39d6b3ee0d | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import print_function
from __future__ import absolute_import
import argparse
import json
import os
import sys
import six.moves.urllib.pa... | 32.267647 | 77 | 0.673959 |
2520c9c7768c3648bac57dfd7b71fb62adacf67a | 6,724 | py | Python | volpy/scene.py | OEP/volpy | f49cae8b2e14b664dea26ccbcbdcadac31d80d5b | [
"MIT"
] | null | null | null | volpy/scene.py | OEP/volpy | f49cae8b2e14b664dea26ccbcbdcadac31d80d5b | [
"MIT"
] | null | null | null | volpy/scene.py | OEP/volpy | f49cae8b2e14b664dea26ccbcbdcadac31d80d5b | [
"MIT"
] | null | null | null | import numpy as np
import threading
import multiprocessing
from .camera import Camera
from ._util import cartesian
from ._native import cast_rays
class Element(object):
def __init__(self, density, color=None):
'''
Element constructor.
Parameters
----------
density : cal... | 30.563636 | 79 | 0.586109 |
9016596c667ca1241e413bd33e8349f734810397 | 3,294 | py | Python | day16/part2.py | nealcox/aoc2021 | e5eb78bc9fb5d0ab0a19b0c3ea8634560a30d220 | [
"MIT"
] | null | null | null | day16/part2.py | nealcox/aoc2021 | e5eb78bc9fb5d0ab0a19b0c3ea8634560a30d220 | [
"MIT"
] | null | null | null | day16/part2.py | nealcox/aoc2021 | e5eb78bc9fb5d0ab0a19b0c3ea8634560a30d220 | [
"MIT"
] | null | null | null | import re
import sys
from collections import defaultdict
from itertools import permutations
def main():
filename = "input.txt"
if len(sys.argv) > 1:
filename = sys.argv[1]
with open(filename) as f:
input_text = f.read().strip()
print(f"Answer: {calculate(input_text)}")
def calculate(... | 19.963636 | 78 | 0.514572 |
921a9ce3610c8e74f2779c3a3e0fadc1972a84e3 | 995 | py | Python | examples/chatbot.py | kneasle/belltower | a8016b3adf3cd0202fa1323fd7d83f00406c11f5 | [
"MIT"
] | 1 | 2021-05-09T08:47:55.000Z | 2021-05-09T08:47:55.000Z | examples/chatbot.py | kneasle/belltower | a8016b3adf3cd0202fa1323fd7d83f00406c11f5 | [
"MIT"
] | null | null | null | examples/chatbot.py | kneasle/belltower | a8016b3adf3cd0202fa1323fd7d83f00406c11f5 | [
"MIT"
] | null | null | null | # Import the tower class, and 'time.sleep'
from time import sleep
from belltower import RingingRoomTower
# Create a new tower, and tell it to join tower ID 765432918
tower = RingingRoomTower(765432918)
# Register a function to be called when a chat message is posted
@tower.on_chat
def on_chat(user, message):
prin... | 36.851852 | 77 | 0.706533 |
87792dd2144cb18321dbea6ec438fb1a8fa2bafe | 49,028 | py | Python | test/test_references_with_asset_group_id_link.py | greenpau/py_insightvm_sdk | bd881f26e14cb9f0f9c47927469ec992de9de8e6 | [
"Apache-2.0"
] | 2 | 2019-03-15T16:05:54.000Z | 2020-07-19T18:37:50.000Z | test/test_references_with_asset_group_id_link.py | greenpau/py_insightvm_sdk | bd881f26e14cb9f0f9c47927469ec992de9de8e6 | [
"Apache-2.0"
] | 1 | 2021-03-26T04:46:12.000Z | 2021-03-26T04:51:23.000Z | test/test_references_with_asset_group_id_link.py | greenpau/py_insightvm_sdk | bd881f26e14cb9f0f9c47927469ec992de9de8e6 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
InsightVM API
# Overview This guide documents the InsightVM Application Programming Interface (API) Version 3. This API supports the Representation State Transfer (REST) design pattern. Unless noted otherwise this API accepts and produces the `application/json` media type. This API uses ... | 1,195.804878 | 48,045 | 0.491801 |
28a0f4468219b35c131c114f612a5ea659ec43cc | 16,166 | py | Python | hatespeech_core/modules/models/codeword_search.py | JherezTaylor/thesis-preprocessing | 7b52ee05af90b451c8bd07c29610cce36e08aa94 | [
"MIT"
] | 13 | 2018-02-14T13:59:23.000Z | 2021-04-16T10:05:59.000Z | hatespeech_core/modules/models/codeword_search.py | JherezTaylor/hatespeech_codewords | 7b52ee05af90b451c8bd07c29610cce36e08aa94 | [
"MIT"
] | 13 | 2016-12-15T09:56:36.000Z | 2016-12-20T04:58:48.000Z | hatespeech_core/modules/models/codeword_search.py | JherezTaylor/thesis-preprocessing | 7b52ee05af90b451c8bd07c29610cce36e08aa94 | [
"MIT"
] | 4 | 2019-08-12T13:33:33.000Z | 2020-08-26T07:54:44.000Z | # Author: Jherez Taylor <jherez.taylor@gmail.com>
# License: MIT
# Python 3.5
"""
This module stores functions for selecting candidate codewords.
"""
from joblib import Parallel, delayed, cpu_count
from textblob import TextBlob
from ..utils import settings
from ..utils import file_ops
from ..utils import word_enrichm... | 42.994681 | 121 | 0.630459 |
611678dc53de47ca738404698086b9514527b2d7 | 1,003 | py | Python | molo/core/migrations/0031_sitesettings.py | Ishma59/molo | 4fd31df9266bc251e09e9339a132d3ccd4143c69 | [
"BSD-2-Clause"
] | 25 | 2015-09-26T13:45:30.000Z | 2018-09-13T14:12:20.000Z | molo/core/migrations/0031_sitesettings.py | Ishma59/molo | 4fd31df9266bc251e09e9339a132d3ccd4143c69 | [
"BSD-2-Clause"
] | 510 | 2015-05-29T09:30:44.000Z | 2018-12-11T09:08:11.000Z | molo/core/migrations/0031_sitesettings.py | Ishma59/molo | 4fd31df9266bc251e09e9339a132d3ccd4143c69 | [
"BSD-2-Clause"
] | 5 | 2020-03-26T19:30:13.000Z | 2020-09-04T16:35:59.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('wagtailcore', '0023_alter_page_revision_on_delete_behaviour'),
('wagtailimages', '0010_change_on_del... | 34.586207 | 157 | 0.628116 |
47183a4eadaa96825289bfaefb3c3318b282cb6e | 166 | py | Python | week0/swap.py | WilliamDu22/WilliamDu | fae50124bdcddec2891075d403cc950475eef900 | [
"MIT"
] | null | null | null | week0/swap.py | WilliamDu22/WilliamDu | fae50124bdcddec2891075d403cc950475eef900 | [
"MIT"
] | null | null | null | week0/swap.py | WilliamDu22/WilliamDu | fae50124bdcddec2891075d403cc950475eef900 | [
"MIT"
] | null | null | null | def sort(a, b):
if b < a:
a, b = b, a
return a, b
def run():
a = input("first number")
b = input("second numer")
print(', '.join(sort(a, b)))
| 15.090909 | 30 | 0.481928 |
e1c9afafb6bcb67c985d96f86df82a5fbd87a625 | 2,773 | py | Python | release/stubs.min/System/Runtime/InteropServices/__init___parts/_ILGenerator.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/System/Runtime/InteropServices/__init___parts/_ILGenerator.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs.min/System/Runtime/InteropServices/__init___parts/_ILGenerator.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | class _ILGenerator:
""" Exposes the System.Reflection.Emit.ILGenerator class to unmanaged code. """
def GetIDsOfNames(self, riid, rgszNames, cNames, lcid, rgDispId):
"""
GetIDsOfNames(self: _ILGenerator,riid: Guid,rgszNames: IntPtr,cNames: UInt32,lcid: UInt32,rgDispId: IntPtr) -> Guid
... | 27.455446 | 171 | 0.664623 |
39973b6b47d7d007fd155c8b9f4d434abe63b4bd | 3,473 | py | Python | src/utils/semisup/general.py | hendraet/IIC | a5bab915eda133b0ecfd42eaacd60c7b26807cb6 | [
"MIT"
] | null | null | null | src/utils/semisup/general.py | hendraet/IIC | a5bab915eda133b0ecfd42eaacd60c7b26807cb6 | [
"MIT"
] | null | null | null | src/utils/semisup/general.py | hendraet/IIC | a5bab915eda133b0ecfd42eaacd60c7b26807cb6 | [
"MIT"
] | null | null | null | import numpy as np
import torch
from torch import nn as nn
from torch.autograd import Variable
from src.utils.cluster.transforms import sobel_process
def get_dlen(net_features, dataloader, include_rgb=None, penultimate_features=False):
imgs, _ = next(iter(dataloader))
img = torch.unsqueeze(imgs[0], 0)
so... | 34.04902 | 116 | 0.661964 |
ff979fbeec87b0004762c1026cca15efd88c6346 | 14,129 | py | Python | fanficdownloader/adapters/adapter_ksarchivecom.py | rodrigonz/rodrigodeoliveiracosta-clone | 5fb6d2a167e24199f8080ba78392821659575685 | [
"Apache-2.0"
] | null | null | null | fanficdownloader/adapters/adapter_ksarchivecom.py | rodrigonz/rodrigodeoliveiracosta-clone | 5fb6d2a167e24199f8080ba78392821659575685 | [
"Apache-2.0"
] | null | null | null | fanficdownloader/adapters/adapter_ksarchivecom.py | rodrigonz/rodrigodeoliveiracosta-clone | 5fb6d2a167e24199f8080ba78392821659575685 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2011 Fanficdownloader team
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 45.140575 | 162 | 0.56338 |
530aae24dd4d9eab2a5e35b28342acbb21294bd8 | 1,939 | py | Python | src/tradssat/out/soilwat.py | gaiadhi/traDSSAT | 1d5615dbd4965bab5c2740134c706c1748ff5fae | [
"MIT"
] | 6 | 2020-10-05T11:50:37.000Z | 2022-02-24T08:36:22.000Z | src/tradssat/out/soilwat.py | gaiadhi/traDSSAT | 1d5615dbd4965bab5c2740134c706c1748ff5fae | [
"MIT"
] | 23 | 2018-11-08T19:16:36.000Z | 2021-07-20T23:34:18.000Z | src/tradssat/out/soilwat.py | gaiadhi/traDSSAT | 1d5615dbd4965bab5c2740134c706c1748ff5fae | [
"MIT"
] | 9 | 2018-11-06T21:04:07.000Z | 2021-06-19T05:43:24.000Z | from tradssat.tmpl.output import OutFile
from tradssat.tmpl.var import FloatVar, IntegerVar
class SoilWatOut(OutFile):
filename = 'SoilWat.Out'
def _get_var_info(self):
return vars_
vars_ = {
IntegerVar('YEAR', 4, info='Year'),
IntegerVar('DOY', 3, info='Day of year starting on Jan 1.'),
... | 48.475 | 83 | 0.656008 |
7cdf7e67fd5bdac87f30de0ca57759fba6ccb119 | 544 | py | Python | imre/day3_1.py | codingkrabbe/adventofcode | 21965a9519e8c20ab154354fd4b4ad3c807b7b95 | [
"MIT"
] | 5 | 2021-12-01T21:44:22.000Z | 2021-12-09T19:11:21.000Z | imre/day3_1.py | codingkrabbe/adventofcode | 21965a9519e8c20ab154354fd4b4ad3c807b7b95 | [
"MIT"
] | null | null | null | imre/day3_1.py | codingkrabbe/adventofcode | 21965a9519e8c20ab154354fd4b4ad3c807b7b95 | [
"MIT"
] | 3 | 2021-12-01T21:41:20.000Z | 2021-12-03T14:17:24.000Z | import pyperclip
input = pyperclip.paste().splitlines()
ones = [0] * len(input[0]) # Number of ones
for i in input:
vals = [int(n) for n in i]
ones = [a + b for a, b in zip(ones, vals)]
bin1 = [int(n > len(input) / 2) for n in ones] # Most common digit
bin2 = [{0: 1, 1: 0}[n] for n in bin1] # Mirror the above
g... | 45.333333 | 95 | 0.628676 |
36077273be1eb8303f498f4284e7d4a5183e7b63 | 750 | py | Python | lib/rats.py | d2verb/firmflaws | 2ac5dd9fcde46a24b70cdd402af371e2b2f93445 | [
"Beerware"
] | 46 | 2016-07-25T14:42:58.000Z | 2022-03-20T00:39:53.000Z | lib/rats.py | d2verb/firmflaws | 2ac5dd9fcde46a24b70cdd402af371e2b2f93445 | [
"Beerware"
] | 4 | 2016-07-22T13:32:36.000Z | 2017-08-23T07:27:47.000Z | lib/rats.py | d2verb/firmflaws | 2ac5dd9fcde46a24b70cdd402af371e2b2f93445 | [
"Beerware"
] | 23 | 2016-07-21T18:58:58.000Z | 2022-03-20T00:40:01.000Z | import os
from django.conf import settings
import subprocess
def is_parsable(filename):
""" check if file is parsable by rats
"""
filename, file_extension = os.path.splitext(filename)
return file_extension in ['.php', '.pl', '.c', '.cpp', '.py', '.cgi', '.inc', '.cgi']
def parse(filename):
""" Do the rats parsi... | 26.785714 | 86 | 0.646667 |
6cdaf73d27f50497b3b6b9de3fdca3bc2edc6759 | 152 | py | Python | tests/testapp1/views/myview.py | Prev/jikji | 1878791456737e3053bc7e0748a7a890a77a98bc | [
"MIT"
] | 11 | 2016-09-14T12:03:43.000Z | 2021-01-24T08:56:28.000Z | tests/testapp1/views/myview.py | Prev/jikji | 1878791456737e3053bc7e0748a7a890a77a98bc | [
"MIT"
] | 17 | 2016-09-20T09:36:55.000Z | 2020-07-05T05:30:10.000Z | tests/testapp1/views/myview.py | Prev/jikji | 1878791456737e3053bc7e0748a7a890a77a98bc | [
"MIT"
] | 5 | 2016-09-29T06:52:43.000Z | 2017-06-21T00:36:41.000Z | from jikji import render_template, register_view
@register_view(url_rule='/$1.html')
def myview(num) :
return render_template('template1.html', n=num) | 30.4 | 48 | 0.782895 |
a5d078ced2876757f3258f8a6aea5cf4bd0155da | 9,334 | py | Python | python/paddle/fluid/tests/unittests/npu/test_reduce_max_op_npu.py | xingjing1/Paddle | af886995ac38bd26588de33205a19eb1e72fecbf | [
"Apache-2.0"
] | 3 | 2017-05-11T11:10:13.000Z | 2017-10-23T09:13:14.000Z | python/paddle/fluid/tests/unittests/npu/test_reduce_max_op_npu.py | gongweibao/Paddle | c91b1e039f29a62fb3050f979afecd71eabd734f | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/unittests/npu/test_reduce_max_op_npu.py | gongweibao/Paddle | c91b1e039f29a62fb3050f979afecd71eabd734f | [
"Apache-2.0"
] | 1 | 2021-08-12T02:27:50.000Z | 2021-08-12T02:27:50.000Z | # Copyright (c) 2021 PaddlePaddle 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 app... | 33.217082 | 87 | 0.632526 |
9fd9dd7c8134874c07bcb2bb0f54c5818f8ca27e | 5,541 | py | Python | activitysim/abm/models/cdap.py | SEMCOG/SEMCOG_ActSim | cc18cce84b2e4b5f380f58c7919953d2cd03ee73 | [
"BSD-3-Clause"
] | null | null | null | activitysim/abm/models/cdap.py | SEMCOG/SEMCOG_ActSim | cc18cce84b2e4b5f380f58c7919953d2cd03ee73 | [
"BSD-3-Clause"
] | 1 | 2021-06-30T23:39:37.000Z | 2021-06-30T23:39:37.000Z | activitysim/abm/models/cdap.py | SEMCOG/SEMCOG_ActSim | cc18cce84b2e4b5f380f58c7919953d2cd03ee73 | [
"BSD-3-Clause"
] | null | null | null | # ActivitySim
# See full license in LICENSE.txt.
import logging
import pandas as pd
from activitysim.core import simulate
from activitysim.core import tracing
from activitysim.core import pipeline
from activitysim.core import config
from activitysim.core import inject
from activitysim.core import expressions
from ac... | 42.623077 | 115 | 0.750587 |
6bcbf8738ac484769b424e5bad2bad7a91ed3e39 | 3,916 | py | Python | state_experiments/ub_runs.py | vrdi/shortbursts-gingles | d9fb26ec313cd93ac80171b23095c4f3dfab0422 | [
"MIT"
] | 1 | 2020-12-29T22:54:06.000Z | 2020-12-29T22:54:06.000Z | state_experiments/ub_runs.py | vrdi/shortbursts-gingles | d9fb26ec313cd93ac80171b23095c4f3dfab0422 | [
"MIT"
] | null | null | null | state_experiments/ub_runs.py | vrdi/shortbursts-gingles | d9fb26ec313cd93ac80171b23095c4f3dfab0422 | [
"MIT"
] | 1 | 2021-07-16T22:41:54.000Z | 2021-07-16T22:41:54.000Z | import argparse
import geopandas as gpd
import numpy as np
import pickle
from functools import partial
from gerrychain import Graph, GeographicPartition, Partition, Election, accept
from gerrychain.updaters import Tally, cut_edges
from gerrychain import MarkovChain
from gerrychain.proposals import recom
from gerrychain... | 33.758621 | 109 | 0.607252 |
e0670c957a737e8d346b83e084699b185e4267d8 | 15,136 | py | Python | compliance_checker/acdd.py | duncombe/compliance-checker | 424c762c68c215a4548ff2006716ad5594605ee7 | [
"Apache-2.0"
] | null | null | null | compliance_checker/acdd.py | duncombe/compliance-checker | 424c762c68c215a4548ff2006716ad5594605ee7 | [
"Apache-2.0"
] | null | null | null | compliance_checker/acdd.py | duncombe/compliance-checker | 424c762c68c215a4548ff2006716ad5594605ee7 | [
"Apache-2.0"
] | null | null | null | import itertools
import numpy as np
from dateutil.parser import parse as parse_dt
from cf_units import Unit
from compliance_checker.base import BaseCheck, BaseNCCheck, check_has, score_group, Result
from compliance_checker.cf.util import is_time_variable, is_vertical_coordinate, _possiblexunits, _possibleyunits
cla... | 38.910026 | 168 | 0.551533 |
175d83ec397347c89172df3b9d835fcb65907937 | 4,264 | py | Python | ucscsdk/mometa/fabric/FabricFIPortOperationFsmStage.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 9 | 2016-12-22T08:39:25.000Z | 2019-09-10T15:36:19.000Z | ucscsdk/mometa/fabric/FabricFIPortOperationFsmStage.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 10 | 2017-01-31T06:59:56.000Z | 2021-11-09T09:14:37.000Z | ucscsdk/mometa/fabric/FabricFIPortOperationFsmStage.py | parag-may4/ucscsdk | 2ea762fa070330e3a4e2c21b46b157469555405b | [
"Apache-2.0"
] | 13 | 2016-11-14T07:42:58.000Z | 2022-02-10T17:32:05.000Z | """This module contains the general information for FabricFIPortOperationFsmStage ManagedObject."""
from ...ucscmo import ManagedObject
from ...ucsccoremeta import UcscVersion, MoPropertyMeta, MoMeta
from ...ucscmeta import VersionMeta
class FabricFIPortOperationFsmStageConsts():
LAST_UPDATE_TIME_ = ""
NAME_... | 55.376623 | 325 | 0.664634 |
aba409e35fd34f5dacd67657523b5757fe359ac4 | 3,410 | py | Python | scripts/extract_titles_newscom.py | purrfectgrape/wmt2021 | f8a9a9ad044eeece4757a1480b63a46df84b3e1c | [
"MIT"
] | null | null | null | scripts/extract_titles_newscom.py | purrfectgrape/wmt2021 | f8a9a9ad044eeece4757a1480b63a46df84b3e1c | [
"MIT"
] | null | null | null | scripts/extract_titles_newscom.py | purrfectgrape/wmt2021 | f8a9a9ad044eeece4757a1480b63a46df84b3e1c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Date: Mar 10, 2021
Adapted from https://github.com/facebookresearch/LASER/blob/master/tasks/WikiMatrix/extract.py
"""
import re
import os
import sys
import argparse
parser = argparse.ArgumentParser(description='Tool to extract bitext from subtitles, wikititles, and n... | 44.285714 | 118 | 0.525513 |
04b4249ca06160d96076522607ddf6d92e6f032f | 4,855 | py | Python | py/vtproto/tableacl_pb2.py | msolo/vitess | 04736af822e2143f7b60e993d5bfe6b37343ac0b | [
"Apache-2.0"
] | 1 | 2017-06-29T04:57:43.000Z | 2017-06-29T04:57:43.000Z | py/vtproto/tableacl_pb2.py | msolo/vitess | 04736af822e2143f7b60e993d5bfe6b37343ac0b | [
"Apache-2.0"
] | 2 | 2017-09-25T08:35:22.000Z | 2018-03-29T15:21:54.000Z | py/vtproto/tableacl_pb2.py | msolo/vitess | 04736af822e2143f7b60e993d5bfe6b37343ac0b | [
"Apache-2.0"
] | 3 | 2017-04-19T22:29:59.000Z | 2018-03-29T14:28:09.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tableacl.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 reflection as _refl... | 33.951049 | 386 | 0.746653 |
1c27b335054bebe545afbcf410a5e43b5e3091a6 | 4,678 | py | Python | tests/test_cases/project_service_test.py | webu/pyopenproject | 40b2cb9fe0fa3f89bc0fe2a3be323422d9ecf966 | [
"MIT"
] | 5 | 2021-02-25T15:54:28.000Z | 2021-04-22T15:43:36.000Z | tests/test_cases/project_service_test.py | webu/pyopenproject | 40b2cb9fe0fa3f89bc0fe2a3be323422d9ecf966 | [
"MIT"
] | 7 | 2021-03-15T16:26:23.000Z | 2022-03-16T13:45:18.000Z | tests/test_cases/project_service_test.py | webu/pyopenproject | 40b2cb9fe0fa3f89bc0fe2a3be323422d9ecf966 | [
"MIT"
] | 6 | 2021-06-18T18:59:11.000Z | 2022-03-27T04:58:52.000Z | import json
import os
from pyopenproject.business.exception.business_error import BusinessError
from pyopenproject.business.util.filter import Filter
from pyopenproject.model.project import Project
from pyopenproject.model.user import User
from pyopenproject.model.work_package import WorkPackage
from tests.test_cases.... | 38.661157 | 106 | 0.662035 |
f83776ba6952e43bee457934d29d2c328e4797ea | 5,191 | py | Python | examination/views.py | henrylameck/school_management_system | 38c270977d001d28f2338eb90fffc3e8c2598d06 | [
"MIT"
] | null | null | null | examination/views.py | henrylameck/school_management_system | 38c270977d001d28f2338eb90fffc3e8c2598d06 | [
"MIT"
] | 3 | 2021-06-05T00:01:48.000Z | 2021-09-22T19:39:12.000Z | examination/views.py | henrylameck/school_management_system | 38c270977d001d28f2338eb90fffc3e8c2598d06 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from django.urls import reverse
from django.http import HttpResponse
from django.contrib.auth.decorators import login_required
from tablib import Dataset
from django.contrib import messages
from .resources import ExamMarkEntryResource
from .models import *
from students.mo... | 33.490323 | 120 | 0.605278 |
0cc1ef859ac386b4a352662b9ede06e124da46b7 | 161 | py | Python | research/utils/messages.py | ZviBaratz/pylabber | 35337284f3d0615249f642743b993b7dad407390 | [
"Apache-2.0"
] | null | null | null | research/utils/messages.py | ZviBaratz/pylabber | 35337284f3d0615249f642743b993b7dad407390 | [
"Apache-2.0"
] | 36 | 2018-05-14T14:41:02.000Z | 2020-05-22T15:14:14.000Z | research/utils/messages.py | ZviBaratz/pylabber | 35337284f3d0615249f642743b993b7dad407390 | [
"Apache-2.0"
] | 3 | 2019-05-07T07:09:05.000Z | 2019-08-30T15:40:47.000Z | """
Messages for the :mod:`research.utils` module.
"""
INVALID_CONTENT_TYPE: str = "Invalid content type definition in data acquisition models: {content_type}"
| 26.833333 | 104 | 0.757764 |
28a1d6853b063a9a2356c6644266cc1b0e253f45 | 1,100 | py | Python | uer/utils/misc.py | krevas/ET-BERT | 464ce3e7942d4450f55021e267ceb9dd48a36b1f | [
"MIT"
] | null | null | null | uer/utils/misc.py | krevas/ET-BERT | 464ce3e7942d4450f55021e267ceb9dd48a36b1f | [
"MIT"
] | null | null | null | uer/utils/misc.py | krevas/ET-BERT | 464ce3e7942d4450f55021e267ceb9dd48a36b1f | [
"MIT"
] | null | null | null | import torch
def count_lines(file_path):
lines_num = 0
with open(file_path, 'rb') as f:
while True:
data = f.read(2 ** 20)
if not data:
break
lines_num += data.count(b'\n')
return lines_num
def flip(x, dim):
indices = [slice(None)] * x.dim(... | 31.428571 | 129 | 0.585455 |
e17adc127f5e7c7e99664dac5bc1cb7ebc211fe5 | 11,984 | py | Python | bctop/allocations.py | asestes1/ctop-tests | baabbdce3d8125268f6b05a8cb161a48478a13cf | [
"MIT"
] | null | null | null | bctop/allocations.py | asestes1/ctop-tests | baabbdce3d8125268f6b05a8cb161a48478a13cf | [
"MIT"
] | null | null | null | bctop/allocations.py | asestes1/ctop-tests | baabbdce3d8125268f6b05a8cb161a48478a13cf | [
"MIT"
] | null | null | null | import attr
import datetime
import typing
import operator
import gurobipy as grb
import collections
@attr.s(frozen=True, kw_only=True)
class Slot(object):
sid = attr.ib(type=str)
time = attr.ib(type=datetime.datetime)
@attr.s(frozen=True, kw_only=True)
class Flight(object):
fid = attr.ib(type=str)
a... | 38.044444 | 120 | 0.62767 |
ad623b101a53715a5ff3d787e45b5681f8148966 | 6,750 | py | Python | fn.py | NOTNOTsergey/lightning-manager-alternative | 63e64532a5141abb51186ebf55ee3f2eeb8c2791 | [
"MIT"
] | null | null | null | fn.py | NOTNOTsergey/lightning-manager-alternative | 63e64532a5141abb51186ebf55ee3f2eeb8c2791 | [
"MIT"
] | null | null | null | fn.py | NOTNOTsergey/lightning-manager-alternative | 63e64532a5141abb51186ebf55ee3f2eeb8c2791 | [
"MIT"
] | null | null | null | import os
from typing import List, Dict, Union
import pickle
import hashlib
from Crypto.Cipher import AES
import colorama
'''
менять кодовое слово можно только перед созданием новой базы данных, иначе замена
приведет к утере изначального слова и утере возможности входа в базу данных и как следствие потере данных
кт... | 30.542986 | 148 | 0.68963 |
d7007771da85f2d164ebee943c4e1b9e47ff417b | 7,971 | py | Python | Geometry/CMSCommonData/python/cmsExtendedGeometry2026D57XML_cfi.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 6 | 2017-09-08T14:12:56.000Z | 2022-03-09T23:57:01.000Z | Geometry/CMSCommonData/python/cmsExtendedGeometry2026D57XML_cfi.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 545 | 2017-09-19T17:10:19.000Z | 2022-03-07T16:55:27.000Z | Geometry/CMSCommonData/python/cmsExtendedGeometry2026D57XML_cfi.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 14 | 2017-10-04T09:47:21.000Z | 2019-10-23T18:04:45.000Z | import FWCore.ParameterSet.Config as cms
# This config was generated automatically using generate2026Geometry.py
# If you notice a mistake, please update the generating script, not just this config
XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource",
geomXMLFiles = cms.vstring(
'Geometry/CM... | 61.790698 | 100 | 0.734663 |
1ef8b7cc70e171ee776ae956646aac72eba53ac5 | 11,415 | py | Python | specs/src/setup.py | Gawesomer/specs2016 | 9cada8ec8943ad67ed5e581b5a47ce5ac1f97b47 | [
"MIT"
] | null | null | null | specs/src/setup.py | Gawesomer/specs2016 | 9cada8ec8943ad67ed5e581b5a47ce5ac1f97b47 | [
"MIT"
] | null | null | null | specs/src/setup.py | Gawesomer/specs2016 | 9cada8ec8943ad67ed5e581b5a47ce5ac1f97b47 | [
"MIT"
] | null | null | null | import os,sys,argparse
cppflags_gcc = "-Werror $(CONDCOMP) -DGITTAG=$(TAG) --std=c++11 -I ."
cppflags_clang = "-Werror $(CONDCOMP) -DGITTAG=$(TAG) -std=c++11 -I ."
cppflags_vs = "$(CONDCOMP) /DGITTAG=$(TAG) /nologo /I."
body1 = \
"""
CCSRC = $(wildcard cli/*.cc) \
$(wildcard specitems/*.cc) \
$(wildcard processin... | 29.194373 | 144 | 0.676654 |
6367dc2eab92b555bb8bc25744cc9a9cc8da9615 | 786 | py | Python | code/UI/OpenAPI/python-flask-server/openapi_server/controllers/translate_controller.py | meghasin/RTX | 4e7b73263f60840d206ce759111214c28bfc999d | [
"MIT"
] | null | null | null | code/UI/OpenAPI/python-flask-server/openapi_server/controllers/translate_controller.py | meghasin/RTX | 4e7b73263f60840d206ce759111214c28bfc999d | [
"MIT"
] | null | null | null | code/UI/OpenAPI/python-flask-server/openapi_server/controllers/translate_controller.py | meghasin/RTX | 4e7b73263f60840d206ce759111214c28bfc999d | [
"MIT"
] | null | null | null | import connexion
import six
from openapi_server.models.query import Query # noqa: E501
from openapi_server import util
from ParseQuestion import ParseQuestion
def translate(request_body): # noqa: E501
"""Translate natural language question into a standardized query
# noqa: E501
:param request_body:... | 29.111111 | 144 | 0.698473 |
b359f43a9f9ab9026f92566b7e5f40571f2d1e3f | 616 | py | Python | powerline_shell/segments/time.py | aradzu10/powerline-shell | 299493eb3ad65b0331d9369a279833e61237d9a6 | [
"MIT"
] | null | null | null | powerline_shell/segments/time.py | aradzu10/powerline-shell | 299493eb3ad65b0331d9369a279833e61237d9a6 | [
"MIT"
] | null | null | null | powerline_shell/segments/time.py | aradzu10/powerline-shell | 299493eb3ad65b0331d9369a279833e61237d9a6 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import time
from powerline_shell import utils
class Segment(utils.BasicSegment):
def add_to_powerline(self):
powerline = self.powerline
format = powerline.segment_conf('time', 'format')
if format:
time_ = time.strftime(format)
eli... | 29.333333 | 57 | 0.592532 |
fb7ff58dd32c94f5d3bd647750e1ad2f4fc9d3cd | 1,814 | py | Python | nslocalizer/xcodeproj/pbProj/PBXFileReference.py | kolyadenko/nslocalizer | 70fab1f5bc6f0ebfe7f7e394dc1739ea50cde29a | [
"BSD-3-Clause"
] | 172 | 2016-09-03T22:27:37.000Z | 2022-03-09T03:35:49.000Z | nslocalizer/xcodeproj/pbProj/PBXFileReference.py | kolyadenko/nslocalizer | 70fab1f5bc6f0ebfe7f7e394dc1739ea50cde29a | [
"BSD-3-Clause"
] | 7 | 2016-12-19T12:22:50.000Z | 2019-05-03T06:38:46.000Z | nslocalizer/xcodeproj/pbProj/PBXFileReference.py | kolyadenko/nslocalizer | 70fab1f5bc6f0ebfe7f7e394dc1739ea50cde29a | [
"BSD-3-Clause"
] | 11 | 2016-09-04T14:04:13.000Z | 2021-05-21T12:05:16.000Z | # Copyright (c) 2016, Samantha Marshall (http://pewpewthespells.com)
# All rights reserved.
#
# https://github.com/samdmarshall/nslocalizer
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of sourc... | 50.388889 | 84 | 0.789967 |
5ffdf5f9bc910a8cabc7e2c557526ea20947c21a | 3,337 | py | Python | napari/components/_tests/test_world_coordinates.py | harripj/napari | 7a284b1efeb14b1f812f0d98c608f70f0dd66ad2 | [
"BSD-3-Clause"
] | null | null | null | napari/components/_tests/test_world_coordinates.py | harripj/napari | 7a284b1efeb14b1f812f0d98c608f70f0dd66ad2 | [
"BSD-3-Clause"
] | null | null | null | napari/components/_tests/test_world_coordinates.py | harripj/napari | 7a284b1efeb14b1f812f0d98c608f70f0dd66ad2 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import pytest
from napari.components import ViewerModel
def test_translated_images():
"""Test two translated images."""
viewer = ViewerModel()
np.random.seed(0)
data = np.random.random((10, 10, 10))
viewer.add_image(data)
viewer.add_image(data, translate=[10, 0, 0])
ass... | 34.402062 | 70 | 0.621217 |
5f0da817ed1c57119cadac785d10a4a98cb1d8e1 | 1,127 | py | Python | uni_not_hesaplama.py | AdanedhelWrites/PythonKucukProjecikler | b623fb8ec9ea706bd64ef073fafb057c97f1206e | [
"Unlicense"
] | null | null | null | uni_not_hesaplama.py | AdanedhelWrites/PythonKucukProjecikler | b623fb8ec9ea706bd64ef073fafb057c97f1206e | [
"Unlicense"
] | null | null | null | uni_not_hesaplama.py | AdanedhelWrites/PythonKucukProjecikler | b623fb8ec9ea706bd64ef073fafb057c97f1206e | [
"Unlicense"
] | null | null | null | import time
vize = int(input("Öğrencinin vize notu :"))
final = int(input("Öğrencinin final notu :"))
h = vize * 0.40 + final * 0.60
print("Öğrencinin notu hesaplanıyor..")
time.sleep(1.5)
if h >= 88 and h <= 100:
print("Öğrencinin harf notu: AA \nÖğrenci Başarıyla dersi geçti...")
elif h >= 81 and h < 88:
p... | 37.566667 | 76 | 0.665484 |
899524af1ef861dc3aba59384842c2cacc66e20e | 10,099 | py | Python | examples/python/ode_occurrence_polygon_area_inclussion_exclusion.py | bradh/deepstream-services-library | 5e9f077925e3bf7551d3960b1e4bfaedb92ef9ea | [
"MIT"
] | null | null | null | examples/python/ode_occurrence_polygon_area_inclussion_exclusion.py | bradh/deepstream-services-library | 5e9f077925e3bf7551d3960b1e4bfaedb92ef9ea | [
"MIT"
] | null | null | null | examples/python/ode_occurrence_polygon_area_inclussion_exclusion.py | bradh/deepstream-services-library | 5e9f077925e3bf7551d3960b1e4bfaedb92ef9ea | [
"MIT"
] | null | null | null | ################################################################################
# The MIT License
#
# Copyright (c) 2021, Prominence AI, Inc.
#
# 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 Softwar... | 40.23506 | 120 | 0.643925 |
37437a10cda9162e8e579cb4517439ce5f22a4b5 | 238 | py | Python | ex3.py | hninpoeaukyaw/coding-sprint | 09548104fec7f659607e3ae4a214f84b4712060f | [
"MIT"
] | null | null | null | ex3.py | hninpoeaukyaw/coding-sprint | 09548104fec7f659607e3ae4a214f84b4712060f | [
"MIT"
] | null | null | null | ex3.py | hninpoeaukyaw/coding-sprint | 09548104fec7f659607e3ae4a214f84b4712060f | [
"MIT"
] | null | null | null | print("I will now count my chickens:")
print("Hens", 25 + 30 / 6)
print("Roosters", 100 - 25 * 3 % 4)
print("Now I will cout the eggs:")
print(3 + 2 + 1 - 5 + 4 % 2 - 1 / 4 + 6)
print("Is it true that 3 + 2 < 5 - 7?")
print(3 + 2 < 5 - 7) | 34 | 40 | 0.546218 |
44010fac4968a996d70ef755ee876bcec470dfd5 | 1,556 | py | Python | examples/custom_parameterized_image_label_loss.py | YipengHu/DeepReg | 6c610a29c813448be25d384555f5b9bbb6a3bd2a | [
"Apache-2.0"
] | null | null | null | examples/custom_parameterized_image_label_loss.py | YipengHu/DeepReg | 6c610a29c813448be25d384555f5b9bbb6a3bd2a | [
"Apache-2.0"
] | null | null | null | examples/custom_parameterized_image_label_loss.py | YipengHu/DeepReg | 6c610a29c813448be25d384555f5b9bbb6a3bd2a | [
"Apache-2.0"
] | null | null | null | """This script provides an example of using custom backbone for training."""
import tensorflow as tf
from deepreg.registry import REGISTRY
from deepreg.train import train
@REGISTRY.register_loss(name="lp_norm")
class LPNorm(tf.keras.losses.Loss):
"""
L^p norm between y_true and y_pred, p = 1 or 2.
y_tru... | 27.785714 | 85 | 0.600257 |
0c604274bfa7c8c0efa529cfe9e6676ac055d534 | 2,891 | py | Python | featherstore/_table/insert.py | Hakonmh/featherstore | 2dacdb6645b8ad0a559c6e20b598e3f8858d14e1 | [
"MIT"
] | null | null | null | featherstore/_table/insert.py | Hakonmh/featherstore | 2dacdb6645b8ad0a559c6e20b598e3f8858d14e1 | [
"MIT"
] | null | null | null | featherstore/_table/insert.py | Hakonmh/featherstore | 2dacdb6645b8ad0a559c6e20b598e3f8858d14e1 | [
"MIT"
] | null | null | null | import pandas as pd
from featherstore.connection import Connection
from featherstore._table import _raise_if
from featherstore._table import _table_utils
def can_insert_table(df, table_path):
Connection.is_connected()
_raise_if.table_not_exists(table_path)
_raise_if.df_is_not_pandas_table(df)
if is... | 35.256098 | 87 | 0.74853 |
7a55331686273d6624e9c262ffaad45e2f0731f2 | 8,227 | py | Python | pump_cb.py | couchbaselabs/couchbase-cli | 596f3564d08881af83f93910ac3d2c53a82b1d64 | [
"Apache-2.0"
] | null | null | null | pump_cb.py | couchbaselabs/couchbase-cli | 596f3564d08881af83f93910ac3d2c53a82b1d64 | [
"Apache-2.0"
] | null | null | null | pump_cb.py | couchbaselabs/couchbase-cli | 596f3564d08881af83f93910ac3d2c53a82b1d64 | [
"Apache-2.0"
] | 1 | 2018-08-23T11:14:28.000Z | 2018-08-23T11:14:28.000Z | #!/usr/bin/env python
import logging
import simplejson as json
import time
import pump
import pump_mc
class CBSink(pump_mc.MCSink):
"""Smart client sink to couchbase cluster."""
def __init__(self, opts, spec, source_bucket, source_node,
source_map, sink_map, ctl, cur):
super(CBSink,... | 37.058559 | 83 | 0.544184 |
c4e2ac884b2bcaf3c50f5bebd6a6357bc673901b | 2,227 | py | Python | run_cem.py | D3473R/modular_rl | 126b0a799c5bc3dd18a8b55ac555fe38e6e2f1fd | [
"MIT"
] | 628 | 2016-04-26T00:05:25.000Z | 2022-03-20T12:36:00.000Z | run_cem.py | D3473R/modular_rl | 126b0a799c5bc3dd18a8b55ac555fe38e6e2f1fd | [
"MIT"
] | 25 | 2016-05-28T03:21:00.000Z | 2021-06-21T08:31:03.000Z | run_cem.py | D3473R/modular_rl | 126b0a799c5bc3dd18a8b55ac555fe38e6e2f1fd | [
"MIT"
] | 185 | 2016-04-27T08:41:23.000Z | 2022-03-19T08:19:56.000Z | #!/usr/bin/env python
"""
This script runs the cross-entropy method
"""
from gym.envs import make
from modular_rl import *
import argparse, sys, cPickle, shutil
import gym, logging
from tabulate import tabulate
if __name__ == "__main__":
parser = argparse.ArgumentParser(formatter_class=argparse.ArgumentDefaultsH... | 39.070175 | 106 | 0.680287 |
220232e7cbe3ca3d09a9085bdaa818cbf0426765 | 1,399 | py | Python | tests/test_error_prop.py | jefferycline1/Metallicity_Stack_Commons | b726609692bccc623d8a7bf1dde4559caa196720 | [
"MIT"
] | null | null | null | tests/test_error_prop.py | jefferycline1/Metallicity_Stack_Commons | b726609692bccc623d8a7bf1dde4559caa196720 | [
"MIT"
] | 67 | 2019-12-23T02:23:41.000Z | 2021-06-22T23:17:50.000Z | tests/test_error_prop.py | jefferycline1/Metallicity_Stack_Commons | b726609692bccc623d8a7bf1dde4559caa196720 | [
"MIT"
] | 1 | 2020-11-30T21:47:25.000Z | 2020-11-30T21:47:25.000Z | from Metallicity_Stack_Commons.analysis import error_prop
deep2_dir = 'tests_data/DEEP2_Ly2015/'
def test_fluxes_derived_prop():
# Even though these are individual galaxies, we can trick it to think
# it's binned data.
params_list = [
{'raw': True, # No MC, no dust, use default valid_table
... | 35.871795 | 77 | 0.573267 |
857415990a819dee7b35758f9e7d5a830e967bb8 | 9,386 | py | Python | on_http_redfish_1_0/models/session_collection_session_collection.py | jlongever/redfish-client-python | 94db1dfa1d9fadf1c000dfab2e89bdb24f8b053c | [
"Apache-2.0"
] | 1 | 2017-02-01T08:25:41.000Z | 2017-02-01T08:25:41.000Z | on_http_redfish_1_0/models/session_collection_session_collection.py | jlongever/redfish-client-python | 94db1dfa1d9fadf1c000dfab2e89bdb24f8b053c | [
"Apache-2.0"
] | null | null | null | on_http_redfish_1_0/models/session_collection_session_collection.py | jlongever/redfish-client-python | 94db1dfa1d9fadf1c000dfab2e89bdb24f8b053c | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Copyright 2015 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | 29.796825 | 121 | 0.636906 |
ad29723f847a0602496a25f0f6e8d3c08b495aa3 | 1,347 | py | Python | notes/migrations/0001_initial.py | kait-schorr/personal_organization_software | a006427d94b7e160a78fd8c8372be4fe5aa0c9f5 | [
"MIT"
] | null | null | null | notes/migrations/0001_initial.py | kait-schorr/personal_organization_software | a006427d94b7e160a78fd8c8372be4fe5aa0c9f5 | [
"MIT"
] | 2 | 2020-06-05T18:34:22.000Z | 2021-06-10T20:35:13.000Z | notes/migrations/0001_initial.py | kait-schorr/personal_organization_software | a006427d94b7e160a78fd8c8372be4fe5aa0c9f5 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.6 on 2018-06-29 20:35
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | 35.447368 | 185 | 0.613957 |
8d10104fd4b500d315226c36ccace6a2816b3b7e | 25,080 | py | Python | openmc/stats/univariate.py | norberto-schmidt/openmc | ff4844303154a68027b9c746300f5704f73e0875 | [
"MIT"
] | 262 | 2018-08-09T21:27:03.000Z | 2022-03-24T05:02:10.000Z | openmc/stats/univariate.py | norberto-schmidt/openmc | ff4844303154a68027b9c746300f5704f73e0875 | [
"MIT"
] | 753 | 2018-08-03T15:26:57.000Z | 2022-03-29T23:54:48.000Z | openmc/stats/univariate.py | norberto-schmidt/openmc | ff4844303154a68027b9c746300f5704f73e0875 | [
"MIT"
] | 196 | 2018-08-06T13:41:14.000Z | 2022-03-29T20:47:12.000Z | from abc import ABC, abstractmethod
from collections.abc import Iterable
from numbers import Real
from xml.etree import ElementTree as ET
import numpy as np
import openmc.checkvalue as cv
from .._xml import get_text
from ..mixin import EqualityMixin
_INTERPOLATION_SCHEMES = [
'histogram',
'linear-linear',
... | 26.125 | 99 | 0.595255 |
c2d838bf943424f80bc4bbf969487775ca3a2581 | 1,218 | py | Python | checksubs.py | coryshrmn/grade-for-reddit | e66e6c7d456255242835406c7419770ae10b48f6 | [
"MIT"
] | null | null | null | checksubs.py | coryshrmn/grade-for-reddit | e66e6c7d456255242835406c7419770ae10b48f6 | [
"MIT"
] | null | null | null | checksubs.py | coryshrmn/grade-for-reddit | e66e6c7d456255242835406c7419770ae10b48f6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# prints sub counts, to make sure I typed names correctly
import urllib.request
import json
from time import sleep
subs = []
subs.append('dataisbeautiful')
subs.append('data_irl')
subs.append('trees')
subs.append('askscience')
subs.append('askhistorians')
subs.append('askouija')
subs.append('g... | 24.36 | 81 | 0.740558 |
fd990e2e037cbc8c23295c3f671dfda1968adb65 | 4,523 | py | Python | scrape_magic/loaders.py | edementyev/py-telegram-broker | 7cf6ab9a243e1309e4edd8257efb0f6a7340bfae | [
"MIT"
] | null | null | null | scrape_magic/loaders.py | edementyev/py-telegram-broker | 7cf6ab9a243e1309e4edd8257efb0f6a7340bfae | [
"MIT"
] | 7 | 2020-12-07T09:11:01.000Z | 2022-03-02T18:15:01.000Z | scrape_magic/loaders.py | edementyev/py-telegram-broker | 7cf6ab9a243e1309e4edd8257efb0f6a7340bfae | [
"MIT"
] | null | null | null | from scrapy.loader import Identity, ItemLoader
from scrapy.loader.processors import TakeFirst
class URLListLoader(ItemLoader):
default_output_processor = Identity()
def __init__(self, item=None, selector=None, response=None, parent=None, **context):
super().__init__(item, selector, response, parent, ... | 34.265152 | 88 | 0.57683 |
6f793b5c61e3c9395a648be99ad233b165e5c951 | 1,164 | py | Python | moco/training_tools/combiner.py | stanfordmlgroup/MedAug | 0db9cd9c97b9774b2656de5bdeeace57236b79d6 | [
"MIT"
] | 3 | 2021-10-09T02:04:36.000Z | 2022-03-05T06:48:25.000Z | moco/training_tools/combiner.py | stanfordmlgroup/MedAug | 0db9cd9c97b9774b2656de5bdeeace57236b79d6 | [
"MIT"
] | null | null | null | moco/training_tools/combiner.py | stanfordmlgroup/MedAug | 0db9cd9c97b9774b2656de5bdeeace57236b79d6 | [
"MIT"
] | null | null | null | import numpy as np
from collections import defaultdict
def detach_tensor(tensor):
if type(tensor) != np.ndarray:
if type(tensor) == list:
return np.ndarray(tensor)
else:
return tensor.cpu().detach().numpy()
return tensor
def recursive_append(target_dict, so... | 34.235294 | 80 | 0.597079 |
aa8b4a53c2d0d5b12f2701d59db65d3c4ef6598d | 22,113 | py | Python | ui/mouse_event.py | shasph/dualFace | f2b1d9cd1f05221a34e252f1b3d77eb3e7a76091 | [
"MIT"
] | 39 | 2021-04-23T12:38:50.000Z | 2022-02-28T05:01:40.000Z | ui/mouse_event.py | shasph/dualFace | f2b1d9cd1f05221a34e252f1b3d77eb3e7a76091 | [
"MIT"
] | 1 | 2021-05-21T16:46:43.000Z | 2021-07-14T13:19:16.000Z | ui/mouse_event.py | shasph/dualFace | f2b1d9cd1f05221a34e252f1b3d77eb3e7a76091 | [
"MIT"
] | 11 | 2021-04-27T01:09:30.000Z | 2021-08-04T07:17:43.000Z | # -*- coding: utf-8 -*-
from PIL.ImageQt import ImageQt
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
import numpy as np
import os
import socket
import sys
import time
from ui.util2 import *
import pickle#load,save list
color_list = [QColor(0, 0, 0), QColor(204, 0, 0), QColor(76, ... | 38.125862 | 396 | 0.549541 |
54c6cdba837b629a5b8f52ca8febc185190a919c | 5,078 | py | Python | app.py | dsoyolo/ms-identity-python-flask-webapp-call-graph | fdc62f029bb927c84f7d766cbd2575dc83e0558b | [
"MIT"
] | null | null | null | app.py | dsoyolo/ms-identity-python-flask-webapp-call-graph | fdc62f029bb927c84f7d766cbd2575dc83e0558b | [
"MIT"
] | null | null | null | app.py | dsoyolo/ms-identity-python-flask-webapp-call-graph | fdc62f029bb927c84f7d766cbd2575dc83e0558b | [
"MIT"
] | null | null | null | import logging
import requests
from flask import Flask, current_app, render_template, redirect, url_for, request
from flask_session import Session
from pathlib import Path
import app_config
from ms_identity_web import IdentityWebPython
from ms_identity_web.adapters import FlaskContextAdapter
from ms_identity_web.errors... | 44.156522 | 155 | 0.72371 |
9e3fe51cf7540fa19d886f97978656d37447456e | 1,221 | py | Python | tests/apps/app1/http/controllers/admin.py | uvicore/framework | 9c21b85e9e470c6d789899340332a9abd0b26ab1 | [
"MIT"
] | 11 | 2021-03-22T22:07:49.000Z | 2022-03-08T16:18:33.000Z | tests/apps/app1/http/controllers/admin.py | uvicore/framework | 9c21b85e9e470c6d789899340332a9abd0b26ab1 | [
"MIT"
] | 12 | 2021-03-04T05:51:24.000Z | 2021-09-22T05:16:18.000Z | tests/apps/app1/http/controllers/admin.py | uvicore/framework | 9c21b85e9e470c6d789899340332a9abd0b26ab1 | [
"MIT"
] | 2 | 2021-03-25T14:49:56.000Z | 2021-11-17T23:20:29.000Z | import uvicore
from uvicore.support.dumper import dd, dump
from uvicore.contracts import UserInfo
from uvicore.http import Request, response
from uvicore.http.routing import WebRouter, Controller, Guard
from fastapi import Depends
@uvicore.controller()
class Admin(Controller):
# Route middleware
#middleware ... | 31.307692 | 80 | 0.600328 |
e69cefac91773f945822085b124c48e7f79c78de | 2,431 | py | Python | test.py | ne-bo/BML_2018 | fd29a54d2ca7b7abf68fe25d826ddd8138da40f6 | [
"MIT"
] | 4 | 2018-10-03T18:19:18.000Z | 2020-11-25T10:52:07.000Z | test.py | ne-bo/BML_2018 | fd29a54d2ca7b7abf68fe25d826ddd8138da40f6 | [
"MIT"
] | null | null | null | test.py | ne-bo/BML_2018 | fd29a54d2ca7b7abf68fe25d826ddd8138da40f6 | [
"MIT"
] | null | null | null | import argparse
import torch
from tqdm import tqdm
import data_loader.data_loaders as module_data
import model.loss as module_loss
import model.metric as module_metric
import model.model as module_arch
def get_instance(module, name, config, *args):
return getattr(module, config[name]['type'])(*args, **config[name... | 31.166667 | 103 | 0.648704 |
1665fce568c0434ca000d6110600b93d13287c98 | 2,156 | py | Python | utils/citl-run-directory.py | cyber-itl/citl-static-analysis | 32ef8e519dac1c6a49ff41d902a62df8f5a8e948 | [
"MIT"
] | 14 | 2021-05-03T16:03:22.000Z | 2022-02-14T23:42:39.000Z | utils/citl-run-directory.py | cyber-itl/citl-static-analysis | 32ef8e519dac1c6a49ff41d902a62df8f5a8e948 | [
"MIT"
] | 1 | 2021-09-27T12:01:33.000Z | 2021-09-27T12:01:33.000Z | utils/citl-run-directory.py | cyber-itl/citl-static-analysis | 32ef8e519dac1c6a49ff41d902a62df8f5a8e948 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import magic
import os
import sys
import json
import subprocess
import copy
from argparse import ArgumentParser
analyzer = ["citl-static-analysis", "-nopretty_print", "-nolog_prefix", "-all_analyzers", "-logtostderr", "-binfile", ""]
parser = ArgumentParser(prog='Process a directory of binarie... | 26.95 | 157 | 0.647959 |
b96221f91c1f8b989e5efc36693d676b82191ace | 790 | py | Python | dreqPy/utils_dreq.py | zklaus-cmip6/CMIP6dreq | 647459f5f1799b1a847a071248904c34d6a58064 | [
"BSD-3-Clause-Clear"
] | null | null | null | dreqPy/utils_dreq.py | zklaus-cmip6/CMIP6dreq | 647459f5f1799b1a847a071248904c34d6a58064 | [
"BSD-3-Clause-Clear"
] | null | null | null | dreqPy/utils_dreq.py | zklaus-cmip6/CMIP6dreq | 647459f5f1799b1a847a071248904c34d6a58064 | [
"BSD-3-Clause-Clear"
] | null | null | null | import string
def uniCleanFunc(ss,jsFilt=False):
if type(ss) in [type('x'),type(u'x')]:
ss = string.replace( ss, u'\u2013', '-' )
ss = string.replace( ss, u'\u2014', '-' )
ss = string.replace( ss, u'\u201c', '"' )
ss = string.replace( ss, u'\u201d', '"' )
ss = st... | 34.347826 | 53 | 0.446835 |
585ad9ab87d2db6526212aceca4de73567920b7b | 13,218 | py | Python | pypy/jit/backend/x86/test/test_assembler.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | 1 | 2020-01-21T11:10:51.000Z | 2020-01-21T11:10:51.000Z | pypy/jit/backend/x86/test/test_assembler.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | null | null | null | pypy/jit/backend/x86/test/test_assembler.py | benoitc/pypy | a3e1b12d1d01dc29056b7badc051ffc034297658 | [
"MIT"
] | null | null | null | from pypy.jit.backend.x86.regloc import *
from pypy.jit.backend.x86.assembler import Assembler386
from pypy.jit.backend.x86.regalloc import X86FrameManager, get_ebp_ofs
from pypy.jit.metainterp.history import BoxInt, BoxPtr, BoxFloat, ConstFloat
from pypy.jit.metainterp.history import INT, REF, FLOAT
from pypy.rlib.rar... | 38.424419 | 134 | 0.600166 |
610da43b8d8ad8533897e285fe4cb1381b93d6be | 14,958 | py | Python | src/briefcase/platforms/iOS/xcode.py | danyeaw/briefcase | fd9744e5b8dfc8a4c7606dc63cddfcda2dd00d78 | [
"BSD-3-Clause"
] | null | null | null | src/briefcase/platforms/iOS/xcode.py | danyeaw/briefcase | fd9744e5b8dfc8a4c7606dc63cddfcda2dd00d78 | [
"BSD-3-Clause"
] | null | null | null | src/briefcase/platforms/iOS/xcode.py | danyeaw/briefcase | fd9744e5b8dfc8a4c7606dc63cddfcda2dd00d78 | [
"BSD-3-Clause"
] | null | null | null | import subprocess
import time
from uuid import UUID
from briefcase.commands import (
BuildCommand,
CreateCommand,
PackageCommand,
PublishCommand,
RunCommand,
UpdateCommand
)
from briefcase.config import BaseConfig
from briefcase.console import InputDisabled, select_option
from briefcase.excepti... | 36.933333 | 110 | 0.5714 |
4b2307862b0c4faec7ad86ae9e26a92ce75166fc | 296 | py | Python | app/utility/logger.py | SteffenRossberg/pomalu-ale-jiste | 0cadb2ba58b9e67733a76a79a71652575800d982 | [
"MIT"
] | null | null | null | app/utility/logger.py | SteffenRossberg/pomalu-ale-jiste | 0cadb2ba58b9e67733a76a79a71652575800d982 | [
"MIT"
] | null | null | null | app/utility/logger.py | SteffenRossberg/pomalu-ale-jiste | 0cadb2ba58b9e67733a76a79a71652575800d982 | [
"MIT"
] | null | null | null | import os
class Logger:
@staticmethod
def log(log_id, log_message):
log_file_path = f'data/{log_id}.train.txt'
mode = 'wt' if not os.path.exists(log_file_path) else 'at'
with open(log_file_path, mode) as log_file:
log_file.write(f"\n{log_message}")
| 24.666667 | 66 | 0.638514 |
12c2347b514f01660a87de273b0549d5f03a0089 | 2,377 | py | Python | telegram_bot.py | ficanovak/Automated-Media-Collector | 754bd93243d33a83177c70cc1a0963a5634ca970 | [
"MIT"
] | 4 | 2020-07-31T13:03:00.000Z | 2021-12-29T21:23:15.000Z | telegram_bot.py | ficanovak/Automated-Media-Collector | 754bd93243d33a83177c70cc1a0963a5634ca970 | [
"MIT"
] | null | null | null | telegram_bot.py | ficanovak/Automated-Media-Collector | 754bd93243d33a83177c70cc1a0963a5634ca970 | [
"MIT"
] | 4 | 2020-08-31T13:18:09.000Z | 2022-02-27T11:53:29.000Z | import instaloader
import telegram_send
import time
print("Starting")
L = instaloader.Instaloader(download_comments=False, max_connection_attempts=9, post_metadata_txt_pattern=None, save_metadata=False, download_video_thumbnails=False, download_geotags=False, filename_pattern="{shortcode}")
print("Login")
BOT_INSTAGRA... | 39.616667 | 221 | 0.566681 |
376c7a89ab26dd5f2584671042b65a00bd5ff01e | 19,556 | py | Python | stressor/config_manager.py | mar10/stressor | 21ece6f74a8110c530980597b4f2d66e76298f16 | [
"MIT"
] | 7 | 2020-03-07T21:57:09.000Z | 2021-11-18T11:41:39.000Z | stressor/config_manager.py | mar10/stressor | 21ece6f74a8110c530980597b4f2d66e76298f16 | [
"MIT"
] | 9 | 2020-03-24T18:13:46.000Z | 2021-04-01T16:33:20.000Z | stressor/config_manager.py | mar10/stressor | 21ece6f74a8110c530980597b4f2d66e76298f16 | [
"MIT"
] | 3 | 2020-11-03T11:53:07.000Z | 2022-03-14T17:13:04.000Z | # -*- coding: utf-8 -*-
# (c) 2020-2021 Martin Wendt and contributors; see https://github.com/mar10/stressor
# Licensed under the MIT license: https://www.opensource.org/licenses/mit-license.php
"""
"""
import os
import re
import yaml
from stressor.plugin_manager import PluginManager
from stressor.plugins.base import... | 39.190381 | 108 | 0.514318 |
ebc62d6784b7078ab6cd6cca48edfae258b3cd25 | 285 | py | Python | RemoveDuplicatesFromSortedArray.py | sharanramjee/My-LeetCode-Solutions | 15b76268caab0b2a09f9764c2a46d7302f25df19 | [
"MIT"
] | null | null | null | RemoveDuplicatesFromSortedArray.py | sharanramjee/My-LeetCode-Solutions | 15b76268caab0b2a09f9764c2a46d7302f25df19 | [
"MIT"
] | null | null | null | RemoveDuplicatesFromSortedArray.py | sharanramjee/My-LeetCode-Solutions | 15b76268caab0b2a09f9764c2a46d7302f25df19 | [
"MIT"
] | null | null | null | class Solution(object):
def removeDuplicates(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
num_set = set(nums)
num_list = list(num_set)
num_list.sort()
nums[:] = num_list[:]
return len(nums)
| 21.923077 | 37 | 0.487719 |
da74062ab677d262f1ef8a29788807902648c584 | 426 | py | Python | supermarket_pricing/python/supermarket_abxsantos/src/product/product_bundle_discount.py | TijsDeBelie/codekatas-TDD | fff067b4089c7651630994bb938de4f54461b93d | [
"MIT"
] | null | null | null | supermarket_pricing/python/supermarket_abxsantos/src/product/product_bundle_discount.py | TijsDeBelie/codekatas-TDD | fff067b4089c7651630994bb938de4f54461b93d | [
"MIT"
] | null | null | null | supermarket_pricing/python/supermarket_abxsantos/src/product/product_bundle_discount.py | TijsDeBelie/codekatas-TDD | fff067b4089c7651630994bb938de4f54461b93d | [
"MIT"
] | null | null | null | import unittest
class ProductBundleDiscount(object):
def __init__(self, bundle_quantity, bundle_price):
self.bundle_quantity: int = self._validate(parameter=bundle_quantity)
self.bundle_price: float = self._validate(parameter=bundle_price)
@staticmethod
def _validate(parameter):
i... | 30.428571 | 77 | 0.711268 |
1f2d6d16e4fe4032e1b5379f34d680684f6884df | 937 | py | Python | Exercicios/Ex_068.py | jotmar/PythonEx | bf026518ae5479d5c99ff7a4e95fc383dec22d36 | [
"MIT"
] | null | null | null | Exercicios/Ex_068.py | jotmar/PythonEx | bf026518ae5479d5c99ff7a4e95fc383dec22d36 | [
"MIT"
] | null | null | null | Exercicios/Ex_068.py | jotmar/PythonEx | bf026518ae5479d5c99ff7a4e95fc383dec22d36 | [
"MIT"
] | null | null | null | from random import randint
victory = 0
print('='*50)
print(f'{"PAR OU ÍMPAR":^50}')
print('='*50)
while True:
pc = randint(1, 10)
while True:
escolha = str(input('Qual você escolhe?[P/I]: ')).strip().upper()
if escolha not in ['P', 'PAR', 'I', 'IMPAR', 'ÍMPAR']:
print('Valor Inváli... | 29.28125 | 101 | 0.540021 |
6e38ffef7338321b6d14e510881df0ff21fccc52 | 900 | py | Python | im2mesh/psgn/models/__init__.py | FooVizDevs/occupancy_networks | 8668618123449cbd77ddb539e1902682b738086d | [
"MIT"
] | 801 | 2019-05-04T19:14:54.000Z | 2022-03-29T08:47:12.000Z | im2mesh/psgn/models/__init__.py | FooVizDevs/occupancy_networks | 8668618123449cbd77ddb539e1902682b738086d | [
"MIT"
] | 106 | 2019-05-05T15:27:07.000Z | 2022-03-22T23:01:23.000Z | im2mesh/psgn/models/__init__.py | FooVizDevs/occupancy_networks | 8668618123449cbd77ddb539e1902682b738086d | [
"MIT"
] | 202 | 2019-05-05T08:42:30.000Z | 2022-03-29T08:47:15.000Z | import torch.nn as nn
from im2mesh.psgn.models.decoder import Decoder
from im2mesh.psgn.models.psgn_2branch import PCGN_2Branch
decoder_dict = {
'simple': Decoder,
'psgn_2branch': PCGN_2Branch
}
class PCGN(nn.Module):
r''' The Point Set Generation Network.
For the PSGN, the input image is first pass... | 27.272727 | 76 | 0.67 |
41effd4dcdc43ec918eff910515702b352a6c4dc | 2,581 | py | Python | rdisq/redis_dispatcher.py | gregie156/rdisq | bed3028997f7f64d956b2731437febfc5f2d0061 | [
"MIT"
] | 1 | 2015-09-08T06:12:14.000Z | 2015-09-08T06:12:14.000Z | rdisq/redis_dispatcher.py | gregie156/rdisq | bed3028997f7f64d956b2731437febfc5f2d0061 | [
"MIT"
] | null | null | null | rdisq/redis_dispatcher.py | gregie156/rdisq | bed3028997f7f64d956b2731437febfc5f2d0061 | [
"MIT"
] | 2 | 2016-12-16T10:17:39.000Z | 2020-06-13T14:37:57.000Z | __author__ = 'smackware'
from typing import ClassVar
from redis import Redis
from redis import ConnectionPool
from rdisq.identification import generate_task_id, get_request_key
from rdisq.payload import RequestPayload
from rdisq.response import RdisqResponse
from rdisq.serialization import PickleSerializer
class ... | 30.011628 | 124 | 0.697017 |
939d501fa8096022bf24e1d0949dad69ea793a46 | 1,042 | py | Python | scaper_concept/venv/lib/python3.9/site-packages/celery/security/key.py | edudbot/web-scraper | 12c07f805427699b2c3a35ed7c0d7efbc3673a7f | [
"MIT"
] | 3 | 2022-02-11T12:09:29.000Z | 2022-02-12T19:13:17.000Z | scaper_concept/venv/lib/python3.9/site-packages/celery/security/key.py | edudbot/web-scraper | 12c07f805427699b2c3a35ed7c0d7efbc3673a7f | [
"MIT"
] | null | null | null | scaper_concept/venv/lib/python3.9/site-packages/celery/security/key.py | edudbot/web-scraper | 12c07f805427699b2c3a35ed7c0d7efbc3673a7f | [
"MIT"
] | 1 | 2021-06-30T12:43:39.000Z | 2021-06-30T12:43:39.000Z | """Private keys for the security serializer."""
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
from cryptography.hazmat.primitives.asymmetric import padding
from kombu.utils.encoding import ensure_bytes
from .utils import reraise_errors
__all__ = ('Pr... | 31.575758 | 67 | 0.653551 |
b6621d2971899571ac4d8a4638a271cfdf98070a | 15,411 | py | Python | cirq-core/cirq/ops/measurement_gate_test.py | Saibaba-Alapati/Cirq | 782efcd04c3bbf73a0d630306a3d1cfd9966521d | [
"Apache-2.0"
] | null | null | null | cirq-core/cirq/ops/measurement_gate_test.py | Saibaba-Alapati/Cirq | 782efcd04c3bbf73a0d630306a3d1cfd9966521d | [
"Apache-2.0"
] | null | null | null | cirq-core/cirq/ops/measurement_gate_test.py | Saibaba-Alapati/Cirq | 782efcd04c3bbf73a0d630306a3d1cfd9966521d | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cirq Developers
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 35.34633 | 99 | 0.612225 |
fb886f30bd64df9cd71605d0dc1f342c7a28b13b | 1,321 | py | Python | src/etc/maketest.py | adevore/rust | edf351e9f7d17777b1385093bfa7b6654e662d44 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | src/etc/maketest.py | adevore/rust | edf351e9f7d17777b1385093bfa7b6654e662d44 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | src/etc/maketest.py | adevore/rust | edf351e9f7d17777b1385093bfa7b6654e662d44 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or ht... | 31.452381 | 68 | 0.560182 |
9740fc7783edc009a5bbb4b1f4c2fb9e59810040 | 2,394 | py | Python | examples/pipeline/hetero_logistic_regression/pipeline-hetero-lr-ovr-sqn.py | qixiuai/FATE | 6d50af65b96b5b226afda30dfa8e4a1e5746952d | [
"Apache-2.0"
] | null | null | null | examples/pipeline/hetero_logistic_regression/pipeline-hetero-lr-ovr-sqn.py | qixiuai/FATE | 6d50af65b96b5b226afda30dfa8e4a1e5746952d | [
"Apache-2.0"
] | null | null | null | examples/pipeline/hetero_logistic_regression/pipeline-hetero-lr-ovr-sqn.py | qixiuai/FATE | 6d50af65b96b5b226afda30dfa8e4a1e5746952d | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2019 The FATE 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 appli... | 28.5 | 85 | 0.626984 |
6c0e2bd71eb55b1cb7a996909eff8556b30402d3 | 12,199 | py | Python | test/unit/mysql_db_dump/main.py | deepcoder42/mysql-db-dump | b6d2c3af5fa450bfd377318f2ba3a70c9fb2799a | [
"MIT"
] | null | null | null | test/unit/mysql_db_dump/main.py | deepcoder42/mysql-db-dump | b6d2c3af5fa450bfd377318f2ba3a70c9fb2799a | [
"MIT"
] | null | null | null | test/unit/mysql_db_dump/main.py | deepcoder42/mysql-db-dump | b6d2c3af5fa450bfd377318f2ba3a70c9fb2799a | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Classification (U)
"""Program: main.py
Description: Unit testing of main in mysql_db_dump.py.
Usage:
test/unit/mysql_db_dump/main.py
Arguments:
"""
# Libraries and Global Variables
# Standard
import sys
import os
if sys.version_info < (2, 7):
import unittest2 as uni... | 29.681265 | 76 | 0.689155 |
1529dbf63a25df24e2614cc2b1d6afbee06e0821 | 336 | py | Python | integration/experiment/monitor/run_monitor_dgemm.py | avilcheslopez/geopm | 35ad0af3f17f42baa009c97ed45eca24333daf33 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | integration/experiment/monitor/run_monitor_dgemm.py | avilcheslopez/geopm | 35ad0af3f17f42baa009c97ed45eca24333daf33 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | integration/experiment/monitor/run_monitor_dgemm.py | avilcheslopez/geopm | 35ad0af3f17f42baa009c97ed45eca24333daf33 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) 2015 - 2022, Intel Corporation
# SPDX-License-Identifier: BSD-3-Clause
#
'''
Run DGEMM with the monitor agent.
'''
from experiment.monitor import monitor
from apps.geopmbench import geopmbench
if __name__ == '__main__':
app_conf = geopmbench.DgemmAppConf()
monitor... | 17.684211 | 47 | 0.723214 |
776bb7bcc3a8144fe5b246d4f81ab116d822b88f | 1,064 | py | Python | src/Classes/MSDS400/Module 3/temp.py | bmoretz/Python-Playground | a367ec7659b85c24363c21b5c0ac25db08ffa1f6 | [
"MIT"
] | null | null | null | src/Classes/MSDS400/Module 3/temp.py | bmoretz/Python-Playground | a367ec7659b85c24363c21b5c0ac25db08ffa1f6 | [
"MIT"
] | null | null | null | src/Classes/MSDS400/Module 3/temp.py | bmoretz/Python-Playground | a367ec7659b85c24363c21b5c0ac25db08ffa1f6 | [
"MIT"
] | null | null | null | # A biologist must make a nutrient for her algae.
# The nutrient must contain the three basic elements D, E, and F,
# and must contain at least
# 10 kg of D,
# 18 kg of E,
# and
# 20 kg of F.
# The nutrient is made from three ingredients, I, II and III.
# The quantity of D, E, and F in one unit of each of... | 27.282051 | 97 | 0.652256 |
6508007a47d2c68c022e66c377fd361f20e9b74c | 6,182 | py | Python | tests/functional/dashboard/page_tests.py | elliotthill/django-oscar | 5a71a1f896f2c14f8ed3e68535a36b26118a65c5 | [
"BSD-3-Clause"
] | 1 | 2015-08-02T05:36:11.000Z | 2015-08-02T05:36:11.000Z | tests/functional/dashboard/page_tests.py | elliotthill/django-oscar | 5a71a1f896f2c14f8ed3e68535a36b26118a65c5 | [
"BSD-3-Clause"
] | null | null | null | tests/functional/dashboard/page_tests.py | elliotthill/django-oscar | 5a71a1f896f2c14f8ed3e68535a36b26118a65c5 | [
"BSD-3-Clause"
] | null | null | null | from django.core.urlresolvers import reverse
from django.contrib.flatpages.models import FlatPage
from oscar.test.testcases import WebTestCase
class PageViewTests(WebTestCase):
is_anonymous = False
is_staff = True
def setUp(self):
self.flatpage_1 = FlatPage.objects.create(title='title1', url='/ur... | 40.405229 | 79 | 0.539631 |
ca12b74a45aa74401ec7a4f766abc6b27d198cce | 793 | py | Python | helpers.py | domonmar/HEXI | 23c62bb950f85177000cbfe964b58491c53b0602 | [
"MIT"
] | null | null | null | helpers.py | domonmar/HEXI | 23c62bb950f85177000cbfe964b58491c53b0602 | [
"MIT"
] | null | null | null | helpers.py | domonmar/HEXI | 23c62bb950f85177000cbfe964b58491c53b0602 | [
"MIT"
] | null | null | null | # from tkinter import *
from PIL import Image, ImageTk
import cv2
def convert_image_opencv_to_tk(opencv_image):
# Rearrange the color channel
b, g, r = cv2.split(opencv_image)
img = cv2.merge((r, g, b))
# Convert the Image object into a TkPhoto object
im = Image.fromarray(img)
img_tk = ImageT... | 21.432432 | 52 | 0.691047 |
10027999dda0b277bbdbca275722b8c6dcc6f61e | 1,143 | py | Python | homeassistant/components/melissa/__init__.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | homeassistant/components/melissa/__init__.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 24,710 | 2016-04-13T08:27:26.000Z | 2020-03-02T12:59:13.000Z | homeassistant/components/melissa/__init__.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Support for Melissa climate."""
import melissa
import voluptuous as vol
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.discovery import async_load_platform
from h... | 27.878049 | 71 | 0.704287 |
8b4d317d735adc6a6ff68f4b897a9be456ca8d01 | 297 | py | Python | jetavator/config/__init__.py | jetavator/jetavator | 6edc7b57532809f9903735c333544658631252b5 | [
"Apache-2.0"
] | null | null | null | jetavator/config/__init__.py | jetavator/jetavator | 6edc7b57532809f9903735c333544658631252b5 | [
"Apache-2.0"
] | 86 | 2020-04-11T18:03:32.000Z | 2021-06-15T14:48:45.000Z | jetavator/config/__init__.py | jetavator/jetavator | 6edc7b57532809f9903735c333544658631252b5 | [
"Apache-2.0"
] | null | null | null | from . import secret_lookup
from .ConfigProperty import ConfigProperty
from .Config import (
Config,
ServiceConfig,
StorageConfig,
RegistryServiceConfig,
StorageServiceConfig,
ComputeServiceConfig,
SimpleFileRegistryServiceConfig,
SQLAlchemyRegistryServiceConfig
)
| 22.846154 | 42 | 0.781145 |
3518c71b909098255c38a61c2acf998a13e4d380 | 3,599 | py | Python | bindings/python/ensmallen/datasets/string/propionibacteriumfreudenreichii.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/propionibacteriumfreudenreichii.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/propionibacteriumfreudenreichii.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 Propionibacterium freudenreichii.
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: protei... | 33.324074 | 223 | 0.682134 |
654def5906e79e10fcc33b4fc738a91ace20b243 | 1,477 | py | Python | bentoml/fastai.py | joswlv/BentoML | 3e4e66ebeaec76fb5a43f9897ebf3a60ed6718e4 | [
"Apache-2.0"
] | null | null | null | bentoml/fastai.py | joswlv/BentoML | 3e4e66ebeaec76fb5a43f9897ebf3a60ed6718e4 | [
"Apache-2.0"
] | null | null | null | bentoml/fastai.py | joswlv/BentoML | 3e4e66ebeaec76fb5a43f9897ebf3a60ed6718e4 | [
"Apache-2.0"
] | null | null | null | import os
import typing as t
from ._internal.models.base import MODEL_NAMESPACE, PICKLE_EXTENSION, Model
from ._internal.types import MetadataType, PathType
from .exceptions import MissingDependencyException
try:
import fastai
import fastai.basics # noqa
# fastai v2
import fastai.learner
except Impo... | 25.465517 | 76 | 0.647935 |
87a8a6999f807926169e2720d6eaf1e6cf898379 | 4,013 | py | Python | scripts/apy.py | scottincrypto/yearn-exporter | 8addda383c70cb588005d3ef1ae8af750f0bb67d | [
"MIT"
] | null | null | null | scripts/apy.py | scottincrypto/yearn-exporter | 8addda383c70cb588005d3ef1ae8af750f0bb67d | [
"MIT"
] | null | null | null | scripts/apy.py | scottincrypto/yearn-exporter | 8addda383c70cb588005d3ef1ae8af750f0bb67d | [
"MIT"
] | null | null | null | import json
import dataclasses
import warnings
import logging
from brownie.exceptions import BrownieEnvironmentWarning
from tabulate import tabulate
from yearn.apy import get_samples, ApyError
from yearn.v1.registry import Registry as RegistryV1
from yearn.v2.registry import Registry as RegistryV2
from yearn.v2.vau... | 31.598425 | 86 | 0.72315 |
30480388c31a21bf1d5626a09f4697e71a925a93 | 7,486 | py | Python | ibis/backends/clickhouse/__init__.py | jayceslesar/ibis | 3c950a225883d8077b20497cdc3a9a0fb35a46c9 | [
"Apache-2.0"
] | 1 | 2022-03-22T10:39:37.000Z | 2022-03-22T10:39:37.000Z | ibis/backends/clickhouse/__init__.py | marlenezw/ibis | 14b9baf3e1021e8698e7f0ae3c0ae5747543431c | [
"Apache-2.0"
] | null | null | null | ibis/backends/clickhouse/__init__.py | marlenezw/ibis | 14b9baf3e1021e8698e7f0ae3c0ae5747543431c | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
import json
from typing import Any, Literal, Mapping
import pandas as pd
from clickhouse_driver.client import Client as _DriverClient
from pydantic import Field
import ibis
import ibis.config
import ibis.expr.schema as sch
from ibis.backends.base.sql import BaseSQLBackend
from ibis... | 30.064257 | 89 | 0.5712 |
22561cd45b27663acf5dc29f28450f783f783772 | 357 | py | Python | Medium/Simplify Path.py | lukemshannonhill/LeetCode_Daily_Problem_Solutions | ead0f38316761c2533c879289b8128a14feaf020 | [
"MIT"
] | null | null | null | Medium/Simplify Path.py | lukemshannonhill/LeetCode_Daily_Problem_Solutions | ead0f38316761c2533c879289b8128a14feaf020 | [
"MIT"
] | null | null | null | Medium/Simplify Path.py | lukemshannonhill/LeetCode_Daily_Problem_Solutions | ead0f38316761c2533c879289b8128a14feaf020 | [
"MIT"
] | null | null | null | # https://leetcode.com/problems/simplify-path
class Solution:
def simplifyPath(self, path: str) -> str:
stack = []
for i in path.split('/'):
if stack and i == "..":
stack.pop()
elif i not in [".", "", ".."]:
stack.append(i)
... | 23.8 | 45 | 0.431373 |
38e86f77d71d8ecc6a27b6080afc944382ef09c0 | 4,114 | py | Python | health_workforce/resources.py | ahoazure/ahodct_old_stage | 9331318fa7bc9b1082d2bb448d660191fcd09282 | [
"MIT"
] | null | null | null | health_workforce/resources.py | ahoazure/ahodct_old_stage | 9331318fa7bc9b1082d2bb448d660191fcd09282 | [
"MIT"
] | null | null | null | health_workforce/resources.py | ahoazure/ahodct_old_stage | 9331318fa7bc9b1082d2bb448d660191fcd09282 | [
"MIT"
] | null | null | null | from import_export import resources
from import_export.fields import Field
from .models import (StgHealthWorkforceFacts,StgHealthCadre,StgTrainingInstitution,
HumanWorkforceResourceProxy,)
from home.models import StgCategoryoption,StgDatasource,StgValueDatatype
from regions.models import StgLocation
from import_exp... | 48.97619 | 85 | 0.730919 |
fb504c0fb3a4b2ea8fb076d1de4553c745ff5bb4 | 2,337 | py | Python | memsql_test.py | renato2099/helper_scripts | ad68e531a6679fdc3b9263a60a458e20b6881175 | [
"Apache-2.0"
] | null | null | null | memsql_test.py | renato2099/helper_scripts | ad68e531a6679fdc3b9263a60a458e20b6881175 | [
"Apache-2.0"
] | null | null | null | memsql_test.py | renato2099/helper_scripts | ad68e531a6679fdc3b9263a60a458e20b6881175 | [
"Apache-2.0"
] | 1 | 2020-02-25T12:55:27.000Z | 2020-02-25T12:55:27.000Z | #!/usr/bin/python
import time
import threading
from memsql.common import database
from memsql.common.query_builder import multi_insert
HOST = "euler07"
PORT = 3306
USER = "root"
PASSWORD = ""
DATABASE = "test"
TABLE = "tbl"
NUM_WORKERS = 5
BATCH_SIZE = 10000000
#BATCH_SIZE = 50
QUERY_TEXT = "INSERT INTO tbl VALUES ... | 28.851852 | 92 | 0.601198 |
b2161ebeb2730b7683ad3c6226c75a40749684c2 | 5,737 | py | Python | code/tmp_rtrip/test/test_pipes.py | emilyemorehouse/ast-and-me | 3f58117512e125e1ecbe3c72f2f0d26adb80b7b3 | [
"MIT"
] | 24 | 2018-01-23T05:28:40.000Z | 2021-04-13T20:52:59.000Z | code/tmp_rtrip/test/test_pipes.py | emilyemorehouse/ast-and-me | 3f58117512e125e1ecbe3c72f2f0d26adb80b7b3 | [
"MIT"
] | 17 | 2017-12-21T18:32:31.000Z | 2018-12-18T17:09:50.000Z | code/tmp_rtrip/test/test_pipes.py | emilyemorehouse/ast-and-me | 3f58117512e125e1ecbe3c72f2f0d26adb80b7b3 | [
"MIT"
] | null | null | null | import pipes
import os
import string
import unittest
import shutil
from test.support import TESTFN, run_unittest, unlink, reap_children
if os.name != 'posix':
raise unittest.SkipTest('pipes module only works on posix')
TESTFN2 = TESTFN + '2'
s_command = 'tr %s %s' % (string.ascii_lowercase, string.ascii_uppercase)
... | 33.549708 | 79 | 0.586718 |
16c782c80cba374fa4b13517eb3302ec1dd7b80f | 2,124 | py | Python | examples/is_malicious/is_malicious.py | jbfeldman/OTX-Python-SDK | 6c5a4b4ab89163ba8355b1d4cad3cf0bafdf92cb | [
"Apache-2.0"
] | 203 | 2017-05-23T11:57:42.000Z | 2022-03-14T22:20:57.000Z | examples/is_malicious/is_malicious.py | jbfeldman/OTX-Python-SDK | 6c5a4b4ab89163ba8355b1d4cad3cf0bafdf92cb | [
"Apache-2.0"
] | 25 | 2017-06-27T17:36:19.000Z | 2022-03-25T02:03:58.000Z | examples/is_malicious/is_malicious.py | jbfeldman/OTX-Python-SDK | 6c5a4b4ab89163ba8355b1d4cad3cf0bafdf92cb | [
"Apache-2.0"
] | 113 | 2017-05-25T11:38:01.000Z | 2022-03-23T05:58:11.000Z | #!/usr/bin/env python
# This script tells if a File, IP, Domain or URL may be malicious according to the data in OTX
from OTXv2 import OTXv2
import argparse
import get_malicious
import hashlib
# Your API key
API_KEY = ''
OTX_SERVER = 'https://otx.alienvault.com/'
otx = OTXv2(API_KEY, server=OTX_SERVER)
parser = ar... | 29.915493 | 95 | 0.661017 |
5acde80f9c921e33c420b1863a5322bed966747c | 4,518 | py | Python | testscripts/RDKB/component/TDKB_TR181/TDKB_TR181_SNMP_LOGAGENT_GetAllParameterValues.py | rdkcmf/rdkb-tools-tdkb | 9f9c3600cd701d5fc90ac86a6394ebd28d49267e | [
"Apache-2.0"
] | null | null | null | testscripts/RDKB/component/TDKB_TR181/TDKB_TR181_SNMP_LOGAGENT_GetAllParameterValues.py | rdkcmf/rdkb-tools-tdkb | 9f9c3600cd701d5fc90ac86a6394ebd28d49267e | [
"Apache-2.0"
] | null | null | null | testscripts/RDKB/component/TDKB_TR181/TDKB_TR181_SNMP_LOGAGENT_GetAllParameterValues.py | rdkcmf/rdkb-tools-tdkb | 9f9c3600cd701d5fc90ac86a6394ebd28d49267e | [
"Apache-2.0"
] | null | null | null | ##########################################################################
# If not stated otherwise in this file or this component's Licenses.txt
# file the following copyright and licenses apply:
#
# Copyright 2019 RDK Management
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use th... | 38.288136 | 111 | 0.737052 |
66bf2d787761a13a9f6a7e49cbc30d26bd25eaf4 | 1,653 | py | Python | baselines/acktr/policies.py | georgepsh/expert | 01127eb93966d3de2c74f1843376098d522de235 | [
"MIT"
] | 11 | 2018-09-12T08:59:20.000Z | 2022-03-11T03:09:58.000Z | baselines/acktr/policies.py | georgepsh/expert | 01127eb93966d3de2c74f1843376098d522de235 | [
"MIT"
] | 4 | 2021-06-01T22:36:44.000Z | 2022-03-11T23:27:56.000Z | baselines/acktr/policies.py | georgepsh/expert | 01127eb93966d3de2c74f1843376098d522de235 | [
"MIT"
] | 2 | 2018-10-17T17:04:07.000Z | 2021-09-17T12:11:40.000Z | import numpy as np
import tensorflow as tf
from baselines.common.distributions import make_pdtype
from baselines.acktr.utils import conv, fc, conv_to_fc
def nature_cnn(unscaled_images):
"""
CNN from Nature paper.
"""
scaled_images = tf.cast(unscaled_images, tf.float32) / 255.
activ = tf.nn.relu
... | 31.788462 | 101 | 0.592861 |
420af4ec16c7fa25d703bffe9f0a71f5b6b49453 | 7,659 | py | Python | tests/collections/reconstruction/test_subsample.py | jerke123/mridc | 7e22ac50f8df73f2305d61979da2a5d59874546e | [
"Apache-2.0"
] | null | null | null | tests/collections/reconstruction/test_subsample.py | jerke123/mridc | 7e22ac50f8df73f2305d61979da2a5d59874546e | [
"Apache-2.0"
] | null | null | null | tests/collections/reconstruction/test_subsample.py | jerke123/mridc | 7e22ac50f8df73f2305d61979da2a5d59874546e | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
__author__ = "Dimitrios Karkalousos"
import numpy as np
import pytest
from mridc.collections.reconstruction.data.subsample import (
EquispacedMaskFunc,
Gaussian1DMaskFunc,
Gaussian2DMaskFunc,
Poisson2DMaskFunc,
RandomMaskFunc,
create_mask_for_mask_type,
)
@pytest.mark.param... | 35.458333 | 107 | 0.688602 |
a6aa4bae30da055d058fbfc69e633e4c3e5b337f | 1,623 | py | Python | LeetCode/Max Depth of BInary Tree.py | Jaidev810/Competitive-Questions | 5d5b28be69e8572e9b4353e9790ee39b56769fc3 | [
"MIT"
] | 1 | 2021-02-27T06:12:55.000Z | 2021-02-27T06:12:55.000Z | LeetCode/Max Depth of BInary Tree.py | Jaidev810/Competitive-Questions | 5d5b28be69e8572e9b4353e9790ee39b56769fc3 | [
"MIT"
] | 1 | 2021-02-02T08:52:17.000Z | 2021-02-03T08:19:12.000Z | LeetCode/Max Depth of BInary Tree.py | Jaidev810/Competitive-Questions | 5d5b28be69e8572e9b4353e9790ee39b56769fc3 | [
"MIT"
] | null | null | null | import queue
class BinaryTree:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def takeLevelwiseinput():
print('enter the root Data:')
rootData = int(input())
if rootData == -1:
return None
root = BinaryTree(rootData)
q = queue.Queu... | 25.761905 | 57 | 0.571165 |
591c5484aa687f644b68ecda32d0a924908ffb82 | 1,335 | py | Python | delocate/cmd/delocate_fuse.py | atwilso/delocate | 17d3a1d98ee315304e1ce3af133419011e21140e | [
"BSD-2-Clause"
] | null | null | null | delocate/cmd/delocate_fuse.py | atwilso/delocate | 17d3a1d98ee315304e1ce3af133419011e21140e | [
"BSD-2-Clause"
] | 1 | 2021-07-12T15:34:40.000Z | 2021-07-12T17:29:41.000Z | delocate/cmd/delocate_fuse.py | atwilso/delocate | 17d3a1d98ee315304e1ce3af133419011e21140e | [
"BSD-2-Clause"
] | 3 | 2021-05-12T14:17:25.000Z | 2021-09-02T02:11:36.000Z | #!python
""" Fuse two (probably delocated) wheels
Overwrites the first wheel in-place by default
"""
# vim: ft=python
from __future__ import division, print_function, absolute_import
from os.path import (join as pjoin, basename, expanduser, abspath)
import sys
from optparse import OptionParser, Option
from delocate... | 29.021739 | 73 | 0.63221 |
406f6c82a0e7e8341eafab1d32d1f8412fc20423 | 4,191 | py | Python | src/integrationtest/python/_mp_manager_server.py | karellen/geventmp | ecb1142051d0749ad09471c8b9f6abeb9be1d982 | [
"Apache-2.0"
] | 14 | 2019-08-15T21:52:05.000Z | 2022-01-20T03:06:13.000Z | src/integrationtest/python/_mp_manager_server.py | karellen/geventmp | ecb1142051d0749ad09471c8b9f6abeb9be1d982 | [
"Apache-2.0"
] | 10 | 2019-09-20T02:37:32.000Z | 2022-02-10T22:31:48.000Z | src/integrationtest/python/_mp_manager_server.py | karellen/geventmp | ecb1142051d0749ad09471c8b9f6abeb9be1d982 | [
"Apache-2.0"
] | 2 | 2020-02-28T16:25:58.000Z | 2020-04-09T09:42:01.000Z | # -*- coding: utf-8 -*-
# Copyright 2022 Karellen, Inc. and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | 30.816176 | 97 | 0.597948 |
962886d2e10a5bb9314e63161aea8e2ee3b1f69e | 445 | py | Python | api/src/app/app.py | ryanmcdermott/terraform-microservices-example | 35a8bff3ff3ffcde173e7fc7ee14790ee8c8042c | [
"MIT"
] | 20 | 2020-08-15T19:56:10.000Z | 2022-03-01T04:24:29.000Z | api/src/app/app.py | ryanmcdermott/terraform-microservices-example | 35a8bff3ff3ffcde173e7fc7ee14790ee8c8042c | [
"MIT"
] | 1 | 2020-12-19T20:10:46.000Z | 2020-12-20T17:36:47.000Z | api/src/app/app.py | ryanmcdermott/terraform-microservices-example | 35a8bff3ff3ffcde173e7fc7ee14790ee8c8042c | [
"MIT"
] | 7 | 2021-01-06T03:25:36.000Z | 2022-03-20T20:22:12.000Z | from flask import Flask
from flask_restful import Resource, Api
import os
app = Flask(__name__)
api = Api(app)
class Foo(Resource):
def get(self):
return {'foo': 'bar'}
api.add_resource(Foo, '/api/foo')
class Main(Resource):
"""
Health check route.
"""
def get(self):
return ... | 13.90625 | 42 | 0.61573 |
15a58ca526488a75605c8a2e5141491f9dc0ab72 | 2,628 | py | Python | predict_image_sequence.py | LiuShenLan/uav_dronet | c9a6434102352ed67179d291b8a21d813b562fce | [
"MIT"
] | null | null | null | predict_image_sequence.py | LiuShenLan/uav_dronet | c9a6434102352ed67179d291b8a21d813b562fce | [
"MIT"
] | null | null | null | predict_image_sequence.py | LiuShenLan/uav_dronet | c9a6434102352ed67179d291b8a21d813b562fce | [
"MIT"
] | null | null | null | import os,sys
import utils
import cv2
import numpy as np
import math
from keras import backend as K
TEST_PHASE=0
def central_image_crop(img, crop_width, crop_heigth):
"""
Crops the input PILLOW image centered in width and starting from the bottom
in height.
Arguments:
crop_width: Width of the ... | 35.04 | 145 | 0.612633 |
a85911b59482726fd93be4a627cd7d09b5387998 | 8,893 | py | Python | airflow/contrib/hooks/ssh_hook.py | diggzhang/airflow-dingit | 41482b83130d5815b772840681fb36eb9bfa69b9 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-05-20T05:42:19.000Z | 2020-05-20T05:42:19.000Z | airflow/contrib/hooks/ssh_hook.py | diggzhang/airflow-dingit | 41482b83130d5815b772840681fb36eb9bfa69b9 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 13 | 2018-11-30T18:18:32.000Z | 2021-02-19T17:04:12.000Z | airflow/contrib/hooks/ssh_hook.py | diggzhang/airflow-dingit | 41482b83130d5815b772840681fb36eb9bfa69b9 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 3 | 2017-09-05T23:23:19.000Z | 2018-02-07T23:08:03.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
# Ported to Airflow by Bolke de Bruin
#
# 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... | 40.422727 | 102 | 0.574159 |
bf36f999c6eff4a1d3131fab20429b86f7598128 | 728 | py | Python | test/_init_paths.py | TonyChouZJU/py-faster-rcnn-batch | f4b1cc452b86861cdbba4558a28ef19606e14763 | [
"MIT"
] | null | null | null | test/_init_paths.py | TonyChouZJU/py-faster-rcnn-batch | f4b1cc452b86861cdbba4558a28ef19606e14763 | [
"MIT"
] | 1 | 2017-03-02T06:19:53.000Z | 2017-03-02T06:19:53.000Z | test/_init_paths.py | TonyChouZJU/py-faster-rcnn-batch | f4b1cc452b86861cdbba4558a28ef19606e14763 | [
"MIT"
] | null | null | null | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
"""Set up paths for Fast R-CNN."""
import os.path as osp
import sys
d... | 24.266667 | 66 | 0.592033 |
f2324e20186fc75f7e596b8071f5601d9b62ac90 | 222 | py | Python | exercicios/ex027.py | luccasocastro/Curso-Python | 7ad2b980bb2f95f833811291273d6ca1beb0fe77 | [
"MIT"
] | null | null | null | exercicios/ex027.py | luccasocastro/Curso-Python | 7ad2b980bb2f95f833811291273d6ca1beb0fe77 | [
"MIT"
] | null | null | null | exercicios/ex027.py | luccasocastro/Curso-Python | 7ad2b980bb2f95f833811291273d6ca1beb0fe77 | [
"MIT"
] | null | null | null | v = float(input('Informe a velocidade: '))
if v > 80:
multa = (v-80)*7
print('Você está acima da velocidade!! Pagará uma multa de R${:.2f}'.format(multa))
else:
print('Tenha um bom dia! Dirija com segurança!')
| 31.714286 | 87 | 0.644144 |
1466ac3ade9208de34a418ac2ec25c1edbfd9011 | 1,171 | py | Python | python/test/function/test_asin.py | sdonatti/nnabla | ac4a42e62dd358f16bd79c08a9a9f3d83c0100c9 | [
"Apache-2.0"
] | 1 | 2020-08-03T12:49:19.000Z | 2020-08-03T12:49:19.000Z | python/test/function/test_asin.py | sdonatti/nnabla | ac4a42e62dd358f16bd79c08a9a9f3d83c0100c9 | [
"Apache-2.0"
] | 1 | 2020-11-09T07:33:29.000Z | 2020-11-09T07:33:29.000Z | python/test/function/test_asin.py | sdonatti/nnabla | ac4a42e62dd358f16bd79c08a9a9f3d83c0100c9 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017 Sony Corporation. 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 applicabl... | 37.774194 | 81 | 0.740393 |
599241740c5ab980bc5742efebdb5665beea3b22 | 39,015 | py | Python | test/functional/p2p-compactblocks.py | gbtn/bitcoin-sv-gbtn | 8b09d1aa072da819fb3309b0be85dae0f1ac9549 | [
"MIT"
] | 10 | 2018-05-01T19:24:54.000Z | 2019-11-18T09:24:19.000Z | test/functional/p2p-compactblocks.py | Chihuataneo/bitcoin-sv | d9b12a23dbf0d2afc5f488fa077d762b302ba873 | [
"MIT"
] | 2 | 2017-08-02T15:48:07.000Z | 2017-08-04T16:54:18.000Z | test/functional/p2p-compactblocks.py | Chihuataneo/bitcoin-sv | d9b12a23dbf0d2afc5f488fa077d762b302ba873 | [
"MIT"
] | 18 | 2017-07-28T20:12:05.000Z | 2019-05-21T16:31:14.000Z | #!/usr/bin/env python3
# Copyright (c) 2016 The Bitcoin Core developers
# Copyright (c) 2017 The Bitcoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.mininode import *
from test_framework.test_fra... | 43.68981 | 115 | 0.652749 |
04431e2da08bef716f7dd5fb0dd4bbe31d5c345f | 8,390 | py | Python | src/comparators/activation_comparator.py | renyi-ai/drfrankenstein | b9064cdea67698f70af07849bc5decaafccac9f3 | [
"MIT"
] | 4 | 2021-12-08T14:27:19.000Z | 2022-01-05T20:19:03.000Z | src/comparators/activation_comparator.py | renyi-ai/drfrankenstein | b9064cdea67698f70af07849bc5decaafccac9f3 | [
"MIT"
] | null | null | null | src/comparators/activation_comparator.py | renyi-ai/drfrankenstein | b9064cdea67698f70af07849bc5decaafccac9f3 | [
"MIT"
] | null | null | null | from functools import partial
from typing import List, Dict, Any
import numpy as np
import torch
from dotmap import DotMap
from src.comparators import get_comparator_function
from src.comparators.comparator_base import ComparatorBaseClass
from src.dataset.utils import _get_data_loader
from src.utils import config
c... | 37.455357 | 84 | 0.536353 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.