hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | 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 245 | max_issues_repo_name stringlengths 6 130 | 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 245 | max_forks_repo_name stringlengths 6 130 | 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 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f70ae444d51b1c010b6a015103dbd35afc54919e | 1,352 | py | Python | python/old/hiddenBlock.py | BenOsborn/Cerci | 5785ae0c9db8a88a5ac8d91aed29cdf0c0c7854a | [
"Apache-2.0"
] | null | null | null | python/old/hiddenBlock.py | BenOsborn/Cerci | 5785ae0c9db8a88a5ac8d91aed29cdf0c0c7854a | [
"Apache-2.0"
] | null | null | null | python/old/hiddenBlock.py | BenOsborn/Cerci | 5785ae0c9db8a88a5ac8d91aed29cdf0c0c7854a | [
"Apache-2.0"
] | null | null | null | from resources import relu, learnFunc, dot
class HiddenBlock:
def __init__(self, weights, bias):
self.weights = weights
self.bias = bias
def feedForward(self, hidden_inputs):
output = [
relu(
dot(hidden_inputs, weights) + self.bias
)
for... | 33.8 | 85 | 0.579882 | from resources import relu, learnFunc, dot
class HiddenBlock:
def __init__(self, weights, bias):
self.weights = weights
self.bias = bias
def feedForward(self, hidden_inputs):
output = [
relu(
dot(hidden_inputs, weights) + self.bias
)
for... | true | true |
f70ae5186d99b2365c6e21842c72a147f0715710 | 9,285 | py | Python | tests/tensorflow/test_tensorflow_model_export.py | 0wu/mlflow | 2b5a21af05defcfa80255c081b5d9f07443f3f64 | [
"Apache-2.0"
] | null | null | null | tests/tensorflow/test_tensorflow_model_export.py | 0wu/mlflow | 2b5a21af05defcfa80255c081b5d9f07443f3f64 | [
"Apache-2.0"
] | null | null | null | tests/tensorflow/test_tensorflow_model_export.py | 0wu/mlflow | 2b5a21af05defcfa80255c081b5d9f07443f3f64 | [
"Apache-2.0"
] | null | null | null | # pep8: disable=E501
from __future__ import print_function
import collections
import os
import pandas
import shutil
import unittest
import pandas as pd
import sklearn.datasets as datasets
import tensorflow as tf
from mlflow import tensorflow, pyfunc
from mlflow import tracking
from mlflow.utils.file_utils import Te... | 49.919355 | 99 | 0.566505 |
from __future__ import print_function
import collections
import os
import pandas
import shutil
import unittest
import pandas as pd
import sklearn.datasets as datasets
import tensorflow as tf
from mlflow import tensorflow, pyfunc
from mlflow import tracking
from mlflow.utils.file_utils import TempDir
class TestMo... | true | true |
f70ae55504722915015de818a6e0d47a6ddfbf80 | 4,881 | py | Python | test/functional/wallet_import_with_label.py | natangl/refnet | 59c1f1cdae3d79b1c6756185fe8051bd656f1e49 | [
"MIT"
] | null | null | null | test/functional/wallet_import_with_label.py | natangl/refnet | 59c1f1cdae3d79b1c6756185fe8051bd656f1e49 | [
"MIT"
] | null | null | null | test/functional/wallet_import_with_label.py | natangl/refnet | 59c1f1cdae3d79b1c6756185fe8051bd656f1e49 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018 The Refnet Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the behavior of RPC importprivkey on set and unset labels of
addresses.
It tests different cases in whi... | 35.889706 | 85 | 0.589224 |
from test_framework.test_framework import RefnetTestFramework
from test_framework.wallet_util import test_address
class ImportWithLabel(RefnetTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.setup_clean_chain = True
def skip_test_if_missing_module(self):
self.sk... | true | true |
f70ae599068c451f51ac29a3025118f4af8d1413 | 2,139 | py | Python | g_function_weak_coupling/G_function.py | helene-todd/XPPAUT_code | e4caf112c03889a68eed0f4e5fa9d9d436918914 | [
"MIT"
] | null | null | null | g_function_weak_coupling/G_function.py | helene-todd/XPPAUT_code | e4caf112c03889a68eed0f4e5fa9d9d436918914 | [
"MIT"
] | null | null | null | g_function_weak_coupling/G_function.py | helene-todd/XPPAUT_code | e4caf112c03889a68eed0f4e5fa9d9d436918914 | [
"MIT"
] | null | null | null | from matplotlib import cm, rcParams
import matplotlib.pyplot as plt
import numpy as np
import math as math
import random as rand
""" G(phi) function in Rinzel & Lewis' article (2003) under weak coupling """
""" This is under weak coupling theory, although one can note that gamma only serves to scale the function """
... | 25.464286 | 164 | 0.635344 | from matplotlib import cm, rcParams
import matplotlib.pyplot as plt
import numpy as np
import math as math
import random as rand
c = ['#aa3863', '#d97020', '#ef9f07', '#449775', '#3b7d86']
rcParams.update({'figure.autolayout': True})
def T(I):
return math.log(I/(I-1))
def G(phi, I, gamma):
if phi != 0 and p... | true | true |
f70ae60535808681e6fb238519e5687bcd959b2c | 1,086 | py | Python | exoplanet/theano_ops/starry/base_op.py | Junjun1guo/exoplanet | 5df07b16cf7f8770f02fa53598ae3961021cfd0f | [
"MIT"
] | 2 | 2020-05-29T07:10:48.000Z | 2021-04-07T06:43:53.000Z | exoplanet/theano_ops/starry/base_op.py | Junjun1guo/exoplanet | 5df07b16cf7f8770f02fa53598ae3961021cfd0f | [
"MIT"
] | null | null | null | exoplanet/theano_ops/starry/base_op.py | Junjun1guo/exoplanet | 5df07b16cf7f8770f02fa53598ae3961021cfd0f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import division, print_function
__all__ = ["StarryBaseOp"]
import pkg_resources
from theano import gof
from ..build_utils import get_compile_args, get_cache_version
class StarryBaseOp(gof.COp):
__props__ = ()
func_file = None
func_name = None
def __init__... | 26.487805 | 74 | 0.634438 |
from __future__ import division, print_function
__all__ = ["StarryBaseOp"]
import pkg_resources
from theano import gof
from ..build_utils import get_compile_args, get_cache_version
class StarryBaseOp(gof.COp):
__props__ = ()
func_file = None
func_name = None
def __init__(self):
super(S... | true | true |
f70ae64b1876509c4ce63dc278cd4d9e00c288bd | 293 | py | Python | fileopener.py | PiSaucer/jumpcutter | 3b5c723b3b70244471c26345c3bd686bf445b25b | [
"MIT"
] | null | null | null | fileopener.py | PiSaucer/jumpcutter | 3b5c723b3b70244471c26345c3bd686bf445b25b | [
"MIT"
] | null | null | null | fileopener.py | PiSaucer/jumpcutter | 3b5c723b3b70244471c26345c3bd686bf445b25b | [
"MIT"
] | null | null | null | from tkinter import *
from tkinter.filedialog import askopenfilename
import time
Tk().withdraw() # we don't want a full GUI, so keep the root window from appearing
filename = askopenfilename() # show an "Open" dialog box and return the path to the selected file
print(filename)
time.sleep(1)
| 32.555556 | 97 | 0.774744 | from tkinter import *
from tkinter.filedialog import askopenfilename
import time
Tk().withdraw()
filename = askopenfilename() # show an "Open" dialog box and return the path to the selected file
print(filename)
time.sleep(1)
| true | true |
f70ae6e8124f0eeef44e323640c73e9d0141dc7c | 4,098 | py | Python | run_analyst.py | nevertheless-ui/TelegramData_Analyst | 6c7b33560a2b8b26bce99c9a82efa6b4796d5828 | [
"MIT"
] | null | null | null | run_analyst.py | nevertheless-ui/TelegramData_Analyst | 6c7b33560a2b8b26bce99c9a82efa6b4796d5828 | [
"MIT"
] | null | null | null | run_analyst.py | nevertheless-ui/TelegramData_Analyst | 6c7b33560a2b8b26bce99c9a82efa6b4796d5828 | [
"MIT"
] | null | null | null | # Filename: analyst.py
"""Analyst is a tool to look up (and export selected) data and insights
from exported data from chats and channels in Telegram
using Python and PyQt5."""
import sys
import pandas as pd
from pathlib import Path
from PyQt5 import QtWidgets, QtCore
from PyQt5 import uic
from backend import (
... | 31.523077 | 92 | 0.678136 |
import sys
import pandas as pd
from pathlib import Path
from PyQt5 import QtWidgets, QtCore
from PyQt5 import uic
from backend import (
converter,
handler,
)
__version__ = '0.1'
__author__ = 'Artyom Filippenko'
df = pd.DataFrame({'a': ['Mary', 'Jim', 'John'],
'b': [100, 200, 300],
... | true | true |
f70ae90ab76967c88f0a8aa21711c21e46566272 | 2,516 | py | Python | tests/1_local/test_ping.py | kpimparkar/cloudmesh-cloud | cb5ec6c2c8e5eb8c41a697cb67e72183808adb64 | [
"Apache-2.0"
] | null | null | null | tests/1_local/test_ping.py | kpimparkar/cloudmesh-cloud | cb5ec6c2c8e5eb8c41a697cb67e72183808adb64 | [
"Apache-2.0"
] | null | null | null | tests/1_local/test_ping.py | kpimparkar/cloudmesh-cloud | cb5ec6c2c8e5eb8c41a697cb67e72183808adb64 | [
"Apache-2.0"
] | null | null | null | ###############################################################
# pytest -v --capture=no tests/1_local/test_name.py
# pytest -v tests/1_local/test_name.py
# pytest -v --capture=no tests/1_local/test_name.py:Test_name.<METHIDNAME>
###############################################################
import pytest
from clou... | 29.6 | 75 | 0.521463 | true | true | |
f70ae99dd663fc32f1c74a2e029d50b8365dd95c | 3,993 | py | Python | tlib/networks/VGGnet_train.py | shallowyuan/cosegmentor-crf | c84a9418b70f3f3c7c6a7e998de5835182619f30 | [
"BSD-2-Clause"
] | null | null | null | tlib/networks/VGGnet_train.py | shallowyuan/cosegmentor-crf | c84a9418b70f3f3c7c6a7e998de5835182619f30 | [
"BSD-2-Clause"
] | null | null | null | tlib/networks/VGGnet_train.py | shallowyuan/cosegmentor-crf | c84a9418b70f3f3c7c6a7e998de5835182619f30 | [
"BSD-2-Clause"
] | null | null | null | import tensorflow as tf
from networks.network import Network
#define
n_classes = 21
_feat_stride = [16,]
anchor_scales = [8, 16, 32]
class VGGnet_train(Network):
def __init__(self, trainable=True):
self.inputs = []
self.data = tf.placeholder(tf.float32, shape=[None, None, None, 3])
#self... | 40.744898 | 147 | 0.539194 | import tensorflow as tf
from networks.network import Network
n_classes = 21
_feat_stride = [16,]
anchor_scales = [8, 16, 32]
class VGGnet_train(Network):
def __init__(self, trainable=True):
self.inputs = []
self.data = tf.placeholder(tf.float32, shape=[None, None, None, 3])
... | true | true |
f70aea4b89b68eac3f7c8bada0d6ff77a9ea5c18 | 1,575 | py | Python | algorithms/pattern_matching/kmp.py | rrwt/daily-coding-challenge | b16fc365fd142ebab429e605cb146c8bb0bc97a2 | [
"MIT"
] | 1 | 2019-04-18T03:29:02.000Z | 2019-04-18T03:29:02.000Z | algorithms/pattern_matching/kmp.py | rrwt/daily-coding-challenge | b16fc365fd142ebab429e605cb146c8bb0bc97a2 | [
"MIT"
] | null | null | null | algorithms/pattern_matching/kmp.py | rrwt/daily-coding-challenge | b16fc365fd142ebab429e605cb146c8bb0bc97a2 | [
"MIT"
] | null | null | null | """
KMP pattern matching algorithm.
Finds matching patterns in text in linear time.
Text: A longer string of length n. (n > m)
Pattern: Substring to be searched for of length m.
Works by precompiling the pattern string to create a LPS string array.
LPS: Longest Proper Prefix. Longest prefix string that is also a suffix... | 25.403226 | 76 | 0.526349 |
def compute_lps(pattern: str, m: int) -> list:
lps = [0] * m
i, j = 1, 0
while i < m:
if pattern[i] == pattern[j]:
j += 1
lps[i] = j
i += 1
else:
if j > 0:
j = lps[j - 1]
else:
... | true | true |
f70aebfd8d72e36ce7a654aef6710e7290e9ca98 | 602 | py | Python | pyapple/interface/exceptions.py | fxrcha/PyApple | 6f1336c63583204d4b2b723dd1de8d1895e42430 | [
"MIT"
] | 13 | 2021-02-21T04:16:40.000Z | 2022-03-21T23:34:18.000Z | pyapple/interface/exceptions.py | fxrcha/PyApple | 6f1336c63583204d4b2b723dd1de8d1895e42430 | [
"MIT"
] | null | null | null | pyapple/interface/exceptions.py | fxrcha/PyApple | 6f1336c63583204d4b2b723dd1de8d1895e42430 | [
"MIT"
] | 4 | 2021-02-21T04:16:42.000Z | 2021-03-13T00:22:42.000Z | class HTTPException(Exception):
"""
Exception which happens when HTTP status code is not 200 (OK).
"""
def __init__(self, code, url) -> None:
self.error = f"While requesting to {url}, request returned status {code}."
def __str__(self) -> str:
return self.error
class NoCatalogResu... | 26.173913 | 82 | 0.641196 | class HTTPException(Exception):
def __init__(self, code, url) -> None:
self.error = f"While requesting to {url}, request returned status {code}."
def __str__(self) -> str:
return self.error
class NoCatalogResult(Exception):
def __init__(self, product_id) -> None:
self.error = f"... | true | true |
f70aec16628b9cde66e6d82f41b5f6d38354523d | 1,451 | py | Python | mongo_connector/constants.py | hannelita/mongo-connector | 3df79c656b11bc8f540b42e0a4604bb71a1e2434 | [
"Apache-2.0"
] | 15 | 2015-01-06T08:10:21.000Z | 2017-03-12T23:06:43.000Z | mongo_connector/constants.py | hannelita/mongo-connector | 3df79c656b11bc8f540b42e0a4604bb71a1e2434 | [
"Apache-2.0"
] | 16 | 2015-03-11T09:28:33.000Z | 2016-03-06T14:45:54.000Z | mongo_connector/constants.py | hannelita/mongo-connector | 3df79c656b11bc8f540b42e0a4604bb71a1e2434 | [
"Apache-2.0"
] | 13 | 2015-03-21T13:39:10.000Z | 2022-03-14T11:50:24.000Z | # Copyright 2013-2014 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 33.744186 | 77 | 0.772571 |
= None
DEFAULT_SYSLOG_HOST = "localhost:512"
DEFAULT_SYSLOG_FACILITY = "user"
DEFAULT_LOGFILE_WHEN = "midnight"
DEFAULT_LOGFILE_INTERVAL = 1
DEFAULT_LOGFILE_BACKUPCOUNT = 7
| true | true |
f70aec762062680c5259cfb5eb77332eb404d8dd | 4,433 | py | Python | mcpython/common/state/ui/UIPartScrollBar.py | mcpython4-coding/core | 8698efe93f5a25421bfa508d769d8fdc8e9ce24c | [
"CC0-1.0",
"MIT"
] | 2 | 2019-11-02T05:26:11.000Z | 2019-11-03T08:52:18.000Z | mcpython/common/state/ui/UIPartScrollBar.py | mcpython4-coding/core | 8698efe93f5a25421bfa508d769d8fdc8e9ce24c | [
"CC0-1.0",
"MIT"
] | 25 | 2019-11-02T05:24:29.000Z | 2022-02-09T14:09:08.000Z | mcpython/common/state/ui/UIPartScrollBar.py | mcpython4-coding/core | 8698efe93f5a25421bfa508d769d8fdc8e9ce24c | [
"CC0-1.0",
"MIT"
] | 5 | 2019-11-09T05:36:06.000Z | 2021-11-28T13:07:08.000Z | """
mcpython - a minecraft clone written in python licenced under the MIT-licence
(https://github.com/mcpython4-coding/core)
Contributors: uuk, xkcdjerry (inactive)
Based on the game of fogleman (https://github.com/fogleman/Minecraft), licenced under the MIT-licence
Original game "minecraft" by Mojang Studios (www.m... | 34.364341 | 103 | 0.653508 | import asyncio
import mcpython.engine.ResourceLoader
import mcpython.util.texture
import PIL.Image
import pyglet
from mcpython.engine.rendering.RenderingLayerManager import MIDDLE_GROUND
from mcpython.util.annotation import onlyInClient
from pyglet.window import mouse
from .AbstractUIPart import AbstractUIPart
IMAGE... | true | true |
f70aed7ed6e1e8d9c85bf0f6c2447a7ce378f443 | 18,439 | py | Python | inb/linkedin/settings.py | JoshiAyush/linkedin-bot | f333218678ab6bc468644dca50aec684b4e29bde | [
"MIT"
] | 2 | 2021-05-30T07:03:31.000Z | 2021-06-03T03:00:31.000Z | inb/linkedin/settings.py | JoshiAyush/linkedin-bot | f333218678ab6bc468644dca50aec684b4e29bde | [
"MIT"
] | 3 | 2021-05-28T10:32:03.000Z | 2021-06-18T09:45:21.000Z | inb/linkedin/settings.py | JoshiAyush/linkedin-bot | f333218678ab6bc468644dca50aec684b4e29bde | [
"MIT"
] | 1 | 2021-03-22T16:01:40.000Z | 2021-03-22T16:01:40.000Z | # Copyright 2021, joshiayus Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... | 37.940329 | 130 | 0.719996 |
import re
import os
import sys
import click
import pathlib
import logging
import subprocess
from urllib import (request, parse)
try:
from gettext import gettext as _
except ImportError:
_ = lambda msg: msg
CONNECTION_LIMIT_EXCEED_EXCEPTION_MESSAGE = """Invalid connection limit %d.
... | true | true |
f70aee199c5545672cba5de1ccc8222cc8715ead | 6,272 | py | Python | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/types/feed_item_service.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/types/feed_item_service.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/types/feed_item_service.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 31.837563 | 112 | 0.656888 |
import proto
from google.ads.googleads.v7.enums.types import response_content_type as gage_response_content_type
from google.ads.googleads.v7.resources.types import feed_item as gagr_feed_item
from google.protobuf import field_mask_pb2
from google.rpc import status_pb2
__protobuf__ = proto.modul... | true | true |
f70aeeecd3129be0699bbccd47f8bc33eb31ff00 | 13,131 | py | Python | Thesis@3.9.1/Lib/site-packages/setuptools/_distutils/command/config.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | null | null | null | Thesis@3.9.1/Lib/site-packages/setuptools/_distutils/command/config.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | null | null | null | Thesis@3.9.1/Lib/site-packages/setuptools/_distutils/command/config.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | null | null | null | """distutils.command.config
Implements the Distutils 'config' command, a (mostly) empty command class
that exists mainly to be sub-classed by specific module distributions and
applications. The idea is that while every "config" command is different,
at least they're all named the same, and users always see "config" i... | 34.830239 | 88 | 0.596527 |
import os, re
from distutils.core import Command
from distutils.errors import DistutilsExecError
from distutils.sysconfig import customize_compiler
from distutils import log
LANG_EXT = {"c": ".c", "c++": ".cxx"}
class config(Command):
description = "prepare to build"
user_options = [
("compiler="... | true | true |
f70aef653d2ef3b2e8701681f111cc6df59eb702 | 407 | py | Python | packages/python/plotly/plotly/validators/splom/_hoverinfosrc.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/splom/_hoverinfosrc.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/splom/_hoverinfosrc.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class HoverinfosrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="hoverinfosrc", parent_name="splom", **kwargs):
super(HoverinfosrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | 33.916667 | 82 | 0.68059 | import _plotly_utils.basevalidators
class HoverinfosrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="hoverinfosrc", parent_name="splom", **kwargs):
super(HoverinfosrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | true | true |
f70af01d82997fdd5c275f0119e776bc23bc6b61 | 1,730 | py | Python | local_image.py | EnterpriseWS/visitor_badge | 98593be190af299148068598b7074c4105a7d20e | [
"MIT"
] | null | null | null | local_image.py | EnterpriseWS/visitor_badge | 98593be190af299148068598b7074c4105a7d20e | [
"MIT"
] | null | null | null | local_image.py | EnterpriseWS/visitor_badge | 98593be190af299148068598b7074c4105a7d20e | [
"MIT"
] | null | null | null | from PIL import Image
from datetime import datetime
import sys
import base64
from io import BytesIO
import platform
import urllib.parse
IMG_FOLDER = ''
if platform.system() == 'Linux':
IMG_FOLDER = 'images/'
elif platform.system() == 'Windows':
IMG_FOLDER = '.\\images\\'
def get_base64_image(filename: str = ... | 35.306122 | 83 | 0.554913 | from PIL import Image
from datetime import datetime
import sys
import base64
from io import BytesIO
import platform
import urllib.parse
IMG_FOLDER = ''
if platform.system() == 'Linux':
IMG_FOLDER = 'images/'
elif platform.system() == 'Windows':
IMG_FOLDER = '.\\images\\'
def get_base64_image(filename: str = ... | true | true |
f70af03c0b36276c0b4f3b78e7ca52a6c4bd0075 | 3,242 | py | Python | br_record.py | purplewish07/pybrother | fe94d95ae90c677a72a82e2a3c7a602f3f16803f | [
"Unlicense"
] | null | null | null | br_record.py | purplewish07/pybrother | fe94d95ae90c677a72a82e2a3c7a602f3f16803f | [
"Unlicense"
] | null | null | null | br_record.py | purplewish07/pybrother | fe94d95ae90c677a72a82e2a3c7a602f3f16803f | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------
# Date: 2021/01/06
# Author: Shaun
# 檔案功能描述:
# 自動抓取機台狀態,更新資料庫,配合bash腳本,寫入系統排程crontab -e
# -------------------------------------------------------------------
import socket
# import pymysql
... | 31.784314 | 124 | 0.546885 |
import socket
import os
import time
from datetime import datetime
cnc_config = [('cnc46', "192.168.3.46")]
def get_from_brother(ip='127.0.0.1', port=10000):
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.settimeout(10)
try:
client.connect((ip, port))
instruct = ... | true | true |
f70af04d64e25ed6b095196a829ad2d2f12abde2 | 35,753 | py | Python | mermaid/forward_models.py | HastingsGreer/mermaid | bd13c5fc427eb8cd9054973a8eaaeb302078182d | [
"Apache-2.0"
] | 120 | 2019-10-29T23:53:02.000Z | 2022-03-30T02:59:58.000Z | mermaid/forward_models.py | HastingsGreer/mermaid | bd13c5fc427eb8cd9054973a8eaaeb302078182d | [
"Apache-2.0"
] | 10 | 2019-11-05T09:28:35.000Z | 2022-01-09T19:12:51.000Z | mermaid/forward_models.py | HastingsGreer/mermaid | bd13c5fc427eb8cd9054973a8eaaeb302078182d | [
"Apache-2.0"
] | 19 | 2019-11-10T13:34:39.000Z | 2022-03-13T20:30:10.000Z | """
Package defining various dynamic forward models as well as convenience methods to generate the
right hand sides (RHS) of the related partial differential equations.
Currently, the following forward models are implemented:
#. An advection equation for images
#. An advection equation for maps
#. The EPDi... | 40.17191 | 176 | 0.609795 | from __future__ import print_function
from __future__ import absolute_import
from builtins import range
from builtins import object
from abc import ABCMeta, abstractmethod
import numpy as np
from . import finite_differences_multi_channel as fdm
from . import utils
from .data_wrapper import MyTensor
from future.utils i... | true | true |
f70af051aa8623d4b8e4b7eaf375f8307bb9bfdb | 3,988 | py | Python | stackdriver_log_formatter/formatter.py | tmshn/python-stackdriver-formatter | 7cb424283cae47a56a2e4f0c98cb654e6c819bf6 | [
"MIT"
] | 2 | 2020-03-13T06:07:35.000Z | 2020-07-02T13:24:44.000Z | stackdriver_log_formatter/formatter.py | tmshn/python-stackdriver-formatter | 7cb424283cae47a56a2e4f0c98cb654e6c819bf6 | [
"MIT"
] | 9 | 2019-08-13T10:00:07.000Z | 2019-08-13T10:11:24.000Z | stackdriver_log_formatter/formatter.py | tmshn/python-stackdriver-formatter | 7cb424283cae47a56a2e4f0c98cb654e6c819bf6 | [
"MIT"
] | null | null | null | from collections.abc import Mapping
from datetime import datetime
import logging
from typing import Optional
from stackdriver_log_formatter.serializer import DefaultFunc, dumps
class StackdriverLogFormatter(logging.Formatter):
"""Log formatter suitable for Stackdriver Logging.
This formatter print log as a ... | 34.982456 | 93 | 0.604313 | from collections.abc import Mapping
from datetime import datetime
import logging
from typing import Optional
from stackdriver_log_formatter.serializer import DefaultFunc, dumps
class StackdriverLogFormatter(logging.Formatter):
DATE_FORMAT = '%Y-%m-%dT%H:%M:%S.%fZ'
def __init__(self, *, default: DefaultFunc=... | true | true |
f70af54400dc4d7f00f926ece3a5f21098a359e1 | 3,841 | py | Python | Redis/owlbot.py | chingor13/google-cloud-php | b110b4b6d354d2a74674ce3a63d619f3f14e84a2 | [
"Apache-2.0"
] | 411 | 2016-09-02T15:39:15.000Z | 2018-09-20T15:15:20.000Z | Redis/owlbot.py | chingor13/google-cloud-php | b110b4b6d354d2a74674ce3a63d619f3f14e84a2 | [
"Apache-2.0"
] | 786 | 2016-08-23T01:22:16.000Z | 2018-09-20T19:26:41.000Z | Redis/owlbot.py | chingor13/google-cloud-php | b110b4b6d354d2a74674ce3a63d619f3f14e84a2 | [
"Apache-2.0"
] | 182 | 2016-08-23T13:29:37.000Z | 2018-09-20T17:27:06.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... | 30.484127 | 122 | 0.643582 |
import logging
from pathlib import Path
import subprocess
import synthtool as s
from synthtool.languages import php
from synthtool import _tracked_paths
logging.basicConfig(level=logging.DEBUG)
src = Path(f"../{php.STAGING_DIR}/Redis").resolve()
dest = Path().resolve()
_tracked_paths.add(src)
php.o... | true | true |
f70af59cb50cd0fd6732b83ac04eb6a2a19b41d6 | 902 | py | Python | car_detection.py | jitendrasb24/Car-Detection-OpenCV | 92a68158bde3ae6168d09b38a6301af4362425ec | [
"MIT"
] | 1 | 2021-07-30T21:58:26.000Z | 2021-07-30T21:58:26.000Z | car_detection.py | jitendrasb24/Car-Detection-OpenCV | 92a68158bde3ae6168d09b38a6301af4362425ec | [
"MIT"
] | null | null | null | car_detection.py | jitendrasb24/Car-Detection-OpenCV | 92a68158bde3ae6168d09b38a6301af4362425ec | [
"MIT"
] | null | null | null | #import libraries of python opencv
import cv2
# capture video/ video path
cap = cv2.VideoCapture('cars.mp4')
#use trained cars XML classifiers
car_cascade = cv2.CascadeClassifier('haarcascade_cars.xml')
#read until video is completed
while True:
#capture frame by frame
ret, frame = cap.read()
#convert ... | 23.736842 | 59 | 0.672949 |
import cv2
cap = cv2.VideoCapture('cars.mp4')
car_cascade = cv2.CascadeClassifier('haarcascade_cars.xml')
while True:
ret, frame = cap.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cars = car_cascade.detectMultiScale(gray, 1.1, 3)
for (x,y,w,h) in cars:
... | true | true |
f70af5dc5a014d27ac2dd0ca237b6c9fbe2e74e4 | 573 | py | Python | asgi_websub/hub.py | Kludex/fastapi-websub | 1e109545e9ae26f9e36f10252ed321c41053224e | [
"MIT"
] | 1 | 2021-02-10T13:01:17.000Z | 2021-02-10T13:01:17.000Z | asgi_websub/hub.py | Kludex/fastapi-websub | 1e109545e9ae26f9e36f10252ed321c41053224e | [
"MIT"
] | null | null | null | asgi_websub/hub.py | Kludex/fastapi-websub | 1e109545e9ae26f9e36f10252ed321c41053224e | [
"MIT"
] | null | null | null | """
A WebSub Hub is an implementation that handles subscription requests and distributes
the content to subscribers when the corresponding topic URL has been updated. Hubs
MUST support subscription requests with a secret and deliver
[authenticated requests](https://www.w3.org/TR/websub/#authenticated-content-distributi... | 40.928571 | 90 | 0.799302 |
class Hub:
...
| true | true |
f70af7721a9f5b84af3224a3f8ec3e5b86a4b268 | 3,268 | py | Python | tests/unit_tests/test_notice.py | i8enn/aiovertica | 508c5a6a7b05e618c290271f404dee5e41c1d9a7 | [
"Apache-2.0"
] | 1 | 2021-11-29T10:23:42.000Z | 2021-11-29T10:23:42.000Z | tests/unit_tests/test_notice.py | i8enn/aiovertica | 508c5a6a7b05e618c290271f404dee5e41c1d9a7 | [
"Apache-2.0"
] | null | null | null | tests/unit_tests/test_notice.py | i8enn/aiovertica | 508c5a6a7b05e618c290271f404dee5e41c1d9a7 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019-2021 Micro Focus or one of its affiliates.
#
# 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 applic... | 40.345679 | 126 | 0.687576 |
from __future__ import print_function, division, absolute_import
import mock
from .base import VerticaPythonUnitTestCase
from aiovertica.messages import NoticeResponse
from aiovertica.errors import QueryError
class NoticeTestCase(VerticaPythonUnitTestCase):
SAMPLE_DATA = {b'S': 'FATAL',
... | true | true |
f70af7796f844e524d5d7ecb7ec6b3b1df6ca720 | 4,888 | py | Python | rl_games/common/segment_tree.py | NikitaRdn/rl_games | 50d9a460f8ba41de5dbac4abed04f8de9b849f4f | [
"MIT"
] | 193 | 2019-05-28T01:48:56.000Z | 2022-03-31T07:56:37.000Z | rl_games/common/segment_tree.py | NikitaRdn/rl_games | 50d9a460f8ba41de5dbac4abed04f8de9b849f4f | [
"MIT"
] | 35 | 2020-01-28T22:15:51.000Z | 2022-03-28T22:10:54.000Z | rl_games/common/segment_tree.py | NikitaRdn/rl_games | 50d9a460f8ba41de5dbac4abed04f8de9b849f4f | [
"MIT"
] | 37 | 2019-06-28T01:09:53.000Z | 2022-03-26T09:14:06.000Z | import operator
class SegmentTree(object):
def __init__(self, capacity, operation, neutral_element):
"""Build a Segment Tree data structure.
https://en.wikipedia.org/wiki/Segment_tree
Can be used as regular array, but with two
important differences:
a) setting item's va... | 36.207407 | 109 | 0.557488 | import operator
class SegmentTree(object):
def __init__(self, capacity, operation, neutral_element):
assert capacity > 0 and capacity & (capacity - 1) == 0, "capacity must be positive and a power of 2."
self._capacity = capacity
self._value = [neutral_element for _ in range(2 * capacity)]
... | true | true |
f70af7f247a2d22961c36fe039a604db4f490235 | 10,146 | py | Python | tests/integration/verify/v2/service/rate_limit/test_bucket.py | BrimmingDev/twilio-python | 3226b5fed92b3c2ce64f03e6b19fc4792ef7647f | [
"MIT"
] | 1,362 | 2015-01-04T10:25:18.000Z | 2022-03-24T10:07:08.000Z | tests/integration/verify/v2/service/rate_limit/test_bucket.py | BrimmingDev/twilio-python | 3226b5fed92b3c2ce64f03e6b19fc4792ef7647f | [
"MIT"
] | 299 | 2015-01-30T09:52:39.000Z | 2022-03-31T23:03:02.000Z | tests/integration/verify/v2/service/rate_limit/test_bucket.py | BrimmingDev/twilio-python | 3226b5fed92b3c2ce64f03e6b19fc4792ef7647f | [
"MIT"
] | 622 | 2015-01-03T04:43:09.000Z | 2022-03-29T14:11:00.000Z | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class BucketTestCase(Integratio... | 44.113043 | 194 | 0.583974 |
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class BucketTestCase(IntegrationTestCase):
def test_create_request(self):
self.holodeck.mock(Response(500, ''))
with self.assert... | true | true |
f70af9e0821e905487a6177fe9cec05be0014885 | 701 | py | Python | com/puzzlesolver/cross_over.py | bekirduran/AI_Puzzle_Solver | 7e8c007802d1e4596dd09edd97bafeb7a4ff7f61 | [
"MIT"
] | null | null | null | com/puzzlesolver/cross_over.py | bekirduran/AI_Puzzle_Solver | 7e8c007802d1e4596dd09edd97bafeb7a4ff7f61 | [
"MIT"
] | null | null | null | com/puzzlesolver/cross_over.py | bekirduran/AI_Puzzle_Solver | 7e8c007802d1e4596dd09edd97bafeb7a4ff7f61 | [
"MIT"
] | null | null | null | import numpy as np
# This class generating new list item given first of list item row and second of list item row
class Crossover:
@staticmethod
def crossover(best):
row_begin_index = 0
row_half = 2
cross_list = []
for i in range(len(best) - 1):
first_part1 = best... | 29.208333 | 94 | 0.621969 | import numpy as np
class Crossover:
@staticmethod
def crossover(best):
row_begin_index = 0
row_half = 2
cross_list = []
for i in range(len(best) - 1):
first_part1 = best[i][row_begin_index:row_half, :]
first_part2 = best[i + 1][row_half:, :]
... | true | true |
f70af9fd28bd05e69268c8b7a15da6da05539c50 | 2,299 | py | Python | handlers/commandInfo.py | secondfry/school21-randomcoffee | 261b8d562d02b5a79b12603e0b74c90289523408 | [
"MIT"
] | 3 | 2021-02-28T12:00:26.000Z | 2021-03-14T03:00:42.000Z | handlers/commandInfo.py | secondfry/school21-randomcoffee | 261b8d562d02b5a79b12603e0b74c90289523408 | [
"MIT"
] | null | null | null | handlers/commandInfo.py | secondfry/school21-randomcoffee | 261b8d562d02b5a79b12603e0b74c90289523408 | [
"MIT"
] | null | null | null | from typing import Dict, Any
from telegram import Update, ParseMode
from telegram.ext import CallbackContext
from config.constants import (
USER_DATA_V1_SETTINGS_CAMPUS,
USER_DATA_V1_SETTINGS_ONLINE,
USER_DATA_V1_INTRA_LOGIN,
USER_DATA_V1_INTRA_CAMPUS,
USER_DATA_V1_SETTINGS_ACTIVE,
USER_DATA_V... | 28.382716 | 115 | 0.676816 | from typing import Dict, Any
from telegram import Update, ParseMode
from telegram.ext import CallbackContext
from config.constants import (
USER_DATA_V1_SETTINGS_CAMPUS,
USER_DATA_V1_SETTINGS_ONLINE,
USER_DATA_V1_INTRA_LOGIN,
USER_DATA_V1_INTRA_CAMPUS,
USER_DATA_V1_SETTINGS_ACTIVE,
USER_DATA_V... | true | true |
f70afa56a030c0bd6f0835494dee2ed74f7dff35 | 3,337 | py | Python | src/gui.py | ksern94/six-percent | a3eb637d72d47f396945a4488222d63ae93df53d | [
"MIT"
] | 1 | 2020-10-17T08:56:41.000Z | 2020-10-17T08:56:41.000Z | src/gui.py | ksern94/six-percent | a3eb637d72d47f396945a4488222d63ae93df53d | [
"MIT"
] | null | null | null | src/gui.py | ksern94/six-percent | a3eb637d72d47f396945a4488222d63ae93df53d | [
"MIT"
] | null | null | null | import logging
import os
import re
import sys
from typing import Any, Dict
import PySimpleGUI as sg # type: ignore
from PySimpleGUI.PySimpleGUI import Column # type: ignore
from .utils.encryption import encrypt_password, generate_key
logger = logging.getLogger(__name__)
def login_gui() -> Dict[str, Any]:
sg.... | 34.05102 | 169 | 0.596943 | import logging
import os
import re
import sys
from typing import Any, Dict
import PySimpleGUI as sg
from PySimpleGUI.PySimpleGUI import Column
from .utils.encryption import encrypt_password, generate_key
logger = logging.getLogger(__name__)
def login_gui() -> Dict[str, Any]:
sg.theme('DarkTeal12')
def... | true | true |
f70afac02a6128129ed13868fbdec50f32f336fa | 1,077 | py | Python | src/cards.py | tylernickr/cribbage | 04d594c2c9fcc2faf96f17bfa3d75b76b9ee36f8 | [
"MIT"
] | null | null | null | src/cards.py | tylernickr/cribbage | 04d594c2c9fcc2faf96f17bfa3d75b76b9ee36f8 | [
"MIT"
] | null | null | null | src/cards.py | tylernickr/cribbage | 04d594c2c9fcc2faf96f17bfa3d75b76b9ee36f8 | [
"MIT"
] | null | null | null | from random import shuffle
class Deck(object):
CARD_VALUES = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K']
CARD_SUITS = ['H', 'D', 'S', 'C']
@staticmethod
def get_shuffled_deck():
deck = Deck()
deck.shuffle()
return deck
def __init__(self):
se... | 22.914894 | 93 | 0.559889 | from random import shuffle
class Deck(object):
CARD_VALUES = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K']
CARD_SUITS = ['H', 'D', 'S', 'C']
@staticmethod
def get_shuffled_deck():
deck = Deck()
deck.shuffle()
return deck
def __init__(self):
se... | true | true |
f70afaf5df169b83dcb2c1b6ed171ffa8616d273 | 5,747 | py | Python | tensorflow/python/compiler/tensorrt/test/trt_mode_test.py | huonw/tensorflow | 85f47254af7cc230a4a031998dffe770b7edbb9d | [
"Apache-2.0"
] | 1 | 2020-10-01T16:52:51.000Z | 2020-10-01T16:52:51.000Z | tensorflow/python/compiler/tensorrt/test/trt_mode_test.py | huonw/tensorflow | 85f47254af7cc230a4a031998dffe770b7edbb9d | [
"Apache-2.0"
] | 1 | 2022-02-10T01:08:48.000Z | 2022-02-10T01:08:48.000Z | tensorflow/python/compiler/tensorrt/test/trt_mode_test.py | huonw/tensorflow | 85f47254af7cc230a4a031998dffe770b7edbb9d | [
"Apache-2.0"
] | null | null | null | # 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... | 35.257669 | 93 | 0.712894 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from unittest import SkipTest
from tensorflow.compiler.tf2tensorrt.wrap_py_utils import get_linked_tensorrt_version
from tensorflow.python.compiler.tensorrt.test import tf_trt_integration_test... | true | true |
f70afc2cecdad59dc581cd68886b60f4e9f9968e | 870 | py | Python | ax/modelbridge/numpy.py | mpolson64/Ax-1 | cf9e12cc1253efe0fc893f2620e99337e0927a26 | [
"MIT"
] | 1 | 2022-02-10T10:51:40.000Z | 2022-02-10T10:51:40.000Z | ax/modelbridge/numpy.py | mpolson64/Ax-1 | cf9e12cc1253efe0fc893f2620e99337e0927a26 | [
"MIT"
] | null | null | null | ax/modelbridge/numpy.py | mpolson64/Ax-1 | cf9e12cc1253efe0fc893f2620e99337e0927a26 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import List
from ax.modelbridge.array import ArrayModelBridge
from ax.models.numpy_base import NumpyMode... | 31.071429 | 73 | 0.757471 |
from typing import List
from ax.modelbridge.array import ArrayModelBridge
from ax.models.numpy_base import NumpyModel
class NumpyModelBridge(ArrayModelBridge):
model: NumpyModel
outcomes: List[str]
parameters: List[str]
| true | true |
f70afc3ff1c2e6df15de3340a6c530b958a903f9 | 26,367 | py | Python | src/transformers/training_args.py | hlahkar/transformers | c19d04623eacfbc2c452397a5eda0fde42db3fc5 | [
"Apache-2.0"
] | null | null | null | src/transformers/training_args.py | hlahkar/transformers | c19d04623eacfbc2c452397a5eda0fde42db3fc5 | [
"Apache-2.0"
] | null | null | null | src/transformers/training_args.py | hlahkar/transformers | c19d04623eacfbc2c452397a5eda0fde42db3fc5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 49.009294 | 142 | 0.64668 |
import dataclasses
import json
import os
from dataclasses import dataclass, field
from enum import Enum
from typing import Any, Dict, List, Optional, Tuple
from .file_utils import cached_property, is_torch_available, is_torch_tpu_available, torch_required
from .trainer_utils import EvaluationStrategy
fro... | true | true |
f70afc80da633e56f080f73b9d417cce0188dc99 | 4,232 | py | Python | influxdb_client/domain/variable_assignment.py | rhajek/influxdb-client-python | 852e6f1b1161df4d67eabc19cdb6b323a46b88e2 | [
"MIT"
] | null | null | null | influxdb_client/domain/variable_assignment.py | rhajek/influxdb-client-python | 852e6f1b1161df4d67eabc19cdb6b323a46b88e2 | [
"MIT"
] | null | null | null | influxdb_client/domain/variable_assignment.py | rhajek/influxdb-client-python | 852e6f1b1161df4d67eabc19cdb6b323a46b88e2 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Influx API Service
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: 0.1.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class Vari... | 25.341317 | 124 | 0.548204 |
import pprint
import re
import six
class VariableAssignment(object):
openapi_types = {
'type': 'str',
'id': 'Identifier',
'init': 'Expression'
}
attribute_map = {
'type': 'type',
'id': 'id',
'init': 'init'
}
def __init__(self, type=None, id... | true | true |
f70afe6072a76e5fe93f7e3e26275edc78dfaba1 | 784 | py | Python | main/zlib/template.py | ismith/cports | 9fe76e231872e0b03b425252b5fc5e1d9af2a6d8 | [
"BSD-2-Clause"
] | null | null | null | main/zlib/template.py | ismith/cports | 9fe76e231872e0b03b425252b5fc5e1d9af2a6d8 | [
"BSD-2-Clause"
] | null | null | null | main/zlib/template.py | ismith/cports | 9fe76e231872e0b03b425252b5fc5e1d9af2a6d8 | [
"BSD-2-Clause"
] | null | null | null | pkgname = "zlib"
version = "1.2.11"
revision = 0
build_style = "configure"
short_desc = "Compression/decompression Library"
maintainer = "q66 <q66@chimera-linux.org>"
license = "Zlib"
homepage = "http://www.zlib.net"
distfiles = [f"{homepage}/{pkgname}-{version}.tar.gz"]
checksum = ["c3e5e9fdd5004dcb542feda5ee4f0ff0744... | 25.290323 | 79 | 0.640306 | pkgname = "zlib"
version = "1.2.11"
revision = 0
build_style = "configure"
short_desc = "Compression/decompression Library"
maintainer = "q66 <q66@chimera-linux.org>"
license = "Zlib"
homepage = "http://www.zlib.net"
distfiles = [f"{homepage}/{pkgname}-{version}.tar.gz"]
checksum = ["c3e5e9fdd5004dcb542feda5ee4f0ff0744... | true | true |
f70afe9d202280156e80d97bbe01c5a86d7add8a | 154 | py | Python | tests/test_nba_py_shotchart.py | evanmjohnson/nba-awards-predictor | 33fbf48252bc7b85c5e406be13e957988c418182 | [
"BSD-3-Clause"
] | 1,189 | 2015-08-25T22:51:49.000Z | 2022-03-25T06:29:04.000Z | tests/test_nba_py_shotchart.py | calestini/nba_py | ffeaf4251d796ff9313367a752a45a0d7b16489e | [
"BSD-3-Clause"
] | 111 | 2015-08-28T15:41:10.000Z | 2021-05-17T11:12:04.000Z | tests/test_nba_py_shotchart.py | calestini/nba_py | ffeaf4251d796ff9313367a752a45a0d7b16489e | [
"BSD-3-Clause"
] | 377 | 2015-08-26T00:35:07.000Z | 2022-02-07T18:29:33.000Z | from nba_py import shotchart
from nba_py.player import get_player
def test():
pid = get_player('Kevin', 'Durant')
assert shotchart.ShotChart(pid) | 25.666667 | 39 | 0.746753 | from nba_py import shotchart
from nba_py.player import get_player
def test():
pid = get_player('Kevin', 'Durant')
assert shotchart.ShotChart(pid) | true | true |
f70b001653854db2cd84ceba965fb48abc9e0a5c | 18,327 | py | Python | wagtail/wagtailusers/tests.py | jordij/wagtail | d4259e133b80d5648266db181029dfbe0fbcf885 | [
"BSD-3-Clause"
] | null | null | null | wagtail/wagtailusers/tests.py | jordij/wagtail | d4259e133b80d5648266db181029dfbe0fbcf885 | [
"BSD-3-Clause"
] | null | null | null | wagtail/wagtailusers/tests.py | jordij/wagtail | d4259e133b80d5648266db181029dfbe0fbcf885 | [
"BSD-3-Clause"
] | 1 | 2019-02-04T13:57:39.000Z | 2019-02-04T13:57:39.000Z | from __future__ import unicode_literals
import unittest
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, Permission
from django.utils import six
from wagtail.tests.utils import WagtailTestUtils
f... | 41.938215 | 134 | 0.6569 | from __future__ import unicode_literals
import unittest
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, Permission
from django.utils import six
from wagtail.tests.utils import WagtailTestUtils
f... | true | true |
f70b00541c568010e818a7b67bc34d90385cc984 | 148 | py | Python | tasks.py | mtkennerly/clingy | 39454bcf535127ee80ca3e9fb1580dfefcb8aad9 | [
"MIT"
] | 1 | 2017-03-24T09:19:18.000Z | 2017-03-24T09:19:18.000Z | tasks.py | mtkennerly/clingy | 39454bcf535127ee80ca3e9fb1580dfefcb8aad9 | [
"MIT"
] | null | null | null | tasks.py | mtkennerly/clingy | 39454bcf535127ee80ca3e9fb1580dfefcb8aad9 | [
"MIT"
] | null | null | null | from invoke import task
@task
def dist(context):
context.run("python setup.py bdist_wheel")
@task
def test(context):
context.run("tox")
| 12.333333 | 46 | 0.695946 | from invoke import task
@task
def dist(context):
context.run("python setup.py bdist_wheel")
@task
def test(context):
context.run("tox")
| true | true |
f70b0072f7dbff073d399e1d6359799fc8a20bd0 | 23,970 | py | Python | cmake/external/tvm/python/tvm/relay/op/nn/nn.py | fushwLZU/onnxruntime_test | 7ee82dde9150dc0d3014c06a82eabdecb989f2f3 | [
"MIT"
] | 2 | 2020-06-24T03:16:34.000Z | 2020-06-24T03:16:36.000Z | cmake/external/tvm/python/tvm/relay/op/nn/nn.py | fushwLZU/onnxruntime_test | 7ee82dde9150dc0d3014c06a82eabdecb989f2f3 | [
"MIT"
] | 4 | 2020-12-04T21:00:38.000Z | 2022-01-22T12:49:30.000Z | cmake/external/tvm/python/tvm/relay/op/nn/nn.py | fushwLZU/onnxruntime_test | 7ee82dde9150dc0d3014c06a82eabdecb989f2f3 | [
"MIT"
] | 1 | 2019-09-20T07:05:27.000Z | 2019-09-20T07:05:27.000Z | """Neural network operations."""
from __future__ import absolute_import as _abs
from ...expr import TupleWrapper
from . import _make
def conv2d(data,
weight,
strides=(1, 1),
padding=(0, 0),
dilation=(1, 1),
groups=1,
channels=None,
kernel_si... | 27.839721 | 93 | 0.591197 | from __future__ import absolute_import as _abs
from ...expr import TupleWrapper
from . import _make
def conv2d(data,
weight,
strides=(1, 1),
padding=(0, 0),
dilation=(1, 1),
groups=1,
channels=None,
kernel_size=None,
data_layout="... | true | true |
f70b00d468378a77011e80dc65f27686941deebd | 820 | py | Python | tests/test_parser_leaf_html.py | sthagen/python-artichoke_growth | 4d96d8bf63234248352dd10a3fb99c35d8312661 | [
"MIT"
] | 1 | 2020-07-16T17:29:06.000Z | 2020-07-16T17:29:06.000Z | tests/test_parser_leaf_html.py | sthagen/python-artichoke_growth | 4d96d8bf63234248352dd10a3fb99c35d8312661 | [
"MIT"
] | 17 | 2020-07-16T17:07:07.000Z | 2020-12-06T16:36:23.000Z | tests/test_parser_leaf_html.py | sthagen/python-artichoke_growth | 4d96d8bf63234248352dd10a3fb99c35d8312661 | [
"MIT"
] | null | null | null | import pathlib
from bs4 import BeautifulSoup
HTML_LEAF_PAGE_SAMPLE_PATH = pathlib.Path('tests', 'fixtures', 'html', 'leaf_page_sample.html')
HTML_TEXT = ''
def setup():
global HTML_TEXT
with open(HTML_LEAF_PAGE_SAMPLE_PATH, "rt", encoding="utf-8") as handle:
HTML_TEXT = handle.read()
def teardown()... | 24.848485 | 95 | 0.590244 | import pathlib
from bs4 import BeautifulSoup
HTML_LEAF_PAGE_SAMPLE_PATH = pathlib.Path('tests', 'fixtures', 'html', 'leaf_page_sample.html')
HTML_TEXT = ''
def setup():
global HTML_TEXT
with open(HTML_LEAF_PAGE_SAMPLE_PATH, "rt", encoding="utf-8") as handle:
HTML_TEXT = handle.read()
def teardown()... | true | true |
f70b0188a275a756a3c5e6d61a896aefc90b9b12 | 835 | py | Python | mysite/polls/models.py | 3ng7n33r/DjangoTutorial | 0885d3d9468292c0bf81f5a5fd508fae2c1a482c | [
"MIT"
] | 40 | 2018-02-06T09:16:18.000Z | 2022-03-27T14:56:24.000Z | mysite/polls/models.py | 3ng7n33r/DjangoTutorial | 0885d3d9468292c0bf81f5a5fd508fae2c1a482c | [
"MIT"
] | 12 | 2019-08-06T01:56:51.000Z | 2022-02-10T09:14:43.000Z | mysite/polls/models.py | 3ng7n33r/DjangoTutorial | 0885d3d9468292c0bf81f5a5fd508fae2c1a482c | [
"MIT"
] | 35 | 2018-06-05T20:27:21.000Z | 2022-02-23T12:05:40.000Z | import datetime
from django.db import models
from django.utils import timezone
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
def __str__(self):
return self.question_text
def was_published_recently(self):
... | 28.793103 | 71 | 0.736527 | import datetime
from django.db import models
from django.utils import timezone
class Question(models.Model):
question_text = models.CharField(max_length=200)
pub_date = models.DateTimeField('date published')
def __str__(self):
return self.question_text
def was_published_recently(self):
... | true | true |
f70b035def2ff8729c21add34a0315c29add3dcb | 1,251 | py | Python | PyGame-Tutorials/tut06.py | AnubhavMadhav/PyGames | d35ac2c8140bdae1b2bf2f6dca057b3b461d11c8 | [
"Apache-2.0"
] | 5 | 2020-06-04T11:48:09.000Z | 2020-11-29T08:33:42.000Z | PyGame-Tutorials/tut06.py | AnubhavMadhav/PyGames | d35ac2c8140bdae1b2bf2f6dca057b3b461d11c8 | [
"Apache-2.0"
] | null | null | null | PyGame-Tutorials/tut06.py | AnubhavMadhav/PyGames | d35ac2c8140bdae1b2bf2f6dca057b3b461d11c8 | [
"Apache-2.0"
] | null | null | null | '''
Coding our First Game in PyGame
-
Creating Ground for Snakes
'''
import pygame
pygame.init()
# print(x) # All 6 pygame modules successfully imported
# Colors
white = (255, 255, 255)
red = (255, 0, 0)
black = (0, 0, 0)
# Creating Game Window
screen_width = 900
screen_height = 600
gameWindow = pygame... | 28.431818 | 173 | 0.650679 |
import pygame
pygame.init()
black = (0, 0, 0)
screen_width = 900
screen_height = 600
gameWindow = pygame.display.set_mode((screen_width, screen_height))
pygame.display.set_caption("Snake - by Anubhav Madhav")
pygame.display.update()
exit_game = False
game_over... | true | true |
f70b03c8718a2d81744520d6a0d9e0abea8b40a2 | 124 | py | Python | Florence/FiniteElements/Assembly/__init__.py | jdlaubrie/florence | 830dca4a34be00d6e53cbec3007c10d438b27f57 | [
"MIT"
] | 65 | 2017-08-04T10:21:13.000Z | 2022-02-21T21:45:09.000Z | Florence/FiniteElements/Assembly/__init__.py | jdlaubrie/florence | 830dca4a34be00d6e53cbec3007c10d438b27f57 | [
"MIT"
] | 6 | 2018-06-03T02:29:20.000Z | 2022-01-18T02:30:22.000Z | Florence/FiniteElements/Assembly/__init__.py | jdlaubrie/florence | 830dca4a34be00d6e53cbec3007c10d438b27f57 | [
"MIT"
] | 10 | 2018-05-30T09:44:10.000Z | 2021-05-18T08:06:51.000Z | from .Assembly import Assemble, AssembleForces, AssembleInternalTractionForces, AssembleExplicit, AssembleMass, AssembleForm | 124 | 124 | 0.887097 | from .Assembly import Assemble, AssembleForces, AssembleInternalTractionForces, AssembleExplicit, AssembleMass, AssembleForm | true | true |
f70b056c1b447b1d1d2392ed2df978ee7b7e61f4 | 7,455 | py | Python | prog/python/python tuto/Pygame-Zero/pacman2/pacman2.py | gribdesbois/prog-backup | a394a392d32c550caf97119456aec1546bc8fbe1 | [
"MIT"
] | null | null | null | prog/python/python tuto/Pygame-Zero/pacman2/pacman2.py | gribdesbois/prog-backup | a394a392d32c550caf97119456aec1546bc8fbe1 | [
"MIT"
] | null | null | null | prog/python/python tuto/Pygame-Zero/pacman2/pacman2.py | gribdesbois/prog-backup | a394a392d32c550caf97119456aec1546bc8fbe1 | [
"MIT"
] | null | null | null | import pgzrun
import gameinput
import gamemaps
from random import randint
from datetime import datetime
WIDTH = 600
HEIGHT = 660
player = Actor("pacman_o") # Load in the player Actor image
player.score = 0
player.lives = 3
level = 0
SPEED = 3
def draw(): # Pygame Zero draw function
global pacDots, player
scre... | 32.272727 | 180 | 0.535882 | import pgzrun
import gameinput
import gamemaps
from random import randint
from datetime import datetime
WIDTH = 600
HEIGHT = 660
player = Actor("pacman_o")
player.score = 0
player.lives = 3
level = 0
SPEED = 3
def draw():
global pacDots, player
screen.blit('header', (0, 0))
screen.blit('colourmap', (0, ... | true | true |
f70b06132039891cd3318917fc783ba4c170086b | 697 | py | Python | examples/example_function_order.py | leandroltavares/pylint-plus | f3ad1a5470f4a99438b39f72a9f4ae690399b08c | [
"MIT"
] | null | null | null | examples/example_function_order.py | leandroltavares/pylint-plus | f3ad1a5470f4a99438b39f72a9f4ae690399b08c | [
"MIT"
] | null | null | null | examples/example_function_order.py | leandroltavares/pylint-plus | f3ad1a5470f4a99438b39f72a9f4ae690399b08c | [
"MIT"
] | null | null | null | #pylint: disable=missing-module-docstring,missing-function-docstring,missing-class-docstring,no-self-use,too-few-public-methods
def first(): # First should be defined after second, too keep call order
pass
def second():
first()
class Example:
def first(self): # First should be defined after second, to... | 23.233333 | 127 | 0.657102 |
def first():
pass
def second():
first()
class Example:
def first(self):
pass
def second(self):
self.first()
def before(self):
self.after()
def after(self):
pass
class ExampleInner:
def outer(self):
def inner():
pass
... | true | true |
f70b061d2606ca0be36e23f56f65b717929eb470 | 104 | py | Python | calculator/__init__.py | goncalovalverde/seshat | deff5cdd985f81ac2b4ebd077eea11f7c4f4118f | [
"MIT"
] | 1 | 2020-12-22T13:23:00.000Z | 2020-12-22T13:23:00.000Z | calculator/__init__.py | goncalovalverde/seshat | deff5cdd985f81ac2b4ebd077eea11f7c4f4118f | [
"MIT"
] | 5 | 2020-12-22T13:36:30.000Z | 2021-02-27T05:42:18.000Z | calculator/__init__.py | goncalovalverde/seshat | deff5cdd985f81ac2b4ebd077eea11f7c4f4118f | [
"MIT"
] | null | null | null | import logging
class Calculator(object):
def __init__(self, config):
self.config = config
| 14.857143 | 31 | 0.682692 | import logging
class Calculator(object):
def __init__(self, config):
self.config = config
| true | true |
f70b0657a109c516768a303f19153456024b4d50 | 3,686 | py | Python | tests/conftest.py | datdinhquoc/flask_jsondash | 124f5739aebb39c4d36d27a57acb1a32df95a51d | [
"MIT"
] | 3,503 | 2016-08-25T19:57:33.000Z | 2022-03-31T20:04:37.000Z | tests/conftest.py | datdinhquoc/flask_jsondash | 124f5739aebb39c4d36d27a57acb1a32df95a51d | [
"MIT"
] | 203 | 2016-05-06T18:01:12.000Z | 2022-03-23T09:05:28.000Z | tests/conftest.py | datdinhquoc/flask_jsondash | 124f5739aebb39c4d36d27a57acb1a32df95a51d | [
"MIT"
] | 350 | 2016-08-30T10:29:57.000Z | 2022-02-02T17:59:41.000Z | import json
import os
import pytest
from flask import Flask, url_for
from pyquery import PyQuery as pq
from flask_jsondash import charts_builder, utils
from flask_jsondash import db
URL_BASE = 'http://127.0.0.1:80'
app = Flask('test_flask_jsondash',
template_folder='../flask_jsondash/example_app/templat... | 24.091503 | 75 | 0.616658 | import json
import os
import pytest
from flask import Flask, url_for
from pyquery import PyQuery as pq
from flask_jsondash import charts_builder, utils
from flask_jsondash import db
URL_BASE = 'http://127.0.0.1:80'
app = Flask('test_flask_jsondash',
template_folder='../flask_jsondash/example_app/templat... | true | true |
f70b06873d5edf44d17aafe0818fcc3b08d0f79f | 1,866 | py | Python | sam-app-py/tests/unit/test_handler.py | abhinavDhulipala/SAM-URL | 2edaaf11f5baa0153e6ee943635c5d86a55cd84f | [
"MIT"
] | 1 | 2021-04-07T02:44:29.000Z | 2021-04-07T02:44:29.000Z | sam-app-py/tests/unit/test_handler.py | abhinavDhulipala/SAM-URL | 2edaaf11f5baa0153e6ee943635c5d86a55cd84f | [
"MIT"
] | null | null | null | sam-app-py/tests/unit/test_handler.py | abhinavDhulipala/SAM-URL | 2edaaf11f5baa0153e6ee943635c5d86a55cd84f | [
"MIT"
] | null | null | null | import json
import pytest
import os
import sys
abs_path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(f'{abs_path}/../..')
sys.path.append(f'{abs_path}/../../..')
print(sys.path[-1])
from moto import mock_dynamodb2
from redirect_handler import app
import boto_utils
from constants import TABLE_NAME
import... | 29.619048 | 117 | 0.595927 | import json
import pytest
import os
import sys
abs_path = os.path.dirname(os.path.abspath(__file__))
sys.path.append(f'{abs_path}/../..')
sys.path.append(f'{abs_path}/../../..')
print(sys.path[-1])
from moto import mock_dynamodb2
from redirect_handler import app
import boto_utils
from constants import TABLE_NAME
import... | true | true |
f70b0689e2b44f236e300dba244ccadd6bdde193 | 4,551 | py | Python | test method/tensorflow2.0/deep-sort-yolov4/demo.py | vedanthpadigelwar/AI_projects | 885bbe76800f9a449414b3735ab4a4c4bd2e7aa0 | [
"MIT"
] | null | null | null | test method/tensorflow2.0/deep-sort-yolov4/demo.py | vedanthpadigelwar/AI_projects | 885bbe76800f9a449414b3735ab4a4c4bd2e7aa0 | [
"MIT"
] | null | null | null | test method/tensorflow2.0/deep-sort-yolov4/demo.py | vedanthpadigelwar/AI_projects | 885bbe76800f9a449414b3735ab4a4c4bd2e7aa0 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function, absolute_import
from timeit import time
import warnings
import cv2
import numpy as np
from PIL import Image
from yolo import YOLO
from deep_sort import preprocessing
from deep_sort import nn_matching
from deep_sort.detect... | 30.34 | 105 | 0.587124 |
from __future__ import division, print_function, absolute_import
from timeit import time
import warnings
import cv2
import numpy as np
from PIL import Image
from yolo import YOLO
from deep_sort import preprocessing
from deep_sort import nn_matching
from deep_sort.detection import Detection
from deep_sort.detection... | true | true |
f70b07204b98d80e64ad1e1deb637e4254ae138a | 1,331 | py | Python | var/spack/repos/builtin/packages/py-mypy/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2020-09-02T08:41:39.000Z | 2020-09-02T08:41:39.000Z | var/spack/repos/builtin/packages/py-mypy/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 25 | 2021-02-08T14:39:48.000Z | 2022-03-21T18:37:29.000Z | var/spack/repos/builtin/packages/py-mypy/package.py | LiamBindle/spack | e90d5ad6cfff2ba3de7b537d6511adccd9d5fcf1 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 7 | 2018-09-13T18:04:56.000Z | 2020-03-18T20:52:06.000Z | # Copyright 2013-2021 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 PyMypy(PythonPackage):
"""Optional static typing for Python."""
homepage = "http://ww... | 45.896552 | 97 | 0.730278 |
from spack import *
class PyMypy(PythonPackage):
homepage = "http://www.mypy-lang.org/"
pypi = "mypy/mypy-0.740.tar.gz"
version('0.910', sha256='704098302473cb31a218f1775a873b376b30b4c18229421e9e9dc8916fd16150')
version('0.900', sha256='65c78570329c54fb40f956f7645e2359af5da9d8c54baa44f461cdc7f4... | true | true |
f70b076d6e55129ea6d8cf88397c36dbdcabc138 | 3,122 | py | Python | superset/models/schedules.py | EikotheRookie/incubator-superset-xzf | 5d167afb9499d7ce30c7ea763b19993af347dc23 | [
"Apache-2.0"
] | 1 | 2020-06-25T14:30:12.000Z | 2020-06-25T14:30:12.000Z | superset/models/schedules.py | EikotheRookie/incubator-superset-xzf | 5d167afb9499d7ce30c7ea763b19993af347dc23 | [
"Apache-2.0"
] | 49 | 2021-06-08T22:27:53.000Z | 2022-03-28T15:59:51.000Z | superset/models/schedules.py | hixio-mh/incubator-superset | 7b7e097325fa8f6f785fe15b83f39e922025022f | [
"Apache-2.0"
] | 2 | 2019-07-19T09:34:24.000Z | 2019-09-20T10:02:04.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... | 32.863158 | 85 | 0.744395 |
import enum
from typing import Optional, Type
from flask_appbuilder import Model
from sqlalchemy import Boolean, Column, Enum, ForeignKey, Integer, String, Text
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.orm import relationship
from superset import security_manager
from super... | true | true |
f70b07933f8381b9d635ee33b267d6a4228698c7 | 3,662 | py | Python | ebay_accounts/trading_api.py | luke-dixon/django-ebay-accounts | 54cf0e90b75dfbdd63bcd588f3c4771ebe1297c0 | [
"BSD-3-Clause"
] | 4 | 2018-01-28T20:10:11.000Z | 2020-09-06T14:30:36.000Z | ebay_accounts/trading_api.py | luke-dixon/django-ebay-accounts | 54cf0e90b75dfbdd63bcd588f3c4771ebe1297c0 | [
"BSD-3-Clause"
] | 7 | 2017-06-04T08:50:06.000Z | 2020-09-06T16:03:53.000Z | ebay_accounts/trading_api.py | luke-dixon/django-ebay-accounts | 54cf0e90b75dfbdd63bcd588f3c4771ebe1297c0 | [
"BSD-3-Clause"
] | 7 | 2017-06-01T09:51:35.000Z | 2021-05-25T16:01:53.000Z | # -*- coding: utf-8 -*-
"""
Ebay Trading API
"""
import xmltodict
import requests
from . import app_settings as settings
class TradingAPIWarning(Exception):
pass
class TradingAPIFailure(Exception):
pass
class TradingAPIInvalidResponse(Exception):
pass
class TradingAPI(object):
_last_response = ... | 35.211538 | 77 | 0.648553 |
import xmltodict
import requests
from . import app_settings as settings
class TradingAPIWarning(Exception):
pass
class TradingAPIFailure(Exception):
pass
class TradingAPIInvalidResponse(Exception):
pass
class TradingAPI(object):
_last_response = None
def __init__(self, production=False, s... | true | true |
f70b081736313ab52d82208c2436e124a1ec7ba4 | 2,555 | py | Python | tests/cli/test_keyboard.py | RasaHQ/taipo | 0a0488a591362eca44a7a315cf38f44393b8d209 | [
"MIT"
] | 28 | 2021-06-16T14:08:10.000Z | 2022-03-25T13:26:29.000Z | tests/cli/test_keyboard.py | RasaHQ/taipo | 0a0488a591362eca44a7a315cf38f44393b8d209 | [
"MIT"
] | 16 | 2021-06-29T17:13:48.000Z | 2021-12-13T17:22:13.000Z | tests/cli/test_keyboard.py | RasaHQ/taipo | 0a0488a591362eca44a7a315cf38f44393b8d209 | [
"MIT"
] | 6 | 2021-07-06T17:34:43.000Z | 2022-03-11T10:50:00.000Z | import pathlib
import re
import pytest
from typer.testing import CliRunner
from taipo.__main__ import app
from taipo.common import nlu_path_to_dataframe
runner = CliRunner()
@pytest.mark.parametrize(
"path_in,path_out", [("nlu.yml", "nlu.yml"), ("foobar.yml", "foobar.yml")]
)
def test_keyboard_augment(tmp_path... | 30.058824 | 78 | 0.630137 | import pathlib
import re
import pytest
from typer.testing import CliRunner
from taipo.__main__ import app
from taipo.common import nlu_path_to_dataframe
runner = CliRunner()
@pytest.mark.parametrize(
"path_in,path_out", [("nlu.yml", "nlu.yml"), ("foobar.yml", "foobar.yml")]
)
def test_keyboard_augment(tmp_path... | true | true |
f70b087afb7bff339fcd596ca2064c38ebd2b923 | 7,044 | py | Python | scirpy/tests/test_util.py | ktpolanski/scirpy | 2d6e3a6347ad54425a8dea635fa04609aaf33c57 | [
"BSD-3-Clause"
] | null | null | null | scirpy/tests/test_util.py | ktpolanski/scirpy | 2d6e3a6347ad54425a8dea635fa04609aaf33c57 | [
"BSD-3-Clause"
] | null | null | null | scirpy/tests/test_util.py | ktpolanski/scirpy | 2d6e3a6347ad54425a8dea635fa04609aaf33c57 | [
"BSD-3-Clause"
] | null | null | null | from scirpy.util import (
_is_na,
_is_false,
_is_true,
_normalize_counts,
_is_symmetric,
_reduce_nonzero,
_translate_dna_to_protein,
)
from scirpy.util.graph import layout_components
from itertools import combinations
import igraph as ig
import numpy as np
import pandas as pd
import numpy.te... | 32.611111 | 87 | 0.667376 | from scirpy.util import (
_is_na,
_is_false,
_is_true,
_normalize_counts,
_is_symmetric,
_reduce_nonzero,
_translate_dna_to_protein,
)
from scirpy.util.graph import layout_components
from itertools import combinations
import igraph as ig
import numpy as np
import pandas as pd
import numpy.te... | true | true |
f70b09221802c961e0b9d4fb231642054bff3534 | 3,096 | py | Python | fryptos/main.py | pyohei/encryptfile | 988fa0b2f57c6482d71a81dba3e65ee0ff084048 | [
"MIT"
] | null | null | null | fryptos/main.py | pyohei/encryptfile | 988fa0b2f57c6482d71a81dba3e65ee0ff084048 | [
"MIT"
] | null | null | null | fryptos/main.py | pyohei/encryptfile | 988fa0b2f57c6482d71a81dba3e65ee0ff084048 | [
"MIT"
] | null | null | null | """File path encryption.
Put files to public directory by encryption.
And this anchers of relationship.
This module anable change the anchers.
"""
import glob
import logging
import os
import shutil
try:
from . import filename
from .anchor.anchor import Anchor
except:
import filename
from anchor.anchor ... | 29.207547 | 90 | 0.645995 | import glob
import logging
import os
import shutil
try:
from . import filename
from .anchor.anchor import Anchor
except:
import filename
from anchor.anchor import Anchor
def main(src, dst):
anchor = Anchor('text')
for org_f in _read_files(src):
cur_f = anchor.request_current_path(... | true | true |
f70b0a9a919f5f4038de5f39bbb1976821f60654 | 24,739 | py | Python | alibi/explainers/anchors/anchor_image.py | mauicv/alibi | 30fea76391c255963c8818c2b54aa615b0d6f858 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | alibi/explainers/anchors/anchor_image.py | mauicv/alibi | 30fea76391c255963c8818c2b54aa615b0d6f858 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | alibi/explainers/anchors/anchor_image.py | mauicv/alibi | 30fea76391c255963c8818c2b54aa615b0d6f858 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import copy
import logging
from functools import partial
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
import numpy as np
from skimage.segmentation import felzenszwalb, quickshift, slic
from alibi.api.defaults import DEFAULT_DATA_ANCHOR_IMG, DEFAULT_META_ANCHOR
from alibi.api.interfaces i... | 37.25753 | 120 | 0.606653 | import copy
import logging
from functools import partial
from typing import Any, Callable, Dict, List, Optional, Tuple, Type, Union
import numpy as np
from skimage.segmentation import felzenszwalb, quickshift, slic
from alibi.api.defaults import DEFAULT_DATA_ANCHOR_IMG, DEFAULT_META_ANCHOR
from alibi.api.interfaces i... | true | true |
f70b0eece0552cb8650942bf13b7e0fb7ec7bb56 | 27,283 | py | Python | tensor2tensor/models/research/moe.py | kpe/tensor2tensor | 453c473030c354a3d9a4c27b12bcec8942334bf4 | [
"Apache-2.0"
] | 34 | 2018-12-19T01:00:57.000Z | 2021-03-26T09:36:37.000Z | tensor2tensor/models/research/moe.py | kpe/tensor2tensor | 453c473030c354a3d9a4c27b12bcec8942334bf4 | [
"Apache-2.0"
] | 11 | 2018-12-25T03:37:59.000Z | 2021-08-25T14:43:58.000Z | tensor2tensor/models/research/moe.py | kpe/tensor2tensor | 453c473030c354a3d9a4c27b12bcec8942334bf4 | [
"Apache-2.0"
] | 9 | 2018-12-27T08:00:44.000Z | 2020-06-08T03:05:14.000Z | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 40.122059 | 80 | 0.728549 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import mesh_tensorflow as mtf
import tensorflow as tf
def transformer_moe_layer_v1(inputs, output_dim, hparams, train,
master_dtype=tf.bfloat16,
... | true | true |
f70b0f4818fe2a2313130690f64f8143214ce044 | 2,082 | py | Python | generator/mnistGenerator.py | Kotwic4/SCOTR | 6afabedb672641a9777d8aa9d7b75f998e53c0c9 | [
"MIT"
] | 2 | 2018-01-15T12:27:10.000Z | 2019-01-30T18:42:29.000Z | generator/mnistGenerator.py | Kotwic4/SCOTR | 6afabedb672641a9777d8aa9d7b75f998e53c0c9 | [
"MIT"
] | null | null | null | generator/mnistGenerator.py | Kotwic4/SCOTR | 6afabedb672641a9777d8aa9d7b75f998e53c0c9 | [
"MIT"
] | null | null | null | import random
from sklearn.datasets import fetch_mldata
from util import open_file_in_directory
MNIST_DIR = './tmp/mnist'
MNIST_TRAIN_DIR = './mnist/train'
MNIST_TEST_DIR = './mnist/test'
MNIST_SAMPLE_DIR = './mnist/sample'
TEST_CASES = 60000
def mnist_img_to_file(mnist_img, file):
for x in range(28):
... | 28.520548 | 92 | 0.67195 | import random
from sklearn.datasets import fetch_mldata
from util import open_file_in_directory
MNIST_DIR = './tmp/mnist'
MNIST_TRAIN_DIR = './mnist/train'
MNIST_TEST_DIR = './mnist/test'
MNIST_SAMPLE_DIR = './mnist/sample'
TEST_CASES = 60000
def mnist_img_to_file(mnist_img, file):
for x in range(28):
... | true | true |
f70b0fff4768688affbca729bacf2b1bd853c80d | 1,547 | py | Python | apt/transport/transport.py | javajawa/debian-repo-remux | b6626b268acd1743208d8a399f8c975316cfbc80 | [
"BSD-2-Clause"
] | 1 | 2019-10-31T08:36:29.000Z | 2019-10-31T08:36:29.000Z | apt/transport/transport.py | javajawa/debian-repo-remux | b6626b268acd1743208d8a399f8c975316cfbc80 | [
"BSD-2-Clause"
] | null | null | null | apt/transport/transport.py | javajawa/debian-repo-remux | b6626b268acd1743208d8a399f8c975316cfbc80 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Abstract Transport
"""
import typing
import abc
from apt.transport.directorylisting import DirectoryListing
class Transport:
"""
Abstract class for retrieving information from repos
The functions 'exists' and 'open_read' are required to be implemented... | 20.626667 | 81 | 0.606981 |
import typing
import abc
from apt.transport.directorylisting import DirectoryListing
class Transport:
@abc.abstractmethod
def exists(self, uri: str) -> bool:
@abc.abstractmethod
def open_read(self, uri: str) -> typing.IO:
@abc.abstractmethod
def open_write(self, uri: str) -> typing.IO:
... | true | true |
f70b102230ce619e7bdf83c48010380e4304b537 | 4,264 | py | Python | biointeract/hub/dataload/sources/ConsensusPathDB/parser.py | biothings/biothings_interactions | 7a8b16e8119d6505b6b5d89623051c11f3649430 | [
"Apache-2.0"
] | null | null | null | biointeract/hub/dataload/sources/ConsensusPathDB/parser.py | biothings/biothings_interactions | 7a8b16e8119d6505b6b5d89623051c11f3649430 | [
"Apache-2.0"
] | null | null | null | biointeract/hub/dataload/sources/ConsensusPathDB/parser.py | biothings/biothings_interactions | 7a8b16e8119d6505b6b5d89623051c11f3649430 | [
"Apache-2.0"
] | null | null | null | """
CPDParser parses the ConsensusPathDB_human_PPI data file and yields
a generated dictionary of values.
Source Project: biothings.interactions
Author: Greg Taylor: greg.k.taylor@gmail.com
"""
import hashlib
import re
from hub.dataload.BiointeractParser import BiointeractParser
class CPDParser(BiointeractParser... | 37.403509 | 111 | 0.64728 | import hashlib
import re
from hub.dataload.BiointeractParser import BiointeractParser
class CPDParser(BiointeractParser):
EMPTY_FIELD = 'NA'
SEPARATOR = ','
HUMAN = '_HUMAN'
@staticmethod
def parse_interaction_participants(entry):
vals = CPDParser.parse_list(entry, CPDParser.SEPARATO... | true | true |
f70b1091614744431199f5372bcc30b19abcfd96 | 378 | py | Python | tests/test_things.py | 3jackdaws/distributed-asgi | acc341befe29b9e16ccb9da3d8887dff99636b2a | [
"MIT"
] | 1 | 2019-02-23T11:11:52.000Z | 2019-02-23T11:11:52.000Z | tests/test_things.py | 3jackdaws/distributed-asgi | acc341befe29b9e16ccb9da3d8887dff99636b2a | [
"MIT"
] | null | null | null | tests/test_things.py | 3jackdaws/distributed-asgi | acc341befe29b9e16ccb9da3d8887dff99636b2a | [
"MIT"
] | null | null | null | import pytest
from distributed_asgi import create_path_distributor
def test_path_distributor():
dist = create_path_distributor(routes={
"/api/([a-z-]+)": r"\1"
})
for path, expected_key in [
("/api/banana", "banana"),
("/banana", None),
()
]:
instance = dist({"p... | 21 | 52 | 0.582011 | import pytest
from distributed_asgi import create_path_distributor
def test_path_distributor():
dist = create_path_distributor(routes={
"/api/([a-z-]+)": r"\1"
})
for path, expected_key in [
("/api/banana", "banana"),
("/banana", None),
()
]:
instance = dist({"p... | true | true |
f70b10af0be0cb3da3d2d4e4ce538bc6e4775287 | 4,487 | py | Python | metadata_service/__init__.py | worldwise001/amundsenmetadatalibrary | 9914c8b51d38b8bd76d3249eb4f7fcce3e198d09 | [
"Apache-2.0"
] | null | null | null | metadata_service/__init__.py | worldwise001/amundsenmetadatalibrary | 9914c8b51d38b8bd76d3249eb4f7fcce3e198d09 | [
"Apache-2.0"
] | 1 | 2019-09-21T23:59:46.000Z | 2019-09-21T23:59:46.000Z | metadata_service/__init__.py | worldwise001/amundsenmetadatalibrary | 9914c8b51d38b8bd76d3249eb4f7fcce3e198d09 | [
"Apache-2.0"
] | 1 | 2019-09-21T23:56:40.000Z | 2019-09-21T23:56:40.000Z | import ast
import importlib
import logging
import os
import sys
from typing import Dict, Any # noqa: F401
from flask import Flask, Blueprint
from flask_restful import Api
from metadata_service.api.column import ColumnDescriptionAPI
from metadata_service.api.healthcheck import healthcheck
from metadata_service.api.po... | 43.990196 | 107 | 0.696902 | import ast
import importlib
import logging
import os
import sys
from typing import Dict, Any
from flask import Flask, Blueprint
from flask_restful import Api
from metadata_service.api.column import ColumnDescriptionAPI
from metadata_service.api.healthcheck import healthcheck
from metadata_service.api.popular_tables... | true | true |
f70b128b87482b3cee9323205fe94afb471a66f3 | 5,846 | py | Python | lib-src/lv2/suil/waflib/Tools/c_osx.py | joshrose/audacity | e2b1a2be6b92661628bbb054f915bc50b211c020 | [
"CC-BY-3.0"
] | 7,892 | 2015-03-31T09:24:05.000Z | 2022-03-31T12:30:32.000Z | lib-src/lv2/suil/waflib/Tools/c_osx.py | joshrose/audacity | e2b1a2be6b92661628bbb054f915bc50b211c020 | [
"CC-BY-3.0"
] | 2,050 | 2015-04-03T13:27:52.000Z | 2022-03-31T19:14:10.000Z | lib-src/lv2/suil/waflib/Tools/c_osx.py | joshrose/audacity | e2b1a2be6b92661628bbb054f915bc50b211c020 | [
"CC-BY-3.0"
] | 2,613 | 2015-03-26T11:28:10.000Z | 2022-03-30T13:17:03.000Z | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy 2008-2018 (ita)
"""
MacOSX related tools
"""
import os, shutil, platform
from waflib import Task, Utils
from waflib.TaskGen import taskgen_method, feature, after_method, before_method
app_info = '''
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "f... | 30.134021 | 98 | 0.706295 |
import os, shutil, platform
from waflib import Task, Utils
from waflib.TaskGen import taskgen_method, feature, after_method, before_method
app_info = '''
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>CFBund... | true | true |
f70b13e9224c40649b9bde9fb2b3aa3621b095d9 | 45,694 | py | Python | tests/druid_func_tests.py | longenouvo/incubator-superset | 4e998be6956955041a6d36351f602e27d0c8cbeb | [
"Apache-2.0"
] | 1 | 2020-04-15T18:13:31.000Z | 2020-04-15T18:13:31.000Z | tests/druid_func_tests.py | Odirlei-Stein/incubator-superset | 52afc33b31475536b287b56d262b9eaa32f479ab | [
"Apache-2.0"
] | null | null | null | tests/druid_func_tests.py | Odirlei-Stein/incubator-superset | 52afc33b31475536b287b56d262b9eaa32f479ab | [
"Apache-2.0"
] | 3 | 2020-04-15T16:34:09.000Z | 2020-06-22T17:26:45.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... | 40.798214 | 88 | 0.576093 |
import json
import unittest
from unittest.mock import Mock
import superset.connectors.druid.models as models
from superset.connectors.druid.models import DruidColumn, DruidDatasource, DruidMetric
from superset.exceptions import SupersetException
from .base_tests import SupersetTestCase
try:
from ... | true | true |
f70b14387afbfb856a02ada0d56f10e597f6b54c | 668 | py | Python | esuits/index/views.py | junkhp/esuites_database_modification | ac2b706a7cc8488cbe83a77d7ce062f5b8228463 | [
"MIT"
] | 4 | 2020-11-02T18:25:13.000Z | 2021-03-15T07:56:41.000Z | esuits/index/views.py | junkhp/esuites_database_modification | ac2b706a7cc8488cbe83a77d7ce062f5b8228463 | [
"MIT"
] | 9 | 2021-02-01T03:20:59.000Z | 2021-03-06T08:15:04.000Z | esuits/index/views.py | junkhp/esuites_database_modification | ac2b706a7cc8488cbe83a77d7ce062f5b8228463 | [
"MIT"
] | 4 | 2020-11-03T16:52:37.000Z | 2020-11-11T16:31:26.000Z | from django.shortcuts import render, redirect, get_object_or_404
from django.views.generic import ListView, DetailView, DeleteView, UpdateView
from django import forms
from django.urls import reverse_lazy, reverse
from django.views import View
from django.contrib.auth import authenticate, login, logout
from django.cont... | 31.809524 | 77 | 0.791916 | from django.shortcuts import render, redirect, get_object_or_404
from django.views.generic import ListView, DetailView, DeleteView, UpdateView
from django import forms
from django.urls import reverse_lazy, reverse
from django.views import View
from django.contrib.auth import authenticate, login, logout
from django.cont... | true | true |
f70b15354c78daddad253c8e050db6e8e7e66e50 | 2,094 | py | Python | tests/test_local.py | gaolichuang/py-essential | 9e2b803f878f1cb3686dd365a16b943594a1cd82 | [
"Apache-2.0"
] | 1 | 2015-01-11T06:43:02.000Z | 2015-01-11T06:43:02.000Z | tests/test_local.py | gaolichuang/py-essential | 9e2b803f878f1cb3686dd365a16b943594a1cd82 | [
"Apache-2.0"
] | null | null | null | tests/test_local.py | gaolichuang/py-essential | 9e2b803f878f1cb3686dd365a16b943594a1cd82 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | 30.794118 | 78 | 0.658548 |
import threading
from six import moves
from essential import local
from essential import test
class Dict(dict):
pass
class LocalStoreTestCase(test.BaseTestCase):
v1 = Dict(a='1')
v2 = Dict(a='2')
v3 = Dict(a='3')
def setUp(self):
super(LocalStoreTestCase, self).setUp()
... | true | true |
f70b15ad06c667a6017f75785dfe700e2698982c | 1,310 | py | Python | tests/nn.py | maikka39/Toy-Neural-Network-Py | a76b763e05fb9361a09fc825cdd0dc3606a3cb03 | [
"MIT"
] | null | null | null | tests/nn.py | maikka39/Toy-Neural-Network-Py | a76b763e05fb9361a09fc825cdd0dc3606a3cb03 | [
"MIT"
] | null | null | null | tests/nn.py | maikka39/Toy-Neural-Network-Py | a76b763e05fb9361a09fc825cdd0dc3606a3cb03 | [
"MIT"
] | null | null | null | from random import randint
from tnnp import nn as tnnp
nn = tnnp.NeuralNetwork(2, 2, 1)
if nn is None:
raise Exception("Initialization failed!", m.matrix)
nn = tnnp.NeuralNetwork(2, 2, 1)
input = [1, 0]
output = nn.feedforward(input)
if output < [-1] or output > [1]:
raise Exception(".feedforward function fa... | 23.818182 | 91 | 0.6 | from random import randint
from tnnp import nn as tnnp
nn = tnnp.NeuralNetwork(2, 2, 1)
if nn is None:
raise Exception("Initialization failed!", m.matrix)
nn = tnnp.NeuralNetwork(2, 2, 1)
input = [1, 0]
output = nn.feedforward(input)
if output < [-1] or output > [1]:
raise Exception(".feedforward function fa... | true | true |
f70b16ab99a5af27e7a27a4a42a400263f5c72af | 1,759 | py | Python | superpoint/models/simple_classifier.py | SwagJ/SuperPoint | ecbf1d6e809ea8c7c832078ad26d2a74ed2fae29 | [
"MIT"
] | null | null | null | superpoint/models/simple_classifier.py | SwagJ/SuperPoint | ecbf1d6e809ea8c7c832078ad26d2a74ed2fae29 | [
"MIT"
] | null | null | null | superpoint/models/simple_classifier.py | SwagJ/SuperPoint | ecbf1d6e809ea8c7c832078ad26d2a74ed2fae29 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow import layers as tfl
from .base_model import BaseModel, Mode
class SimpleClassifier(BaseModel):
input_spec = {
'image': {'shape': [None, None, None, 1], 'type': tf.float32}
}
required_config_keys = []
default_config = {'data_format': 'channels_first... | 35.897959 | 89 | 0.583854 | import tensorflow as tf
from tensorflow import layers as tfl
from .base_model import BaseModel, Mode
class SimpleClassifier(BaseModel):
input_spec = {
'image': {'shape': [None, None, None, 1], 'type': tf.float32}
}
required_config_keys = []
default_config = {'data_format': 'channels_first... | true | true |
f70b187b54382fd85b3a73c0c1ad86ac689ae9dc | 3,164 | py | Python | src/python/pipelines/xchem/split_fragnet_candidates.py | Waztom/pipelines | 63ac14d05446ced622fd2acb86c9b84dcc5feae8 | [
"Apache-2.0"
] | 24 | 2017-04-04T19:12:34.000Z | 2022-03-09T16:29:06.000Z | src/python/pipelines/xchem/split_fragnet_candidates.py | Waztom/pipelines | 63ac14d05446ced622fd2acb86c9b84dcc5feae8 | [
"Apache-2.0"
] | 22 | 2017-06-02T07:03:52.000Z | 2021-03-27T09:44:08.000Z | src/python/pipelines/xchem/split_fragnet_candidates.py | Waztom/pipelines | 63ac14d05446ced622fd2acb86c9b84dcc5feae8 | [
"Apache-2.0"
] | 19 | 2017-05-18T10:27:58.000Z | 2021-08-02T10:44:01.000Z | #!/usr/bin/env python
# Copyright 2020 Informatics Matters Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 30.423077 | 149 | 0.596081 |
import argparse, os, sys, json, traceback
from pipelines_utils import utils
from pipelines_utils import utils
def gen_filename(id, generate_filenames):
if generate_filenames:
return str(count)
else:
return id
def execute(candidates_json, generate_filenames):
with open(cand... | true | true |
f70b18a4e556bb5a038129fb8aad566e50ed8df6 | 1,008 | py | Python | flarestack/core/astro.py | robertdstein/flarestack | 2ce7e67da336514f6f38f06126a1fbd82131e441 | [
"MIT"
] | null | null | null | flarestack/core/astro.py | robertdstein/flarestack | 2ce7e67da336514f6f38f06126a1fbd82131e441 | [
"MIT"
] | 25 | 2019-11-14T15:46:24.000Z | 2020-11-27T11:14:22.000Z | flarestack/core/astro.py | robertdstein/flarestack | 2ce7e67da336514f6f38f06126a1fbd82131e441 | [
"MIT"
] | 2 | 2020-01-06T19:39:27.000Z | 2020-07-16T20:32:29.000Z | """
Function taken from IceCube astro package.
"""
import numpy as np
def angular_distance(lon1, lat1, lon2, lat2):
"""
calculate the angular distince along the great circle
on the surface of a shpere between the points
(`lon1`,`lat1`) and (`lon2`,`lat2`)
This function Works for equatorial coordin... | 28.8 | 88 | 0.647817 | import numpy as np
def angular_distance(lon1, lat1, lon2, lat2):
c1 = np.cos(lat1)
c2 = np.cos(lat2)
s1 = np.sin(lat1)
s2 = np.sin(lat2)
sd = np.sin(lon2 - lon1)
cd = np.cos(lon2 - lon1)
return np.arctan2(np.hypot(c2 * sd, c1 * s2 - s1 * c2 * cd), s1 * s2 + c1 * c2 * cd)
| true | true |
f70b18b4b2bf16ceeb39c12757922047f07bde3e | 241 | py | Python | Chapter_04/actions/admin.py | codingEzio/code_py_book_django2_by_example | d215d0c87a557685824286822186966b06fa8d59 | [
"Unlicense"
] | 1 | 2021-04-23T16:35:45.000Z | 2021-04-23T16:35:45.000Z | Chapter_04/actions/admin.py | codingEzio/code_py_book_django2_by_example | d215d0c87a557685824286822186966b06fa8d59 | [
"Unlicense"
] | null | null | null | Chapter_04/actions/admin.py | codingEzio/code_py_book_django2_by_example | d215d0c87a557685824286822186966b06fa8d59 | [
"Unlicense"
] | null | null | null | from django.contrib import admin
from .models import Action
@admin.register(Action)
class ActionAdmin(admin.ModelAdmin):
list_display = ('user', 'verb', 'target', 'created')
list_filter = ('created',)
search_fields = ('verb',) | 24.1 | 56 | 0.697095 | from django.contrib import admin
from .models import Action
@admin.register(Action)
class ActionAdmin(admin.ModelAdmin):
list_display = ('user', 'verb', 'target', 'created')
list_filter = ('created',)
search_fields = ('verb',) | true | true |
f70b19e8b33df4c0fab1ab2a6d898931dffda3c0 | 4,205 | py | Python | azury/asynczury/utils.py | citharus/azury.py | 7079f8f98c68028d17114c830e749254cd483ef2 | [
"Apache-2.0"
] | null | null | null | azury/asynczury/utils.py | citharus/azury.py | 7079f8f98c68028d17114c830e749254cd483ef2 | [
"Apache-2.0"
] | null | null | null | azury/asynczury/utils.py | citharus/azury.py | 7079f8f98c68028d17114c830e749254cd483ef2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021-present citharus
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use utils.py 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 ... | 31.616541 | 75 | 0.572889 |
from __future__ import annotations
from typing import Union, Dict
import azury.asynczury as asynczury
from azury.utils import parse_iso
__all__: list[str] = ['to_file', 'to_user', 'to_team']
async def to_file(
client: asynczury.Client,
service: str,
data: Dict[str, Union[str, ... | true | true |
f70b1b0b16bd605c6b6c84e932a247ada270dac4 | 6,493 | py | Python | pipeline.py | tanynova99/2021-2-level-ctlr | c8a1456c1d719b974f06193e1b7ab4ba0a607229 | [
"MIT"
] | null | null | null | pipeline.py | tanynova99/2021-2-level-ctlr | c8a1456c1d719b974f06193e1b7ab4ba0a607229 | [
"MIT"
] | null | null | null | pipeline.py | tanynova99/2021-2-level-ctlr | c8a1456c1d719b974f06193e1b7ab4ba0a607229 | [
"MIT"
] | null | null | null | """
Pipeline for text processing implementation
"""
from pathlib import Path
import re
import pymorphy2
from pymystem3 import Mystem
from constants import ASSETS_PATH
from core_utils.article import Article, ArtifactType
class EmptyDirectoryError(Exception):
"""
No data to process
"""
class Inconsiste... | 28.108225 | 100 | 0.624365 |
from pathlib import Path
import re
import pymorphy2
from pymystem3 import Mystem
from constants import ASSETS_PATH
from core_utils.article import Article, ArtifactType
class EmptyDirectoryError(Exception):
class InconsistentDatasetError(Exception):
class MorphologicalToken:
def __init__(self, original_wor... | true | true |
f70b1b503b4ddb49f9d18776b11905b96556d553 | 1,458 | py | Python | setup.py | dmitrii-sim/ninjin | 6c3edb46ec873f28ed0b1fcbe20193445e3107e9 | [
"MIT"
] | 2 | 2020-06-03T07:44:46.000Z | 2020-06-05T11:30:46.000Z | setup.py | dmitrii-sim/ninjin | 6c3edb46ec873f28ed0b1fcbe20193445e3107e9 | [
"MIT"
] | null | null | null | setup.py | dmitrii-sim/ninjin | 6c3edb46ec873f28ed0b1fcbe20193445e3107e9 | [
"MIT"
] | 1 | 2020-06-18T15:59:18.000Z | 2020-06-18T15:59:18.000Z | import os
from setuptools import (
find_packages,
setup
)
__version__ = open("VERSION", 'r').read().strip()
REQUIREMENTS_FOLDER = os.getenv('REQUIREMENTS_PATH', '')
requirements = [line.strip() for line in open(os.path.join(REQUIREMENTS_FOLDER, "requirements.txt"), 'r')]
setup(
name='ninjin',
versi... | 26.509091 | 106 | 0.526749 | import os
from setuptools import (
find_packages,
setup
)
__version__ = open("VERSION", 'r').read().strip()
REQUIREMENTS_FOLDER = os.getenv('REQUIREMENTS_PATH', '')
requirements = [line.strip() for line in open(os.path.join(REQUIREMENTS_FOLDER, "requirements.txt"), 'r')]
setup(
name='ninjin',
versi... | true | true |
f70b1b67040779aa3fec10d949f0b6edaadebcce | 4,918 | py | Python | src/prism-fruit/Games-DQL/examples/games/car/networkx/readwrite/sparsegraph6.py | kushgrover/apt-vs-dift | 250f64e6c442f6018cab65ec6979d9568a842f57 | [
"MIT"
] | null | null | null | src/prism-fruit/Games-DQL/examples/games/car/networkx/readwrite/sparsegraph6.py | kushgrover/apt-vs-dift | 250f64e6c442f6018cab65ec6979d9568a842f57 | [
"MIT"
] | null | null | null | src/prism-fruit/Games-DQL/examples/games/car/networkx/readwrite/sparsegraph6.py | kushgrover/apt-vs-dift | 250f64e6c442f6018cab65ec6979d9568a842f57 | [
"MIT"
] | null | null | null | """
**************
SparseGraph 6
**************
Read graphs in graph6 and sparse6 format.
Format
------
"graph6 and sparse6 are formats for storing undirected graphs in a
compact manner, using only printable ASCII characters. Files in these
formats have text type and contain one line per graph."
http://cs... | 28.929412 | 81 | 0.568117 |
__author__ = """Aric Hagberg (hagberg@lanl.gov)"""
__all__ = ['read_graph6', 'parse_graph6', 'read_graph6_list',
'read_sparse6', 'parse_sparse6', 'read_sparse6_list']
import networkx as nx
from networkx.exception import NetworkXError
from networkx.utils import open_file
def read_graph... | true | true |
f70b1bf7e41ca49a3802c244cb6df05ffb1e5edd | 3,203 | py | Python | mars/dataframe/fetch/core.py | sighingnow/mars | c7897fbd144d230fff5edabc1494fb3ff44aa0d2 | [
"Apache-2.0"
] | null | null | null | mars/dataframe/fetch/core.py | sighingnow/mars | c7897fbd144d230fff5edabc1494fb3ff44aa0d2 | [
"Apache-2.0"
] | null | null | null | mars/dataframe/fetch/core.py | sighingnow/mars | c7897fbd144d230fff5edabc1494fb3ff44aa0d2 | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2018 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 38.590361 | 93 | 0.696222 |
import operator
from ...serialize.core import TupleField, ValueType, Int8Field
from ...operands import Fetch, FetchShuffle
from ...utils import on_serialize_shape, on_deserialize_shape
from ..operands import DataFrameOperandMixin, ObjectType
class DataFrameFetchMixin(DataFrameOperandMixin):
def ch... | true | true |
f70b1ca4a8dd551f3d5221559de70f07c52b4a6d | 1,206 | py | Python | ssseg/cfgs/memorynet/cfgs_cocostuff_resnet101os8.py | zhizhangxian/sssegmentation | 90613f6e0abf4cdd729cf382ab2a915e106d8649 | [
"MIT"
] | 41 | 2021-08-28T01:29:19.000Z | 2022-03-30T11:28:37.000Z | ssseg/cfgs/memorynet/cfgs_cocostuff_resnet101os8.py | zhizhangxian/sssegmentation | 90613f6e0abf4cdd729cf382ab2a915e106d8649 | [
"MIT"
] | 6 | 2021-08-31T08:54:39.000Z | 2021-11-02T10:45:47.000Z | ssseg/cfgs/memorynet/cfgs_cocostuff_resnet101os8.py | zhizhangxian/sssegmentation | 90613f6e0abf4cdd729cf382ab2a915e106d8649 | [
"MIT"
] | 1 | 2021-09-08T01:41:10.000Z | 2021-09-08T01:41:10.000Z | '''define the config file for cocostuff and resnet101os8'''
import os
from .base_cfg import *
# modify dataset config
DATASET_CFG = DATASET_CFG.copy()
DATASET_CFG.update({
'type': 'cocostuff',
'rootdir': os.path.join(os.getcwd(), 'COCO'),
})
# modify dataloader config
DATALOADER_CFG = DATALOADER_CFG.copy()
# ... | 26.217391 | 110 | 0.722222 | import os
from .base_cfg import *
DATASET_CFG = DATASET_CFG.copy()
DATASET_CFG.update({
'type': 'cocostuff',
'rootdir': os.path.join(os.getcwd(), 'COCO'),
})
DATALOADER_CFG = DATALOADER_CFG.copy()
OPTIMIZER_CFG = OPTIMIZER_CFG.copy()
OPTIMIZER_CFG.update(
{
'max_epochs': 30
}
)
LOSSES_CFG ... | true | true |
f70b1daf8d65cc9109c42a04aba4fff0fcbd1f13 | 5,875 | py | Python | bgp/simglucose/controller/basal_bolus_ctrller.py | aypan17/value_learning | 240a67ecf99b178fe0c4ced2bfd1dd50453fbdfe | [
"MIT"
] | null | null | null | bgp/simglucose/controller/basal_bolus_ctrller.py | aypan17/value_learning | 240a67ecf99b178fe0c4ced2bfd1dd50453fbdfe | [
"MIT"
] | null | null | null | bgp/simglucose/controller/basal_bolus_ctrller.py | aypan17/value_learning | 240a67ecf99b178fe0c4ced2bfd1dd50453fbdfe | [
"MIT"
] | null | null | null | from .base import Controller
from .base import Action
import numpy as np
import pandas as pd
import pkg_resources
import logging
from collections import namedtuple
logger = logging.getLogger(__name__)
CONTROL_QUEST = '/source/dir/simglucose/params/Quest.csv'
PATIENT_PARA_FILE = '/source/dir/simglucose/params/vpatient_... | 35.179641 | 99 | 0.580766 | from .base import Controller
from .base import Action
import numpy as np
import pandas as pd
import pkg_resources
import logging
from collections import namedtuple
logger = logging.getLogger(__name__)
CONTROL_QUEST = '/source/dir/simglucose/params/Quest.csv'
PATIENT_PARA_FILE = '/source/dir/simglucose/params/vpatient_... | true | true |
f70b1e2720f8ee99979dca1f565540a31b3627d9 | 11,404 | py | Python | gcloud/connection.py | grapefruit623/gcloud-python | 83d130e2cfb0bf867d7ba165ff157d31d52f1b35 | [
"Apache-2.0"
] | null | null | null | gcloud/connection.py | grapefruit623/gcloud-python | 83d130e2cfb0bf867d7ba165ff157d31d52f1b35 | [
"Apache-2.0"
] | null | null | null | gcloud/connection.py | grapefruit623/gcloud-python | 83d130e2cfb0bf867d7ba165ff157d31d52f1b35 | [
"Apache-2.0"
] | null | null | null | # 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 or a... | 35.52648 | 79 | 0.623202 |
import json
from pkg_resources import get_distribution
import six
from six.moves.urllib.parse import urlencode
import httplib2
from gcloud.credentials import get_credentials
from gcloud.exceptions import make_exception
API_BASE_URL = 'https://www.googleapis.com'
class Connection(object):
USE... | true | true |
f70b1e86c28d848a3ed36c803e303c1039a3b3d1 | 2,642 | py | Python | thorpy/elements/text.py | YannThorimbert/ThorPy-1.0 | 2855491e7d5016e9cbefb71784d169bb57cf8c73 | [
"MIT"
] | 1 | 2020-02-23T13:06:02.000Z | 2020-02-23T13:06:02.000Z | thorpy/elements/text.py | YannThorimbert/ThorPy-1.0 | 2855491e7d5016e9cbefb71784d169bb57cf8c73 | [
"MIT"
] | null | null | null | thorpy/elements/text.py | YannThorimbert/ThorPy-1.0 | 2855491e7d5016e9cbefb71784d169bb57cf8c73 | [
"MIT"
] | null | null | null | from __future__ import division
from thorpy.elements.element import Element
from thorpy.miscgui.constants import STATE_NORMAL
class OneLineText(Element):
def __init__(self, text="", elements=None, normal_params=None):
Element.__init__(self, text, elements, normal_params)
def finish(self):
s... | 33.025 | 78 | 0.604845 | from __future__ import division
from thorpy.elements.element import Element
from thorpy.miscgui.constants import STATE_NORMAL
class OneLineText(Element):
def __init__(self, text="", elements=None, normal_params=None):
Element.__init__(self, text, elements, normal_params)
def finish(self):
s... | true | true |
f70b1f86cf5fd83b8b23b2fcca78763698db8f0f | 114 | py | Python | src/vm/__init__.py | mingz2013/lang-py | 1788bae92cbc8b5f3f99d9ae1c45ea116d870d91 | [
"Apache-2.0"
] | null | null | null | src/vm/__init__.py | mingz2013/lang-py | 1788bae92cbc8b5f3f99d9ae1c45ea116d870d91 | [
"Apache-2.0"
] | null | null | null | src/vm/__init__.py | mingz2013/lang-py | 1788bae92cbc8b5f3f99d9ae1c45ea116d870d91 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@FileName: __init__.py
@Time: 2020/2/7 20:11
@Author: zhaojm
Module Description
"""
| 11.4 | 23 | 0.622807 | true | true | |
f70b206f88d8d3a4cabcf553b9de5db1cefe513c | 228 | py | Python | sitepackages/djangae/models.py | bitcpf/djangoage | f116860cbfa799eb6c47306a72d742b63c970dce | [
"Apache-2.0"
] | null | null | null | sitepackages/djangae/models.py | bitcpf/djangoage | f116860cbfa799eb6c47306a72d742b63c970dce | [
"Apache-2.0"
] | null | null | null | sitepackages/djangae/models.py | bitcpf/djangoage | f116860cbfa799eb6c47306a72d742b63c970dce | [
"Apache-2.0"
] | null | null | null | from django.db import models
from djangae import patches
class CounterShard(models.Model):
count = models.PositiveIntegerField()
label = models.CharField(max_length=500)
class Meta:
app_label = "djangae"
| 19 | 44 | 0.723684 | from django.db import models
from djangae import patches
class CounterShard(models.Model):
count = models.PositiveIntegerField()
label = models.CharField(max_length=500)
class Meta:
app_label = "djangae"
| true | true |
f70b2195d3e92beb097b41bf27615ee7cb7b8faa | 489 | py | Python | galeria/migrations/0006_alter_post_published.py | JoseDevApps/Pets | 280e193c5bb293893a2baa547fcde0141f5db010 | [
"MIT"
] | null | null | null | galeria/migrations/0006_alter_post_published.py | JoseDevApps/Pets | 280e193c5bb293893a2baa547fcde0141f5db010 | [
"MIT"
] | null | null | null | galeria/migrations/0006_alter_post_published.py | JoseDevApps/Pets | 280e193c5bb293893a2baa547fcde0141f5db010 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-11-11 05:59
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('galeria', '0005_auto_20211111_0052'),
]
operations = [
migrations.AlterField(
model_name='post',
nam... | 24.45 | 136 | 0.633947 |
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('galeria', '0005_auto_20211111_0052'),
]
operations = [
migrations.AlterField(
model_name='post',
name='published',
field=models.DateTim... | true | true |
f70b22555f264ff3a1b0984a03ecb595e0901e16 | 865 | py | Python | practice/practice/spiders/authors.py | Soulzerz/py_web_crawler | 13f66611703ce253ac85f914cabe3b851138f966 | [
"MIT"
] | null | null | null | practice/practice/spiders/authors.py | Soulzerz/py_web_crawler | 13f66611703ce253ac85f914cabe3b851138f966 | [
"MIT"
] | null | null | null | practice/practice/spiders/authors.py | Soulzerz/py_web_crawler | 13f66611703ce253ac85f914cabe3b851138f966 | [
"MIT"
] | null | null | null | from scrapy import Spider
class AuthorSpider(Spider):
name = 'author'
start_urls = [
'http://quotes.toscrape.com/',
]
def parse(self, response):
#follow links to author pages
for href in response.css('.author + a::attr(href)'):
yield response.follow(href, ca... | 34.6 | 69 | 0.60578 | from scrapy import Spider
class AuthorSpider(Spider):
name = 'author'
start_urls = [
'http://quotes.toscrape.com/',
]
def parse(self, response):
for href in response.css('.author + a::attr(href)'):
yield response.follow(href, callback=self.parse_author)
... | true | true |
f70b22fe0f0e714035cf9a82676dd1c359a9668f | 6,912 | py | Python | tests/use_cases/test_environments.py | namuan/orkestra | 83b67f7e816c94b75232691c14d91fd9d62213ed | [
"MIT"
] | null | null | null | tests/use_cases/test_environments.py | namuan/orkestra | 83b67f7e816c94b75232691c14d91fd9d62213ed | [
"MIT"
] | 11 | 2020-06-07T12:29:21.000Z | 2020-06-24T19:44:36.000Z | tests/use_cases/test_environments.py | namuan/orkestra | 83b67f7e816c94b75232691c14d91fd9d62213ed | [
"MIT"
] | null | null | null | from PyQt5 import QtCore
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QDialogButtonBox
from . import get_main_window, close_application
NO_OF_ENVIRONMENTS = 5
NO_OF_ENVIRONMENTS_TO_DELETE = 3
NO_OF_ENVIRONMENTS_TO_RE_ADD = 1
def get_toolbar_environments_combo(window):
return window.environment_list_v... | 30.183406 | 109 | 0.757813 | from PyQt5 import QtCore
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QDialogButtonBox
from . import get_main_window, close_application
NO_OF_ENVIRONMENTS = 5
NO_OF_ENVIRONMENTS_TO_DELETE = 3
NO_OF_ENVIRONMENTS_TO_RE_ADD = 1
def get_toolbar_environments_combo(window):
return window.environment_list_v... | true | true |
f70b230a8610bab237b7c392f0f4b340a61d5e65 | 1,343 | py | Python | tests/integration/test_main.py | benjaminkaplanphd/traveling-salesperson | 5c788554fe90eeb81b6351aeec96f1d64caa7591 | [
"MIT"
] | null | null | null | tests/integration/test_main.py | benjaminkaplanphd/traveling-salesperson | 5c788554fe90eeb81b6351aeec96f1d64caa7591 | [
"MIT"
] | null | null | null | tests/integration/test_main.py | benjaminkaplanphd/traveling-salesperson | 5c788554fe90eeb81b6351aeec96f1d64caa7591 | [
"MIT"
] | null | null | null | """
Integration tests for __main__.py
"""
# pragma pylint: disable=redefined-outer-name
from click.testing import CliRunner
import pytest
from traveling_salesperson import __main__ as main
def test_main_runs(mocker, filename_fixture):
"""Ensures that main() runs smoothly over a test file."""
mock_etl = mocke... | 35.342105 | 89 | 0.673864 |
from click.testing import CliRunner
import pytest
from traveling_salesperson import __main__ as main
def test_main_runs(mocker, filename_fixture):
mock_etl = mocker.spy(main, 'etl')
mock_distance = mocker.spy(main, 'distance_matrix')
mock_path = mocker.spy(main, 'determine_path')
mock_plot = mocker.... | true | true |
f70b236aca7e96af4bd08a8c9e8e52cae3f487e5 | 544 | py | Python | src/astrolib/util/constants.py | space-geek/integrationutils | 384375702a6c053aa2e5aaca6b9d5c43d86a16ad | [
"MIT"
] | null | null | null | src/astrolib/util/constants.py | space-geek/integrationutils | 384375702a6c053aa2e5aaca6b9d5c43d86a16ad | [
"MIT"
] | null | null | null | src/astrolib/util/constants.py | space-geek/integrationutils | 384375702a6c053aa2e5aaca6b9d5c43d86a16ad | [
"MIT"
] | null | null | null | """ TODO Module docstring
"""
# Threshold value under which a float will be treated as zero
MAX_ZERO_THRESHOLD_VALUE = 1.0e-14
# Minimum integration step size, in seconds
MINIMUM_STEP_SIZE_IN_SECONDS = 1.0e-9
# Number of whole nanoseconds per second
NANOSECONDS_PER_SECOND = int(1e9)
# Number of seconds per mean so... | 21.76 | 61 | 0.773897 |
MAX_ZERO_THRESHOLD_VALUE = 1.0e-14
MINIMUM_STEP_SIZE_IN_SECONDS = 1.0e-9
NANOSECONDS_PER_SECOND = int(1e9)
SECONDS_PER_SOLAR_DAY = 86400.0
SECONDS_PER_MINUTE = 60.0
SECONDS_PER_HOUR = 3600.0
EARTH_MU = 3.986004418e5
| true | true |
f70b23f1200f4265cbd2958a15e879a5f263f877 | 10,005 | py | Python | src/dataload/__init__.py | karawallace/mygene | 35bf066eb50bc929b4bb4e2423d47b4c98797526 | [
"Apache-2.0"
] | null | null | null | src/dataload/__init__.py | karawallace/mygene | 35bf066eb50bc929b4bb4e2423d47b4c98797526 | [
"Apache-2.0"
] | null | null | null | src/dataload/__init__.py | karawallace/mygene | 35bf066eb50bc929b4bb4e2423d47b4c98797526 | [
"Apache-2.0"
] | null | null | null | '''data_load module is for loading individual genedocs from various data sources.'''
from __future__ import print_function
import sys
import copy
import types
import time
import datetime
import importlib
from biothings.utils.mongo import get_src_conn, get_src_dump, get_data_folder
from biothings.utils.common import get... | 35.105263 | 144 | 0.593303 | from __future__ import print_function
import sys
import copy
import types
import time
import datetime
import importlib
from biothings.utils.mongo import get_src_conn, get_src_dump, get_data_folder
from biothings.utils.common import get_timestamp, get_random_string, timesofar, dump2gridfs, iter_n
from config import DATA... | true | true |
f70b274505cb775f5dfe8ee0c0eddac1fc9d3788 | 798 | py | Python | rendering/tasks.py | everyvoter/everyvoter | 65d9b8bdf9b5c64057135c279f6e03b6c207e0fa | [
"MIT"
] | 5 | 2019-07-01T17:50:44.000Z | 2022-02-20T02:44:42.000Z | rendering/tasks.py | everyvoter/everyvoter | 65d9b8bdf9b5c64057135c279f6e03b6c207e0fa | [
"MIT"
] | 3 | 2020-06-05T21:44:33.000Z | 2021-06-10T21:39:26.000Z | rendering/tasks.py | everyvoter/everyvoter | 65d9b8bdf9b5c64057135c279f6e03b6c207e0fa | [
"MIT"
] | 1 | 2021-12-09T06:32:40.000Z | 2021-12-09T06:32:40.000Z | """Rendering Related Tasks"""
from celery import shared_task
import newrelic.agent
from rendering.render_email import compose_email
from mailer.mailserver import deliver
@shared_task
def sample_email(to_address, user_id, email_id, election_id, district_ids):
"""Sample an email to an end user"""
result = comp... | 26.6 | 75 | 0.692982 | from celery import shared_task
import newrelic.agent
from rendering.render_email import compose_email
from mailer.mailserver import deliver
@shared_task
def sample_email(to_address, user_id, email_id, election_id, district_ids):
result = compose_email(
user_id,
email_id,
election_id,
... | true | true |
f70b27fea3ce5edeff7e9b072b5f43440d39c19d | 3,763 | py | Python | staff_manage_sdk/model/cmdb_extend/idcrack_unit_info_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | 5 | 2019-07-31T04:11:05.000Z | 2021-01-07T03:23:20.000Z | webshell_sdk/model/cmdb_extend/idcrack_unit_info_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | webshell_sdk/model/cmdb_extend/idcrack_unit_info_pb2.py | easyopsapis/easyops-api-python | adf6e3bad33fa6266b5fa0a449dd4ac42f8447d0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: idcrack_unit_info.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.pr... | 39.197917 | 396 | 0.766144 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db ... | true | true |
f70b2818b2e1e54a65dde52029d6950bf731af54 | 1,296 | py | Python | ThreeBotPackages/threebot/capacity/package.py | grimpy/jumpscaleX_threebot | 81aab3f049b2b353c247cd2c9eecd759a34a64c3 | [
"Apache-2.0"
] | null | null | null | ThreeBotPackages/threebot/capacity/package.py | grimpy/jumpscaleX_threebot | 81aab3f049b2b353c247cd2c9eecd759a34a64c3 | [
"Apache-2.0"
] | null | null | null | ThreeBotPackages/threebot/capacity/package.py | grimpy/jumpscaleX_threebot | 81aab3f049b2b353c247cd2c9eecd759a34a64c3 | [
"Apache-2.0"
] | null | null | null | from Jumpscale import j
class Package(j.baseclasses.threebot_package):
def prepare(self):
"""
is called at install time
:return:
"""
pass
def start(self):
"""
called when the 3bot starts
:return:
"""
## TODO: BAD
# self.d... | 25.411765 | 89 | 0.588735 | from Jumpscale import j
class Package(j.baseclasses.threebot_package):
def prepare(self):
pass
def start(self):
server = self.openresty
website = server.get_from_port(443)
locations = website.locations.get("threebotapp_locations")
website_location =... | true | true |
f70b281ecb804bd367a615bc4a4bbf8209ed8eb9 | 101 | py | Python | classwork1/classworkApp1/apps.py | cs-fullstack-2019-spring/django-intro1-cw-itayanna | 5c4d577f890991ef78c2f98203c8deda65c04357 | [
"Apache-2.0"
] | null | null | null | classwork1/classworkApp1/apps.py | cs-fullstack-2019-spring/django-intro1-cw-itayanna | 5c4d577f890991ef78c2f98203c8deda65c04357 | [
"Apache-2.0"
] | null | null | null | classwork1/classworkApp1/apps.py | cs-fullstack-2019-spring/django-intro1-cw-itayanna | 5c4d577f890991ef78c2f98203c8deda65c04357 | [
"Apache-2.0"
] | null | null | null | from django.apps import AppConfig
class Classworkapp1Config(AppConfig):
name = 'classworkApp1'
| 16.833333 | 37 | 0.782178 | from django.apps import AppConfig
class Classworkapp1Config(AppConfig):
name = 'classworkApp1'
| true | true |
f70b29e2ae59baf04fbe095ef1fe4e2a9c27ec3a | 7,212 | py | Python | plyse/term_parser.py | arcodergh/plyse | bb44543f9c812401489ceba68b24b8618d263830 | [
"MIT"
] | 26 | 2016-05-31T14:45:24.000Z | 2021-04-27T01:54:52.000Z | plyse/term_parser.py | arcodergh/plyse | bb44543f9c812401489ceba68b24b8618d263830 | [
"MIT"
] | 11 | 2016-05-31T20:09:57.000Z | 2022-02-18T11:43:50.000Z | plyse/term_parser.py | arcodergh/plyse | bb44543f9c812401489ceba68b24b8618d263830 | [
"MIT"
] | 13 | 2016-05-31T19:41:36.000Z | 2021-03-01T15:22:38.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
from .util import load_module
class TermParserFactory(object):
@staticmethod
def build_from_conf(conf):
args = {k: conf[k] for k in ['default_fields', 'aliases', 'integer_as_string'] if k in conf}
return TermParser(**args) if not 'class' in conf else... | 36.984615 | 122 | 0.640044 |
from .util import load_module
class TermParserFactory(object):
@staticmethod
def build_from_conf(conf):
args = {k: conf[k] for k in ['default_fields', 'aliases', 'integer_as_string'] if k in conf}
return TermParser(**args) if not 'class' in conf else load_module(conf['class'])(**args)
... | true | true |
f70b2a813717d6b844f5a5aa9a42bc87923adf2a | 7,571 | py | Python | bluetail/models/ocds_models.py | CodeForAfrica/bluetail | 776e9f2993b6bc91c5ab0337fca4efcbaa1c320d | [
"MIT"
] | 1 | 2022-01-31T08:18:35.000Z | 2022-01-31T08:18:35.000Z | bluetail/models/ocds_models.py | CodeForAfrica/bluetail | 776e9f2993b6bc91c5ab0337fca4efcbaa1c320d | [
"MIT"
] | 1 | 2022-02-03T06:53:36.000Z | 2022-02-03T10:22:33.000Z | bluetail/models/ocds_models.py | CodeForAfrica/bluetail | 776e9f2993b6bc91c5ab0337fca4efcbaa1c320d | [
"MIT"
] | null | null | null | from django.contrib.postgres.fields import JSONField
from django.db import models
from django_pgviews import view as pgviews
from cove.input.models import SuppliedData
from .bluetail_models import Flag
class OCDSPackageDataJSON(models.Model):
"""
Model to store OCDS JSON package data.
"""
package_dat... | 36.752427 | 129 | 0.632941 | from django.contrib.postgres.fields import JSONField
from django.db import models
from django_pgviews import view as pgviews
from cove.input.models import SuppliedData
from .bluetail_models import Flag
class OCDSPackageDataJSON(models.Model):
package_data = JSONField(null=True)
supplied_data = models.Foreign... | true | true |
f70b2ab2a3782f1d53ea23d291f9fea3c10fe878 | 7,613 | py | Python | lib/tools/common.py | rowlap/ganeti | 8ed853a8ec86cd9c295a086403a0ddd8c36c8173 | [
"BSD-2-Clause"
] | 1 | 2022-01-30T01:46:46.000Z | 2022-01-30T01:46:46.000Z | lib/tools/common.py | seanpm2001/ganeti | 9129897cbe631bac198cbb432074bde789c6c29e | [
"BSD-2-Clause"
] | null | null | null | lib/tools/common.py | seanpm2001/ganeti | 9129897cbe631bac198cbb432074bde789c6c29e | [
"BSD-2-Clause"
] | null | null | null | #
#
# Copyright (C) 2014 Google Inc.
# All rights reserved.
#
# 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 ... | 30.210317 | 80 | 0.720609 |
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
import logging
import os
import time
from io import StringIO
import OpenSSL
from ganeti import constants
from ganeti import errors
from ganeti import pathutils
from ganeti import utils
from ganeti import serializer
f... | true | true |
f70b2b2cddf15273b70142530c473aa2b5c66fe5 | 11,360 | py | Python | meraki/controllers/saml_roles_controller.py | bossypants22/python-sdk-test | 37701d62dc18c2abb910eb790ab978913adcaf7b | [
"MIT"
] | null | null | null | meraki/controllers/saml_roles_controller.py | bossypants22/python-sdk-test | 37701d62dc18c2abb910eb790ab978913adcaf7b | [
"MIT"
] | null | null | null | meraki/controllers/saml_roles_controller.py | bossypants22/python-sdk-test | 37701d62dc18c2abb910eb790ab978913adcaf7b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
meraki
This file was automatically generated for meraki by APIMATIC v2.0 ( https://apimatic.io ).
"""
from meraki.api_helper import APIHelper
from meraki.configuration import Configuration
from meraki.controllers.base_controller import BaseController
from meraki.http.au... | 39.859649 | 154 | 0.603081 |
from meraki.api_helper import APIHelper
from meraki.configuration import Configuration
from meraki.controllers.base_controller import BaseController
from meraki.http.auth.custom_header_auth import CustomHeaderAuth
class SAMLRolesController(BaseController):
def get_organization_saml_roles(self,
... | true | true |
f70b2c2919f1a0e38a2129982ef8b02639dfb5a5 | 2,171 | py | Python | credential.py | fiona-niwiduhaye/python-password-locker | aaed8ceac7f1dc0301db9d20594413ffd2e0b9ab | [
"Unlicense"
] | null | null | null | credential.py | fiona-niwiduhaye/python-password-locker | aaed8ceac7f1dc0301db9d20594413ffd2e0b9ab | [
"Unlicense"
] | null | null | null | credential.py | fiona-niwiduhaye/python-password-locker | aaed8ceac7f1dc0301db9d20594413ffd2e0b9ab | [
"Unlicense"
] | null | null | null |
class Credential:
'''
Class that generates instances of a users credentials
'''
# Empty list of credentials
credential_list = []
def __init__(self, user_password, credential_name, credential_password):
'''
__init__ method to define the properties of a User object
Args:
... | 28.194805 | 82 | 0.605251 |
class Credential:
credential_list = []
def __init__(self, user_password, credential_name, credential_password):
self.user_password = user_password
self.credential_name = credential_name
self.credential_password = credential_password
def save_credential(self):
Credenti... | true | true |
f70b2cd894737b29ceab7431ed16bf4467dc58e5 | 2,306 | py | Python | tests/test_autoregressive.py | ai-di/Brancher | 01d51137b0e6fc81512994c21cc3a19287353767 | [
"MIT"
] | 208 | 2019-06-15T13:48:40.000Z | 2021-10-16T05:03:46.000Z | tests/test_autoregressive.py | ai-di/Brancher | 01d51137b0e6fc81512994c21cc3a19287353767 | [
"MIT"
] | 18 | 2019-06-17T11:22:13.000Z | 2019-09-26T10:45:59.000Z | tests/test_autoregressive.py | ai-di/Brancher | 01d51137b0e6fc81512994c21cc3a19287353767 | [
"MIT"
] | 32 | 2019-06-15T19:08:53.000Z | 2020-02-16T13:39:41.000Z | import matplotlib.pyplot as plt
import numpy as np
from brancher.variables import RootVariable, RandomVariable, ProbabilisticModel
from brancher.standard_variables import NormalVariable, LogNormalVariable, BetaVariable
from brancher import inference
import brancher.functions as BF
# Probabilistic model #
T = 100
nu ... | 32.942857 | 87 | 0.702082 | import matplotlib.pyplot as plt
import numpy as np
from brancher.variables import RootVariable, RandomVariable, ProbabilisticModel
from brancher.standard_variables import NormalVariable, LogNormalVariable, BetaVariable
from brancher import inference
import brancher.functions as BF
T = 100
nu = LogNormalVariable(0.3,... | true | true |
f70b2dba7099f61d4cf65957484d07a3eb6e18bf | 21,084 | py | Python | madgraph/iolibs/template_files/subtraction/commons/beam_factorization_BF.py | madnklo/madnklo | 646a3db9c8efd7b4cb00e9d89b9197cd5394c01b | [
"NCSA"
] | 1 | 2019-12-14T15:25:38.000Z | 2019-12-14T15:25:38.000Z | madgraph/iolibs/template_files/subtraction/commons/beam_factorization_BF.py | madnklo/madnklo | 646a3db9c8efd7b4cb00e9d89b9197cd5394c01b | [
"NCSA"
] | 26 | 2018-10-08T15:49:32.000Z | 2020-05-15T13:33:36.000Z | madgraph/iolibs/template_files/subtraction/commons/beam_factorization_BF.py | madnklo/madnklo | 646a3db9c8efd7b4cb00e9d89b9197cd5394c01b | [
"NCSA"
] | 2 | 2019-03-25T17:28:48.000Z | 2021-04-21T12:15:53.000Z | ##########################################################################################
#
# Copyright (c) 2009 The MadGraph5_aMC@NLO Development team and Contributors
#
# This file is a part of the MadGraph5_aMC@NLO project, an application which
# automatically generates Feynman diagrams and matrix elements for arb... | 44.859574 | 125 | 0.5738 | kernel_gq = {
'bulk' : prefactor*color_factor*(EpsilonExpansion({
-1 : -(self.CF/self.CA)*(1.+(1.-x)**2) / x ,
0 : (self.CF/self.CA)*( ((1.+(1.-x)**2)/x)*( log1mx*(1.+theta_x_1my0) + logy0*theta_1my0_x ) + x )
})),
'counterterm... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.