hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ad8d447b964ebc89e8a57c459e754b4bbbeeb7e0 | 7,118 | py | Python | obfsproxy/transports/scramblesuit/message.py | Samdney/obfsproxy | 2bf9d096bb45a4e6c69f1cbdc3d2565f54a44efc | [
"BSD-3-Clause"
] | 101 | 2015-01-24T07:37:03.000Z | 2022-01-22T15:38:44.000Z | obfsproxy/transports/scramblesuit/message.py | david415/obfsproxy | ea0e1b2b62be9113155f25f53baf5fce4392c430 | [
"BSD-3-Clause"
] | 1 | 2015-03-29T15:16:04.000Z | 2015-04-09T03:56:24.000Z | obfsproxy/transports/scramblesuit/message.py | david415/obfsproxy | ea0e1b2b62be9113155f25f53baf5fce4392c430 | [
"BSD-3-Clause"
] | 29 | 2015-05-11T09:45:43.000Z | 2020-02-22T17:50:27.000Z | """
This module provides code to handle ScrambleSuit protocol messages.
The exported classes and functions provide interfaces to handle protocol
messages, check message headers for validity and create protocol messages out
of application data.
"""
import obfsproxy.common.log as logging
import obfsproxy.common.seriali... | 31.356828 | 79 | 0.622647 |
7fd138b63e60cf1167f2e9ac1477ffbb3b9ad844 | 1,837 | py | Python | leetcode/278.first_bad_version/278.FirstBadVersion_JohnJim0816.py | henrytien/AlgorithmSolutions | 62339269f4fa698ddd2e73458caef875af05af8f | [
"MIT"
] | 15 | 2020-06-27T03:28:39.000Z | 2021-08-13T10:42:24.000Z | leetcode/278.first_bad_version/278.FirstBadVersion_JohnJim0816.py | henrytien/AlgorithmSolutions | 62339269f4fa698ddd2e73458caef875af05af8f | [
"MIT"
] | 40 | 2020-06-27T03:29:53.000Z | 2020-11-05T12:29:49.000Z | leetcode/278.first_bad_version/278.FirstBadVersion_JohnJim0816.py | henrytien/AlgorithmSolutions | 62339269f4fa698ddd2e73458caef875af05af8f | [
"MIT"
] | 22 | 2020-07-16T03:23:43.000Z | 2022-02-19T16:00:55.000Z | #!/usr/bin/env python
# coding=utf-8
'''
@Author: John
@Email: johnjim0816@gmail.com
@Date: 2020-07-21 09:46:44
@LastEditor: John
@LastEditTime: 2020-07-21 09:47:20
@Discription:
@Environment: python 3.7.7
'''
# Source : https://leetcode.com/problems/first-bad-version/
# Author : JohnJim0816
# Date : 2020-07-21
###... | 31.135593 | 102 | 0.577028 |
94401deab3733d20ff47eb24fa7cc99808291697 | 2,109 | py | Python | demo_double_cross_validation_for_pls.py | hkaneko1985/dcek | 13d9228b2dc2fd87c2e08a01721e1b1b220f2e19 | [
"MIT"
] | 25 | 2019-08-23T12:39:14.000Z | 2022-03-30T08:58:15.000Z | demo_double_cross_validation_for_pls.py | hkaneko1985/dcek | 13d9228b2dc2fd87c2e08a01721e1b1b220f2e19 | [
"MIT"
] | 2 | 2022-01-06T11:21:21.000Z | 2022-01-18T22:11:12.000Z | demo_double_cross_validation_for_pls.py | hkaneko1985/dcek | 13d9228b2dc2fd87c2e08a01721e1b1b220f2e19 | [
"MIT"
] | 16 | 2019-12-12T08:20:48.000Z | 2022-01-26T00:34:31.000Z | # -*- coding: utf-8 -*- %reset -f
"""
@author: Hiromasa Kaneko
"""
# Demonstration of Double Cross-Validation (DCV) for PLS
import matplotlib.figure as figure
import matplotlib.pyplot as plt
import numpy as np
from dcekit.validation import double_cross_validation
from sklearn import datasets
# import pand... | 42.18 | 111 | 0.683736 |
69490fd692a8298e0680ea33c78730521b0e84c3 | 19,173 | py | Python | bokeh/tests/test_io.py | SiggyF/bokeh | 52a2ce993b0f1102fd9e136f66036f52e91cdcc3 | [
"BSD-3-Clause"
] | null | null | null | bokeh/tests/test_io.py | SiggyF/bokeh | 52a2ce993b0f1102fd9e136f66036f52e91cdcc3 | [
"BSD-3-Clause"
] | null | null | null | bokeh/tests/test_io.py | SiggyF/bokeh | 52a2ce993b0f1102fd9e136f66036f52e91cdcc3 | [
"BSD-3-Clause"
] | null | null | null | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2015, Continuum Analytics, Inc. All rights reserved.
#
# Powered by the Bokeh Development Team.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#----------------------------------------... | 41.954048 | 118 | 0.628592 |
4a46ce0cca70ed71db7a37baa6688e585475545d | 16,117 | py | Python | tensorflow/python/keras/layers/preprocessing/table_utils_test.py | ashutom/tensorflow-upstream | c16069c19de9e286dd664abb78d0ea421e9f32d4 | [
"Apache-2.0"
] | 190,993 | 2015-11-09T13:17:30.000Z | 2022-03-31T23:05:27.000Z | tensorflow/python/keras/layers/preprocessing/table_utils_test.py | CaptainGizzy21/tensorflow | 3457a2b122e50b4d44ceaaed5a663d635e5c22df | [
"Apache-2.0"
] | 48,461 | 2015-11-09T14:21:11.000Z | 2022-03-31T23:17:33.000Z | tensorflow/python/keras/layers/preprocessing/table_utils_test.py | CaptainGizzy21/tensorflow | 3457a2b122e50b4d44ceaaed5a663d635e5c22df | [
"Apache-2.0"
] | 104,981 | 2015-11-09T13:40:17.000Z | 2022-03-31T19:51:54.000Z | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.629545 | 81 | 0.664454 |
c255f64433901e09b9530d53ae4a8499c4a5a55f | 3,690 | py | Python | data/p3BR/R2/benchmark/startCirq271.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R2/benchmark/startCirq271.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R2/benchmark/startCirq271.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 5/15/20 4:49 PM
# @File : grover.py
# qubit number=3
# total number=54
import cirq
import cirq.google as cg
from typing import Optional
import sys
from math import log2
import numpy as np
#thatsNoCode
from cirq.contrib.svg import SVGCircuit
# Symbols for... | 38.4375 | 77 | 0.683198 |
8f2d13ad2be126171bf810ee327b5409508ffc27 | 393 | py | Python | ProgrammingProject4/Projectsetup/volumes/task3code.py | samuelmmorse/MGSsecurity | 425621afca366244cdcdc5b991538a618d45fd12 | [
"Apache-2.0"
] | null | null | null | ProgrammingProject4/Projectsetup/volumes/task3code.py | samuelmmorse/MGSsecurity | 425621afca366244cdcdc5b991538a618d45fd12 | [
"Apache-2.0"
] | null | null | null | ProgrammingProject4/Projectsetup/volumes/task3code.py | samuelmmorse/MGSsecurity | 425621afca366244cdcdc5b991538a618d45fd12 | [
"Apache-2.0"
] | null | null | null | from scapy.all import *
a = IP()
dest = '8.8.8.8'
a.dst = dest
b = ICMP()
a.ttl = 1
while (a.ttl < 100):
reply = sr1(a/b, verbose=0, timeout=2)
if (reply == None):
print(str(a.ttl) + "\t* * * *")
a.ttl += 1
continue
print(str(a.ttl) + "\t" + reply.src)
if (reply.src == dest):
break
a.ttl +=1
#pa... | 13.551724 | 60 | 0.544529 |
ab10749ca20cb742fb91a11cac71af28bd52e2c1 | 3,823 | py | Python | whatpulse/__init__.py | sl4vkek/python-whatpulse | bf8abad0a9d0cfdbb96c3cdfc58282f98959180f | [
"WTFPL"
] | null | null | null | whatpulse/__init__.py | sl4vkek/python-whatpulse | bf8abad0a9d0cfdbb96c3cdfc58282f98959180f | [
"WTFPL"
] | null | null | null | whatpulse/__init__.py | sl4vkek/python-whatpulse | bf8abad0a9d0cfdbb96c3cdfc58282f98959180f | [
"WTFPL"
] | 1 | 2020-03-18T21:06:31.000Z | 2020-03-18T21:06:31.000Z | import requests
import json
from urllib.parse import urljoin
class InvalidIPError(Exception):
pass
class RealTime:
def __init__(self, clicks_pressed, keys_typed, download_speed, upload_speed):
self.clicks_typed = float(clicks_pressed)
self.keys_typed = float(keys_typed)
... | 32.398305 | 93 | 0.597698 |
f52b0506c75b802e0a080bdb9ae10715baad9e04 | 18,515 | py | Python | CustomOp/MetaOptimizer.py | ozzzp/MLHF | 119d8fbedb8661f0474389c6a048decb2505cf45 | [
"Apache-2.0"
] | 3 | 2018-08-11T02:51:51.000Z | 2019-01-28T14:03:59.000Z | CustomOp/MetaOptimizer.py | ozzzp/MLHF | 119d8fbedb8661f0474389c6a048decb2505cf45 | [
"Apache-2.0"
] | null | null | null | CustomOp/MetaOptimizer.py | ozzzp/MLHF | 119d8fbedb8661f0474389c6a048decb2505cf45 | [
"Apache-2.0"
] | null | null | null | import itertools
# import numpy as np
import os
import tensorflow as tf
import tensorflow.contrib as tfcb
from tensorflow.python.framework import function
from tensorflow.python.training.optimizer import _var_key
from tensorflow.python.training.slot_creator import create_slot_with_initializer
from .gradients_impl imp... | 44.614458 | 179 | 0.569052 |
f9aabc0db2d79dcd8f61805e5399ec1c253439e2 | 556 | py | Python | cpsplines/utils/timer.py | ManuelNavarroGarcia/cpsplines | 544e8ccf7e438a192dea6c4a4e685d9346f57f9a | [
"MIT"
] | null | null | null | cpsplines/utils/timer.py | ManuelNavarroGarcia/cpsplines | 544e8ccf7e438a192dea6c4a4e685d9346f57f9a | [
"MIT"
] | 1 | 2022-02-12T17:33:08.000Z | 2022-02-12T17:33:08.000Z | cpsplines/utils/timer.py | ManuelNavarroGarcia/cpsplines | 544e8ccf7e438a192dea6c4a4e685d9346f57f9a | [
"MIT"
] | null | null | null | from contextlib import contextmanager
from timeit import default_timer
from typing import Optional
@contextmanager
def timer(tag: Optional[str] = None) -> None:
"""
Computes the elapsed time that a task last.
Parameters
----------
tag : str, optional
The name of the task. By default, Non... | 22.24 | 83 | 0.609712 |
9c07aa3cfaf87ecf569cebf670dc523efee96fdd | 3,527 | py | Python | paddlex/cv/datasets/easydata_cls.py | mingren8888/PaddleX | d44249da26898b4b77491f8a5e8a86d680e52fa4 | [
"Apache-2.0"
] | null | null | null | paddlex/cv/datasets/easydata_cls.py | mingren8888/PaddleX | d44249da26898b4b77491f8a5e8a86d680e52fa4 | [
"Apache-2.0"
] | null | null | null | paddlex/cv/datasets/easydata_cls.py | mingren8888/PaddleX | d44249da26898b4b77491f8a5e8a86d680e52fa4 | [
"Apache-2.0"
] | null | null | null | # copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
# 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... | 39.629213 | 77 | 0.617806 |
f4663d022e5c891a06c7f5ad97e3101ef049e76d | 1,010 | py | Python | common/ops/merge_ops.py | vahidk/TensorflowFramework | a9377d0dd8f5ac93e810876fbe8987990e3c728f | [
"BSD-3-Clause"
] | 129 | 2017-08-19T07:18:55.000Z | 2020-07-16T03:05:31.000Z | common/ops/merge_ops.py | vahidk/TensorflowFramework | a9377d0dd8f5ac93e810876fbe8987990e3c728f | [
"BSD-3-Clause"
] | 5 | 2017-09-13T08:55:31.000Z | 2019-07-12T06:52:07.000Z | common/ops/merge_ops.py | vahidk/TensorflowFramework | a9377d0dd8f5ac93e810876fbe8987990e3c728f | [
"BSD-3-Clause"
] | 46 | 2017-08-21T21:18:50.000Z | 2022-03-12T05:57:02.000Z | """Merge ops."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
from common.ops import regularizer_ops
def merge(tensors, units,
activation=tf.nn.relu,
name=None,
weight_decay=0.0,
weigh... | 25.897436 | 64 | 0.647525 |
3dc86378efd15da478c27d56780e6e3b3e2b64c4 | 7,647 | py | Python | sandbox/rocky/tf/policies/categorical_gru_policy.py | RussellM2020/maml_gps | 631560dfd4e23dc2da9bfbbd2e3c5252aa9775c5 | [
"MIT"
] | 541 | 2017-07-19T00:49:13.000Z | 2022-03-28T21:14:23.000Z | sandbox/rocky/tf/policies/categorical_gru_policy.py | RussellM2020/maml_gps | 631560dfd4e23dc2da9bfbbd2e3c5252aa9775c5 | [
"MIT"
] | 13 | 2018-02-28T02:29:58.000Z | 2021-03-21T13:49:49.000Z | sandbox/rocky/tf/policies/categorical_gru_policy.py | RussellM2020/maml_gps | 631560dfd4e23dc2da9bfbbd2e3c5252aa9775c5 | [
"MIT"
] | 168 | 2017-07-19T12:21:01.000Z | 2022-02-22T00:46:40.000Z | import numpy as np
import sandbox.rocky.tf.core.layers as L
import tensorflow as tf
from sandbox.rocky.tf.core.layers_powered import LayersPowered
from sandbox.rocky.tf.core.network import GRUNetwork, MLP
from sandbox.rocky.tf.distributions.recurrent_categorical import RecurrentCategorical
from sandbox.rocky.tf.misc im... | 37.302439 | 105 | 0.598928 |
7b8559c815140b9b7b55c4d4400eac932a3e981e | 80 | py | Python | thesis_analysis/thesis_analysis.py | egpbos/thesis_analysis | 01d0dfed0d69941526edc0a20aeaa4cd85fb81c4 | [
"MIT"
] | null | null | null | thesis_analysis/thesis_analysis.py | egpbos/thesis_analysis | 01d0dfed0d69941526edc0a20aeaa4cd85fb81c4 | [
"MIT"
] | null | null | null | thesis_analysis/thesis_analysis.py | egpbos/thesis_analysis | 01d0dfed0d69941526edc0a20aeaa4cd85fb81c4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# FIXME: put actual code here
def example():
pass
| 11.428571 | 29 | 0.575 |
ce4dee45ddd6436c261a9ebe23c8d317c995875d | 1,590 | py | Python | examples/event_generation/parton_shower_gen.py | samcaf/JetMonteCarlo | 71f50f3bb53a4f68ed927eaeaed5ee258da0dd34 | [
"MIT"
] | null | null | null | examples/event_generation/parton_shower_gen.py | samcaf/JetMonteCarlo | 71f50f3bb53a4f68ed927eaeaed5ee258da0dd34 | [
"MIT"
] | null | null | null | examples/event_generation/parton_shower_gen.py | samcaf/JetMonteCarlo | 71f50f3bb53a4f68ed927eaeaed5ee258da0dd34 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
# Loading parton shower class and parameters:
from jetmontecarlo.montecarlo.partonshower import *
from examples.params import *
# Run with 1) false fixed coupling, LL observable, then 2) false fixed coupling, MU_NP, MLL
# then 3) false fixed coupling, MU_NP, MLL for each beta
#... | 36.976744 | 91 | 0.576101 |
94490c146ae16b22b405b9bf9cf79b4337614551 | 537,332 | py | Python | DearPyGui/dearpygui/dearpygui.py | Treygec/DearPyGui | 3421291b0ac93f6e4f2a936501d7140feb8f6b2f | [
"MIT"
] | null | null | null | DearPyGui/dearpygui/dearpygui.py | Treygec/DearPyGui | 3421291b0ac93f6e4f2a936501d7140feb8f6b2f | [
"MIT"
] | null | null | null | DearPyGui/dearpygui/dearpygui.py | Treygec/DearPyGui | 3421291b0ac93f6e4f2a936501d7140feb8f6b2f | [
"MIT"
] | null | null | null |
##########################################################
# Dear PyGui User Interface
# ~ Version: master
#
# Notes:
# * This file is automatically generated.
#
# Resources:
# * FAQ: https://github.com/hoffstadt/DearPyGui/discussions/categories/frequently-asked-questions-faq
# * Homepage: ... | 56.135813 | 1,319 | 0.737808 |
bca34c403a4539cc61e0e270d4d3befc8c32dddf | 29,490 | py | Python | Lib/site-packages/tensorflow_core/contrib/boosted_trees/proto/learner_pb2.py | shivammaniharsahu/django_api | 6ffb3d9f70f30f5fd3ae06ec00a6dd7c7783a797 | [
"bzip2-1.0.6"
] | 2 | 2019-08-04T20:28:14.000Z | 2019-10-27T23:26:42.000Z | Lib/site-packages/tensorflow_core/contrib/boosted_trees/proto/learner_pb2.py | shivammaniharsahu/django_api | 6ffb3d9f70f30f5fd3ae06ec00a6dd7c7783a797 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/tensorflow_core/contrib/boosted_trees/proto/learner_pb2.py | shivammaniharsahu/django_api | 6ffb3d9f70f30f5fd3ae06ec00a6dd7c7783a797 | [
"bzip2-1.0.6"
] | 1 | 2020-11-04T03:16:29.000Z | 2020-11-04T03:16:29.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: tensorflow/contrib/boosted_trees/proto/learner.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 messa... | 46.222571 | 3,097 | 0.782469 |
7511af5c0a722274b460c3760a807a009cc8b447 | 439 | py | Python | tests/dev_controller.py | bbockelm/htcondor_jobview | ee8e7d9127f0218f99ce61532bc8cdfbf9708f24 | [
"Apache-2.0"
] | 4 | 2016-11-03T15:57:13.000Z | 2021-03-08T16:56:08.000Z | tests/dev_controller.py | bbockelm/htcondor_jobview | ee8e7d9127f0218f99ce61532bc8cdfbf9708f24 | [
"Apache-2.0"
] | null | null | null | tests/dev_controller.py | bbockelm/htcondor_jobview | ee8e7d9127f0218f99ce61532bc8cdfbf9708f24 | [
"Apache-2.0"
] | 1 | 2018-07-17T14:39:49.000Z | 2018-07-17T14:39:49.000Z | #!/usr/bin/python
import os
import sys
if os.path.exists("src"):
sys.path.append("src")
from wsgiref.simple_server import make_server
from htcondor_jobview.jobview_app import application
httpd = make_server('', 8000, application)
httpd.base_environ['jobview.config'] = 'tests/unl.conf'
httpd.base_environ['jobv... | 19.086957 | 55 | 0.753986 |
64a5585a6c0343f78dadd1862483d6dfca8ca1be | 451 | py | Python | .history/src/Simulador_20200707131332.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | .history/src/Simulador_20200707131332.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | .history/src/Simulador_20200707131332.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from Matriz_esferica import Matriz_esferica
from Individuo import Individuo
class Simulador():
def __init__(self, tamanho_matriz,):
self.num_iteracoes = 0
self.matriz_individuos = np.asmatrix(tamanho_matriz)
self.matriz_esferica = Matriz_esferica(taman... | 22.55 | 62 | 0.727273 |
9d1cf0bb83e8a9396d0943dd92b39f295c1de946 | 106 | py | Python | cryptodock_framework/portfolio_manager/__init__.py | the-launch-tech/cryptodock-framework | de5a8ea8d4bcc427ff122cba8684abfd6a483152 | [
"MIT"
] | null | null | null | cryptodock_framework/portfolio_manager/__init__.py | the-launch-tech/cryptodock-framework | de5a8ea8d4bcc427ff122cba8684abfd6a483152 | [
"MIT"
] | null | null | null | cryptodock_framework/portfolio_manager/__init__.py | the-launch-tech/cryptodock-framework | de5a8ea8d4bcc427ff122cba8684abfd6a483152 | [
"MIT"
] | null | null | null | __all__ = [
'CryptoDockPortfolioManager'
]
from .portfolio_manager import CryptoDockPortfolioManager
| 17.666667 | 57 | 0.811321 |
1ef19966c005fb09e72b0d2b045c06221c23ba25 | 1,172 | py | Python | catalog/export_xml.py | pedroalvesfilho/flask_vehicle | 702854eb14ef0e4d4c1231687a08a3b123b5b7c8 | [
"MIT"
] | null | null | null | catalog/export_xml.py | pedroalvesfilho/flask_vehicle | 702854eb14ef0e4d4c1231687a08a3b123b5b7c8 | [
"MIT"
] | 1 | 2021-04-30T20:46:37.000Z | 2021-04-30T20:46:37.000Z | catalog/export_xml.py | pedroalvesfilho/flask_vehicle | 702854eb14ef0e4d4c1231687a08a3b123b5b7c8 | [
"MIT"
] | null | null | null | """Provides an XML API endpoint."""
from xml.etree.ElementTree import Element, SubElement, tostring
from xml.dom.minidom import parseString
from catalog import app
from catalog.database_setup import Category, Item
from catalog.connect_to_database import connect_to_database
@app.route('/catalog.xml/')
def items_xml():... | 34.470588 | 75 | 0.642491 |
3a0ba2b9aa4db59d3bbb2e1a7d979f1483fa2da9 | 640 | py | Python | src/assemblyline/runtests.py | eventbrite/django-assemblyline | 3f4e0524b54ea5d840f6989abc89613abcded575 | [
"MIT"
] | 1 | 2016-05-23T15:11:58.000Z | 2016-05-23T15:11:58.000Z | src/assemblyline/runtests.py | mscheibe/django-assemblyline | 170db91f43ac915d4c671e2fc342a60df5cc3b35 | [
"MIT"
] | null | null | null | src/assemblyline/runtests.py | mscheibe/django-assemblyline | 170db91f43ac915d4c671e2fc342a60df5cc3b35 | [
"MIT"
] | 2 | 2016-08-14T07:15:43.000Z | 2021-09-08T11:57:38.000Z | #This file mainly exists to allow python setup.py test to work.
import os
import sys
def runtests():
# set the environment up so Django can find some settings
os.environ['DJANGO_SETTINGS_MODULE'] = 'assemblyline.testsettings'
# ...and now that it can find settings, import them
from django.conf import... | 29.090909 | 70 | 0.734375 |
44739aef486e738d006d0bc08016481c7ca6d68d | 5,766 | py | Python | city_scrapers/spiders/chi_police.py | zarifmahmud/city-scrapers | 52d6056001c8ea5e100dd686c52947836d63aff9 | [
"MIT"
] | null | null | null | city_scrapers/spiders/chi_police.py | zarifmahmud/city-scrapers | 52d6056001c8ea5e100dd686c52947836d63aff9 | [
"MIT"
] | null | null | null | city_scrapers/spiders/chi_police.py | zarifmahmud/city-scrapers | 52d6056001c8ea5e100dd686c52947836d63aff9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
All spiders should yield data shaped according to the Open Civic Data
specification (http://docs.opencivicdata.org/en/latest/data/event.html).
"""
import json
import re
from datetime import datetime
from city_scrapers.constants import COMMITTEE, POLICE_BEAT
from city_scrapers.spider import ... | 35.158537 | 196 | 0.560527 |
a0a75b391f0a5e49f7274473a3406b830285ab86 | 1,291 | py | Python | app/core/tests/test_models.py | graovic/recipe-app-api | e883c64c144b67689238d2506552cc16703bb6a4 | [
"Apache-2.0"
] | null | null | null | app/core/tests/test_models.py | graovic/recipe-app-api | e883c64c144b67689238d2506552cc16703bb6a4 | [
"Apache-2.0"
] | null | null | null | app/core/tests/test_models.py | graovic/recipe-app-api | e883c64c144b67689238d2506552cc16703bb6a4 | [
"Apache-2.0"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
class ModelTest(TestCase):
def test_create_user_with_email_successful(self):
"""Test creating a new user with an email is successful"""
email = 'goran.raovic@gmail.com'
password = 'testpass123'
user = ... | 37.970588 | 70 | 0.658404 |
b255bb49ee4d57e9ed835917f0ec5670c9478348 | 5,400 | py | Python | apps/export/views.py | rapidsms/rapidsms-legacy | 43c2ecd41fd1541a2538326edee3d9e816d84529 | [
"BSD-3-Clause"
] | null | null | null | apps/export/views.py | rapidsms/rapidsms-legacy | 43c2ecd41fd1541a2538326edee3d9e816d84529 | [
"BSD-3-Clause"
] | null | null | null | apps/export/views.py | rapidsms/rapidsms-legacy | 43c2ecd41fd1541a2538326edee3d9e816d84529 | [
"BSD-3-Clause"
] | 1 | 2019-11-02T19:35:54.000Z | 2019-11-02T19:35:54.000Z | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
import os, re
import datetime
from subprocess import *
from django import http
from django.db import models
from django.utils.text import capfirst
from django.core.exceptions import FieldError
from rapidsms.webui import settings
def database(req):
"""Returns a... | 30.167598 | 131 | 0.660926 |
31101ab899de0b52bd3f69c710a04286dd78adea | 9,331 | py | Python | pythreejs/pythreejs.py | elPistolero/pythreejs | f3c5000a6fcf06af775664d55ad6ef16322e8eca | [
"BSD-3-Clause"
] | null | null | null | pythreejs/pythreejs.py | elPistolero/pythreejs | f3c5000a6fcf06af775664d55ad6ef16322e8eca | [
"BSD-3-Clause"
] | null | null | null | pythreejs/pythreejs.py | elPistolero/pythreejs | f3c5000a6fcf06af775664d55ad6ef16322e8eca | [
"BSD-3-Clause"
] | 1 | 2019-11-04T09:00:17.000Z | 2019-11-04T09:00:17.000Z | r"""
Python widgets for three.js plotting
In this wrapping of three.js, we try to stay close to the three.js API. Often,
the three.js documentation at http://threejs.org/docs/ helps in understanding
these classes and the various constants.
This is meant to be a low-level wrapper around three.js. We hope that others
w... | 36.449219 | 99 | 0.627907 |
c4ace9bf77fb4975bd3b2e93b2b9e5271d0c6f8b | 13,949 | py | Python | sdk/python/pulumi_azure_native/network/v20210201/ddos_protection_plan.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20210201/ddos_protection_plan.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/network/v20210201/ddos_protection_plan.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"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... | 54.701961 | 3,782 | 0.693885 |
36c94e8d7bc09fa4103b898b60ea271734440068 | 6,106 | py | Python | telemetry/telemetry/internal/platform/fuchsia_device.py | Martijnve23/catapult | 5c63b19d221af6a12889e8727acc85d93892cab7 | [
"BSD-3-Clause"
] | 1 | 2021-07-04T03:26:43.000Z | 2021-07-04T03:26:43.000Z | telemetry/telemetry/internal/platform/fuchsia_device.py | Martijnve23/catapult | 5c63b19d221af6a12889e8727acc85d93892cab7 | [
"BSD-3-Clause"
] | null | null | null | telemetry/telemetry/internal/platform/fuchsia_device.py | Martijnve23/catapult | 5c63b19d221af6a12889e8727acc85d93892cab7 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2019 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.
"""A Fuchsia device instance"""
from __future__ import absolute_import
import logging
import os
import platform
import subprocess
import tarfile
from telem... | 34.303371 | 76 | 0.675729 |
00dee54650063b5522a3100f624d9a125ce7a01b | 388 | py | Python | app/wsgi.py | StevenMedina/MovieAPI | 805e79d396e197383bce6095febf0252231a1018 | [
"MIT"
] | null | null | null | app/wsgi.py | StevenMedina/MovieAPI | 805e79d396e197383bce6095febf0252231a1018 | [
"MIT"
] | null | null | null | app/wsgi.py | StevenMedina/MovieAPI | 805e79d396e197383bce6095febf0252231a1018 | [
"MIT"
] | null | null | null | """
WSGI config for omnibank project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETT... | 22.823529 | 78 | 0.783505 |
309865549b0680df44e3d283fcaa28042caa02ec | 1,926 | py | Python | src/Pybind11Wraps/Boundary/AxisBoundaryRZ.py | jmikeowen/Spheral | 3e1082a7aefd6b328bd3ae24ca1a477108cfc3c4 | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | 22 | 2018-07-31T21:38:22.000Z | 2020-06-29T08:58:33.000Z | src/Pybind11Wraps/Boundary/AxisBoundaryRZ.py | jmikeowen/Spheral | 3e1082a7aefd6b328bd3ae24ca1a477108cfc3c4 | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | 41 | 2020-09-28T23:14:27.000Z | 2022-03-28T17:01:33.000Z | src/Pybind11Wraps/Boundary/AxisBoundaryRZ.py | jmikeowen/Spheral | 3e1082a7aefd6b328bd3ae24ca1a477108cfc3c4 | [
"BSD-Source-Code",
"BSD-3-Clause-LBNL",
"FSFAP"
] | 7 | 2019-12-01T07:00:06.000Z | 2020-09-15T21:12:39.000Z | #-------------------------------------------------------------------------------
# AxisBoundaryRZ
#-------------------------------------------------------------------------------
from PYB11Generator import *
from Boundary import *
from BoundaryAbstractMethods import *
@PYB11template()
@PYB11template_dict({"Dimension" ... | 36.339623 | 103 | 0.492731 |
d94e087e5a91ffc3b890eaf740fc60b69c448b43 | 560 | py | Python | jacquard/storage/tests/test_file.py | peteowlett/jacquard | 772fd633e521501688e0933482cba45f48c23ef9 | [
"MIT"
] | null | null | null | jacquard/storage/tests/test_file.py | peteowlett/jacquard | 772fd633e521501688e0933482cba45f48c23ef9 | [
"MIT"
] | null | null | null | jacquard/storage/tests/test_file.py | peteowlett/jacquard | 772fd633e521501688e0933482cba45f48c23ef9 | [
"MIT"
] | null | null | null | import unittest
from jacquard.storage.file import FileStore
from jacquard.storage.testing_utils import StorageGauntlet
class FileGauntletTest(StorageGauntlet, unittest.TestCase):
def open_storage(self):
return FileStore(':memory:')
def test_exceptions_back_out_writes():
storage = FileStore(':memory... | 23.333333 | 59 | 0.685714 |
ea73ab3a3be66386d3b4d9467185caada18f7b22 | 497 | py | Python | market/test/test_zones.py | dpsommer/market | 36df4527fcf4f0ef99207c8b8e63172429cfd226 | [
"MIT"
] | null | null | null | market/test/test_zones.py | dpsommer/market | 36df4527fcf4f0ef99207c8b8e63172429cfd226 | [
"MIT"
] | null | null | null | market/test/test_zones.py | dpsommer/market | 36df4527fcf4f0ef99207c8b8e63172429cfd226 | [
"MIT"
] | null | null | null | import unittest
from market.data.zones import Zone, world_map
from market.test import MockDataTestCase
class TestZones(MockDataTestCase):
def test_seeded_map_generation(self):
pass
def test_add_zone_to_map(self):
town = Zone('Town')
world_map.add_zone(town)
self.assertIn(tow... | 19.115385 | 45 | 0.694165 |
49bd760f4e20e2a12e5686b3193bdba2895612e4 | 4,617 | py | Python | paddle/trainer/tests/testPyDataWrapper.py | TarzanQll/Paddle-master | 1f192b22c641f91bd98a5babe7189ac5d7d3b408 | [
"Apache-2.0"
] | 1 | 2016-10-23T09:31:38.000Z | 2016-10-23T09:31:38.000Z | paddle/trainer/tests/testPyDataWrapper.py | TarzanQll/Paddle-master | 1f192b22c641f91bd98a5babe7189ac5d7d3b408 | [
"Apache-2.0"
] | 3 | 2016-10-22T16:06:11.000Z | 2016-11-07T06:30:37.000Z | paddle/trainer/tests/testPyDataWrapper.py | TarzanQll/Paddle-master | 1f192b22c641f91bd98a5babe7189ac5d7d3b408 | [
"Apache-2.0"
] | 1 | 2019-10-26T12:51:13.000Z | 2019-10-26T12:51:13.000Z | # Copyright (c) 2016 Baidu, 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 o... | 36.642857 | 105 | 0.700455 |
1107fe72dc239ce96485354cd4e90e18a992d66b | 17,838 | py | Python | thirdpart/wsgidav/wsgidav_app.py | saukrIppl/newsea | 0fd5ab2ade9a8fb16b1e7b43ba13dac32eb39603 | [
"Apache-2.0"
] | 2 | 2017-06-21T09:46:55.000Z | 2018-05-30T10:07:32.000Z | thirdpart/wsgidav/wsgidav_app.py | saukrIppl/newsea | 0fd5ab2ade9a8fb16b1e7b43ba13dac32eb39603 | [
"Apache-2.0"
] | null | null | null | thirdpart/wsgidav/wsgidav_app.py | saukrIppl/newsea | 0fd5ab2ade9a8fb16b1e7b43ba13dac32eb39603 | [
"Apache-2.0"
] | 1 | 2020-10-01T04:11:41.000Z | 2020-10-01T04:11:41.000Z | # (c) 2009-2014 Martin Wendt and contributors; see WsgiDAV https://github.com/mar10/wsgidav
# Original PyFileServer (c) 2005 Ho Chun Wei.
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
"""
WSGI container, that handles the HTTP requests. This object is passed to the
WSGI serve... | 44.263027 | 131 | 0.56531 |
416ec46bedc43ac213a4e09e41649cff261f23db | 4,107 | py | Python | Gena/basic_image.py | mllzl/earthengine-py-notebooks | cade6a81dd4dbbfb1b9b37aaf6955de42226cfc5 | [
"MIT"
] | 1 | 2020-03-26T04:21:15.000Z | 2020-03-26T04:21:15.000Z | Gena/basic_image.py | mllzl/earthengine-py-notebooks | cade6a81dd4dbbfb1b9b37aaf6955de42226cfc5 | [
"MIT"
] | null | null | null | Gena/basic_image.py | mllzl/earthengine-py-notebooks | cade6a81dd4dbbfb1b9b37aaf6955de42226cfc5 | [
"MIT"
] | null | null | null | # %%
"""
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/Gena/basic_image.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_blank" hr... | 51.3375 | 1,021 | 0.741904 |
4dec35474eeaa2bc1224bd401c81a2370cfd3952 | 1,848 | py | Python | ambari-server/src/main/resources/stacks/BigInsights/4.2/services/SQOOP/package/scripts/sqoop_client.py | kuhella/ambari | 9396c17b0305665d31d7a4f4525be857958b5d4c | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/stacks/BigInsights/4.2/services/SQOOP/package/scripts/sqoop_client.py | kuhella/ambari | 9396c17b0305665d31d7a4f4525be857958b5d4c | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/stacks/BigInsights/4.2/services/SQOOP/package/scripts/sqoop_client.py | kuhella/ambari | 9396c17b0305665d31d7a4f4525be857958b5d4c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License");... | 31.862069 | 98 | 0.770022 |
57e5209234324ff0c35c29950b895839171621f9 | 4,959 | py | Python | examples/flax_mnist.py | tachukao/jaxopt | dae2f66a2e5899ade8032a2dd13609acd371d4de | [
"Apache-2.0"
] | null | null | null | examples/flax_mnist.py | tachukao/jaxopt | dae2f66a2e5899ade8032a2dd13609acd371d4de | [
"Apache-2.0"
] | null | null | null | examples/flax_mnist.py | tachukao/jaxopt | dae2f66a2e5899ade8032a2dd13609acd371d4de | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 31.993548 | 84 | 0.666062 |
9f5fb1854328e658f9b083d3e0d313416295726b | 3,179 | py | Python | Vision/owlbot.py | nick-lai/google-cloud-php | 52130ee60f03c61ef0ada04c31b1268af87bacb6 | [
"Apache-2.0"
] | 524 | 2018-09-26T02:29:52.000Z | 2022-03-30T12:57:26.000Z | Vision/owlbot.py | nick-lai/google-cloud-php | 52130ee60f03c61ef0ada04c31b1268af87bacb6 | [
"Apache-2.0"
] | 2,028 | 2018-09-20T22:35:42.000Z | 2022-03-31T18:13:07.000Z | Vision/owlbot.py | nick-lai/google-cloud-php | 52130ee60f03c61ef0ada04c31b1268af87bacb6 | [
"Apache-2.0"
] | 262 | 2018-10-02T15:43:46.000Z | 2022-03-29T19:37:04.000Z | # 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 27.405172 | 94 | 0.647688 |
cba2b2a490b2c4ee3e26343c2c566b7482092d71 | 576 | py | Python | login.py | Entropy03/linyi | 1e5f924c217095d6757e29cac128e5ac5085ec11 | [
"MIT"
] | null | null | null | login.py | Entropy03/linyi | 1e5f924c217095d6757e29cac128e5ac5085ec11 | [
"MIT"
] | null | null | null | login.py | Entropy03/linyi | 1e5f924c217095d6757e29cac128e5ac5085ec11 | [
"MIT"
] | null | null | null | import ssl
import sys
import urllib2
import random
import httplib
import json
from cookielib import LWPCookieJar
import urllib
import re
import getpass
class lgoin :
def __init__(self) :
self.logindata = {}
self.username ='china199123@163.com'
self.password ='ZAQjay12306'
self.randcode = ''
#在http交互中即时更... | 23.04 | 73 | 0.743056 |
b21abd96d0480f750f5b0089725872ee5225a01f | 4,430 | py | Python | blastsight/view/drawables/gldrawable.py | gsanhueza/BlastSight | 4b5c48e7ea5f67b737429f05d5213e9ff1fd399d | [
"MIT"
] | null | null | null | blastsight/view/drawables/gldrawable.py | gsanhueza/BlastSight | 4b5c48e7ea5f67b737429f05d5213e9ff1fd399d | [
"MIT"
] | 1 | 2022-03-13T17:35:35.000Z | 2022-03-13T17:35:35.000Z | blastsight/view/drawables/gldrawable.py | gsanhueza/BlastSight | 4b5c48e7ea5f67b737429f05d5213e9ff1fd399d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2019-2021 Gabriel Sanhueza.
#
# Distributed under the MIT License.
# See LICENSE for more info.
import numpy as np
from OpenGL.GL import *
class GLDrawable:
def __init__(self, element, *args, **kwargs):
# assert element
super().__setattr__('element', elem... | 29.337748 | 89 | 0.631377 |
48d2cf4f5a8692ae6171d29853d355c5beed1073 | 2,508 | py | Python | examples/Raspberry_Pi_Pico_4x4_Macropad_v2/code.py | Mindplague/pykey | e069ccdacd470d8d27ad1b701f333ea8e118fc49 | [
"MIT"
] | 7 | 2021-10-13T10:18:42.000Z | 2022-03-03T03:51:58.000Z | examples/Raspberry_Pi_Pico_4x4_Macropad_v2/code.py | Mindplague/pykey | e069ccdacd470d8d27ad1b701f333ea8e118fc49 | [
"MIT"
] | 3 | 2021-10-13T00:35:04.000Z | 2021-10-15T00:19:31.000Z | examples/Raspberry_Pi_Pico_4x4_Macropad_v2/code.py | Mindplague/pykey | e069ccdacd470d8d27ad1b701f333ea8e118fc49 | [
"MIT"
] | 3 | 2021-10-13T02:55:51.000Z | 2022-02-10T05:01:08.000Z | # SPDX-FileCopyrightText: 2021 Pierre Constantineau
# SPDX-License-Identifier: MIT
# Raspberry Pi Pico 4x4 Macropad
"""
Code adapted from the following sources:
MACROPAD Hotkey (https://learn.adafruit.com/macropad-hotkeys/project-code)
Pico Four Keypad (https://learn.adafruit.com/pico-four-key-macropad/cod... | 34.356164 | 94 | 0.621212 |
5875e307d8f1064648010f07a0c213ad36c41c14 | 11,238 | py | Python | src/datasets/utils/streaming_download_manager.py | jimregan/datasets | fc46bba66ba4f432cc10501c16a677112e13984c | [
"Apache-2.0"
] | null | null | null | src/datasets/utils/streaming_download_manager.py | jimregan/datasets | fc46bba66ba4f432cc10501c16a677112e13984c | [
"Apache-2.0"
] | null | null | null | src/datasets/utils/streaming_download_manager.py | jimregan/datasets | fc46bba66ba4f432cc10501c16a677112e13984c | [
"Apache-2.0"
] | null | null | null | import os
import re
import time
from pathlib import Path, PurePosixPath
from typing import Optional, Tuple
import fsspec
import posixpath
from aiohttp.client_exceptions import ClientError
from .. import config
from ..filesystems import COMPRESSION_FILESYSTEMS
from .download_manager import DownloadConfig, map_nested
f... | 35.904153 | 140 | 0.654832 |
264d9aa9fb447555b6ea42e97edd0462c1503277 | 13,824 | py | Python | sdk/python/pulumi_azure_native/changeanalysis/outputs.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/changeanalysis/outputs.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/changeanalysis/outputs.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"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
from... | 41.389222 | 271 | 0.67419 |
4d42914389da921d7a1c15c79345c932493f67ab | 1,612 | py | Python | wristband/constants.py | MONICA-Project/scral-framework | ad9ff066cd204ea7bf5099866c53ae320800995e | [
"Apache-2.0"
] | null | null | null | wristband/constants.py | MONICA-Project/scral-framework | ad9ff066cd204ea7bf5099866c53ae320800995e | [
"Apache-2.0"
] | null | null | null | wristband/constants.py | MONICA-Project/scral-framework | ad9ff066cd204ea7bf5099866c53ae320800995e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#############################################################################
# _____ __________ ___ __ #
# / ___// ____/ __ \/ | / / #
# \__ \/ / / /_/ / /| | / / ... | 41.333333 | 78 | 0.450372 |
1ceaab12466feb4301fc7f45b63b129034c7bbdf | 574 | py | Python | tests/share/tasks/__init__.py | felliott/SHARE | 8fd60ff4749349c9b867f6188650d71f4f0a1a56 | [
"Apache-2.0"
] | 87 | 2015-01-06T18:24:45.000Z | 2021-08-08T07:59:40.000Z | tests/share/tasks/__init__.py | fortress-biotech/SHARE | 9c5a05dd831447949fa6253afec5225ff8ab5d4f | [
"Apache-2.0"
] | 442 | 2015-01-01T19:16:01.000Z | 2022-03-30T21:10:26.000Z | tests/share/tasks/__init__.py | fortress-biotech/SHARE | 9c5a05dd831447949fa6253afec5225ff8ab5d4f | [
"Apache-2.0"
] | 67 | 2015-03-10T16:32:58.000Z | 2021-11-12T16:33:41.000Z | import threading
class SyncedThread(threading.Thread):
def __init__(self, target, args=(), kwargs={}):
self._end = threading.Event()
self._start = threading.Event()
def _target(*args, **kwargs):
with target(*args, **kwargs):
self._start.set()
s... | 23.916667 | 66 | 0.569686 |
27947a93d459905a3b21e377e5aff41c54450c94 | 3,623 | py | Python | poseidon/baseClasses/Rabbit_Base.py | danielpops/poseidon | 290405b02a0cd46dcbfafceded12ddc06b7a641a | [
"Apache-2.0"
] | null | null | null | poseidon/baseClasses/Rabbit_Base.py | danielpops/poseidon | 290405b02a0cd46dcbfafceded12ddc06b7a641a | [
"Apache-2.0"
] | null | null | null | poseidon/baseClasses/Rabbit_Base.py | danielpops/poseidon | 290405b02a0cd46dcbfafceded12ddc06b7a641a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 In-Q-Tel, 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.or... | 36.969388 | 78 | 0.591499 |
9f081b9fa9ccc679f07d5eea77807e66bf5308d6 | 156 | py | Python | striplog/_version.py | rgmyr/striplog | 9813f1c5b109de60f0717cdf0018042cd8ddeb69 | [
"Apache-2.0"
] | 1 | 2021-05-18T08:23:58.000Z | 2021-05-18T08:23:58.000Z | striplog/_version.py | rgmyr/striplog | 9813f1c5b109de60f0717cdf0018042cd8ddeb69 | [
"Apache-2.0"
] | null | null | null | striplog/_version.py | rgmyr/striplog | 9813f1c5b109de60f0717cdf0018042cd8ddeb69 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Version.
Doing it this way provides for access in setup.py and via __version__
"""
__version__ = "0.8.0"
| 17.333333 | 69 | 0.660256 |
69665378468280c82a4c776f01d8ed79b1d6df6d | 623 | py | Python | work/yml/manage.py | judebues/softmanage | 3882534422c09cc3a6978890e51fff9ff465de24 | [
"MIT"
] | 1 | 2020-05-21T06:48:34.000Z | 2020-05-21T06:48:34.000Z | work/yml/manage.py | judebues/softmanage | 3882534422c09cc3a6978890e51fff9ff465de24 | [
"MIT"
] | 3 | 2021-03-19T03:07:36.000Z | 2021-04-08T20:33:38.000Z | work/yml/manage.py | judebues/softmanage | 3882534422c09cc3a6978890e51fff9ff465de24 | [
"MIT"
] | 1 | 2020-05-21T06:48:36.000Z | 2020-05-21T06:48:36.000Z | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'yml.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportErro... | 28.318182 | 73 | 0.680578 |
e060d94fd3c0a061f5cd541e0d5276b6ead987ba | 56,803 | py | Python | venv/Lib/site-packages/sqlalchemy/dialects/oracle/base.py | sunausti/mywebdemo | 884bcf3b68e0063dcb08c602f0dc784753ec8a87 | [
"Apache-2.0"
] | 1 | 2021-11-11T08:52:09.000Z | 2021-11-11T08:52:09.000Z | venv/Lib/site-packages/sqlalchemy/dialects/oracle/base.py | sunausti/mywebdemo | 884bcf3b68e0063dcb08c602f0dc784753ec8a87 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/sqlalchemy/dialects/oracle/base.py | sunausti/mywebdemo | 884bcf3b68e0063dcb08c602f0dc784753ec8a87 | [
"Apache-2.0"
] | null | null | null | # oracle/base.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""
.. dialect:: oracle
:name: Oracle
Oracle version 8 through current (11g ... | 36.272669 | 95 | 0.601975 |
7dacd8e046ccc823467161e4d0e59a7887a035fc | 4,717 | py | Python | tests/python/unittest/test_tir_transform_coproc_sync.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 4,640 | 2017-08-17T19:22:15.000Z | 2019-11-04T15:29:46.000Z | tests/python/unittest/test_tir_transform_coproc_sync.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 3,022 | 2020-11-24T14:02:31.000Z | 2022-03-31T23:55:31.000Z | tests/python/unittest/test_tir_transform_coproc_sync.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 1,352 | 2017-08-17T19:30:38.000Z | 2019-11-04T16:09:29.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.284615 | 89 | 0.634513 |
5f173a5909f012704284dcf04812fc2c5937c2b5 | 18,128 | py | Python | sgdml/utils/perm.py | rangsimanketkaew/sGDML | 3f06e0de33462afdfaecb310ac2d4e073b6ed2cf | [
"MIT"
] | 72 | 2018-07-11T18:46:17.000Z | 2022-03-13T03:33:09.000Z | sgdml/utils/perm.py | rangsimanketkaew/sGDML | 3f06e0de33462afdfaecb310ac2d4e073b6ed2cf | [
"MIT"
] | 11 | 2018-09-14T18:43:03.000Z | 2021-06-15T12:21:52.000Z | sgdml/utils/perm.py | rangsimanketkaew/sGDML | 3f06e0de33462afdfaecb310ac2d4e073b6ed2cf | [
"MIT"
] | 31 | 2018-10-29T08:06:00.000Z | 2022-03-25T13:53:43.000Z | #!/usr/bin/python
# MIT License
#
# Copyright (c) 2018-2021 Stefan Chmiela
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to... | 29.914191 | 160 | 0.616339 |
1df70361b98cb23ca3c4396c93c48529e5fc5b95 | 288 | py | Python | logiclibrary/storage.py | ld4apps/lda-serverlib | e76441e658c24d6cd2d7826f50e7b8c0dfc65350 | [
"Apache-2.0"
] | 3 | 2015-07-08T12:35:08.000Z | 2016-11-08T02:08:31.000Z | logiclibrary/storage.py | ld4apps/lda-serverlib | e76441e658c24d6cd2d7826f50e7b8c0dfc65350 | [
"Apache-2.0"
] | null | null | null | logiclibrary/storage.py | ld4apps/lda-serverlib | e76441e658c24d6cd2d7826f50e7b8c0dfc65350 | [
"Apache-2.0"
] | 1 | 2015-02-23T17:49:55.000Z | 2015-02-23T17:49:55.000Z | import os
import importlib
if 'OPERATION_PRIMITIVES' in os.environ:
import_name = os.environ['OPERATION_PRIMITIVES']
else:
import_name = 'operation_primitives' #assume it has the standard name and is on the python path
operation_primitives = importlib.import_module(import_name)
| 32 | 99 | 0.798611 |
5b31b2e81d0f39ce9fd8e1e0e5ff0bf9b4490673 | 1,659 | py | Python | homeassistant/components/uptime/sensor.py | nickna/core | c682d5d5e430de52e3da7e06026cd8b4087e864f | [
"Apache-2.0"
] | 11 | 2018-02-16T15:35:47.000Z | 2020-01-14T15:20:00.000Z | homeassistant/components/uptime/sensor.py | flexy2dd/core | 1019ee22ff13e5f542e868179d791e6a0d87369a | [
"Apache-2.0"
] | 77 | 2020-07-16T16:43:09.000Z | 2022-03-31T06:14:37.000Z | homeassistant/components/uptime/sensor.py | Vaarlion/core | f3de8b9f28de01abf72c0f5bb0b457eb1841f201 | [
"Apache-2.0"
] | 6 | 2018-02-04T03:48:55.000Z | 2022-01-24T20:37:04.000Z | """Platform to retrieve uptime for Home Assistant."""
from __future__ import annotations
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import (
CONF_NAME,
CONF_UNIT_OF_MEASUREMENT,
DEVICE_CLASS_TIMESTAMP,
)
from homeassistant.co... | 30.722222 | 76 | 0.717902 |
42b44ca16ad4a76ab7e8f539bed8f5f3ea7b82ab | 235 | py | Python | Exercicios/mundo1-exercicios-01-35/ex015.py | rafaelbarretomg/Curso-Python-3 | 7e772cbaf4c1e1bf7f1a9fb2925ec2e0eecf2998 | [
"MIT"
] | null | null | null | Exercicios/mundo1-exercicios-01-35/ex015.py | rafaelbarretomg/Curso-Python-3 | 7e772cbaf4c1e1bf7f1a9fb2925ec2e0eecf2998 | [
"MIT"
] | null | null | null | Exercicios/mundo1-exercicios-01-35/ex015.py | rafaelbarretomg/Curso-Python-3 | 7e772cbaf4c1e1bf7f1a9fb2925ec2e0eecf2998 | [
"MIT"
] | null | null | null | # Aluguel de carros custa 60 reais dia e 0.15 por km rodado
dias = int(input('Quantos dias alugados? '))
km = float(input('Quantos Km rodados? '))
aluguel = (dias * 60) + (km * 0.15)
print('O aluguel foi de R${:.2f}' .format(aluguel))
| 39.166667 | 59 | 0.66383 |
09601087429e188e4f256039ab06e7a51b9d3570 | 14,779 | py | Python | chia/consensus/multiprocess_validation.py | Heather-Network/heather-blockchain | 75a37c6f54d98b5c36c5e8cf5b27c5ed9ae977fa | [
"Apache-2.0"
] | 1 | 2021-09-19T18:57:21.000Z | 2021-09-19T18:57:21.000Z | chia/consensus/multiprocess_validation.py | Heather-Network/heather-blockchain | 75a37c6f54d98b5c36c5e8cf5b27c5ed9ae977fa | [
"Apache-2.0"
] | null | null | null | chia/consensus/multiprocess_validation.py | Heather-Network/heather-blockchain | 75a37c6f54d98b5c36c5e8cf5b27c5ed9ae977fa | [
"Apache-2.0"
] | null | null | null | import asyncio
import logging
import traceback
from concurrent.futures.process import ProcessPoolExecutor
from dataclasses import dataclass
from typing import Dict, List, Optional, Sequence, Tuple, Union, Callable
from chia.consensus.block_header_validation import validate_finished_header_block
from chia.consensus.blo... | 46.329154 | 117 | 0.660194 |
1c699cb9b740f7c3cce4823b9ca663fad84601f3 | 107,581 | py | Python | fhir/resources/fhirtypes.py | iatechicken/fhir.resources | 8ccb21aaa00755c6d230522bd7ddb655155b4bcb | [
"BSD-3-Clause"
] | null | null | null | fhir/resources/fhirtypes.py | iatechicken/fhir.resources | 8ccb21aaa00755c6d230522bd7ddb655155b4bcb | [
"BSD-3-Clause"
] | null | null | null | fhir/resources/fhirtypes.py | iatechicken/fhir.resources | 8ccb21aaa00755c6d230522bd7ddb655155b4bcb | [
"BSD-3-Clause"
] | null | null | null | # _*_ coding: utf-8 _*_
import datetime
import re
from email.utils import formataddr, parseaddr
from typing import TYPE_CHECKING, Any, Dict, Optional, Pattern, Union
from uuid import UUID
from pydantic import AnyUrl
from pydantic.errors import DateError, DateTimeError, TimeError
from pydantic.main import load_str_byte... | 27.914115 | 119 | 0.789266 |
4353b06a0ce18b0487c06aeaaa36b25441f0234f | 3,087 | py | Python | SGD2.py | parrt/gmdh | 77d54c35ed22e007098c6105066b6bae18ed364a | [
"BSD-2-Clause"
] | 3 | 2017-02-09T14:34:49.000Z | 2020-03-23T15:50:08.000Z | SGD2.py | parrt/gmdh | 77d54c35ed22e007098c6105066b6bae18ed364a | [
"BSD-2-Clause"
] | 1 | 2017-05-23T06:08:12.000Z | 2017-05-23T17:42:10.000Z | SGD2.py | parrt/gmdh | 77d54c35ed22e007098c6105066b6bae18ed364a | [
"BSD-2-Clause"
] | 1 | 2019-11-20T20:56:31.000Z | 2019-11-20T20:56:31.000Z | import numpy as np
import gzip, cPickle
from numpy import linalg as LA
from collections import Counter
from decimal import Decimal
import random
from network2 import Network2, init_index_map
# Load the dataset
f = gzip.open('/Users/parrt/data/mnist.pkl.gz', 'rb')
train_set, valid_set, test_set = cPickle.load(f)
f.clo... | 30.564356 | 103 | 0.646259 |
1d9c761f3c83798fd6723d0da3f054681695f01a | 5,417 | py | Python | Environment.py | zhangks93/ASPS | 02f1f8cd563cdccea01dedc950fa38c570dc996e | [
"MIT"
] | 2 | 2021-03-26T00:17:44.000Z | 2021-08-17T12:23:56.000Z | Environment.py | zhangks93/ASPS | 02f1f8cd563cdccea01dedc950fa38c570dc996e | [
"MIT"
] | null | null | null | Environment.py | zhangks93/ASPS | 02f1f8cd563cdccea01dedc950fa38c570dc996e | [
"MIT"
] | null | null | null | import influent as If
import reactor as Ra
import clarifier as Ca
import constant
import pandas as pd
import numpy as np
class WWTP():
def __init__(self):
self.Influent=If.influent('influent',0,'data/bsm1LT.xlsx')
self.A=Ra.bioreactor('Reactor1',0,1000)
self.B=Ra.bioreactor('Reactor2',0... | 55.845361 | 234 | 0.602363 |
b3b78fe7db9285dc545bf40341c632ed871c1545 | 565 | py | Python | makegbs.py | DevEd2/HokeyPokey-GB | b7d08b8c3eadc5f19519bfb2961cda7eacf11c6f | [
"MIT"
] | null | null | null | makegbs.py | DevEd2/HokeyPokey-GB | b7d08b8c3eadc5f19519bfb2961cda7eacf11c6f | [
"MIT"
] | null | null | null | makegbs.py | DevEd2/HokeyPokey-GB | b7d08b8c3eadc5f19519bfb2961cda7eacf11c6f | [
"MIT"
] | null | null | null | # makegbs.py - create GBS file from GBSHeader.bin and DevSound.gb
# open files
HdrFile = open("GBSHeader.bin", "rb") # GBS header
ROMFile = open("HokeyPokey.gbc", "rb") # demo ROM
OutFile = open("HokeyPokey.gbs", "wb") # output file
# copy header
OutFile.write(HdrFile.read(0x70)) # write GBS he... | 29.736842 | 80 | 0.656637 |
dd00e200c627f7efdffc0413b9f09a77924f50b4 | 81,841 | py | Python | src/transformers/models/bert/modeling_bert.py | bhavika/transformers | 65cf33e7e53cd46313f3655f274b3f6ca0fd679d | [
"Apache-2.0"
] | 1 | 2022-03-16T13:02:15.000Z | 2022-03-16T13:02:15.000Z | src/transformers/models/bert/modeling_bert.py | bhavika/transformers | 65cf33e7e53cd46313f3655f274b3f6ca0fd679d | [
"Apache-2.0"
] | 2 | 2022-03-14T10:13:16.000Z | 2022-03-14T11:50:27.000Z | src/transformers/models/bert/modeling_bert.py | bhavika/transformers | 65cf33e7e53cd46313f3655f274b3f6ca0fd679d | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA 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 cop... | 43.602025 | 202 | 0.665632 |
46220da617b5efd4483962670eb50a9016d06156 | 35,967 | py | Python | Mask-vs-No-Mask-Detection/Model/utils/general.py | talkshrey/ML-Reserve | 62fe72ba7e7513be52955aff7a6c12d5fe44d757 | [
"MIT"
] | 12 | 2021-09-11T09:44:23.000Z | 2022-03-12T09:16:53.000Z | Mask-vs-No-Mask-Detection/Model/utils/general.py | talkshrey/ML-Reserve | 62fe72ba7e7513be52955aff7a6c12d5fe44d757 | [
"MIT"
] | 54 | 2021-09-11T09:48:07.000Z | 2022-01-31T05:38:12.000Z | Mask-vs-No-Mask-Detection/Model/utils/general.py | talkshrey/ML-Reserve | 62fe72ba7e7513be52955aff7a6c12d5fe44d757 | [
"MIT"
] | 39 | 2021-09-11T09:44:26.000Z | 2022-03-12T09:16:55.000Z | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
General utils
"""
import contextlib
import glob
import logging
import math
import os
import platform
import random
import re
import signal
import time
import urllib
from itertools import repeat
from multiprocessing.pool import ThreadPool
from pathlib import Path
from sub... | 34.418182 | 118 | 0.557622 |
64157e58daca1bb191592aa5abfd32c7d05d764a | 511 | py | Python | tuiuiu/tuiuiucore/migrations/0035_page_last_published_at.py | caputomarcos/tuiuiu.io | d8fb57cf95487e7fe1454b2130ef18acc916da46 | [
"BSD-3-Clause"
] | 3 | 2019-08-08T09:09:35.000Z | 2020-12-15T18:04:17.000Z | tuiuiu/tuiuiucore/migrations/0035_page_last_published_at.py | caputomarcos/tuiuiu.io | d8fb57cf95487e7fe1454b2130ef18acc916da46 | [
"BSD-3-Clause"
] | null | null | null | tuiuiu/tuiuiucore/migrations/0035_page_last_published_at.py | caputomarcos/tuiuiu.io | d8fb57cf95487e7fe1454b2130ef18acc916da46 | [
"BSD-3-Clause"
] | 1 | 2017-09-09T20:10:40.000Z | 2017-09-09T20:10:40.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-22 13:35
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('tuiuiucore', '0034_page_live_revision'),
]
operations = [
migrations.AddFie... | 24.333333 | 100 | 0.641879 |
8c7b819b66d9a9e85664a3dc91130f2a15bb620e | 2,719 | py | Python | tests/parser/functions/rlp/conftest.py | Dexaran/viper | 9c1992f56c2b78416f981452f0457449f7670d1a | [
"MIT"
] | 1 | 2018-07-26T00:56:30.000Z | 2018-07-26T00:56:30.000Z | tests/parser/functions/rlp/conftest.py | Dexaran/viper | 9c1992f56c2b78416f981452f0457449f7670d1a | [
"MIT"
] | null | null | null | tests/parser/functions/rlp/conftest.py | Dexaran/viper | 9c1992f56c2b78416f981452f0457449f7670d1a | [
"MIT"
] | 2 | 2018-04-06T02:55:43.000Z | 2018-07-26T00:56:36.000Z | import pytest
import rlp
from viper import utils as viper_utils
from ethereum import transactions, messages
@pytest.fixture
def inject_tx(utils, chain):
def inject_tx(txhex):
tx = rlp.decode(utils.decode_hex(txhex[2:]), transactions.Transaction)
chain.head_state.set_balance(tx.sender, tx.startgas *... | 93.758621 | 1,741 | 0.891136 |
9de3ba250eb73333853b29db3482e48a696b5b19 | 7,205 | py | Python | implementations-from-scratch/neuralnetwork/neuralnetwork_test.py | georgepachitariu/machine-learning-portfolio | 47452524b0f2ccf409ba12e6a717157e569d62e1 | [
"Apache-2.0"
] | 2 | 2020-11-25T11:27:34.000Z | 2021-01-19T17:42:47.000Z | implementations-from-scratch/neuralnetwork/neuralnetwork_test.py | georgepachitariu/machine-learning-portfolio | 47452524b0f2ccf409ba12e6a717157e569d62e1 | [
"Apache-2.0"
] | null | null | null | implementations-from-scratch/neuralnetwork/neuralnetwork_test.py | georgepachitariu/machine-learning-portfolio | 47452524b0f2ccf409ba12e6a717157e569d62e1 | [
"Apache-2.0"
] | null | null | null | import neuralnetwork as nn
import unittest
import numpy as np
import warnings
class SigmoidTests(unittest.TestCase):
def test_sigmoid(self):
assert 0 < nn.Sigmoid.compute(np.array([-10])) < 0.0001
assert nn.Sigmoid.compute(np.array([0])) == 0.5
assert 0.9999 < nn.Sigmoid.compute(np.array(... | 39.80663 | 114 | 0.489382 |
9e883cacad4c967af960c181b102eb007d005e2d | 8,176 | py | Python | pyperformance/benchmarks/bm_pickle.py | sourcery-ai-bot/pyperformance | f4e5667b080e05227f530ec7c985e6399e86347f | [
"MIT"
] | null | null | null | pyperformance/benchmarks/bm_pickle.py | sourcery-ai-bot/pyperformance | f4e5667b080e05227f530ec7c985e6399e86347f | [
"MIT"
] | null | null | null | pyperformance/benchmarks/bm_pickle.py | sourcery-ai-bot/pyperformance | f4e5667b080e05227f530ec7c985e6399e86347f | [
"MIT"
] | null | null | null |
"""Script for testing the performance of pickling/unpickling.
This will pickle/unpickle several real world-representative objects a few
thousand times. The methodology below was chosen for was chosen to be similar
to real-world scenarios which operate on single objects at a time. Note that if
we did something like
... | 28.587413 | 82 | 0.629036 |
939bd6e7476c81b3dc62c3e6627a94f14a0811d7 | 375 | py | Python | backend/backend/accounts/migrations/0003_auto_20201116_0136.py | mightykim91/howaboutme | 467c3a2eccc959084296bc7f4679e77b93b9d7f7 | [
"Unlicense"
] | null | null | null | backend/backend/accounts/migrations/0003_auto_20201116_0136.py | mightykim91/howaboutme | 467c3a2eccc959084296bc7f4679e77b93b9d7f7 | [
"Unlicense"
] | null | null | null | backend/backend/accounts/migrations/0003_auto_20201116_0136.py | mightykim91/howaboutme | 467c3a2eccc959084296bc7f4679e77b93b9d7f7 | [
"Unlicense"
] | null | null | null | # Generated by Django 3.1.2 on 2020-11-15 16:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0002_user_like'),
]
operations = [
migrations.AlterField(
model_name='user',
name='name',
fi... | 19.736842 | 51 | 0.586667 |
794d6436b61ab02e0d8f6de8d32f421a23a8a200 | 11,749 | py | Python | Lib/test/test_py_compile.py | oleksandr-pavlyk/cpython | eb002dbe0da9622245a355db5f0cd5aa2fc70b40 | [
"0BSD"
] | 5 | 2021-12-03T23:11:53.000Z | 2022-01-08T21:02:50.000Z | Lib/test/test_py_compile.py | dalakatt/cpython | 2f49b97cc5426087b46515254b9a97a22ee8c807 | [
"0BSD"
] | 8 | 2022-01-07T11:31:11.000Z | 2022-03-04T00:07:16.000Z | Lib/test/test_py_compile.py | dalakatt/cpython | 2f49b97cc5426087b46515254b9a97a22ee8c807 | [
"0BSD"
] | 3 | 2017-10-18T09:35:14.000Z | 2018-09-09T16:40:13.000Z | import functools
import importlib.util
import os
import py_compile
import shutil
import stat
import subprocess
import sys
import tempfile
import unittest
from test import support
from test.support import os_helper, script_helper
def without_source_date_epoch(fxn):
"""Runs function with SOURCE_DATE_EPOCH unset.""... | 40.236301 | 97 | 0.637671 |
b60f40d1e1c9e034584ea409c44e9b084d421363 | 7,085 | py | Python | test/integration/test_remote_files.py | fubar2/galaxy | 2d363ea6a374d9339ed1eb55b5565f9bba3fcab1 | [
"CC-BY-3.0"
] | null | null | null | test/integration/test_remote_files.py | fubar2/galaxy | 2d363ea6a374d9339ed1eb55b5565f9bba3fcab1 | [
"CC-BY-3.0"
] | 2 | 2020-08-19T18:14:59.000Z | 2020-08-20T01:19:12.000Z | test/integration/test_remote_files.py | CloudVE/galaxy | 002fac90618529c53c11ec846566ca438a7e02cf | [
"CC-BY-3.0"
] | null | null | null | import json
import operator
import os
import shutil
from tempfile import mkdtemp
from galaxy.exceptions import error_codes
from galaxy_test.base.api_asserts import assert_error_code_is, assert_error_message_contains
from galaxy_test.base.populators import DatasetPopulator
from galaxy_test.driver import integration_uti... | 39.581006 | 105 | 0.668313 |
de126ca073811e55758c3de646079c009a0af5ef | 3,068 | py | Python | setup.py | rserran/FLAML | 7d6822aa40883550e72c4ee24adb765c6e937ce7 | [
"MIT"
] | null | null | null | setup.py | rserran/FLAML | 7d6822aa40883550e72c4ee24adb765c6e937ce7 | [
"MIT"
] | null | null | null | setup.py | rserran/FLAML | 7d6822aa40883550e72c4ee24adb765c6e937ce7 | [
"MIT"
] | null | null | null | import setuptools
import os
here = os.path.abspath(os.path.dirname(__file__))
with open("README.md", "r", encoding="UTF-8") as fh:
long_description = fh.read()
# Get the code version
version = {}
with open(os.path.join(here, "flaml/version.py")) as fp:
exec(fp.read(), version)
__version__ = version["__versi... | 26.678261 | 75 | 0.489896 |
1ad8e8179bdd27c92a847bee4e813ea9fa54a387 | 740 | py | Python | yodatools/dataloader/controller/WizardDatabasePageController.py | ODM2/YODAParser | 274a1fc5ed1810bc748a4ab108855254f8b9fc46 | [
"BSD-3-Clause"
] | null | null | null | yodatools/dataloader/controller/WizardDatabasePageController.py | ODM2/YODAParser | 274a1fc5ed1810bc748a4ab108855254f8b9fc46 | [
"BSD-3-Clause"
] | 21 | 2016-02-06T00:43:44.000Z | 2018-02-02T20:22:05.000Z | yodatools/dataloader/controller/WizardDatabasePageController.py | ODM2/ODM2YODAParser | 274a1fc5ed1810bc748a4ab108855254f8b9fc46 | [
"BSD-3-Clause"
] | 1 | 2017-07-06T18:42:22.000Z | 2017-07-06T18:42:22.000Z | from yodatools.dataloader.view.WizardDatabasePageView import WizardDatabasePageView
import os
class WizardDatabasePageController(WizardDatabasePageView):
def __init__(self, parent, title=''):
super(WizardDatabasePageController, self).__init__(parent)
del self.panel.choices['SQLite']
self.... | 38.947368 | 83 | 0.710811 |
38e4c2c20a76b2cf6a9f2ff52cc59e63d7338f12 | 2,438 | py | Python | views/config.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | null | null | null | views/config.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | 1 | 2022-03-12T00:57:37.000Z | 2022-03-12T00:57:37.000Z | views/config.py | dev-easyshares/mighty | a6cf473fb8cfbf5b92db68c7b068fc8ae2911b8b | [
"MIT"
] | null | null | null | from django.core.exceptions import ObjectDoesNotExist
from django.http import JsonResponse, Http404
from mighty.functions import setting
from mighty.views.template import TemplateView
from mighty.views.crud import ListView, DetailView
from mighty.apps import MightyConfig as conf
from mighty.models import ConfigClient,... | 35.333333 | 109 | 0.7137 |
83fe275186397f48c02c3fe1d98cbee2351c1b36 | 957 | py | Python | NU-CS5001/lab02/weather.py | zahraaliaghazadeh/python | 2f2d0141a916c99e8724f803bd4e5c7246a7a02e | [
"MIT"
] | null | null | null | NU-CS5001/lab02/weather.py | zahraaliaghazadeh/python | 2f2d0141a916c99e8724f803bd4e5c7246a7a02e | [
"MIT"
] | null | null | null | NU-CS5001/lab02/weather.py | zahraaliaghazadeh/python | 2f2d0141a916c99e8724f803bd4e5c7246a7a02e | [
"MIT"
] | null | null | null | # Note date now is 9/21/2021 , and the location Seattle WA
# is used to answer the questions
# What is the difference between the highest and the lowest temperature values
# predicted for the 10 day forecast?
highest = 73
lowest = 55
print("The difference of highest and lowest temp predicted for the 10 day forecast ... | 29.90625 | 89 | 0.716823 |
d37940c738af61cb5ab647d0dbd43502f76204e7 | 1,553 | py | Python | config/urls.py | caseydm/militaryhomes | 25dd2a2d1f85bec5c9200e0961e8a2aacd82fd03 | [
"MIT"
] | null | null | null | config/urls.py | caseydm/militaryhomes | 25dd2a2d1f85bec5c9200e0961e8a2aacd82fd03 | [
"MIT"
] | null | null | null | config/urls.py | caseydm/militaryhomes | 25dd2a2d1f85bec5c9200e0961e8a2aacd82fd03 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.views.generic import TemplateView
from django.views import defaults as default_views
urlpatterns = [
url(r'^$', TemplateView.as_view(template_name='page... | 40.868421 | 110 | 0.696072 |
a1e6521c8c7f9486d911e64cb5fe7ec77d24ccd8 | 695 | py | Python | NEMbox/logger.py | hyskyder/musicbox | ec06a49cc59c683f7f5e69fad5097c34a8a7984c | [
"MIT"
] | null | null | null | NEMbox/logger.py | hyskyder/musicbox | ec06a49cc59c683f7f5e69fad5097c34a8a7984c | [
"MIT"
] | null | null | null | NEMbox/logger.py | hyskyder/musicbox | ec06a49cc59c683f7f5e69fad5097c34a8a7984c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: omi
# @Date: 2014-08-24 21:51:57
from __future__ import (
print_function, unicode_literals, division, absolute_import
)
import logging
from future.builtins import open
from . import const
FILE_NAME = const.Constant.log_path
with open(FILE_NAME, 'a+') a... | 21.060606 | 104 | 0.673381 |
a5799dd45d794b94ea3a9db12f3ea6ae19c07f11 | 1,130 | py | Python | amazon_asin_fetcher/amazon_asin_fetcher/spiders/asin_spider.py | turboLJY/amazon-reviews-scrapy | 31278183a1530ea1a8f2e27f3d85dfbd4848354c | [
"MIT"
] | 4 | 2020-04-19T08:17:03.000Z | 2022-02-17T05:00:03.000Z | amazon_asin_fetcher/amazon_asin_fetcher/spiders/asin_spider.py | turboLJY/amazon-reviews-scrapy | 31278183a1530ea1a8f2e27f3d85dfbd4848354c | [
"MIT"
] | null | null | null | amazon_asin_fetcher/amazon_asin_fetcher/spiders/asin_spider.py | turboLJY/amazon-reviews-scrapy | 31278183a1530ea1a8f2e27f3d85dfbd4848354c | [
"MIT"
] | 1 | 2020-09-01T00:44:01.000Z | 2020-09-01T00:44:01.000Z | # *-* coding: utf-8 *-*
"""
Created on: 5-Jul-2018
@author: Ai
"""
import scrapy
from googletrans import Translator
class ASINSpider(scrapy.Spider):
name = "asin"
def __init__(self, store=None, key=None, *args, **kwargs):
super(ASINSpider, self).__init__(*args, **kwargs)
self.store = store
... | 32.285714 | 106 | 0.574336 |
150ff08a6742385ae301ebc0a725eae9f721682f | 4,487 | py | Python | server/app/outputs/dmx.py | BasementCat/audio-reactive-led-strip | acbfd3709ecf3f970c604045bb62da0b47661330 | [
"MIT"
] | 1 | 2020-05-14T06:27:34.000Z | 2020-05-14T06:27:34.000Z | server/app/outputs/dmx.py | BasementCat/audio-reactive-led-strip | acbfd3709ecf3f970c604045bb62da0b47661330 | [
"MIT"
] | null | null | null | server/app/outputs/dmx.py | BasementCat/audio-reactive-led-strip | acbfd3709ecf3f970c604045bb62da0b47661330 | [
"MIT"
] | null | null | null | import os
import glob
import logging
import threading
import time
import subprocess
import re
from dmxpy.DmxPy import DmxPy
from app import Task
from app.lib.misc import FPSCounter
logger = logging.getLogger(__name__)
hexint = lambda v: int(v, 16)
def find_device_file__linux(vendor, product):
if not os.path.e... | 31.377622 | 106 | 0.516158 |
0547e42bf8128476ba489e42c087078e17dd282b | 1,325 | py | Python | object-generation-using-gans/data/unaligned_dataset.py | sevmardi/ml-projects | 0eb218c77cda61285cfcf599599ff28a8a8deba7 | [
"MIT"
] | null | null | null | object-generation-using-gans/data/unaligned_dataset.py | sevmardi/ml-projects | 0eb218c77cda61285cfcf599599ff28a8a8deba7 | [
"MIT"
] | 7 | 2020-06-06T01:26:08.000Z | 2022-02-10T11:26:58.000Z | object-generation-using-gans/data/unaligned_dataset.py | sevmardi/ml-projects | 0eb218c77cda61285cfcf599599ff28a8a8deba7 | [
"MIT"
] | null | null | null | import os.path
import torchvision.transforms as transforms
from data.base_dataset import BaseDataset, get_transform
from data.image_folder import make_dataset
from PIL import Image
import PIL
from pdb import set_trace as st
class UnalignedDataset(BaseDataset):
def initialize(self, opt):
self.opt = opt
... | 29.444444 | 64 | 0.649811 |
c948f63b55fa433ae8b7ee45a10eedd007753508 | 7,048 | py | Python | smith/modeling_test.py | egonrian/google-research | 8177adbe9ca0d7e5a9463b54581fe6dd27be0974 | [
"Apache-2.0"
] | 3 | 2021-01-18T04:46:49.000Z | 2021-03-05T09:21:40.000Z | smith/modeling_test.py | Alfaxad/google-research | 2c0043ecd507e75e2df9973a3015daf9253e1467 | [
"Apache-2.0"
] | 7 | 2021-11-10T19:44:38.000Z | 2022-02-10T06:48:39.000Z | smith/modeling_test.py | Alfaxad/google-research | 2c0043ecd507e75e2df9973a3015daf9253e1467 | [
"Apache-2.0"
] | 4 | 2021-02-08T10:25:45.000Z | 2021-04-17T14:46:26.000Z | # coding=utf-8
# Copyright 2020 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 38.097297 | 77 | 0.690267 |
f3641bf7fb85f833b58ccd80f2cda096701aedbe | 10,032 | py | Python | misp_epo_policy.py | mohlcyber/MISP-ENS-ExpertRules | 00a3558121c248f564007b78c20aef85cbc10dbc | [
"Apache-2.0"
] | 1 | 2020-11-09T00:24:09.000Z | 2020-11-09T00:24:09.000Z | misp_epo_policy.py | mohlcyber/MISP-ENS-ExpertRules | 00a3558121c248f564007b78c20aef85cbc10dbc | [
"Apache-2.0"
] | null | null | null | misp_epo_policy.py | mohlcyber/MISP-ENS-ExpertRules | 00a3558121c248f564007b78c20aef85cbc10dbc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Written by mohlcyber v.0.2 12/08/2020
import os
import time
import sys
import requests
import json
import xml.etree.ElementTree as ET
import base64
import re
import logging
from pymisp import ExpandedPyMISP
requests.packages.urllib3.disable_warnings()
EPO_URL = 'https://1.1.1.1'
EPO_PORT = ... | 36.48 | 131 | 0.546551 |
cab401857149e5c12cf56d504ec19f1639d115ee | 37,217 | py | Python | qiskit/optimization/algorithms/admm_optimizer.py | Cristian-Malinescu/qiskit-aqua | b29596800447c3130a20ec72a18b7fd8ed9fdb2f | [
"Apache-2.0"
] | null | null | null | qiskit/optimization/algorithms/admm_optimizer.py | Cristian-Malinescu/qiskit-aqua | b29596800447c3130a20ec72a18b7fd8ed9fdb2f | [
"Apache-2.0"
] | null | null | null | qiskit/optimization/algorithms/admm_optimizer.py | Cristian-Malinescu/qiskit-aqua | b29596800447c3130a20ec72a18b7fd8ed9fdb2f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... | 42.292045 | 100 | 0.637961 |
206c47ebc0fdc5a6a9e4a9d94663da5d43e0ab4f | 2,237 | py | Python | code/DNN/dnn_classification-keras.py | Knowledge-Precipitation-Tribe/Neural-network | eac2e66cdde85b34ddf9313ce4d2b123cc1b8be8 | [
"MIT"
] | 3 | 2021-05-25T10:18:23.000Z | 2022-02-09T08:55:14.000Z | code/DNN/dnn_classification-keras.py | Knowledge-Precipitation-Tribe/Neural-network | eac2e66cdde85b34ddf9313ce4d2b123cc1b8be8 | [
"MIT"
] | null | null | null | code/DNN/dnn_classification-keras.py | Knowledge-Precipitation-Tribe/Neural-network | eac2e66cdde85b34ddf9313ce4d2b123cc1b8be8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-#
'''
# Name: dnn_classification-keras
# Description:
# Author: super
# Date: 2020/6/2
'''
from MiniFramework.DataReader_2_0 import *
from keras.models import Sequential
from keras.layers import Dense
import matplotlib.pyplot as plt
import os
os.environ['KMP_DUPLICATE_... | 28.316456 | 99 | 0.675011 |
1a000d88a2cc54e47f4608e2a4b44d6fefafa5d2 | 12,426 | py | Python | samples/train_cancer.py | robvcc/Mask_RCNN_shoe | 67cb95bf931782a166ee8219c5dca41f660aa5a6 | [
"MIT"
] | null | null | null | samples/train_cancer.py | robvcc/Mask_RCNN_shoe | 67cb95bf931782a166ee8219c5dca41f660aa5a6 | [
"MIT"
] | null | null | null | samples/train_cancer.py | robvcc/Mask_RCNN_shoe | 67cb95bf931782a166ee8219c5dca41f660aa5a6 | [
"MIT"
] | null | null | null |
import os
import numpy as np
import cv2
import matplotlib.pyplot as plt
from mrcnn.config import Config
#import utils
from mrcnn import model as modellib
from mrcnn import utils
from mrcnn import visualize
import yaml
from mrcnn.model import log
from PIL import Image
class ShapesConfig(Config):
"""Configuration ... | 40.875 | 123 | 0.601642 |
8203d2474e6c729b07d76277f99a3bc5cf2d0d6e | 47,210 | py | Python | flopy/plot/crosssection.py | emorway-usgs/flopy | 1fa24026d890abc4508a39eddf9049399c1e4d3f | [
"CC0-1.0",
"BSD-3-Clause"
] | 351 | 2015-01-03T15:18:48.000Z | 2022-03-31T09:46:43.000Z | flopy/plot/crosssection.py | emorway-usgs/flopy | 1fa24026d890abc4508a39eddf9049399c1e4d3f | [
"CC0-1.0",
"BSD-3-Clause"
] | 1,256 | 2015-01-15T21:10:42.000Z | 2022-03-31T22:43:06.000Z | flopy/plot/crosssection.py | emorway-usgs/flopy | 1fa24026d890abc4508a39eddf9049399c1e4d3f | [
"CC0-1.0",
"BSD-3-Clause"
] | 553 | 2015-01-31T22:46:48.000Z | 2022-03-31T17:43:35.000Z | import numpy as np
import matplotlib.pyplot as plt
import matplotlib.colors
from matplotlib.patches import Polygon
from . import plotutil
from ..utils import geometry
import copy
import warnings
warnings.simplefilter("always", PendingDeprecationWarning)
class PlotCrossSection:
"""
Class to create a cross ... | 31.515354 | 79 | 0.502245 |
06f0ea901eb9d0c87cc6b5f8a0f42075d0b79213 | 6,044 | py | Python | wbia/viz/interact/interact_qres.py | WildMeOrg/wildbook-ia | a18d57611e5936bea02a964716466e062415aa1a | [
"Apache-2.0"
] | 20 | 2021-01-19T23:17:21.000Z | 2022-03-21T10:25:56.000Z | wbia/viz/interact/interact_qres.py | solomonkimunyu/wildbook-ia | ac433d4f2a47b1d905c421a36c497f787003afc3 | [
"Apache-2.0"
] | 16 | 2021-01-28T23:05:29.000Z | 2022-03-31T20:39:36.000Z | wbia/viz/interact/interact_qres.py | solomonkimunyu/wildbook-ia | ac433d4f2a47b1d905c421a36c497f787003afc3 | [
"Apache-2.0"
] | 9 | 2021-02-13T20:19:46.000Z | 2022-03-29T10:47:11.000Z | # -*- coding: utf-8 -*-
import logging
import utool as ut
import wbia.plottool as pt
from wbia.plottool import plot_helpers as ph
from wbia.plottool import abstract_interaction
from wbia import viz
from wbia.viz.interact.interact_sver import ishow_sver
(print, rrr, profile) = ut.inject2(__name__, '[interact_qres]')
lo... | 35.345029 | 88 | 0.58405 |
a8488f5e4727af056052b884ad58eaed19ccaa8b | 3,934 | py | Python | tests/addons/test_config.py | carver7/supervisor-master | e9802f92c9f77481276ed3c0d524427cc03e4271 | [
"Apache-2.0"
] | null | null | null | tests/addons/test_config.py | carver7/supervisor-master | e9802f92c9f77481276ed3c0d524427cc03e4271 | [
"Apache-2.0"
] | null | null | null | tests/addons/test_config.py | carver7/supervisor-master | e9802f92c9f77481276ed3c0d524427cc03e4271 | [
"Apache-2.0"
] | null | null | null | """Validate Add-on configs."""
import pytest
import voluptuous as vol
from supervisor.addons import validate as vd
from ..common import load_json_fixture
def test_basic_config():
"""Validate basic config and check the default values."""
config = load_json_fixture("basic-addon-config.json")
valid_confi... | 25.057325 | 84 | 0.624555 |
e46778e2334b0fb6582c208a92a587c1a93db058 | 2,884 | py | Python | linear_classifier.py | ashwanikumar04/udacity-mlnd-capstone | f4b067b9f950f5b2d1763b808d296903345577a0 | [
"MIT"
] | 1 | 2019-07-15T17:08:49.000Z | 2019-07-15T17:08:49.000Z | linear_classifier.py | ashwanikumar04/udacity-mlnd-capstone | f4b067b9f950f5b2d1763b808d296903345577a0 | [
"MIT"
] | null | null | null | linear_classifier.py | ashwanikumar04/udacity-mlnd-capstone | f4b067b9f950f5b2d1763b808d296903345577a0 | [
"MIT"
] | 1 | 2020-01-10T05:16:40.000Z | 2020-01-10T05:16:40.000Z | import tensorflow as tf
from helpers import one_hot_encode, get_batch, get_training_set, get_test_set, log
from sklearn.utils import shuffle
class LinearClassifer:
def __init__(self, params, labels, image_size):
self.params = params
self.labels = labels
self.image_size = image_size
de... | 49.724138 | 93 | 0.564147 |
b8728af35d6022f1ab9036d8162c2f4d90db326f | 6,434 | py | Python | contrib/pyminer/pyminer.py | TimMaylon/corecoin | 650b4829e81e51110f0abf13bba0e77d73eb1c07 | [
"MIT"
] | null | null | null | contrib/pyminer/pyminer.py | TimMaylon/corecoin | 650b4829e81e51110f0abf13bba0e77d73eb1c07 | [
"MIT"
] | null | null | null | contrib/pyminer/pyminer.py | TimMaylon/corecoin | 650b4829e81e51110f0abf13bba0e77d73eb1c07 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... | 25.43083 | 84 | 0.664905 |
f4b1987679486f5e35154e82baf63a30d1a703d0 | 6,906 | py | Python | nimbus/fabnet/asyncio_rpc.py | fabregas/nimbusfs-node | 7af3ecc14f78526b477ed29fb9e9b9eb972d6b4e | [
"Apache-2.0"
] | null | null | null | nimbus/fabnet/asyncio_rpc.py | fabregas/nimbusfs-node | 7af3ecc14f78526b477ed29fb9e9b9eb972d6b4e | [
"Apache-2.0"
] | null | null | null | nimbus/fabnet/asyncio_rpc.py | fabregas/nimbusfs-node | 7af3ecc14f78526b477ed29fb9e9b9eb972d6b4e | [
"Apache-2.0"
] | null | null | null | import asyncio
import random
import uuid
import sys
import traceback
import pickle
import inspect
from base64 import b64encode
from hashlib import sha1
from .utils import logger
class TimeoutException(Exception):
pass
class RemoteError(Exception):
pass
def serializable_error(msg):
traceback.print_exc... | 30.157205 | 77 | 0.589343 |
3b66cf9721c9e0b3fef293dbc2e5d11cff77662e | 1,011 | py | Python | tests/test_str.py | uit-cosmo/2d-propagating-blobs | 2c19458a5ba6d0d138461fadf3e935273bee4b5c | [
"MIT"
] | 1 | 2021-10-02T17:58:16.000Z | 2021-10-02T17:58:16.000Z | tests/test_str.py | uit-cosmo/2d_propagating_blobs | 2c19458a5ba6d0d138461fadf3e935273bee4b5c | [
"MIT"
] | 20 | 2021-10-04T10:44:34.000Z | 2022-01-28T15:20:39.000Z | tests/test_str.py | uit-cosmo/2d-propagating-blobs | 2c19458a5ba6d0d138461fadf3e935273bee4b5c | [
"MIT"
] | 1 | 2021-12-06T13:31:58.000Z | 2021-12-06T13:31:58.000Z | import pytest
from blobmodel import Model
from blobmodel.geometry import Geometry
def test_blob_shape_exception():
with pytest.raises(NotImplementedError):
bm = Model(
Nx=2,
Ny=2,
Lx=10,
Ly=10,
dt=0.5,
T=1,
periodic_y=Fals... | 21.0625 | 90 | 0.545994 |
e90b535f739ae9f77823717ce766f80ad9ae27bb | 6,143 | py | Python | week_04/feature_preprocessing.py | MrRozum/DeepLearning_Winter22 | 3bbce7315b342036d6c050e82170fa5d4c4b4993 | [
"MIT"
] | 5 | 2022-02-01T07:25:28.000Z | 2022-02-02T13:58:34.000Z | week_04/feature_preprocessing.py | MrRozum/DeepLearning_Winter22 | 3bbce7315b342036d6c050e82170fa5d4c4b4993 | [
"MIT"
] | 2 | 2021-06-14T21:11:02.000Z | 2021-06-30T20:03:39.000Z | week_04/feature_preprocessing.py | MrRozum/DeepLearning_Winter22 | 3bbce7315b342036d6c050e82170fa5d4c4b4993 | [
"MIT"
] | 8 | 2021-04-07T07:38:20.000Z | 2021-04-24T06:08:01.000Z | import warnings
warnings.filterwarnings("ignore")
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
plt.style.use('ggplot')
import torch
print(torch.__version__)
import torch.nn as nn
import torch.optim as optim
import torch.utils.data as data_utils
from torch.utils.data ... | 32.850267 | 124 | 0.621846 |
46519bdc3adc16e6473b990b3ceab058328351f5 | 2,107 | py | Python | indico/web/forms/fields/protection.py | bpedersen2/indico | 8410ee5f8f8530a8692f3dd2d4015c3074b0aa30 | [
"MIT"
] | 1 | 2021-02-24T10:20:14.000Z | 2021-02-24T10:20:14.000Z | indico/web/forms/fields/protection.py | bpedersen2/indico | 8410ee5f8f8530a8692f3dd2d4015c3074b0aa30 | [
"MIT"
] | 5 | 2021-04-08T19:26:47.000Z | 2022-01-24T16:30:18.000Z | indico/web/forms/fields/protection.py | bpedersen2/indico | 8410ee5f8f8530a8692f3dd2d4015c3074b0aa30 | [
"MIT"
] | 2 | 2019-02-24T17:29:10.000Z | 2021-04-08T19:23:27.000Z | # This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from flask import render_template
from markupsafe import Markup
from indico.core.db import db
from indico... | 45.804348 | 111 | 0.728524 |
0b6073a7cd51dad23173cb33a42118d333820dbb | 7,698 | py | Python | tests/python/Lut1DTransformTest.py | Shrinks99/OpenColorIO | 94ca1fc2f0c0eae3a8678d7fe3c98cfef70f5545 | [
"BSD-3-Clause"
] | null | null | null | tests/python/Lut1DTransformTest.py | Shrinks99/OpenColorIO | 94ca1fc2f0c0eae3a8678d7fe3c98cfef70f5545 | [
"BSD-3-Clause"
] | null | null | null | tests/python/Lut1DTransformTest.py | Shrinks99/OpenColorIO | 94ca1fc2f0c0eae3a8678d7fe3c98cfef70f5545 | [
"BSD-3-Clause"
] | null | null | null | # SPDX-License-Identifier: BSD-3-Clause
# Copyright Contributors to the OpenColorIO Project.
import logging
import unittest
logger = logging.getLogger(__name__)
try:
import numpy as np
except ImportError:
logger.warning(
"NumPy could not be imported. "
"Test case will lack significant coverag... | 35.474654 | 81 | 0.615095 |
82fe853041bb9d462b91a5fbe0e8660c732514db | 8,513 | py | Python | configs/cascade_rcnn_x101_32x4d_fpn_1x.py | eryuehouniao/mmdetection | e80df144aeb2000116f1a8deb98fa4916b1fe5c3 | [
"Apache-2.0"
] | 1 | 2019-10-29T06:45:12.000Z | 2019-10-29T06:45:12.000Z | configs/cascade_rcnn_x101_32x4d_fpn_1x.py | eryuehouniao/mmdetection | e80df144aeb2000116f1a8deb98fa4916b1fe5c3 | [
"Apache-2.0"
] | null | null | null | configs/cascade_rcnn_x101_32x4d_fpn_1x.py | eryuehouniao/mmdetection | e80df144aeb2000116f1a8deb98fa4916b1fe5c3 | [
"Apache-2.0"
] | 1 | 2020-09-24T12:17:55.000Z | 2020-09-24T12:17:55.000Z | # model settings
model = dict(
type='CascadeRCNN',
num_stages=3,
# pretrained='open-mmlab://resnext101_32x4d',
pretrained=None,
backbone=dict(
type='ResNeXt',
depth=101,
groups=32,
base_width=4,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_st... | 32.996124 | 101 | 0.553389 |
7ffbf572ea3d56d9a205e9e1174bb29a3ebae148 | 11,638 | py | Python | tensorqtl/tensorqtl.py | susie-song/tensorqtl | 97d6f26eae9c2d8624214c4e15b52c528e823001 | [
"BSD-3-Clause"
] | null | null | null | tensorqtl/tensorqtl.py | susie-song/tensorqtl | 97d6f26eae9c2d8624214c4e15b52c528e823001 | [
"BSD-3-Clause"
] | null | null | null | tensorqtl/tensorqtl.py | susie-song/tensorqtl | 97d6f26eae9c2d8624214c4e15b52c528e823001 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
from __future__ import print_function
import pandas as pd
import numpy as np
from datetime import datetime
import sys
import os
import argparse
sys.path.insert(1, os.path.dirname(__file__))
from core import *
from post import *
import genotypeio
import cis
import trans
def main():
parser =... | 60.931937 | 190 | 0.653892 |
e115b84c1b43f585764d4356ab8fd6427bb85efd | 292 | py | Python | docs/build/docutils/test/functional/tests/math_output_latex.py | mjtamlyn/django-braces | 8adc9bc4f5139e3d032d4e38657bf86413388b78 | [
"BSD-3-Clause"
] | 1 | 2015-03-22T16:49:07.000Z | 2015-03-22T16:49:07.000Z | docs/build/docutils/test/functional/tests/math_output_latex.py | mjtamlyn/django-braces | 8adc9bc4f5139e3d032d4e38657bf86413388b78 | [
"BSD-3-Clause"
] | null | null | null | docs/build/docutils/test/functional/tests/math_output_latex.py | mjtamlyn/django-braces | 8adc9bc4f5139e3d032d4e38657bf86413388b78 | [
"BSD-3-Clause"
] | null | null | null | # Source and destination file names.
test_source = "data/math.txt"
test_destination = "math_output_latex.html"
# Keyword parameters passed to publish_file.
reader_name = "standalone"
parser_name = "rst"
writer_name = "html"
# Extra setting
settings_overrides['math_output'] = 'latex'
| 20.857143 | 44 | 0.756849 |
5629458ddf65146eec3a0907db863041c0f2409c | 2,775 | py | Python | DQM/TrackingMonitor/python/TrackEfficiencyMonitor_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | DQM/TrackingMonitor/python/TrackEfficiencyMonitor_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | DQM/TrackingMonitor/python/TrackEfficiencyMonitor_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | # The following comments couldn't be translated into the new config version:
# All/OuterSurface/InnerSurface/ImpactPoint/default(track)
#
import FWCore.ParameterSet.Config as cms
from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
TrackEffMon = DQMEDAnalyzer('TrackEfficiencyMonitor',
theRadius = cms.double(... | 28.608247 | 76 | 0.641802 |
b149f7ef4b3a745f29a9235debfd572e21452081 | 2,327 | py | Python | core/api/users/exceptions.py | p-panagiotis/venom | 8544f44b10e95bd3964ddde997cda4169c6d34f0 | [
"MIT"
] | null | null | null | core/api/users/exceptions.py | p-panagiotis/venom | 8544f44b10e95bd3964ddde997cda4169c6d34f0 | [
"MIT"
] | null | null | null | core/api/users/exceptions.py | p-panagiotis/venom | 8544f44b10e95bd3964ddde997cda4169c6d34f0 | [
"MIT"
] | null | null | null | from core.venom import messages
class UserUsernameAlreadyInUseException(Exception):
def __init__(self, username):
self.detail = messages["core.api.users.username_already_in_use"] % username
super(UserUsernameAlreadyInUseException, self).__init__(self.detail)
class UserEmailAlreadyInUseException... | 35.8 | 117 | 0.768801 |
8d07b918502535d6126720d9f9bf2e28d8b9f6c5 | 5,247 | py | Python | neurom/apps/cli.py | musicinmybrain/NeuroM | 76b8c557b81d4189b6c04598e62af3a1a67bebfd | [
"BSD-3-Clause"
] | null | null | null | neurom/apps/cli.py | musicinmybrain/NeuroM | 76b8c557b81d4189b6c04598e62af3a1a67bebfd | [
"BSD-3-Clause"
] | null | null | null | neurom/apps/cli.py | musicinmybrain/NeuroM | 76b8c557b81d4189b6c04598e62af3a1a67bebfd | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2015, Ecole Polytechnique Federale de Lausanne, Blue Brain Project
# All rights reserved.
#
# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | 49.037383 | 94 | 0.693539 |
4654c770f2c695e38705046ada12231ddcd3ecce | 799 | py | Python | python/validParentheses.py | guozengxin/myleetcode | ed7ab4f716845646cf164a08f03ea342f60b14e1 | [
"MIT"
] | null | null | null | python/validParentheses.py | guozengxin/myleetcode | ed7ab4f716845646cf164a08f03ea342f60b14e1 | [
"MIT"
] | null | null | null | python/validParentheses.py | guozengxin/myleetcode | ed7ab4f716845646cf164a08f03ea342f60b14e1 | [
"MIT"
] | null | null | null | class Solution(object):
def isValid(self, s):
"""
:type s: str
:rtype: bool
"""
if len(s) & 1 != 0:
return False
stack = []
mymap = {'}':'{', ']':'[', ')': '('}
for c in s:
if c == '[' or c == '(' or c == '{':
s... | 21.594595 | 48 | 0.34418 |
181ead5f6730bd5224515626f5af0e4f6b490413 | 13,057 | py | Python | dev_nb/nb_002.py | gurvindersingh/fastai_v1 | 18c6170f7fa852f6f24c03badb1bdb03f40c5be9 | [
"Apache-2.0"
] | null | null | null | dev_nb/nb_002.py | gurvindersingh/fastai_v1 | 18c6170f7fa852f6f24c03badb1bdb03f40c5be9 | [
"Apache-2.0"
] | null | null | null | dev_nb/nb_002.py | gurvindersingh/fastai_v1 | 18c6170f7fa852f6f24c03badb1bdb03f40c5be9 | [
"Apache-2.0"
] | null | null | null |
#################################################
### THIS FILE WAS AUTOGENERATED! DO NOT EDIT! ###
#################################################
from nb_001b import *
import sys, PIL, matplotlib.pyplot as plt, itertools, math, random, collections, torch
import scipy.stats, scipy.special
... | 34.002604 | 108 | 0.618059 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.