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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b194d8704816a0157d770f0945bf947a71c4526d | 6,737 | py | Python | wanderbits/things.py | Who8MyLunch/WanderBits | 058685971f5ab2083c9fdd7bd2eba960c2ae5992 | [
"MIT"
] | null | null | null | wanderbits/things.py | Who8MyLunch/WanderBits | 058685971f5ab2083c9fdd7bd2eba960c2ae5992 | [
"MIT"
] | 1 | 2018-01-13T20:53:38.000Z | 2018-01-13T20:53:38.000Z | wanderbits/things.py | Who8MyLunch/WanderBits | 058685971f5ab2083c9fdd7bd2eba960c2ae5992 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from __future__ import division, print_function, unicode_literals
"""
Things class for WanderBits, a text-based adventure game.
"""
import abc
import errors
# Helpers
def find_thing(many_things, name):
"""
Find a matching Thing by name.
"""
if not isinstance(name, basestring):
... | 26.840637 | 79 | 0.556776 |
bd7208a83cbbf70db8fc27535d30e6b93a9f4345 | 642 | py | Python | session2/parantheses1.py | MrCsabaToth/IK | 713f91c28af7b4a964ba854ede9fec73bf0c4682 | [
"Apache-2.0"
] | null | null | null | session2/parantheses1.py | MrCsabaToth/IK | 713f91c28af7b4a964ba854ede9fec73bf0c4682 | [
"Apache-2.0"
] | null | null | null | session2/parantheses1.py | MrCsabaToth/IK | 713f91c28af7b4a964ba854ede9fec73bf0c4682 | [
"Apache-2.0"
] | null | null | null | def parantheses_helper(opener, closer, n, slate):
# Backtracking
# if closer < opener:
# return []
# Leaf node
if opener == 0 and closer == 0:
return ["".join(slate)]
result = []
# Internal node
# Opener
if opener > 0:
slate.append("(")
result.extend(par... | 22.137931 | 71 | 0.570093 |
3a35c678e5d00a185666fd77a2ed3ad7bedf72ef | 3,465 | py | Python | magic_the_decorating/importer.py | jayvdb/magic_the_decorating | c08fb0c21e03376ddd28c9ce63b24f1c1122ceca | [
"Apache-2.0"
] | 2 | 2015-11-02T22:06:26.000Z | 2019-10-28T12:40:37.000Z | magic_the_decorating/importer.py | jayvdb/magic_the_decorating | c08fb0c21e03376ddd28c9ce63b24f1c1122ceca | [
"Apache-2.0"
] | 1 | 2019-10-28T12:33:21.000Z | 2019-10-28T12:33:21.000Z | magic_the_decorating/importer.py | jayvdb/magic_the_decorating | c08fb0c21e03376ddd28c9ce63b24f1c1122ceca | [
"Apache-2.0"
] | 3 | 2015-11-02T22:11:08.000Z | 2019-10-31T01:29:25.000Z | import sys
from config import load as load_config
from loaders import CallableLoader, ModuleLoader
class Finder(object):
"""
Custom importer that should follow 302.
"""
def __init__(self, config_filename):
"""
Inits the finder. Accepts a file name containing yaml dictionary
d... | 30.9375 | 76 | 0.619336 |
9022b3aa13307edadc082384b6d193f727342757 | 13,370 | py | Python | GRU-CFA/Codes/mainClef.py | cs-chan/Deep-Plant | 079fdc538585efa5eab9b5bfef48654a89748b3f | [
"BSD-3-Clause"
] | 81 | 2017-06-24T14:07:18.000Z | 2022-02-04T14:31:22.000Z | GRU-CFA/Codes/mainClef.py | oldfemalepig/Deep-Plant | 42967fa6bc0a30a65caeccc67af44b32492ef449 | [
"BSD-3-Clause"
] | 2 | 2020-03-24T01:31:47.000Z | 2020-03-29T03:26:11.000Z | GRU-CFA/Codes/mainClef.py | oldfemalepig/Deep-Plant | 42967fa6bc0a30a65caeccc67af44b32492ef449 | [
"BSD-3-Clause"
] | 35 | 2017-06-04T07:30:54.000Z | 2021-09-23T00:04:12.000Z | # -*- coding: utf-8 -*-
"""
Created on Thu Nov 30 12:26:45 2017
@author: root
"""
import tensorflow as tf
import numpy as np
import os
import struct
import scipy.io as sio
from array import array as pyarray
from numpy import array, int8, uint8, zeros
import collections
import pickle
import functools
import sets
fro... | 36.630137 | 183 | 0.583096 |
9ae84ae8657385ba458049caa3710f4fe4857cd9 | 5,173 | py | Python | research/deeplab/core/dense_prediction_cell_test.py | slomrafgrav/models | daa6c0415e47bdc52ad6434dc2bdb5d8aeb4f7ce | [
"Apache-2.0"
] | 79 | 2019-03-02T17:40:25.000Z | 2021-08-17T13:22:03.000Z | research/deeplab/core/dense_prediction_cell_test.py | bhushan23/models | e498d28503fd4a12d1fa9ade41891f2f9601c674 | [
"Apache-2.0"
] | 7 | 2019-01-07T16:49:27.000Z | 2020-04-28T16:48:52.000Z | research/deeplab/core/dense_prediction_cell_test.py | bhushan23/models | e498d28503fd4a12d1fa9ade41891f2f9601c674 | [
"Apache-2.0"
] | 26 | 2019-04-17T19:44:47.000Z | 2021-08-07T00:52:32.000Z | # Copyright 2018 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 applicab... | 38.318519 | 80 | 0.67833 |
c3ac9a07281c8c2bcd1925ee506e143c80128436 | 12,687 | py | Python | nenupytv/image/visibilities_old.py | AlanLoh/nenupy-tv | 9c33652521293eaba726f02fdb2331ae32dda6f6 | [
"MIT"
] | null | null | null | nenupytv/image/visibilities_old.py | AlanLoh/nenupy-tv | 9c33652521293eaba726f02fdb2331ae32dda6f6 | [
"MIT"
] | 14 | 2019-11-12T09:48:00.000Z | 2020-02-28T17:02:54.000Z | nenupytv/image/visibilities_old.py | AlanLoh/nenupy-tv | 9c33652521293eaba726f02fdb2331ae32dda6f6 | [
"MIT"
] | 1 | 2020-09-09T17:40:58.000Z | 2020-09-09T17:40:58.000Z | #! /usr/bin/python3
# -*- coding: utf-8 -*-
"""
"""
__author__ = 'Alan Loh, Julien Girard'
__copyright__ = 'Copyright 2020, nenupytv'
__credits__ = ['Alan Loh', 'Julien Girard']
__maintainer__ = 'Alan'
__email__ = 'alan.loh@obspm.fr'
__status__ = 'Production'
__all__ = [
'Visibilities'
]
import numpy as np... | 28.574324 | 102 | 0.45251 |
832e9ede8a6e343b12d17e5326d2a387520d502f | 3,123 | py | Python | ibis/expr/tests/test_case.py | andrewseidl/ibis | 1468b8c4f96d9d58f6fa147a2579b0d9e5796186 | [
"Apache-2.0"
] | null | null | null | ibis/expr/tests/test_case.py | andrewseidl/ibis | 1468b8c4f96d9d58f6fa147a2579b0d9e5796186 | [
"Apache-2.0"
] | null | null | null | ibis/expr/tests/test_case.py | andrewseidl/ibis | 1468b8c4f96d9d58f6fa147a2579b0d9e5796186 | [
"Apache-2.0"
] | null | null | null | import pytest
import ibis.expr.datatypes as dt
import ibis.expr.types as ir
import ibis.expr.operations as ops
import ibis
from ibis.tests.util import assert_equal
def test_ifelse(table):
bools = table.g.isnull()
result = bools.ifelse("foo", "bar")
assert isinstance(result, ir.StringColumn)
@pytest.ma... | 25.390244 | 75 | 0.634646 |
026fc7575e03b916275d794761d78493dafe60b7 | 6,652 | py | Python | bindings/python/ensmallen_graph/datasets/string/thermofilumpendens.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/thermofilumpendens.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/thermofilumpendens.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Thermofilum pendens.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2021-02... | 35.195767 | 223 | 0.702195 |
f2cfb7042f75b33a0f223f53d1ac2b0b4244c1dc | 1,510 | py | Python | python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_watch_grpc_server.py | jrouly/dagster | 2b3104db2fc6439050f7825d4b9ebaf39ddf6c0c | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_watch_grpc_server.py | jrouly/dagster | 2b3104db2fc6439050f7825d4b9ebaf39ddf6c0c | [
"Apache-2.0"
] | 1 | 2021-06-21T18:30:02.000Z | 2021-06-25T21:18:39.000Z | python_modules/dagster-graphql/dagster_graphql_tests/graphql/test_watch_grpc_server.py | jrouly/dagster | 2b3104db2fc6439050f7825d4b9ebaf39ddf6c0c | [
"Apache-2.0"
] | null | null | null | import time
from dagster.core.host_representation.grpc_server_state_subscriber import (
LocationStateChangeEvent,
LocationStateChangeEventType,
LocationStateSubscriber,
)
from .graphql_context_test_suite import GraphQLContextVariant, make_graphql_context_test_suite
class TestSubscribeToGrpcServerEvents(... | 35.952381 | 115 | 0.706623 |
b6f45f8c4cb21f29842cf691d66c2cb85773a592 | 734 | py | Python | googlemaps/__init__.py | ZayanShahid/google-maps-services-python | e630331bb03ac750db5d1df0e2727ec925439574 | [
"Apache-2.0"
] | 1 | 2021-06-02T04:13:17.000Z | 2021-06-02T04:13:17.000Z | googlemaps/__init__.py | ZayanShahid/google-maps-services-python | e630331bb03ac750db5d1df0e2727ec925439574 | [
"Apache-2.0"
] | null | null | null | googlemaps/__init__.py | ZayanShahid/google-maps-services-python | e630331bb03ac750db5d1df0e2727ec925439574 | [
"Apache-2.0"
] | 1 | 2020-10-31T05:44:03.000Z | 2020-10-31T05:44:03.000Z | #
# Copyright 2014 Google Inc. All rights reserved.
#
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 29.36 | 79 | 0.754768 |
d5b2f2b3ad04f231e8c4fbde31a352cd3237eb18 | 531 | py | Python | src/regression/predict_model.py | satishukadam/regressionmodel | 1d6cb4c549b632c09ad81da3494dffc43741e451 | [
"MIT"
] | null | null | null | src/regression/predict_model.py | satishukadam/regressionmodel | 1d6cb4c549b632c09ad81da3494dffc43741e451 | [
"MIT"
] | null | null | null | src/regression/predict_model.py | satishukadam/regressionmodel | 1d6cb4c549b632c09ad81da3494dffc43741e451 | [
"MIT"
] | null | null | null | import os
import pandas as pd
from configs import config
import joblib
def predict_model(model_name, data_file_name):
"""This function predicts house prices based on input data"""
model_path = os.path.join(config.TRAINED_MODEL_DIR, model_name)
data_file_path = os.path.join(os.path.join(config.DATA_DIR, da... | 29.5 | 80 | 0.758945 |
17ae9ad4ebfb47f805bb7afa6f216df0b27adfe9 | 73 | py | Python | tfnlu/classification/__init__.py | ishine/tfnlu | 73d567a5f07845a70bc13da63e6ad7b9eefe837e | [
"MIT"
] | 1 | 2021-03-22T03:51:18.000Z | 2021-03-22T03:51:18.000Z | tfnlu/classification/__init__.py | ishine/tfnlu | 73d567a5f07845a70bc13da63e6ad7b9eefe837e | [
"MIT"
] | null | null | null | tfnlu/classification/__init__.py | ishine/tfnlu | 73d567a5f07845a70bc13da63e6ad7b9eefe837e | [
"MIT"
] | 3 | 2020-09-08T14:45:48.000Z | 2021-05-14T13:45:51.000Z | from .classification import Classification
__all__ = ['Classification']
| 18.25 | 42 | 0.808219 |
d38ba84cd1397fa032cf2e5b1e7377c5b0d15c18 | 5,713 | py | Python | pandas/tests/groupby/test_value_counts.py | umangino/pandas | c492672699110fe711b7f76ded5828ff24bce5ab | [
"BSD-3-Clause"
] | 2 | 2022-02-27T04:02:18.000Z | 2022-03-01T03:48:47.000Z | pandas/tests/groupby/test_value_counts.py | umangino/pandas | c492672699110fe711b7f76ded5828ff24bce5ab | [
"BSD-3-Clause"
] | 1 | 2022-02-12T20:25:37.000Z | 2022-02-25T22:34:54.000Z | pandas/tests/groupby/test_value_counts.py | umangino/pandas | c492672699110fe711b7f76ded5828ff24bce5ab | [
"BSD-3-Clause"
] | 2 | 2022-02-27T04:02:19.000Z | 2022-03-01T03:49:21.000Z | """
these are systematically testing all of the args to value_counts
with different size combinations. This is to ensure stability of the sorting
and proper parameter handling
"""
from itertools import product
import numpy as np
import pytest
from pandas import (
Categorical,
CategoricalIndex,
DataFrame,... | 29.297436 | 87 | 0.59951 |
f5d242be9a521cd2a15d26663c080e1636a33e24 | 1,541 | py | Python | hlt/constants.py | bendemers/Halite3-SVM-Bot | ae30b821d760bd6f7e15f6094029ab78ceaa88d6 | [
"MIT"
] | 2 | 2018-11-15T14:04:26.000Z | 2018-11-19T01:54:01.000Z | hlt/constants.py | bendemers/Halite3-SVM-Bot | ae30b821d760bd6f7e15f6094029ab78ceaa88d6 | [
"MIT"
] | 5 | 2021-02-08T20:26:47.000Z | 2022-02-26T04:28:33.000Z | hlt/constants.py | bendemers/Halite3-SVM-Bot | ae30b821d760bd6f7e15f6094029ab78ceaa88d6 | [
"MIT"
] | 1 | 2018-11-22T14:58:12.000Z | 2018-11-22T14:58:12.000Z | """
Constants representing the game variation being played.
Most constants are global and come from game engine and are immutable and are strictly informational.
Some constants are only used by the local game client and so are mutable.
"""
################################################
# Local and mutable constants.... | 38.525 | 101 | 0.700195 |
b4212854a7c3edaddbcf88aa560c6e73e804f042 | 5,242 | py | Python | zmon_worker_monitor/builtins/plugins/redis_wrapper.py | dneuhaeuser-zalando/zmon-worker | eab7480b4cef8aecf910fb816c4dd0e484caaec4 | [
"Apache-2.0"
] | null | null | null | zmon_worker_monitor/builtins/plugins/redis_wrapper.py | dneuhaeuser-zalando/zmon-worker | eab7480b4cef8aecf910fb816c4dd0e484caaec4 | [
"Apache-2.0"
] | null | null | null | zmon_worker_monitor/builtins/plugins/redis_wrapper.py | dneuhaeuser-zalando/zmon-worker | eab7480b4cef8aecf910fb816c4dd0e484caaec4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import redis
from zmon_worker_monitor.zmon_worker.errors import ConfigurationError
from zmon_worker_monitor.adapters.ifunctionfactory_plugin import IFunctionFactoryPlugin, propartial
from zmon_worker_monitor import plugin_manager
STATISTIC_GAUGE_KEYS = frozenset([
'... | 30.654971 | 114 | 0.634681 |
0ac690f394bc50dcf6617007c512fe6a7bf82f5f | 13,236 | py | Python | credmark/cmf/model/ledger/__init__.py | credmark/credmark-model-framework-py | ab449990018dc1cbb1c70cfbb61c71bfc02f1ebe | [
"MIT"
] | 7 | 2022-03-10T22:28:23.000Z | 2022-03-31T17:02:16.000Z | credmark/cmf/model/ledger/__init__.py | credmark/credmark-model-framework-py | ab449990018dc1cbb1c70cfbb61c71bfc02f1ebe | [
"MIT"
] | 2 | 2022-03-09T04:11:13.000Z | 2022-03-24T14:36:14.000Z | credmark/cmf/model/ledger/__init__.py | credmark/credmark-model-framework-py | ab449990018dc1cbb1c70cfbb61c71bfc02f1ebe | [
"MIT"
] | 1 | 2022-03-29T22:42:07.000Z | 2022-03-29T22:42:07.000Z | from typing import Type, Union, List
from .errors import (
InvalidColumnException,
InvalidQueryException,
)
from credmark.cmf.types.ledger import (
BlockTable, ContractTable,
LogTable, ReceiptTable, TokenTable, TokenTransferTable,
TraceTable, TransactionTable, LedgerTable,
LedgerAggregate, Led... | 44.416107 | 97 | 0.507782 |
cd7a360ae253cdcdf59e641f9adefc4ca87dc299 | 13,300 | py | Python | paddlespeech/s2t/decoders/recog_bin.py | JiehangXie/PaddleSpeech | 60090b49ec27437127ab62358026dd5bb95fccc7 | [
"Apache-2.0"
] | 1,540 | 2017-11-14T13:26:33.000Z | 2021-11-09T14:05:08.000Z | paddlespeech/s2t/decoders/recog_bin.py | JiehangXie/PaddleSpeech | 60090b49ec27437127ab62358026dd5bb95fccc7 | [
"Apache-2.0"
] | 599 | 2017-11-14T13:19:12.000Z | 2021-11-09T01:58:26.000Z | paddlespeech/s2t/decoders/recog_bin.py | JiehangXie/PaddleSpeech | 60090b49ec27437127ab62358026dd5bb95fccc7 | [
"Apache-2.0"
] | 449 | 2017-11-14T12:48:46.000Z | 2021-11-06T09:34:33.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 appli... | 35.37234 | 88 | 0.596842 |
64214edec9794a5dd0e9c02b02a970283cbcdbb2 | 2,114 | py | Python | main.basic.py | GavinPacini/cas-eth-blockchain | 9da976ed9a9a1949e311b0277f703300191cfb81 | [
"MIT"
] | 1 | 2021-02-26T23:47:24.000Z | 2021-02-26T23:47:24.000Z | main.basic.py | GavinPacini/cas-eth-blockchain | 9da976ed9a9a1949e311b0277f703300191cfb81 | [
"MIT"
] | null | null | null | main.basic.py | GavinPacini/cas-eth-blockchain | 9da976ed9a9a1949e311b0277f703300191cfb81 | [
"MIT"
] | null | null | null | import hashlib
import json
import pprint
from time import time, ctime, sleep
class Blockchain(object):
def __init__(self):
self.chain = []
self.pending_transactions = []
self.new_block(previous_hash="A blockchain made for ETHZ's CAS in Applied Information Technology", nonce=100)
def... | 27.815789 | 117 | 0.634342 |
5b5192ef8528fc745e611649db4e8b9eea53e7f5 | 631 | py | Python | allennlp/modules/similarity_functions/__init__.py | justindujardin/allennlp | c4559f3751775aa8bc018db417edc119d29d8051 | [
"Apache-2.0"
] | 2 | 2021-04-27T19:56:28.000Z | 2021-08-19T05:34:37.000Z | allennlp/modules/similarity_functions/__init__.py | justindujardin/allennlp | c4559f3751775aa8bc018db417edc119d29d8051 | [
"Apache-2.0"
] | 5 | 2021-05-03T14:40:33.000Z | 2021-05-03T14:40:34.000Z | allennlp/modules/similarity_functions/__init__.py | justindujardin/allennlp | c4559f3751775aa8bc018db417edc119d29d8051 | [
"Apache-2.0"
] | 1 | 2021-02-04T08:42:23.000Z | 2021-02-04T08:42:23.000Z | """
A `SimilarityFunction` takes a pair of tensors with the same shape, and computes a similarity
function on the vectors in the last dimension.
"""
from allennlp.modules.similarity_functions.bilinear import BilinearSimilarity
from allennlp.modules.similarity_functions.cosine import CosineSimilarity
from allennlp.modul... | 57.363636 | 93 | 0.877971 |
5ce61944edbbd8462f5bc2df82c231292760a4ef | 25,272 | py | Python | tests/unit/test_exam.py | agossino/exam2pdf | bc396c5dbf030fe7c6eb84723ceafc3a3f3467e1 | [
"MIT"
] | null | null | null | tests/unit/test_exam.py | agossino/exam2pdf | bc396c5dbf030fe7c6eb84723ceafc3a3f3467e1 | [
"MIT"
] | null | null | null | tests/unit/test_exam.py | agossino/exam2pdf | bc396c5dbf030fe7c6eb84723ceafc3a3f3467e1 | [
"MIT"
] | null | null | null | import pytest
from pathlib import Path
import random
import exam2pdf
from exam2pdf.exam import SerializeExam
from exam2pdf.utility import ItemLevel, Exam2pdfException
def test_exam():
"""GIVEN an empty Exam
THEN questions attribute is an empty tuple
"""
ex = exam2pdf.Exam()
assert ex.questions =... | 27.559433 | 101 | 0.61301 |
38cc6c6c0e652518c4d8e74b11553929111f6b42 | 836 | py | Python | assetfactory/images/2021/08/10/results-js-and-go-speedup.py | reinhrst/reinhrst.github.io | 3e9dce26c923fca54589ffd1d19d56af0dd27910 | [
"CC0-1.0"
] | null | null | null | assetfactory/images/2021/08/10/results-js-and-go-speedup.py | reinhrst/reinhrst.github.io | 3e9dce26c923fca54589ffd1d19d56af0dd27910 | [
"CC0-1.0"
] | 6 | 2021-07-01T19:35:47.000Z | 2022-02-06T10:30:35.000Z | assetfactory/images/2021/08/10/results-js-and-go-speedup.py | reinhrst/reinhrst.github.io | 3e9dce26c923fca54589ffd1d19d56af0dd27910 | [
"CC0-1.0"
] | 1 | 2021-08-11T22:46:47.000Z | 2021-08-11T22:46:47.000Z | DATA = [
("Load JS/WebAssembly", 2, 2, 2, 2, 2),
("Load /tmp/lines.txt", 225, 222, 218, 209, 202),
("From JS new Fzf() until ready to ....",
7825, 8548, 1579, 2592, 15069),
("Calling fzf-lib's fzf.New()", 1255, 3121, 963, 612, 899),
("return from fzfNew() function", 358, 7, 0, 18, 1),
("sea... | 36.347826 | 79 | 0.578947 |
4a8c6a2bfc7916a443312b39b6d4edb62fa41ca0 | 1,670 | py | Python | example_usage_script.py | defra-data/EODS-API | 5017e8c6080e84f1aa0d286eda96394fadd13015 | [
"MIT"
] | 3 | 2021-06-14T09:06:18.000Z | 2021-08-19T13:50:49.000Z | example_usage_script.py | defra-data/EODS-API | 5017e8c6080e84f1aa0d286eda96394fadd13015 | [
"MIT"
] | 7 | 2021-07-30T13:24:36.000Z | 2021-11-16T14:02:20.000Z | example_usage_script.py | defra-data/EODS-API | 5017e8c6080e84f1aa0d286eda96394fadd13015 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import eodslib
from datetime import datetime
from pathlib import Path
from dotenv import load_dotenv
import os
if __name__ == "__main__":
start_time = datetime.utcnow()
# USER MUST EDIT THE ENVIRONMENT FILE REFERENCED BELOW, OR CREATE THEIR OWN FILE AND REFERENCE IT
load_dotenv('sa... | 29.821429 | 101 | 0.64012 |
8da6b4d04399947b1c0a0a0b4bc48d8fafc68ae4 | 1,715 | py | Python | shop/views.py | FrankCasanova/onlineshop | 1a9011ce3d49976e2584cdadc33893d04947a73b | [
"MIT"
] | null | null | null | shop/views.py | FrankCasanova/onlineshop | 1a9011ce3d49976e2584cdadc33893d04947a73b | [
"MIT"
] | null | null | null | shop/views.py | FrankCasanova/onlineshop | 1a9011ce3d49976e2584cdadc33893d04947a73b | [
"MIT"
] | null | null | null | from django.shortcuts import get_object_or_404, render
from .models import Category, Product
from cart.forms import CartAddProductForm
from .recommender import Recommender
# Create your views here.
def product_list(request, category_slug=None):
category = None
categories = Category.objects.all()
products... | 36.489362 | 74 | 0.573761 |
45b4abde4550d67ec7c610ad77a34e5a4e90ce01 | 113 | py | Python | tests/update_test_files.py | JNDanielson/mplstereonet | 6196e3fd8fff5b2868f50dbcc96eef804024f62e | [
"MIT"
] | 120 | 2015-07-09T21:18:39.000Z | 2022-03-10T14:29:02.000Z | tests/update_test_files.py | JNDanielson/mplstereonet | 6196e3fd8fff5b2868f50dbcc96eef804024f62e | [
"MIT"
] | 32 | 2015-01-09T21:52:30.000Z | 2021-12-15T20:53:37.000Z | tests/update_test_files.py | JNDanielson/mplstereonet | 6196e3fd8fff5b2868f50dbcc96eef804024f62e | [
"MIT"
] | 49 | 2015-02-21T21:55:05.000Z | 2021-09-27T12:13:29.000Z | #! /usr/bin/python
import sys
import examples
for filename in sys.argv[1:]:
examples.save_output(filename)
| 14.125 | 34 | 0.734513 |
36196486e81a607bef1beedaf94fa7bc7ab5ff6b | 9,853 | py | Python | src/command_modules/azure-cli-acr/azure/cli/command_modules/acr/_utils.py | henrypan/azure-cli | 8de0ab5216ed3dc700546ae9a3c485710322376b | [
"MIT"
] | null | null | null | src/command_modules/azure-cli-acr/azure/cli/command_modules/acr/_utils.py | henrypan/azure-cli | 8de0ab5216ed3dc700546ae9a3c485710322376b | [
"MIT"
] | 2 | 2021-03-25T21:38:56.000Z | 2021-11-15T17:46:45.000Z | src/command_modules/azure-cli-acr/azure/cli/command_modules/acr/_utils.py | Visual-Studio-China/azure-cli-int | 48c7c7f371a0ecc4ebfd4dcfdc72764beddf5c31 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 45.197248 | 111 | 0.699076 |
b91308d534ae636e348d3253a1c51d864b34e3ad | 895 | py | Python | user_post/migrations/0002_post.py | anirvansen/graphql_in_python | f7ec3709123ce481719147cafac70070c0eb0628 | [
"MIT"
] | null | null | null | user_post/migrations/0002_post.py | anirvansen/graphql_in_python | f7ec3709123ce481719147cafac70070c0eb0628 | [
"MIT"
] | null | null | null | user_post/migrations/0002_post.py | anirvansen/graphql_in_python | f7ec3709123ce481719147cafac70070c0eb0628 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.9 on 2021-11-22 12:24
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('user_post', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | 33.148148 | 117 | 0.610056 |
56aafe048891eb00a525d23f707fe2a206da75f1 | 2,003 | py | Python | sarathi.py | filius-fall/sarathi | 126a693d91d9bd70872a723f6f67bf445519d707 | [
"MIT"
] | 3 | 2020-11-28T21:51:10.000Z | 2021-01-26T09:04:57.000Z | sarathi.py | filius-fall/sarathi | 126a693d91d9bd70872a723f6f67bf445519d707 | [
"MIT"
] | 12 | 2021-04-10T13:04:40.000Z | 2021-04-18T13:25:54.000Z | sarathi.py | filius-fall/sarathi | 126a693d91d9bd70872a723f6f67bf445519d707 | [
"MIT"
] | 2 | 2021-04-10T13:09:32.000Z | 2021-04-13T15:56:31.000Z | """Sarathi - A discord bot to steer through the battlefield of knowledge"""
import sys
import os
import discord
from discord.ext import commands
from dotenv import load_dotenv
import til
load_dotenv()
TOKEN = os.getenv("DISCORD_TOKEN")
GUILD = os.getenv("DISCORD_GUILD")
bot = commands.Bot(
command_prefix="/",
... | 25.0375 | 78 | 0.620569 |
6012024e22aa4e05e7ace771b30a40d8a6fe12d6 | 1,377 | py | Python | adminmgr/media/code/A3/task1/BD_85_130_185_279_XNvO6Z1.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 9 | 2019-11-08T02:05:27.000Z | 2021-12-13T12:06:35.000Z | adminmgr/media/code/A3/task1/BD_85_130_185_279_XNvO6Z1.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 6 | 2019-11-27T03:23:16.000Z | 2021-06-10T19:15:13.000Z | adminmgr/media/code/A3/task1/BD_85_130_185_279_9ab4wge.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 4 | 2019-11-26T17:04:27.000Z | 2021-12-13T11:57:03.000Z | import findspark
findspark.init()
from pyspark.sql import SparkSession
from pyspark.sql.functions import explode
from pyspark.sql.functions import split
from pyspark.sql.types import StructType
spark = SparkSession \
.builder \
.appName("StructuredNetworkWordCount") \
.getOrCreate()
# Create DataFrame repre... | 44.419355 | 356 | 0.691358 |
5ba1f4371b7ea2632dcfd691bc4683cd15cdf4b1 | 11,114 | py | Python | src/oci/service_catalog/models/application_summary.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 249 | 2017-09-11T22:06:05.000Z | 2022-03-04T17:09:29.000Z | src/oci/service_catalog/models/application_summary.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 228 | 2017-09-11T23:07:26.000Z | 2022-03-23T10:58:50.000Z | src/oci/service_catalog/models/application_summary.py | Manny27nyc/oci-python-sdk | de60b04e07a99826254f7255e992f41772902df7 | [
"Apache-2.0",
"BSD-3-Clause"
] | 224 | 2017-09-27T07:32:43.000Z | 2022-03-25T16:55:42.000Z | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 32.402332 | 245 | 0.648551 |
7519b24a485668504b93db4186a6b1a778025604 | 18,459 | py | Python | pandas/tests/io/test_common.py | jordanrmerrick/pandas | e18415e64c66a5c125a6e6a9e9aa9fa97eb01403 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | 4 | 2020-03-31T23:31:24.000Z | 2021-08-06T13:47:39.000Z | pandas/tests/io/test_common.py | jordanrmerrick/pandas | e18415e64c66a5c125a6e6a9e9aa9fa97eb01403 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | 6 | 2021-05-31T01:10:55.000Z | 2021-07-19T00:37:03.000Z | pandas/tests/io/test_common.py | jordanrmerrick/pandas | e18415e64c66a5c125a6e6a9e9aa9fa97eb01403 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-03-06T10:33:40.000Z | 2021-03-06T10:33:40.000Z | """
Tests for the pandas.io.common functionalities
"""
import codecs
import errno
from functools import partial
from io import (
BytesIO,
StringIO,
)
import mmap
import os
from pathlib import Path
import tempfile
import pytest
from pandas.compat import is_platform_windows
import pandas.util._test_decorators a... | 34.828302 | 88 | 0.588439 |
756e9baadc6e56f605f2fb80b6ef32b2c8aa40d2 | 11,715 | py | Python | src/wechaty/user/contact.py | PIG208/python-wechaty | f6a3a6765d9265905e1ff39142d45eacf87180fd | [
"Apache-2.0"
] | 640 | 2020-02-10T06:39:20.000Z | 2022-03-31T07:56:45.000Z | src/wechaty/user/contact.py | RuoChen-ing/python-wechaty | d915823660ef5de6f1f599bdcc6e45f4a4122581 | [
"Apache-2.0"
] | 245 | 2020-02-28T18:58:50.000Z | 2022-03-28T04:10:24.000Z | src/wechaty/user/contact.py | RuoChen-ing/python-wechaty | d915823660ef5de6f1f599bdcc6e45f4a4122581 | [
"Apache-2.0"
] | 140 | 2019-12-17T02:40:06.000Z | 2022-03-29T02:23:15.000Z | """
Python Wechaty - https://github.com/wechaty/python-wechaty
Authors: Huan LI (李卓桓) <https://github.com/huan>
Jingjing WU (吴京京) <https://github.com/wj-Mcat>
2020-now @ Copyright Wechaty
Licensed under the Apache License, Version 2.0 (the 'License');
you may not use this file except in compliance wit... | 29.885204 | 105 | 0.559624 |
2ca99431123082b7de02f26e13012749f9a00dc1 | 2,477 | py | Python | buildingspy/tests/test_development_error_dictionary.py | wanaylor/NewBuildingsPy | a80ea41600c80569dfb381ed9629161a5f17224e | [
"BSD-3-Clause-LBNL"
] | 1 | 2019-11-17T12:36:21.000Z | 2019-11-17T12:36:21.000Z | buildingspy/tests/test_development_error_dictionary.py | wanaylor/NewBuildingsPy | a80ea41600c80569dfb381ed9629161a5f17224e | [
"BSD-3-Clause-LBNL"
] | null | null | null | buildingspy/tests/test_development_error_dictionary.py | wanaylor/NewBuildingsPy | a80ea41600c80569dfb381ed9629161a5f17224e | [
"BSD-3-Clause-LBNL"
] | null | null | null | #!/usr/bin/env python
import unittest
class Test_development_error_dictionary(unittest.TestCase):
"""
This class contains the unit tests for
:mod:`buildingspy.development.error_dictionary.ErrorDictionary`.
"""
def test_keys(self):
import buildingspy.development.error_dictionary as e
... | 44.232143 | 111 | 0.572063 |
14bca1dc75a95b3c4c32fd5b6699ddc3de9060f0 | 1,064 | py | Python | adat/telepules/parse_precincts.py | korenmiklos/106 | 9925a2bda18915eb43d7bdd2b54d4d7aa113bc66 | [
"MIT"
] | 1 | 2018-04-07T20:44:45.000Z | 2018-04-07T20:44:45.000Z | adat/telepules/parse_precincts.py | korenmiklos/106 | 9925a2bda18915eb43d7bdd2b54d4d7aa113bc66 | [
"MIT"
] | null | null | null | adat/telepules/parse_precincts.py | korenmiklos/106 | 9925a2bda18915eb43d7bdd2b54d4d7aa113bc66 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, csv, re
import lxml.html
import glob
'''
Jelolt-id: 2014 / OEVK # / jelolt sorszam
'''
TELEPULES_RE = re.compile(r'<h2>(.*?) szavazókörei</h2>', re.UNICODE and re.DOTALL)
def find_city(html, regex):
matches = regex.search(html)
return matches.group(1)
... | 28 | 116 | 0.677632 |
6832aba33cca9c297c1a642810345ed066eadc07 | 3,708 | py | Python | selfdrive/test/process_replay/test_processes.py | StingrayCharles/openpilot | 6a48212422ef05792dde058e36c5c3099f17f619 | [
"MIT"
] | 114 | 2020-02-24T14:18:01.000Z | 2022-03-19T03:42:00.000Z | selfdrive/test/process_replay/test_processes.py | StingrayCharles/openpilot | 6a48212422ef05792dde058e36c5c3099f17f619 | [
"MIT"
] | 15 | 2020-02-25T03:37:44.000Z | 2021-09-08T01:51:15.000Z | selfdrive/test/process_replay/test_processes.py | StingrayCharles/openpilot | 6a48212422ef05792dde058e36c5c3099f17f619 | [
"MIT"
] | 55 | 2020-02-24T09:43:04.000Z | 2022-02-15T04:52:00.000Z | #!/usr/bin/env python3
import os
import requests
import sys
import tempfile
from selfdrive.test.process_replay.compare_logs import compare_logs
from selfdrive.test.process_replay.process_replay import replay_process, CONFIGS
from tools.lib.logreader import LogReader
segments = [
"0375fdf7b1ce594d|2019-06-13--08-32-... | 31.159664 | 102 | 0.626214 |
f84247220f6053653cf009996af977f08a9c24fb | 827 | bzl | Python | third_party/tf_runtime/workspace.bzl | erik-888/tensorflow | d207f1fccd696966312d0b2b3c9a84b53ca64ca7 | [
"Apache-2.0"
] | 1 | 2020-03-23T07:42:17.000Z | 2020-03-23T07:42:17.000Z | third_party/tf_runtime/workspace.bzl | a5204662/tensorflow | d207f1fccd696966312d0b2b3c9a84b53ca64ca7 | [
"Apache-2.0"
] | null | null | null | third_party/tf_runtime/workspace.bzl | a5204662/tensorflow | d207f1fccd696966312d0b2b3c9a84b53ca64ca7 | [
"Apache-2.0"
] | null | null | null | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "e48f4cd1e8c2de3dacfac21835e1b6b070c0e00c"
TFRT_SHA256 = "e4d8cda2f6e10c85dee5ec3d133b... | 39.380952 | 124 | 0.698912 |
70cf156e129213cf22f39a3e5b2b7630b3ae176a | 640 | py | Python | kora/install/pg10.py | wannaphong/kora | 8a9034097d07b14094e077769c02a0b4857d179b | [
"MIT"
] | 91 | 2020-05-26T05:54:51.000Z | 2022-03-09T07:33:44.000Z | kora/install/pg10.py | wannaphong/kora | 8a9034097d07b14094e077769c02a0b4857d179b | [
"MIT"
] | 12 | 2020-10-03T10:09:11.000Z | 2021-03-06T23:12:21.000Z | kora/install/pg10.py | wannaphong/kora | 8a9034097d07b14094e077769c02a0b4857d179b | [
"MIT"
] | 16 | 2020-07-07T18:39:29.000Z | 2021-03-06T03:46:49.000Z | import os
# install PostgreSQL 10
os.system("apt install postgresql postgresql-contrib")
os.system("service postgresql start")
os.system("sudo -u postgres psql -c 'CREATE USER root WITH SUPERUSER'")
# update %%sql and add pg special commands
os.system('pip install -U ipython-sql')
os.system('pip install pgspecial')
o... | 32 | 71 | 0.746875 |
5237ce1ced16a55f1aefd8017007786f891bb90e | 2,813 | py | Python | notebook_item.py | kevin-funderburg/alfred-microsoft-onenote-navigator | 90453c5f9f72b502b95520a2e425e06a8eea0708 | [
"MIT"
] | 57 | 2019-07-15T14:52:20.000Z | 2022-02-21T13:48:49.000Z | notebook_item.py | kevin-funderburg/alfred-microsoft-onenote-navigator | 90453c5f9f72b502b95520a2e425e06a8eea0708 | [
"MIT"
] | 19 | 2019-06-14T20:14:51.000Z | 2022-03-27T21:53:13.000Z | notebook_item.py | kevin-funderburg/alfred-microsoft-onenote-navigator | 90453c5f9f72b502b95520a2e425e06a8eea0708 | [
"MIT"
] | 6 | 2019-06-12T09:19:00.000Z | 2021-06-13T18:45:00.000Z | import re
import os
ONENOTE_USER_INFO_CACHE = "~/Library/Containers/com.microsoft.onenote.mac/" \
"Data/Library/Application Support/Microsoft/UserInfoCache/"
ONENOTE_USER_UID = None
ICON_PAGE = 'icons/page.png'
ICON_SECTION = 'icons/section.png'
ICON_NOTEBOOK = 'icons/notebook.png'
ICON_SECT... | 31.965909 | 109 | 0.594028 |
d412461aa79f0b0eaab193b2ed84835c995e9b15 | 814 | py | Python | test/test_time_stamp.py | r7l/python-gitea-api | 31d3dba27ea7e551e2048a1230c4ab4d73365006 | [
"MIT"
] | 1 | 2022-02-09T23:43:26.000Z | 2022-02-09T23:43:26.000Z | test/test_time_stamp.py | r7l/python-gitea-api | 31d3dba27ea7e551e2048a1230c4ab4d73365006 | [
"MIT"
] | null | null | null | test/test_time_stamp.py | r7l/python-gitea-api | 31d3dba27ea7e551e2048a1230c4ab4d73365006 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Gitea API.
This documentation describes the Gitea API. # noqa: E501
OpenAPI spec version: 1.16.7
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import gitea_api
from gitea_api.models.time_stamp i... | 20.35 | 79 | 0.679361 |
467238fbcb2a2f29a57b1e402661fb855d477d07 | 5,167 | py | Python | src/main.py | TomasGB/Voice-Assistant | 96e08a3c1ad2081f8559949bcd7833a8b2be405d | [
"MIT"
] | 2 | 2021-01-08T19:26:57.000Z | 2021-09-12T03:45:32.000Z | src/main.py | TomasGB/Voice-Assistant | 96e08a3c1ad2081f8559949bcd7833a8b2be405d | [
"MIT"
] | 1 | 2021-04-09T09:00:35.000Z | 2021-04-09T13:51:37.000Z | src/main.py | TomasGB/Voice-Assistant | 96e08a3c1ad2081f8559949bcd7833a8b2be405d | [
"MIT"
] | null | null | null | from __future__ import print_function
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
import os
import datetime
import time
import pyaudio
from speak import speak, takeCommand
import subpro... | 35.14966 | 77 | 0.587188 |
33612fe36d862a36a6e5c3786db8ff3797cd1b70 | 2,547 | py | Python | apps/crop_img.py | VladimirYugay/PIFu | 8f80e7ee539098e53c419a518f6f180dbdec97c5 | [
"MIT"
] | null | null | null | apps/crop_img.py | VladimirYugay/PIFu | 8f80e7ee539098e53c419a518f6f180dbdec97c5 | [
"MIT"
] | null | null | null | apps/crop_img.py | VladimirYugay/PIFu | 8f80e7ee539098e53c419a518f6f180dbdec97c5 | [
"MIT"
] | null | null | null | import os
import cv2
import numpy as np
from pathlib import Path
import argparse
def get_bbox(msk):
rows = np.any(msk, axis=1)
cols = np.any(msk, axis=0)
rmin, rmax = np.where(rows)[0][[0, -1]]
cmin, cmax = np.where(cols)[0][[0, -1]]
return rmin, rmax, cmin, cmax
def process_img(img, msk, bbox... | 31.8375 | 120 | 0.586572 |
42a0244af2fc5c6a4f401badc90ae192a5504a04 | 2,546 | py | Python | cc/api/tests/test_support.py | creativecommons/cc.api | 11ad601463b16a77066069ca646d3df284092230 | [
"MIT"
] | 2 | 2017-12-25T14:11:48.000Z | 2020-04-04T23:02:10.000Z | cc/api/tests/test_support.py | creativecommons/cc.api | 11ad601463b16a77066069ca646d3df284092230 | [
"MIT"
] | 4 | 2019-02-12T17:23:14.000Z | 2021-01-04T16:16:26.000Z | cc/api/tests/test_support.py | creativecommons/cc.api | 11ad601463b16a77066069ca646d3df284092230 | [
"MIT"
] | 7 | 2015-06-08T11:17:55.000Z | 2021-04-12T13:16:09.000Z |
import os
import lxml.html
from cc.api.tests.test_common import *
####################
## Path constants ##
####################
RELAX_OPTIONS = os.path.join(RELAX_PATH, 'options.relax.xml')
RELAX_SELECT = os.path.join(RELAX_PATH, 'select.relax.xml')
##################
## Test classes ##
##################
class Te... | 33.946667 | 81 | 0.599372 |
c3e9af5dc1da2d8bc1a441dd1cb07ed1c62eed86 | 1,112 | py | Python | nanome/_internal/_ui/_serialization/_mesh_serializer.py | nanome-ai/nanome-plugin-api | f2ce6a5e3123ee7449a90c2659f3891124289f4a | [
"MIT"
] | 3 | 2020-07-02T13:08:27.000Z | 2021-11-24T14:32:53.000Z | nanome/_internal/_ui/_serialization/_mesh_serializer.py | nanome-ai/nanome-plugin-api | f2ce6a5e3123ee7449a90c2659f3891124289f4a | [
"MIT"
] | 11 | 2020-09-14T17:01:47.000Z | 2022-02-18T04:00:52.000Z | nanome/_internal/_ui/_serialization/_mesh_serializer.py | nanome-ai/nanome-plugin-api | f2ce6a5e3123ee7449a90c2659f3891124289f4a | [
"MIT"
] | 5 | 2020-08-12T16:30:03.000Z | 2021-12-06T18:04:23.000Z | from . import _UIBaseSerializer
from .. import _Mesh
from nanome.util import IntEnum
from nanome._internal._util._serializers import _ColorSerializer, _TypeSerializer
class _MeshSerializer(_TypeSerializer):
def __init__(self):
self.color = _ColorSerializer()
def version(self):
return 1
d... | 30.054054 | 95 | 0.668165 |
228c9892273265b3ecf817a877d8c3edaa5e58d4 | 2,694 | py | Python | ambramelin/util/credentials.py | Palisand/ambramelin | 264da5c3592dc9287bdda3c1383a04420439d07b | [
"MIT"
] | null | null | null | ambramelin/util/credentials.py | Palisand/ambramelin | 264da5c3592dc9287bdda3c1383a04420439d07b | [
"MIT"
] | null | null | null | ambramelin/util/credentials.py | Palisand/ambramelin | 264da5c3592dc9287bdda3c1383a04420439d07b | [
"MIT"
] | null | null | null | import subprocess
from abc import ABC, abstractmethod
from typing import Optional
from ambramelin.util.errors import AmbramelinError
class CredentialManagerError(AmbramelinError):
pass
class CredentialManager(ABC):
@abstractmethod
def get_password(self, account: str) -> Optional[str]:
pass
... | 27.212121 | 81 | 0.5 |
c57b1f7fca9e23fd0350fd7984fe1eb1e1a23a73 | 4,627 | py | Python | data/Resources/Scripts/bleUartCommands.py | robbitay/ConstPort | d948ceb5f0e22504640578e3ef31e3823b29c1c3 | [
"Unlicense"
] | null | null | null | data/Resources/Scripts/bleUartCommands.py | robbitay/ConstPort | d948ceb5f0e22504640578e3ef31e3823b29c1c3 | [
"Unlicense"
] | null | null | null | data/Resources/Scripts/bleUartCommands.py | robbitay/ConstPort | d948ceb5f0e22504640578e3ef31e3823b29c1c3 | [
"Unlicense"
] | null | null | null |
import sys, os, re
BleModCmd_GetBridgeInfo = 0x01
BleModCmd_GetStatus = 0x02
BleModCmd_Pair = 0x03
BleModCmd_Unpair = 0x04
BleModCmd_UpdateStart = 0x05
BleModCmd_FlashWriteRow = 0x06
BleModCmd_UpdateComplete = 0x07
BleModCmd_ButtonHeldDone = ... | 22.352657 | 68 | 0.646855 |
c5846495420841c3067e90128668f1ccdc4b1a3f | 7,887 | py | Python | maml/apps/symbolic/_sis.py | anooptp/maml | fdd95f3d60c9281d871d89b25b073e87b6ba4e52 | [
"BSD-3-Clause"
] | 161 | 2020-01-26T08:24:41.000Z | 2022-03-29T06:42:42.000Z | maml/apps/symbolic/_sis.py | anooptp/maml | fdd95f3d60c9281d871d89b25b073e87b6ba4e52 | [
"BSD-3-Clause"
] | 195 | 2020-01-25T19:35:20.000Z | 2022-03-28T13:14:30.000Z | maml/apps/symbolic/_sis.py | anooptp/maml | fdd95f3d60c9281d871d89b25b073e87b6ba4e52 | [
"BSD-3-Clause"
] | 46 | 2020-03-30T12:56:39.000Z | 2022-03-27T12:53:23.000Z | """
Sure Independence Screening
https://orfe.princeton.edu/~jqfan/papers/06/SIS.pdf
"""
import logging
from itertools import combinations
from typing import Optional, Dict, List
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.metrics import get_scorer
from maml.apps.symbolic._selec... | 30.218391 | 107 | 0.583745 |
193d26bafaa03ad1b0899292ab445312dac89d24 | 24,307 | py | Python | deepvariant/realigner/realigner.py | blackwer/deepvariant | 4a6f09ba69839ae211aab3c02d13ab9edd5620dd | [
"BSD-3-Clause"
] | null | null | null | deepvariant/realigner/realigner.py | blackwer/deepvariant | 4a6f09ba69839ae211aab3c02d13ab9edd5620dd | [
"BSD-3-Clause"
] | null | null | null | deepvariant/realigner/realigner.py | blackwer/deepvariant | 4a6f09ba69839ae211aab3c02d13ab9edd5620dd | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2017 Google LLC.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
#... | 40.511667 | 87 | 0.719957 |
edfb0f7195b7eb33c9f3539f6cf4cea688aaac10 | 279 | py | Python | LeetCode/Python/1748. Sum of Unique Elements.py | rayvantsahni/Competitive-Programming-Codes | 39ba91b69ad8ce7dce554f7817c2f0d5545ef471 | [
"MIT"
] | 1 | 2021-07-05T14:01:36.000Z | 2021-07-05T14:01:36.000Z | LeetCode/Python/1748. Sum of Unique Elements.py | rayvantsahni/Competitive-Programming-and-Interview-Prep | 39ba91b69ad8ce7dce554f7817c2f0d5545ef471 | [
"MIT"
] | null | null | null | LeetCode/Python/1748. Sum of Unique Elements.py | rayvantsahni/Competitive-Programming-and-Interview-Prep | 39ba91b69ad8ce7dce554f7817c2f0d5545ef471 | [
"MIT"
] | null | null | null | class Solution:
def sumOfUnique(self, nums: List[int]) -> int:
from collections import Counter
c = Counter(nums)
_sum = 0
for key in c:
if c.get(key) == 1:
_sum += key
return _sum
| 21.461538 | 50 | 0.451613 |
27b72b67cdb490c3a40ff3b1c192020f3aa8cee3 | 4,908 | py | Python | DPGAnalysis/SiStripTools/test/seedmultiplicity_cfg.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 1 | 2020-10-08T06:48:26.000Z | 2020-10-08T06:48:26.000Z | DPGAnalysis/SiStripTools/test/seedmultiplicity_cfg.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | null | null | null | DPGAnalysis/SiStripTools/test/seedmultiplicity_cfg.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | null | null | null | import FWCore.ParameterSet.Config as cms
import FWCore.ParameterSet.VarParsing as VarParsing
process = cms.Process("SeedMultiplicity")
#prepare options
options = VarParsing.VarParsing("analysis")
options.register ('globalTag',
"DONOTEXIST",
VarParsing.VarParsing.multiplicity.sing... | 41.243697 | 156 | 0.726773 |
98ef88a4b5b9e8bc8f23fb160413c50b4837e709 | 9,485 | py | Python | midonet/neutron/tests/unit/test_extension_tunnelzone.py | midokura/python-neutron-plugin-midonet | a123b0f769c4a0d218bcd6764383ab6c5c9351df | [
"Apache-2.0"
] | null | null | null | midonet/neutron/tests/unit/test_extension_tunnelzone.py | midokura/python-neutron-plugin-midonet | a123b0f769c4a0d218bcd6764383ab6c5c9351df | [
"Apache-2.0"
] | null | null | null | midonet/neutron/tests/unit/test_extension_tunnelzone.py | midokura/python-neutron-plugin-midonet | a123b0f769c4a0d218bcd6764383ab6c5c9351df | [
"Apache-2.0"
] | 1 | 2015-01-14T16:55:34.000Z | 2015-01-14T16:55:34.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2014 Midokura SARL.
# 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.o... | 41.600877 | 78 | 0.62699 |
2741c198193060243fd6fb6dbd210d16ebbbe347 | 518 | py | Python | filetransfers/backends/xsendfile.py | khyer/django-filetransfers | bb18c6d454f61acbb79727c2dfc566fc9e6bf1c4 | [
"BSD-3-Clause"
] | null | null | null | filetransfers/backends/xsendfile.py | khyer/django-filetransfers | bb18c6d454f61acbb79727c2dfc566fc9e6bf1c4 | [
"BSD-3-Clause"
] | null | null | null | filetransfers/backends/xsendfile.py | khyer/django-filetransfers | bb18c6d454f61acbb79727c2dfc566fc9e6bf1c4 | [
"BSD-3-Clause"
] | null | null | null | from django.http import HttpResponse
from django.utils.encoding import smart_str
def serve_file(request, file, save_as, content_type, **kwargs):
"""Lets the web server serve the file using the X-Sendfile extension"""
response = HttpResponse(content_type=content_type)
response['X-Sendfile'] = file.path
... | 39.846154 | 88 | 0.722008 |
984e93a0baf8f1e13c27b91faf013d2b3ae82448 | 11,866 | py | Python | simpy_events/event.py | loicpw/simpy-events | 70160bb433a192d267d5c5fb093129c4ffe938d5 | [
"MIT"
] | 1 | 2020-02-19T07:50:00.000Z | 2020-02-19T07:50:00.000Z | simpy_events/event.py | loicpw/simpy-events | 70160bb433a192d267d5c5fb093129c4ffe938d5 | [
"MIT"
] | null | null | null | simpy_events/event.py | loicpw/simpy-events | 70160bb433a192d267d5c5fb093129c4ffe938d5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import collections
from itertools import chain
class Context:
""" context object forwarded to event handlers by `EventDispatcher`
contains following attributes:
+ `event`, the `Event` instance
+ `hook`, the name of the hook
"""
def __... | 34.9 | 76 | 0.592365 |
78d6ac3380bdf99d55c4b80a9643ee0868be5c2a | 585 | py | Python | pypy/objspace/std/test/test_prebuiltint.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | 1 | 2021-06-02T23:02:09.000Z | 2021-06-02T23:02:09.000Z | pypy/objspace/std/test/test_prebuiltint.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | 1 | 2021-03-30T18:08:41.000Z | 2021-03-30T18:08:41.000Z | pypy/objspace/std/test/test_prebuiltint.py | olliemath/pypy | 8b873bd0b8bf76075aba3d915c260789f26f5788 | [
"Apache-2.0",
"OpenSSL"
] | 1 | 2022-03-30T11:42:37.000Z | 2022-03-30T11:42:37.000Z | import pytest
from pypy.objspace.std.test import test_intobject
@pytest.mark.skipif('config.option.runappdirect')
class AppTestInt(test_intobject.AppTestInt):
spaceconfig = {"objspace.std.withprebuiltint": True}
def setup_class(cls):
space = cls.space
cls.w_start = space.wrap(space.config.objs... | 32.5 | 75 | 0.659829 |
9abd6621f80576a0cb65edc8c9e72485881894f2 | 2,514 | py | Python | techreview2/techapp/migrations/0001_initial.py | elb-dev/ITC-172 | df7acdad309c44cfd3b7580132d28d2d7b9713c4 | [
"Apache-2.0"
] | null | null | null | techreview2/techapp/migrations/0001_initial.py | elb-dev/ITC-172 | df7acdad309c44cfd3b7580132d28d2d7b9713c4 | [
"Apache-2.0"
] | null | null | null | techreview2/techapp/migrations/0001_initial.py | elb-dev/ITC-172 | df7acdad309c44cfd3b7580132d28d2d7b9713c4 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.1.4 on 2019-01-16 19:28
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 37.522388 | 114 | 0.56245 |
d4a2af2f22cfde971274970772a03873fdbbaa32 | 3,867 | py | Python | speechless/recording.py | AdamBraun/speechless | f693a339ea4f16f56c8e995619d950a4912e52a0 | [
"MIT"
] | 92 | 2017-02-05T22:01:13.000Z | 2021-03-08T10:27:46.000Z | speechless/recording.py | AdamBraun/speechless | f693a339ea4f16f56c8e995619d950a4912e52a0 | [
"MIT"
] | 9 | 2017-06-14T19:18:41.000Z | 2020-05-07T11:50:12.000Z | speechless/recording.py | AdamBraun/speechless | f693a339ea4f16f56c8e995619d950a4912e52a0 | [
"MIT"
] | 28 | 2017-02-15T18:04:42.000Z | 2020-04-30T14:55:31.000Z | import array
from itertools import dropwhile
from pathlib import Path
from sys import byteorder
import librosa
import numpy
from numpy import ndarray, abs, max, flipud, concatenate
from speechless import configuration
from speechless.labeled_example import LabeledExample, LabeledExampleFromFile
from speechless.tools ... | 34.837838 | 119 | 0.660719 |
97e1d5c4bcca2b48a471ffe6637b91dc65aaeb75 | 921 | py | Python | medium/python3/c0094_199_binary-tree-right-side-view/00_leetcode_0094.py | drunkwater/leetcode | 8cc4a07763e71efbaedb523015f0c1eff2927f60 | [
"Ruby"
] | null | null | null | medium/python3/c0094_199_binary-tree-right-side-view/00_leetcode_0094.py | drunkwater/leetcode | 8cc4a07763e71efbaedb523015f0c1eff2927f60 | [
"Ruby"
] | null | null | null | medium/python3/c0094_199_binary-tree-right-side-view/00_leetcode_0094.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
#199. Binary Tree Right Side View
#Given a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see orde... | 29.709677 | 143 | 0.624321 |
32e57abf3ef5bd64788184ba3b501c1c7e11183f | 1,081 | py | Python | configs/nowd/nl_gc/trainpp/res101_d_nl_gc_nowd_lnnostd_ws5e-1_trainval1.py | yinmh17/CCNet | d5e90fe5ccfa16389fd25bdd3e2160ffe2dfbd22 | [
"MIT"
] | 1 | 2019-07-24T05:27:29.000Z | 2019-07-24T05:27:29.000Z | configs/nowd/nl_gc/trainpp/res101_d_nl_gc_nowd_lnnostd_ws5e-1_trainval1.py | yinmh17/CCNet | d5e90fe5ccfa16389fd25bdd3e2160ffe2dfbd22 | [
"MIT"
] | 1 | 2019-07-21T19:44:01.000Z | 2019-07-21T19:44:01.000Z | configs/nowd/nl_gc/trainpp/res101_d_nl_gc_nowd_lnnostd_ws5e-1_trainval1.py | yinmh17/CCNet | d5e90fe5ccfa16389fd25bdd3e2160ffe2dfbd22 | [
"MIT"
] | 1 | 2019-07-21T06:28:24.000Z | 2019-07-21T06:28:24.000Z | model = dict(
type='basenet',
pretrained='',
backbone=dict(
type='ResNet',
depth=101,
num_stages=4,
block_num=[3, 4, 23, 3],
),
att=dict(
with_att=False,
type='glore',
att_stage=[False,False,True,False],
att_pos='after_add',
at... | 21.62 | 55 | 0.582794 |
07c80da4850ddd5161ec25d560fa2ddf3e9d2a57 | 15,105 | py | Python | configs/custom_my.py | zvvzuzin/stone_detection | 2287e4d7dfc356c230e0465b3278befbbe77f8eb | [
"MIT"
] | null | null | null | configs/custom_my.py | zvvzuzin/stone_detection | 2287e4d7dfc356c230e0465b3278befbbe77f8eb | [
"MIT"
] | null | null | null | configs/custom_my.py | zvvzuzin/stone_detection | 2287e4d7dfc356c230e0465b3278befbbe77f8eb | [
"MIT"
] | null | null | null | _base_ = '/home/vasily/proj/mmdetection/configs/mask_rcnn/mask_rcnn_r50_fpn_2x_coco.py'
classes = ["stone"]
CLASSES = classes
# learning policy
num_classes = 1
# '../_base_/models/mask_rcnn_r50_fpn.py'
# model settings
model = dict(
type='MaskRCNN',
pretrained='torchvision://resnet50',
backbone=dict(
... | 45.36036 | 243 | 0.652234 |
c888e5b5fecb643206576405e71aca6f014368a3 | 6,900 | py | Python | train_scripts/train_patch_edsr.py | veritas9872/fastMRI-kspace | 4c484b3183e9f06838b5ee108af283611c2e1e77 | [
"MIT"
] | 18 | 2019-10-21T23:54:28.000Z | 2021-12-23T08:16:04.000Z | train_scripts/train_patch_edsr.py | veritas9872/fastMRI-kspace | 4c484b3183e9f06838b5ee108af283611c2e1e77 | [
"MIT"
] | 1 | 2020-07-11T08:05:33.000Z | 2020-07-11T08:05:33.000Z | train_scripts/train_patch_edsr.py | veritas9872/fastMRI-kspace | 4c484b3183e9f06838b5ee108af283611c2e1e77 | [
"MIT"
] | 5 | 2019-11-23T14:11:54.000Z | 2022-02-19T13:39:15.000Z | import torch
from torch import nn, optim
from pathlib import Path
from utils.run_utils import initialize, save_dict_as_json, get_logger, create_arg_parser
from utils.data_loaders import create_prefetch_data_loaders
from train.subsample import RandomMaskFunc, UniformMaskFunc
from data.edsr_input import PreProcessEDSR... | 40.116279 | 115 | 0.700145 |
7c11a4f853d4524947f9db437f88e4d41876079a | 1,252 | py | Python | catch/datasets/el_moro_canyon_orthohantavirus.py | broadinstitute/catch | 2fedca15f921116f580de8b2ae7ac9972932e59e | [
"MIT"
] | 58 | 2018-01-24T16:31:37.000Z | 2022-02-25T07:46:35.000Z | catch/datasets/el_moro_canyon_orthohantavirus.py | broadinstitute/catch | 2fedca15f921116f580de8b2ae7ac9972932e59e | [
"MIT"
] | 29 | 2018-04-17T17:36:06.000Z | 2022-02-25T11:48:58.000Z | catch/datasets/el_moro_canyon_orthohantavirus.py | broadinstitute/catch | 2fedca15f921116f580de8b2ae7ac9972932e59e | [
"MIT"
] | 16 | 2018-05-23T12:19:41.000Z | 2021-08-09T04:16:00.000Z | """Dataset with 'El Moro Canyon orthohantavirus' sequences.
A dataset with 2 'El Moro Canyon orthohantavirus' sequences. The virus
is segmented and has 2 segments. Based on their strain and/or isolate,
these sequences were able to be grouped into 1 genomes. Many genomes
may have fewer than 2 segments.
THIS PYTHON FIL... | 31.3 | 80 | 0.684505 |
eb594870e7acfb7ecaaa3aae9ea5d7ef6aafcd0b | 33,028 | py | Python | mpf/core/bcp/bcp_interface.py | enteryourinitials/mpf | 8fa529aacc1b163c71557adb61b591077d66c77e | [
"MIT"
] | null | null | null | mpf/core/bcp/bcp_interface.py | enteryourinitials/mpf | 8fa529aacc1b163c71557adb61b591077d66c77e | [
"MIT"
] | null | null | null | mpf/core/bcp/bcp_interface.py | enteryourinitials/mpf | 8fa529aacc1b163c71557adb61b591077d66c77e | [
"MIT"
] | null | null | null | """RPC Interface for BCP clients."""
from copy import deepcopy
from mpf.core.rgb_color import ColorException
from mpf.core.events import PostedEvent
from mpf.core.player import Player
from mpf.core.utility_functions import Util
from mpf.core.mpf_controller import MpfController
from mpf.core.switch_controller import M... | 44.692828 | 120 | 0.633735 |
e479da0026e44d3c09037f3860bb77ce98eb2b97 | 23,875 | py | Python | simple_textmining/simple_textmining.py | Q35joih4334/simple_textmining | 1cca58839d50cbf8f865b459da667da81775c593 | [
"MIT"
] | null | null | null | simple_textmining/simple_textmining.py | Q35joih4334/simple_textmining | 1cca58839d50cbf8f865b459da667da81775c593 | [
"MIT"
] | null | null | null | simple_textmining/simple_textmining.py | Q35joih4334/simple_textmining | 1cca58839d50cbf8f865b459da667da81775c593 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Aug 22 11:24:27 2021
@author: Q35joih4334
"""
import sys
import io
import textwrap
import spacy
import textacy.extract
import textacy.tm
import textacy.representations
import pandas as pd
import tqdm
import numpy as np
from wordcloud import WordCloud
import xlsxwriter
import... | 33.113731 | 113 | 0.569131 |
8155b7fb9ed46f990f1f54d2d69ba1c3e6e27571 | 380 | py | Python | vshare/extensions.py | wandonye/vshare | beea2f71fb7a37d9f9110e16dd3e260ba28bdea1 | [
"BSD-3-Clause"
] | null | null | null | vshare/extensions.py | wandonye/vshare | beea2f71fb7a37d9f9110e16dd3e260ba28bdea1 | [
"BSD-3-Clause"
] | null | null | null | vshare/extensions.py | wandonye/vshare | beea2f71fb7a37d9f9110e16dd3e260ba28bdea1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from flask.ext.sqlalchemy import SQLAlchemy
db = SQLAlchemy()
from flask.ext.mail import Mail
mail = Mail()
from flask.ext.cache import Cache
cache = Cache()
from flask.ext.login import LoginManager
login_manager = LoginManager()
from flask.ext.openid import OpenID
oid = OpenID()
from vsha... | 20 | 43 | 0.763158 |
db5d4f4e75d28d02efb2ad86c0b943e4154f89c0 | 1,186 | py | Python | backend/apps/notification_app/notification_commands.py | raphaelrpl/portal | 9e84e52a73500390187d3fc7c4871cf8a3620231 | [
"MIT"
] | null | null | null | backend/apps/notification_app/notification_commands.py | raphaelrpl/portal | 9e84e52a73500390187d3fc7c4871cf8a3620231 | [
"MIT"
] | null | null | null | backend/apps/notification_app/notification_commands.py | raphaelrpl/portal | 9e84e52a73500390187d3fc7c4871cf8a3620231 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from gaebusiness.gaeutil import SaveCommand, ModelSearchCommand
from gaeforms.ndb.form import ModelForm
from gaegraph.business_base import UpdateNode, NodeSearch, DeleteNode
from notification_app.notification_model import Notification
c... | 26.355556 | 87 | 0.790051 |
5d0092c575f85abab11695e984d00229cd3e182d | 6,032 | py | Python | django_inventory/apps/inventory/__init__.py | alka653/inventory | b8fc944962666652189ff73ae53b1c2194553e02 | [
"Apache-2.0"
] | null | null | null | django_inventory/apps/inventory/__init__.py | alka653/inventory | b8fc944962666652189ff73ae53b1c2194553e02 | [
"Apache-2.0"
] | null | null | null | django_inventory/apps/inventory/__init__.py | alka653/inventory | b8fc944962666652189ff73ae53b1c2194553e02 | [
"Apache-2.0"
] | 1 | 2020-06-08T11:57:08.000Z | 2020-06-08T11:57:08.000Z | from __future__ import absolute_import
from django.utils.translation import ugettext_lazy as _
from common.api import register_links, register_menu
from .models import Location, ItemTemplate, Inventory, InventoryTransaction, Supplier
inventory_list = {'text': _('View all inventories'), 'view': 'inventory_list', 'fa... | 81.513514 | 246 | 0.732924 |
0e522ffec783fb6d0d3dc897f878b2f3c67c21ce | 38,785 | py | Python | pypy/module/cpyext/typeobject.py | yxzoro/pypy | 6e47b3d3e5513d9639a21554963a6ace172ccfee | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | pypy/module/cpyext/typeobject.py | yxzoro/pypy | 6e47b3d3e5513d9639a21554963a6ace172ccfee | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | pypy/module/cpyext/typeobject.py | yxzoro/pypy | 6e47b3d3e5513d9639a21554963a6ace172ccfee | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | from rpython.rlib.unroll import unrolling_iterable
from rpython.rlib import jit, rawrefcount
from rpython.rlib.objectmodel import specialize, we_are_translated
from rpython.rtyper.lltypesystem import rffi, lltype
from pypy.interpreter.baseobjspace import DescrMismatch
from pypy.interpreter.error import oefmt
from pypy... | 39.657464 | 89 | 0.66915 |
3406548a3ddd10cb59acf42b18bd1bd6762d28da | 13,678 | py | Python | google-cloud-sdk/lib/third_party/pygments/formatters/latex.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 28 | 2015-01-26T14:00:59.000Z | 2021-01-09T18:13:30.000Z | google-cloud-sdk/lib/third_party/pygments/formatters/latex.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 1 | 2016-04-19T13:03:17.000Z | 2016-04-19T13:03:17.000Z | google-cloud-sdk/lib/third_party/pygments/formatters/latex.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 11 | 2015-02-20T14:41:33.000Z | 2021-12-22T23:50:36.000Z | # -*- coding: utf-8 -*-
"""
pygments.formatters.latex
~~~~~~~~~~~~~~~~~~~~~~~~~
Formatter for LaTeX fancyvrb output.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.formatter import Formatter
from pygments.token import T... | 36.670241 | 80 | 0.5503 |
e5f139ab0a890a500f93ffb4308302463ef5abb6 | 1,387 | py | Python | google/appengine/ext/mapreduce/pipeline_base.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | google/appengine/ext/mapreduce/pipeline_base.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | google/appengine/ext/mapreduce/pipeline_base.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 28.895833 | 74 | 0.751983 |
b39627467ccd0053cc9199c206927f784d793338 | 4,740 | py | Python | vispy/scene/visuals.py | izaid/vispy | 402cf95bfef88d70c9c45bb27c532ed72944e14a | [
"BSD-3-Clause"
] | null | null | null | vispy/scene/visuals.py | izaid/vispy | 402cf95bfef88d70c9c45bb27c532ed72944e14a | [
"BSD-3-Clause"
] | null | null | null | vispy/scene/visuals.py | izaid/vispy | 402cf95bfef88d70c9c45bb27c532ed72944e14a | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2014, Vispy Development Team.
# Distributed under the (new) BSD License. See LICENSE.txt for more info.
"""
The classes in scene.visuals are visuals that may be added to a scenegraph
using the methods and properties defined by vispy.scene.Node.
These classes are automatically ge... | 33.617021 | 78 | 0.58038 |
bb0a6f57bf1a48f5bb0408552ac3863a1b953991 | 11,570 | py | Python | fattureincloud_python_sdk/model/modify_received_document_response.py | fattureincloud/fattureincloud-python-sdk | f3a40fac345751014ea389680efdaef90f03bac1 | [
"MIT"
] | 2 | 2022-02-17T08:33:17.000Z | 2022-03-22T09:27:00.000Z | fattureincloud_python_sdk/model/modify_received_document_response.py | fattureincloud/fattureincloud-python-sdk | f3a40fac345751014ea389680efdaef90f03bac1 | [
"MIT"
] | null | null | null | fattureincloud_python_sdk/model/modify_received_document_response.py | fattureincloud/fattureincloud-python-sdk | f3a40fac345751014ea389680efdaef90f03bac1 | [
"MIT"
] | null | null | null | """
Fatture in Cloud API v2 - API Reference
Connect your software with Fatture in Cloud, the invoicing platform chosen by more than 400.000 businesses in Italy. The Fatture in Cloud API is based on REST, and makes possible to interact with the user related data prior authorization via OAuth2 protocol. # noq... | 43.992395 | 278 | 0.58038 |
1d03f37bdf4badf42b8e70aa36976c9b861e7331 | 4,628 | py | Python | helper.py | grantrosario/semantic-segmentation | a6feea1cfb2c402fb34fb8ee0b27f15dc15c7be7 | [
"MIT"
] | null | null | null | helper.py | grantrosario/semantic-segmentation | a6feea1cfb2c402fb34fb8ee0b27f15dc15c7be7 | [
"MIT"
] | null | null | null | helper.py | grantrosario/semantic-segmentation | a6feea1cfb2c402fb34fb8ee0b27f15dc15c7be7 | [
"MIT"
] | null | null | null | import re
import random
import numpy as np
import os.path
import scipy.misc
import shutil
import zipfile
import time
import tensorflow as tf
from glob import glob
from urllib.request import urlretrieve
from tqdm import tqdm
class DLProgress(tqdm):
last_block = 0
def hook(self, block_num=1, block_size=1, tota... | 37.024 | 93 | 0.646283 |
b41a7bf34bc04bac112723956df098b24a9efb0f | 1,646 | py | Python | azure-mgmt-eventhub/azure/mgmt/eventhub/models/sku.py | apahim/azure-sdk-for-python | f68c120f172404a65ddd477c16bcb4801a26a549 | [
"MIT"
] | null | null | null | azure-mgmt-eventhub/azure/mgmt/eventhub/models/sku.py | apahim/azure-sdk-for-python | f68c120f172404a65ddd477c16bcb4801a26a549 | [
"MIT"
] | null | null | null | azure-mgmt-eventhub/azure/mgmt/eventhub/models/sku.py | apahim/azure-sdk-for-python | f68c120f172404a65ddd477c16bcb4801a26a549 | [
"MIT"
] | null | null | null | # 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 ... | 35.021277 | 78 | 0.589915 |
67797acd6b06ea1e528adb03e93d741d9f91ee94 | 1,018 | py | Python | vendor/packages/translate-toolkit/translate/lang/nso.py | DESHRAJ/fjord | 8899b6286b23347c9b024334e61c33fe133e836d | [
"BSD-3-Clause"
] | null | null | null | vendor/packages/translate-toolkit/translate/lang/nso.py | DESHRAJ/fjord | 8899b6286b23347c9b024334e61c33fe133e836d | [
"BSD-3-Clause"
] | 1 | 2021-12-13T20:55:07.000Z | 2021-12-13T20:55:07.000Z | vendor/packages/translate-toolkit/translate/lang/nso.py | DESHRAJ/fjord | 8899b6286b23347c9b024334e61c33fe133e836d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2013 Zuza Software Foundation
#
# This file is part of translate.
#
# translate is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of t... | 30.848485 | 70 | 0.744597 |
5a5bcd54c6a209f779d003ef161967c7f01d789b | 1,081 | py | Python | lib/surface/access_context_manager/levels/__init__.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | null | null | null | lib/surface/access_context_manager/levels/__init__.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | null | null | null | lib/surface/access_context_manager/levels/__init__.py | bshaffer/google-cloud-sdk | f587382fd112f238c0d6d5ca3dab8f52d2b5c5f9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*- #
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 36.033333 | 76 | 0.764107 |
44302443b731454a6eedb5a5feb82fa423bc9a89 | 1,307 | py | Python | micropython/bluetooth/aioble/aioble/core.py | mkomon/micropython-lib | 25ebe4a261e7b1c7c8471bceef2fd0e12837cdd2 | [
"PSF-2.0"
] | 1,556 | 2015-01-18T01:10:21.000Z | 2022-03-31T23:27:33.000Z | micropython/bluetooth/aioble/aioble/core.py | Li-Lian1069/micropython-lib | 1dfca5ad343b2841965df6c4e59f92d6d94a24bd | [
"PSF-2.0"
] | 414 | 2015-01-01T09:01:22.000Z | 2022-03-31T15:08:24.000Z | micropython/bluetooth/aioble/aioble/core.py | Li-Lian1069/micropython-lib | 1dfca5ad343b2841965df6c4e59f92d6d94a24bd | [
"PSF-2.0"
] | 859 | 2015-02-05T13:23:00.000Z | 2022-03-28T02:28:16.000Z | # MicroPython aioble module
# MIT license; Copyright (c) 2021 Jim Mussared
import bluetooth
log_level = 1
def log_error(*args):
if log_level > 0:
print("[aioble] E:", *args)
def log_warn(*args):
if log_level > 1:
print("[aioble] W:", *args)
def log_info(*args):
if log_level > 2:
... | 18.152778 | 73 | 0.642693 |
504a2c4fa1a8ddd16f8865a964046580d2cd08de | 4,645 | py | Python | sppas/sppas/src/audiodata/aio/waveio.py | mirfan899/MTTS | 3167b65f576abcc27a8767d24c274a04712bd948 | [
"MIT"
] | null | null | null | sppas/sppas/src/audiodata/aio/waveio.py | mirfan899/MTTS | 3167b65f576abcc27a8767d24c274a04712bd948 | [
"MIT"
] | null | null | null | sppas/sppas/src/audiodata/aio/waveio.py | mirfan899/MTTS | 3167b65f576abcc27a8767d24c274a04712bd948 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
"""
..
---------------------------------------------------------------------
___ __ __ __ ___
/ | \ | \ | \ / the automatic
\__ |__/ |__/ |___| \__ annotation and
\ | | | | \ ... | 34.407407 | 78 | 0.522067 |
479828349670ee7787fdf1bfb9f65e88bbc09f29 | 2,535 | py | Python | disent/frameworks/ae/_supervised__tae.py | neonkitchen/disent | 0f45fefea03473690dfdbf48ef83f6e17ca9b8b3 | [
"MIT"
] | null | null | null | disent/frameworks/ae/_supervised__tae.py | neonkitchen/disent | 0f45fefea03473690dfdbf48ef83f6e17ca9b8b3 | [
"MIT"
] | null | null | null | disent/frameworks/ae/_supervised__tae.py | neonkitchen/disent | 0f45fefea03473690dfdbf48ef83f6e17ca9b8b3 | [
"MIT"
] | 1 | 2022-01-18T06:43:33.000Z | 2022-01-18T06:43:33.000Z | # ~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
# MIT License
#
# Copyright (c) 2021 Nathan Juraj Michlo
#
# 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... | 42.25 | 200 | 0.585799 |
c4e4e1702384645fc206c7a9409b60814103c451 | 2,316 | py | Python | helpers/media_manipulator.py | tervay/the-blue-alliance | e14c15cb04b455f90a2fcfdf4c1cdbf8454e17f8 | [
"MIT"
] | 1 | 2016-03-19T20:29:35.000Z | 2016-03-19T20:29:35.000Z | helpers/media_manipulator.py | gregmarra/the-blue-alliance | 5bedaf5c80b4623984760d3da3289640639112f9 | [
"MIT"
] | 11 | 2020-10-10T03:05:29.000Z | 2022-02-27T09:57:22.000Z | helpers/media_manipulator.py | gregmarra/the-blue-alliance | 5bedaf5c80b4623984760d3da3289640639112f9 | [
"MIT"
] | null | null | null | from helpers.cache_clearer import CacheClearer
from helpers.manipulator_base import ManipulatorBase
class MediaManipulator(ManipulatorBase):
"""
Handle Media database writes.
"""
@classmethod
def getCacheKeysAndControllers(cls, affected_refs):
return CacheClearer.get_media_cache_keys_and_c... | 34.567164 | 79 | 0.591105 |
f915ab6684f30d0debbe882f13d54ebe5cb8b802 | 2,772 | py | Python | shop/models.py | Yang-Wei-Ting/williams_website | 7e516ac9388f95e405d58d7f160d8f7081ff9083 | [
"Apache-2.0"
] | null | null | null | shop/models.py | Yang-Wei-Ting/williams_website | 7e516ac9388f95e405d58d7f160d8f7081ff9083 | [
"Apache-2.0"
] | null | null | null | shop/models.py | Yang-Wei-Ting/williams_website | 7e516ac9388f95e405d58d7f160d8f7081ff9083 | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.urls import reverse
COUNTRY_CHOICES = [
('AQ', 'Antarctica'),
('AU', 'Australia'),
('AT', 'Austria'),
('BE', 'Belgium'),
('BR', 'Brazil'),
('CA', 'Canada'),
('CG', 'Congo'),
('CU', 'Cuba'),
('DK', 'Denmark'),
('EG', 'Egypt'),
('FI', ... | 27.72 | 99 | 0.583333 |
21206be1770c402ea22d71e7426477e29b4c9f4e | 3,878 | py | Python | torchvision_paddle/to_pil_image.py | ImportPaddle/Old2Life | 424a2433e9a00c7eaeb660c40d22f6168dc8f576 | [
"MIT"
] | 1 | 2021-11-02T11:38:13.000Z | 2021-11-02T11:38:13.000Z | torchvision_paddle/to_pil_image.py | ImportPaddle/Old2Life | 424a2433e9a00c7eaeb660c40d22f6168dc8f576 | [
"MIT"
] | null | null | null | torchvision_paddle/to_pil_image.py | ImportPaddle/Old2Life | 424a2433e9a00c7eaeb660c40d22f6168dc8f576 | [
"MIT"
] | null | null | null | import paddle
import numpy as np
from PIL import Image
def to_pil_image(pic, mode=None):
"""Convert a tensor or an ndarray to PIL Image. This function does not support torchscript.
See :class:`~torchvision.transforms.ToPILImage` for more details.
Args:
pic (Tensor or numpy.ndarray): Image to be ... | 39.571429 | 107 | 0.610108 |
9a4f96837d206b69cb1f965e2d5b61d3a3ad203e | 1,344 | py | Python | tests/test_http_lookupd.py | rcrai/asyncnsq | 93f163b6d9fbf3c70ad6d045df45c0a77adae196 | [
"MIT"
] | 1 | 2020-11-14T17:38:38.000Z | 2020-11-14T17:38:38.000Z | tests/test_http_lookupd.py | rcrai/asyncnsq | 93f163b6d9fbf3c70ad6d045df45c0a77adae196 | [
"MIT"
] | null | null | null | tests/test_http_lookupd.py | rcrai/asyncnsq | 93f163b6d9fbf3c70ad6d045df45c0a77adae196 | [
"MIT"
] | 2 | 2021-04-09T07:40:02.000Z | 2021-04-11T10:30:33.000Z | from ._testutils import run_until_complete, BaseTest
from nsqio.http.lookupd import NsqLookupd
class NsqLookupdTest(BaseTest):
"""
:see: http://nsq.io/components/nsqd.html
"""
@run_until_complete
async def test_ok(self):
conn = NsqLookupd("127.0.0.1", 4161, loop=self.loop)
res = a... | 29.866667 | 60 | 0.62872 |
a076658680aaf3cb67c77f5d0f6a7c095ca03605 | 887 | py | Python | setup.py | LevPerla/Time_Series_Prediction_RNN | ece481f9defa047423d667b8d49dca34ee83d1a3 | [
"MIT"
] | 2 | 2022-02-06T09:57:53.000Z | 2022-03-19T10:10:07.000Z | setup.py | LevPerla/Time_Series_Prediction_RNN | ece481f9defa047423d667b8d49dca34ee83d1a3 | [
"MIT"
] | 5 | 2020-11-13T19:03:53.000Z | 2021-04-15T13:06:37.000Z | setup.py | LevPerla/Time_Series_Prediction_RNN | ece481f9defa047423d667b8d49dca34ee83d1a3 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from pathlib import Path
# Read the contents of README file
source_root = Path(".")
with (source_root / "README.md").open(encoding="utf-8") as f:
long_description = f.read()
# Read the requirements
with (source_root / "requirements.txt").open(encoding="utf8") as f:
... | 31.678571 | 80 | 0.723788 |
dff3275b7806ca1876b3e6abc28ecb427d1fde9b | 3,769 | py | Python | production/test/testrig.py | Blinkinlabs/EightByEight | 9df6381c33987d6e1bdc88115bfc41287b6bc875 | [
"MIT"
] | 18 | 2016-08-23T03:45:16.000Z | 2021-02-20T20:50:02.000Z | production/test/testrig.py | Blinkinlabs/EightByEight | 9df6381c33987d6e1bdc88115bfc41287b6bc875 | [
"MIT"
] | 3 | 2016-10-22T19:02:44.000Z | 2020-09-21T18:12:24.000Z | production/test/testrig.py | Blinkinlabs/EightByEight | 9df6381c33987d6e1bdc88115bfc41287b6bc875 | [
"MIT"
] | 8 | 2016-08-19T20:56:57.000Z | 2020-12-25T01:39:12.000Z | import ina219
import ads1015
#import Adafruit_ADS1x15
import RPi.GPIO as GPIO
class TestRig:
leds = {"pass" : 14, "fail" : 15}
powerModes = {"full" : 24, "limited" : 27}
#"name" : gpio
digitalPins = {
"1" : 5,
"2" : 6,
"3" : 12,
"4" : 13,
"5" : 16,
"6" : 19,
"7" : 20,
"8" : 21,
"9" : 26,
"10" : 4,
"11" : 17,
"12... | 20.708791 | 53 | 0.668878 |
7beaff66668bc46209d416e053ba12a65db5fb39 | 871 | py | Python | FPE/ETL/Vector.py | chackoge/ERNIE_Plus | 7e480c47a69fc2f736ac7fb55ece35dbff919938 | [
"MIT"
] | 6 | 2017-09-26T23:45:52.000Z | 2021-10-18T22:58:38.000Z | FPE/ETL/Vector.py | NETESOLUTIONS/ERNIE | 454518f28b39a6f37ad8dde4f3be15d4dccc6f61 | [
"MIT"
] | null | null | null | FPE/ETL/Vector.py | NETESOLUTIONS/ERNIE | 454518f28b39a6f37ad8dde4f3be15d4dccc6f61 | [
"MIT"
] | 9 | 2017-11-22T13:42:32.000Z | 2021-05-16T17:58:03.000Z | from decimal import *
class Vector(object):
def __init__(self, args):
""" Create a vector, example: v = Vector(1,2) """
self.values = args
def norm(self):
""" Returns the norm (length, magnitude) of the vector """
return Decimal(sum(comp**2 for comp in self.v... | 33.5 | 87 | 0.559127 |
a42ce5c4777fd9e818367700ee44627bc36bd128 | 5,709 | py | Python | xpdview/waterfall.py | xpdAcq/xpdView | 52a3837eae5b9ececb6f149fc4e7ca96776a2ba7 | [
"BSD-3-Clause"
] | null | null | null | xpdview/waterfall.py | xpdAcq/xpdView | 52a3837eae5b9ececb6f149fc4e7ca96776a2ba7 | [
"BSD-3-Clause"
] | 17 | 2017-01-17T18:37:28.000Z | 2018-12-04T16:47:37.000Z | xpdview/waterfall.py | xpdAcq/xpdView | 52a3837eae5b9ececb6f149fc4e7ca96776a2ba7 | [
"BSD-3-Clause"
] | 1 | 2017-01-19T19:37:23.000Z | 2017-01-19T19:37:23.000Z | import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider
from cycler import cycler
simonCycle2 = [
"#0B3C5D",
"#B82601",
"#1c6b0a",
"#328CC1",
"#062F4F",
"#D9B310",
"#984B43",
"#76323F",
"#626E60",
"#AB987A",
"#C09F80"... | 30.367021 | 72 | 0.561219 |
abc864b1215c7b766d044d0dbe13ed32ea8afd06 | 1,157 | py | Python | Day01-15/pratice_code/HY_Day_03.py | reic/groupLearning-Python-100-Days | 91746e6ee3acf2dbf0e9d324f6c6ce3cb91ed131 | [
"MIT"
] | 4 | 2020-05-21T06:50:52.000Z | 2020-09-07T05:39:24.000Z | Day01-15/pratice_code/HY_Day_03.py | reic/groupLearning-Python-100-Days | 91746e6ee3acf2dbf0e9d324f6c6ce3cb91ed131 | [
"MIT"
] | 1 | 2020-05-24T07:26:56.000Z | 2020-05-25T00:06:02.000Z | Day01-15/pratice_code/HY_Day_03.py | reic/groupLearning-Python-100-Days | 91746e6ee3acf2dbf0e9d324f6c6ce3cb91ed131 | [
"MIT"
] | 1 | 2020-11-05T13:03:42.000Z | 2020-11-05T13:03:42.000Z | '''
Item : Python 100Dsays
Time : 20200522
分支結構,if 結構
# 縮進層次
# 4個空格
'''
# 練習 1-肩平化結構, 分段函數求值, (較優) -------------------------------------
x = float(input("x = "))
if x > 1 :
y = 3 * x - 5
elif x >= -1:
y = x + 2
else:
y = 5 * x + 3
print( "f (%.2f) = %.2f " % ( x , y ))
# 練習 2 - 嵌套結構 ----------------... | 16.768116 | 67 | 0.370787 |
1573a218fa231af67cc812fd8c68c9ebfc76a11d | 3,563 | py | Python | pymtl3/passes/rtlir/behavioral/test/BehavioralRTLIRL3Pass_test.py | mondO/pymtl3 | 9869dda28c01926cee6da94ebdeac2a210150c62 | [
"BSD-3-Clause"
] | null | null | null | pymtl3/passes/rtlir/behavioral/test/BehavioralRTLIRL3Pass_test.py | mondO/pymtl3 | 9869dda28c01926cee6da94ebdeac2a210150c62 | [
"BSD-3-Clause"
] | null | null | null | pymtl3/passes/rtlir/behavioral/test/BehavioralRTLIRL3Pass_test.py | mondO/pymtl3 | 9869dda28c01926cee6da94ebdeac2a210150c62 | [
"BSD-3-Clause"
] | null | null | null | #=========================================================================
# BehavioralRTLIRL3Pass_test.py
#=========================================================================
# Author : Peitian Pan
# Date : Feb 2, 2019
"""Test the level 3 behavioral RTLIR passes.
The L3 generation, L3 type check, and visualiz... | 37.114583 | 82 | 0.629526 |
7aa5c4d5ed44f0d7149826c36f8dad418bc76007 | 85,451 | py | Python | cryspy/A_functions_base/function_2_space_group.py | eandklahn/cryspy | a664cee1e1ffd5f23e54295a11e479d7d4cda7e5 | [
"MIT"
] | null | null | null | cryspy/A_functions_base/function_2_space_group.py | eandklahn/cryspy | a664cee1e1ffd5f23e54295a11e479d7d4cda7e5 | [
"MIT"
] | null | null | null | cryspy/A_functions_base/function_2_space_group.py | eandklahn/cryspy | a664cee1e1ffd5f23e54295a11e479d7d4cda7e5 | [
"MIT"
] | null | null | null | """
Functions and constants to work with space group.
List of constants:
-------------------
ACCESIBLE_BRAVAIS_TYPE
ACCESIBLE_IT_COORDINATE_SYSTEM_CODE
ACCESIBLE_LAUE_CLASS
ACCESIBLE_CENTRING_TYPE
ACCESIBLE_CRYSTAL_SYSTEM
ACCESIBLE_NAME_HM_SHORT
ACCESIBLE_NAME_SCHOENFLIES
ACCESIBLE_NAME_HALL_SHORT
ACCESIBLE_REFERENCE_... | 51.107057 | 161 | 0.509438 |
7f46e7dc23fddfcaaeab0865926b982ff47f6918 | 25,720 | py | Python | libraries/second_processes.py | MickyHCorbett/MorfLess | 9761197d7767c250cc27262e1ab41adf21c59333 | [
"MIT"
] | null | null | null | libraries/second_processes.py | MickyHCorbett/MorfLess | 9761197d7767c250cc27262e1ab41adf21c59333 | [
"MIT"
] | null | null | null | libraries/second_processes.py | MickyHCorbett/MorfLess | 9761197d7767c250cc27262e1ab41adf21c59333 | [
"MIT"
] | null | null | null | # secondary process functions - e.g. creating lists files
from libraries import constants as ct
from libraries import globals as gb
from libraries import schematics as sch
from libraries import html_elements as he
from libraries import string_processes as sp
from libraries import lists as ls
import json
def pcom_proc... | 41.550889 | 131 | 0.642729 |
010c53eb6e8d1948dcdcbc8a622e5af5598c5dc9 | 3,011 | py | Python | examples/basic_operations/pause_ad.py | wfansh/google-ads-python | f94228abd210b0f7e69eadea6df7b60404a1e676 | [
"Apache-2.0"
] | null | null | null | examples/basic_operations/pause_ad.py | wfansh/google-ads-python | f94228abd210b0f7e69eadea6df7b60404a1e676 | [
"Apache-2.0"
] | null | null | null | examples/basic_operations/pause_ad.py | wfansh/google-ads-python | f94228abd210b0f7e69eadea6df7b60404a1e676 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 35.011628 | 79 | 0.696114 |
92a4cd138513303317f477cf2bd344622d260fcd | 16,471 | py | Python | sdk/python/pulumi_azure_native/network/v20181101/get_virtual_network_gateway_connection.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20181101/get_virtual_network_gateway_connection.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20181101/get_virtual_network_gateway_connection.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 43.459103 | 584 | 0.689697 |
87e616d76cd779507b22c724d0d80c434d8cfb6f | 4,562 | py | Python | var/spack/repos/builtin/packages/bzip2/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/bzip2/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | 1 | 2018-07-06T19:11:46.000Z | 2018-07-06T19:12:28.000Z | var/spack/repos/builtin/packages/bzip2/package.py | xiki-tempula/spack | 9d66c05e93ab8a933fc59915040c0e0c86a4aac4 | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Bzip2(Package):
"""bzip2 is a freely available, patent free high-quality data
compress... | 42.240741 | 171 | 0.581105 |
cf550d38058014d0a73c53d26fd36d030369d8e3 | 688 | py | Python | api/citations/serializers.py | fabmiz/osf.io | 8d86af3f0a6e5388bd5b18383e68e27b65a66247 | [
"Apache-2.0"
] | 1 | 2015-10-02T18:35:53.000Z | 2015-10-02T18:35:53.000Z | api/citations/serializers.py | fabmiz/osf.io | 8d86af3f0a6e5388bd5b18383e68e27b65a66247 | [
"Apache-2.0"
] | 18 | 2020-03-24T15:26:02.000Z | 2022-03-08T21:30:39.000Z | api/citations/serializers.py | fabmiz/osf.io | 8d86af3f0a6e5388bd5b18383e68e27b65a66247 | [
"Apache-2.0"
] | 1 | 2019-07-16T00:14:49.000Z | 2019-07-16T00:14:49.000Z | from rest_framework import serializers as ser
from api.base.serializers import JSONAPISerializer, DateByVersion
class CitationSerializer(JSONAPISerializer):
filterable_fields = frozenset([
'title',
'short_title',
'summary',
'id'
])
id = ser.CharField(source='_id', required... | 27.52 | 98 | 0.694767 |
92694057f51d90e6481e437275a49d182ee09358 | 1,309 | py | Python | platform/mcu/atsamd5x_e5x/atsam_binadder_crc32.py | ruoranluomu/AliOS-Things | d0f3431bcacac5b61645e9beb231a0a53be8078b | [
"Apache-2.0"
] | 4 | 2019-11-22T04:28:29.000Z | 2021-07-06T10:45:10.000Z | platform/mcu/atsamd5x_e5x/atsam_binadder_crc32.py | ruoranluomu/AliOS-Things | d0f3431bcacac5b61645e9beb231a0a53be8078b | [
"Apache-2.0"
] | 1 | 2019-04-02T10:03:10.000Z | 2019-04-02T10:03:10.000Z | platform/mcu/atsamd5x_e5x/atsam_binadder_crc32.py | ruoranluomu/AliOS-Things | d0f3431bcacac5b61645e9beb231a0a53be8078b | [
"Apache-2.0"
] | 6 | 2019-08-30T09:43:03.000Z | 2021-04-05T04:20:41.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import datetime
import sys
import argparse
import logging
import os
import binascii
import struct
#
# MAIN top level application entry point
#
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--debug', action='store_t... | 24.698113 | 86 | 0.628724 |
2a7b76d594e57a7f0bdbc11a71c75c921af67bde | 12,435 | py | Python | nipype/interfaces/mrtrix/tracking.py | sebastientourbier/nipype_lts5 | 3b9718d154443574cc6a5d0bbd76ccf7964e6a45 | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/mrtrix/tracking.py | sebastientourbier/nipype_lts5 | 3b9718d154443574cc6a5d0bbd76ccf7964e6a45 | [
"BSD-3-Clause"
] | null | null | null | nipype/interfaces/mrtrix/tracking.py | sebastientourbier/nipype_lts5 | 3b9718d154443574cc6a5d0bbd76ccf7964e6a45 | [
"BSD-3-Clause"
] | 1 | 2020-02-19T13:47:05.000Z | 2020-02-19T13:47:05.000Z | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Change directory to provide relative paths for doctests
>>> import os
>>> filepath = os.path.dirname( os.path.realpath( __file__ ) )
>>> datadir = os.path.realpath(os.path.join(filepath,... | 52.468354 | 230 | 0.690149 |
5ced2b6ce34a01cbc4cbbd77236cad99a9527e5d | 8,032 | py | Python | sepa_sctinst/sct_inst_interbank.py | lquastana/sepa-sctinst | 066458b8a58712a564520829b0f27caf1397f4ea | [
"Apache-2.0"
] | 2 | 2021-08-22T03:20:13.000Z | 2022-03-24T00:07:20.000Z | sepa_sctinst/sct_inst_interbank.py | lquastana/sepa-sctinst | 066458b8a58712a564520829b0f27caf1397f4ea | [
"Apache-2.0"
] | 13 | 2021-08-22T03:03:08.000Z | 2021-09-01T21:29:16.000Z | sepa_sctinst/sct_inst_interbank.py | lquastana/sepa-sctinst | 066458b8a58712a564520829b0f27caf1397f4ea | [
"Apache-2.0"
] | null | null | null | from sepa_sctinst.participant import Participant
import xml.etree.ElementTree as ET
from datetime import datetime,date
import random
from faker import Faker
SERVICE_LEVEL_CODE = 'SEPA'
LOCAL_INSTRUMENT = 'INST'
CHARGE_BEARER='SLEV'
CURRENCY='EUR'
class GroupHeader:
"""A class to represent the group header in inte... | 39.762376 | 158 | 0.661604 |
abd70c06800f8774a0c530cf34c9929fb3e09dd9 | 1,348 | py | Python | wxAnimation/decoders/flif_animation_decoder/filebuf.py | kdschlosser/wxAnimation | ad472719a77a081da5e51280d469cfd5d5bfcd3c | [
"MIT"
] | 2 | 2020-03-23T11:29:56.000Z | 2021-11-24T22:10:07.000Z | wxAnimation/decoders/flif_animation_decoder/filebuf.py | kdschlosser/wxAnimation | ad472719a77a081da5e51280d469cfd5d5bfcd3c | [
"MIT"
] | null | null | null | wxAnimation/decoders/flif_animation_decoder/filebuf.py | kdschlosser/wxAnimation | ad472719a77a081da5e51280d469cfd5d5bfcd3c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Helper for getting buffers from file objects
from __future__ import unicode_literals, division
import mmap
class FileBuffer(object):
def __init__(self, fileobj):
self.file = fileobj
try:
self.fileno = self.file.fileno()
except OSError:
se... | 28.083333 | 91 | 0.551187 |
9544e1dfc575953cbbbbe83a3df8ac301df21467 | 1,381 | py | Python | src/OCR/GeneratedImages/DataModule.py | tsteffek/LicensePlateReconstructor | 4930a080fbdf6e7d726e5282b2d75650566fd5d4 | [
"MIT"
] | 2 | 2020-12-21T02:02:13.000Z | 2021-11-09T06:25:36.000Z | src/OCR/GeneratedImages/DataModule.py | tsteffek/LicensePlateReconstructor | 4930a080fbdf6e7d726e5282b2d75650566fd5d4 | [
"MIT"
] | 1 | 2021-11-09T06:25:36.000Z | 2021-11-18T08:35:35.000Z | src/OCR/GeneratedImages/DataModule.py | tsteffek/LicensePlateReconstructor | 4930a080fbdf6e7d726e5282b2d75650566fd5d4 | [
"MIT"
] | null | null | null | import os
from typing import Tuple, Union
import torch
from src.OCR.GeneratedImages.model.Image import TypedImageWithText
from src.base import IO
from src.base.data import ImagesDataModule, ImageDataset
class GeneratedImagesDataModule(ImagesDataModule):
def __init__(
self,
path: str,
... | 33.682927 | 111 | 0.623461 |
19f1ac84e443ad3bbbb9d28e90c84c39a3b73ed1 | 320 | py | Python | App/ocr_dispatcher/apps.py | JulesVautier/rabbitmq-ocr | 5e5e30145fc4420be690ce1242ddda54d74ee1f7 | [
"MIT"
] | null | null | null | App/ocr_dispatcher/apps.py | JulesVautier/rabbitmq-ocr | 5e5e30145fc4420be690ce1242ddda54d74ee1f7 | [
"MIT"
] | null | null | null | App/ocr_dispatcher/apps.py | JulesVautier/rabbitmq-ocr | 5e5e30145fc4420be690ce1242ddda54d74ee1f7 | [
"MIT"
] | null | null | null | import sys
import django
from django.apps import AppConfig
class OcrDispatcherConfig(AppConfig):
name = 'ocr_dispatcher'
def ready(self):
if 'runserver' not in sys.argv:
return True
from .rpc_listener import ListenerRpc
listener = ListenerRpc()
listener.start()
| 17.777778 | 45 | 0.659375 |
8f572b34a79d7ecf040da9b011dc10acab805e4a | 1,574 | py | Python | dojo/management/commands/fix_0120.py | mtcolman/django-DefectDojo | 76175aca446e077884bdb5e1d8e2a671a0840775 | [
"BSD-3-Clause"
] | 1,772 | 2018-01-22T23:32:15.000Z | 2022-03-31T14:49:33.000Z | dojo/management/commands/fix_0120.py | mtcolman/django-DefectDojo | 76175aca446e077884bdb5e1d8e2a671a0840775 | [
"BSD-3-Clause"
] | 3,461 | 2018-01-20T19:12:28.000Z | 2022-03-31T17:14:39.000Z | dojo/management/commands/fix_0120.py | mtcolman/django-DefectDojo | 76175aca446e077884bdb5e1d8e2a671a0840775 | [
"BSD-3-Clause"
] | 1,173 | 2018-01-23T07:10:23.000Z | 2022-03-31T14:40:43.000Z | from django.core.management.base import BaseCommand
from dojo.models import Test
from django.db.migrations.executor import MigrationExecutor
from django.db import connections, DEFAULT_DB_ALIAS
from django.db.utils import OperationalError
import logging
logger = logging.getLogger(__name__)
class Command(BaseCommand)... | 42.540541 | 156 | 0.658831 |
78eaa4120a5f09a04e02d685c5e740150a8353f5 | 36,909 | py | Python | Collections-a-installer/community-general-2.4.0/plugins/modules/vdo.py | d-amien-b/simple-getwordpress | da90d515a0aa837b633d50db4d91d22b031c04a2 | [
"MIT"
] | 22 | 2021-07-16T08:11:22.000Z | 2022-03-31T07:15:34.000Z | Collections-a-installer/community-general-2.4.0/plugins/modules/vdo.py | d-amien-b/simple-getwordpress | da90d515a0aa837b633d50db4d91d22b031c04a2 | [
"MIT"
] | 1 | 2022-03-12T02:25:26.000Z | 2022-03-12T02:25:26.000Z | Collections-a-installer/community-general-2.4.0/plugins/modules/vdo.py | d-amien-b/simple-getwordpress | da90d515a0aa837b633d50db4d91d22b031c04a2 | [
"MIT"
] | 39 | 2021-07-05T02:31:42.000Z | 2022-03-31T02:46:03.000Z | #!/usr/bin/python
# Copyright: (c) 2018, Red Hat, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = r'''
---
author:
- Bryan Gurney (@bgurney-rh)
module: vdo
sho... | 42.570934 | 92 | 0.552575 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.