hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f72d14251e2e59abadb132e5d0bcd62e485d2cd2 | 1,963 | py | Python | src/python/SpatialConvergence.py | OpenCMISS-Examples/left_ventricle_inflation | ee405d7b8aebec7222dafa5e0e6b2a4a1fc37eec | [
"Apache-2.0"
] | null | null | null | src/python/SpatialConvergence.py | OpenCMISS-Examples/left_ventricle_inflation | ee405d7b8aebec7222dafa5e0e6b2a4a1fc37eec | [
"Apache-2.0"
] | null | null | null | src/python/SpatialConvergence.py | OpenCMISS-Examples/left_ventricle_inflation | ee405d7b8aebec7222dafa5e0e6b2a4a1fc37eec | [
"Apache-2.0"
] | 3 | 2017-12-14T07:25:54.000Z | 2018-08-24T03:59:02.000Z | __author__ = 'zwan145'
import sys, os
import numpy
from utils import *
## This script implements mesh convergence for the cantilever problem.
# It modifies the problem1_tricubic.py script for each mesh resolution
# and calls the python script for each mesh resolution.
# It then reads out the 2PK fibre stress for the ... | 37.037736 | 100 | 0.543556 | __author__ = 'zwan145'
import sys, os
import numpy
from utils import *
| false | true |
f72d15f5ed33a0c85d9606f64c9acb94edfbe6d1 | 16,313 | py | Python | synapse/storage/receipts.py | xsteadfastx/synapse | 9a8ae6f1bf833b58416fae1add1972ac3e9d2d59 | [
"Apache-2.0"
] | 1 | 2017-02-03T18:58:29.000Z | 2017-02-03T18:58:29.000Z | synapse/storage/receipts.py | xsteadfastx/synapse | 9a8ae6f1bf833b58416fae1add1972ac3e9d2d59 | [
"Apache-2.0"
] | null | null | null | synapse/storage/receipts.py | xsteadfastx/synapse | 9a8ae6f1bf833b58416fae1add1972ac3e9d2d59 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket 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... | 34.199161 | 89 | 0.554343 |
from ._base import SQLBaseStore
from synapse.util.caches.descriptors import cachedInlineCallbacks, cachedList, cached
from synapse.util.caches.stream_change_cache import StreamChangeCache
from twisted.internet import defer
import logging
import ujson as json
logger = logging.getLogger(__name__)
cla... | true | true |
f72d160fcdb7089f1134d2d7d9f76d09c9f85a8c | 2,166 | py | Python | services/getSearchResults.py | r0uxt1/falcon | 852774e3628fcc08209f34a69bcae4e0d903d408 | [
"Unlicense"
] | null | null | null | services/getSearchResults.py | r0uxt1/falcon | 852774e3628fcc08209f34a69bcae4e0d903d408 | [
"Unlicense"
] | null | null | null | services/getSearchResults.py | r0uxt1/falcon | 852774e3628fcc08209f34a69bcae4e0d903d408 | [
"Unlicense"
] | null | null | null | import pickle
import collections
import json
import sys
import argparse
import pathlib
import time
ROOT_PATH = pathlib.Path(__file__).parents[1].as_posix()
trie = pickle.load(open( ROOT_PATH + "/dumps/trie.p", "rb"))
catMap = pickle.load(open(ROOT_PATH + "/dumps/catMap.p", "rb"))
category = json.load(open(ROOT_PATH +... | 30.942857 | 72 | 0.607572 | import pickle
import collections
import json
import sys
import argparse
import pathlib
import time
ROOT_PATH = pathlib.Path(__file__).parents[1].as_posix()
trie = pickle.load(open( ROOT_PATH + "/dumps/trie.p", "rb"))
catMap = pickle.load(open(ROOT_PATH + "/dumps/catMap.p", "rb"))
category = json.load(open(ROOT_PATH +... | true | true |
f72d16e50aee7d691584f49425e40834f26ba2c2 | 2,098 | py | Python | __init__.py | CraftYun83/Survery | bdd80186f5d0e22407c5a22cdf3c80edd50276de | [
"MIT"
] | null | null | null | __init__.py | CraftYun83/Survery | bdd80186f5d0e22407c5a22cdf3c80edd50276de | [
"MIT"
] | null | null | null | __init__.py | CraftYun83/Survery | bdd80186f5d0e22407c5a22cdf3c80edd50276de | [
"MIT"
] | null | null | null | questions = []
Answers = []
ending = "Thank you for taking this quiz!"
def help():
print("SubCommands:")
print("-----------------------------------------")
print("help - shows this help page")
print("addQuestion - adds a question")
print("deleteQuestion - removes a questi... | 36.172414 | 84 | 0.522402 | questions = []
Answers = []
ending = "Thank you for taking this quiz!"
def help():
print("SubCommands:")
print("-----------------------------------------")
print("help - shows this help page")
print("addQuestion - adds a question")
print("deleteQuestion - removes a questi... | true | true |
f72d187a0bb36150ddc8d414250d5ed8a96e26c9 | 48,395 | py | Python | gilbert.py | Erebyel/Gilbert | b7206278cae8c4686de9b87f042fbda42b5fe324 | [
"MIT"
] | null | null | null | gilbert.py | Erebyel/Gilbert | b7206278cae8c4686de9b87f042fbda42b5fe324 | [
"MIT"
] | null | null | null | gilbert.py | Erebyel/Gilbert | b7206278cae8c4686de9b87f042fbda42b5fe324 | [
"MIT"
] | null | null | null |
##---------------------- Carga de bibliotecas
from pandas import DataFrame
import streamlit as st
import numpy as np
##---------------------- Base de datos
frase = DataFrame({'artículo': ['El', 'El', 'El', 'La', 'El', 'La', 'El', 'El', 'La', 'El', 'La', 'El', 'La', 'La', 'El', 'La', 'La', 'El', 'La', 'El', 'El', 'El'... | 439.954545 | 39,817 | 0.638351 |
it as st
import numpy as np
, 'El', 'El', 'La', 'El', 'La', 'El', 'El', 'La', 'El', 'La', 'El', 'La', 'La', 'El', 'La', 'La', 'El', 'La', 'El', 'El', 'El', 'La', 'El', 'El', 'El', 'La', 'La', 'El', 'El', 'El', 'El', 'El', 'El', 'El', 'La', 'La', 'La', 'La', 'El', 'El', 'El', 'El', 'El', 'La', 'La', 'El', 'La', 'El', ... | true | true |
f72d191576e71f07bf2745d08e2318b97ae476f0 | 52,444 | py | Python | mne/viz/misc.py | GanshengT/mne-python | 49253e74308137e14187561a204d784ea28f12a7 | [
"BSD-3-Clause"
] | null | null | null | mne/viz/misc.py | GanshengT/mne-python | 49253e74308137e14187561a204d784ea28f12a7 | [
"BSD-3-Clause"
] | null | null | null | mne/viz/misc.py | GanshengT/mne-python | 49253e74308137e14187561a204d784ea28f12a7 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Functions to make simple plots with M/EEG data."""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Denis Engemann <denis.engemann@gmail.com>
# Martin Luessi <mluessi@nmr.mgh.harvard.edu>
# Eric Larson <larson.eric.d@gmail.com>
# Cathy Nangini... | 37.783862 | 79 | 0.574556 |
import base64
import copy
from glob import glob
from io import BytesIO
from itertools import cycle
import os.path as op
import warnings
from distutils.version import LooseVersion
from collections import defaultdict
import numpy as np
from ..defaults import DEFAULTS
from ..fixes import _get_img_fdata
from .... | true | true |
f72d193485085f4417f86600a03b9ba6200ca275 | 3,529 | py | Python | bindings/python/ensmallen/datasets/string/alteromonadaceaebacteriumbs31.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/alteromonadaceaebacteriumbs31.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/alteromonadaceaebacteriumbs31.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Alteromonadaceae bacterium Bs31.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein... | 33.609524 | 223 | 0.682063 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def AlteromonadaceaeBacteriumBs31(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "gr... | true | true |
f72d19bd7e21d68363282be4231a798cef9d93e4 | 716 | py | Python | venv/Lib/site-packages/marshmallow/__init__.py | kakinpe1u/Riki | 2812ce3279aacbd759fcaa096bb2cf2658195b7b | [
"BSD-3-Clause"
] | null | null | null | venv/Lib/site-packages/marshmallow/__init__.py | kakinpe1u/Riki | 2812ce3279aacbd759fcaa096bb2cf2658195b7b | [
"BSD-3-Clause"
] | 1 | 2021-06-02T01:17:03.000Z | 2021-06-02T01:17:03.000Z | venv/Lib/site-packages/marshmallow/__init__.py | kakinpe1u/Riki | 2812ce3279aacbd759fcaa096bb2cf2658195b7b | [
"BSD-3-Clause"
] | null | null | null | from marshmallow.schema import Schema, SchemaOpts
from . import fields
from marshmallow.decorators import (
pre_dump,
post_dump,
pre_load,
post_load,
validates,
validates_schema,
)
from marshmallow.utils import EXCLUDE, INCLUDE, RAISE, pprint, missing
from marshmallow.exceptions import Validati... | 20.457143 | 70 | 0.685754 | from marshmallow.schema import Schema, SchemaOpts
from . import fields
from marshmallow.decorators import (
pre_dump,
post_dump,
pre_load,
post_load,
validates,
validates_schema,
)
from marshmallow.utils import EXCLUDE, INCLUDE, RAISE, pprint, missing
from marshmallow.exceptions import Validati... | true | true |
f72d19fb07ebb13290b184d52af272ca902172d8 | 3,406 | py | Python | python/generic/parallel-processes.py | lotharwissler/bioinformatics | 83a53771222ecb0759e3b4bfa2018d2cd7647643 | [
"MIT"
] | 10 | 2016-01-13T00:39:30.000Z | 2020-11-30T05:56:19.000Z | python/generic/parallel-processes.py | lotharwissler/bioinformatics | 83a53771222ecb0759e3b4bfa2018d2cd7647643 | [
"MIT"
] | 1 | 2017-02-09T22:46:49.000Z | 2017-02-09T22:46:49.000Z | python/generic/parallel-processes.py | lotharwissler/bioinformatics | 83a53771222ecb0759e3b4bfa2018d2cd7647643 | [
"MIT"
] | 10 | 2015-10-09T00:29:16.000Z | 2019-06-09T05:32:15.000Z | #!/usr/bin/python
import sys, os
import math, time
import threading
import getopt # comand line argument handling
from low import *
# =============================================================================
def show_help():
""" displays the program parameter list and usage information """
stdout( "usa... | 31.831776 | 231 | 0.490018 |
import sys, os
import math, time
import threading
import getopt
from low import *
def show_help():
stdout( "usage: " + sys.argv[0] + " -f <path> -n " )
stdout( " " )
stdout( " option description" )
stdout( " -h help (this text here)" )
stdout( " -f file that contains all system ca... | true | true |
f72d1b20c6a6249fbd56850720d0cd584b7fb599 | 2,809 | py | Python | env/lib/python3.6/site-packages/torch/optim/asgd.py | bopopescu/smart_contracts7 | 40a487cb3843e86ab5e4cb50b1aafa2095f648cd | [
"Apache-2.0"
] | null | null | null | env/lib/python3.6/site-packages/torch/optim/asgd.py | bopopescu/smart_contracts7 | 40a487cb3843e86ab5e4cb50b1aafa2095f648cd | [
"Apache-2.0"
] | null | null | null | env/lib/python3.6/site-packages/torch/optim/asgd.py | bopopescu/smart_contracts7 | 40a487cb3843e86ab5e4cb50b1aafa2095f648cd | [
"Apache-2.0"
] | 1 | 2020-07-24T17:53:25.000Z | 2020-07-24T17:53:25.000Z | import math
import torch
from .optimizer import Optimizer
class ASGD(Optimizer):
"""Implements Averaged Stochastic Gradient Descent.
It has been proposed in `Acceleration of stochastic approximation by
averaging`_.
Arguments:
params (iterable): iterable of parameters to optimize or dicts def... | 35.1125 | 109 | 0.521538 | import math
import torch
from .optimizer import Optimizer
class ASGD(Optimizer):
def __init__(self, params, lr=1e-2, lambd=1e-4, alpha=0.75, t0=1e6, weight_decay=0):
defaults = dict(lr=lr, lambd=lambd, alpha=alpha, t0=t0,
weight_decay=weight_decay)
super(ASGD, self).__init... | true | true |
f72d1b37a5cef82cf5cf152d89c95f2474d1e422 | 14,941 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/quicktest/asymmetricthroughput_b9e3c6717e2faf761c693cccff9c71b8.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/quicktest/asymmetricthroughput_b9e3c6717e2faf761c693cccff9c71b8.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/quicktest/asymmetricthroughput_b9e3c6717e2faf761c693cccff9c71b8.py | rfrye-github/ixnetwork_restpy | 23eeb24b21568a23d3f31bbd72814ff55eb1af44 | [
"MIT"
] | null | null | null | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, ... | 39.318421 | 191 | 0.647212 |
from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class AsymmetricThroughput(Base):
__slots__ = ()
_SDM_NAME = 'asymmetricThroughput'
_SDM_ATT_MAP = {
'ForceApplyQTConfig': 'forceApplyQTConfig',
'InputParameters': 'inputParamete... | true | true |
f72d1dd9c1044400d4f9011000b5c29914781ea4 | 1,959 | py | Python | activemq/setup.py | kzap/integrations-core | 88c3a72dbf5223b496be1c549ca2857d8489c491 | [
"BSD-3-Clause"
] | 1 | 2021-01-28T01:45:37.000Z | 2021-01-28T01:45:37.000Z | activemq/setup.py | kzap/integrations-core | 88c3a72dbf5223b496be1c549ca2857d8489c491 | [
"BSD-3-Clause"
] | 3 | 2021-01-27T04:56:40.000Z | 2021-02-26T06:29:22.000Z | activemq/setup.py | kzap/integrations-core | 88c3a72dbf5223b496be1c549ca2857d8489c491 | [
"BSD-3-Clause"
] | 1 | 2021-04-07T16:58:27.000Z | 2021-04-07T16:58:27.000Z | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from codecs import open # To use a consistent encoding
from os import path
from setuptools import setup
HERE = path.dirname(path.abspath(__file__))
# Get version info
ABOUT = {}
with open(path.join(HER... | 30.138462 | 78 | 0.678918 |
from codecs import open
from os import path
from setuptools import setup
HERE = path.dirname(path.abspath(__file__))
ABOUT = {}
with open(path.join(HERE, 'datadog_checks', 'activemq', '__about__.py')) as f:
exec(f.read(), ABOUT)
with open(path.join(HERE, 'README.md'), encoding='utf-8') as f:
long_des... | true | true |
f72d1df9ba0d4ece4941df1261e9df055c7d4e59 | 1,480 | py | Python | pyblas/level1/cswap.py | timleslie/pyblas | 9109f2cc24e674cf59a3b39f95c2d7b8116ae884 | [
"BSD-3-Clause"
] | null | null | null | pyblas/level1/cswap.py | timleslie/pyblas | 9109f2cc24e674cf59a3b39f95c2d7b8116ae884 | [
"BSD-3-Clause"
] | 1 | 2020-10-10T23:23:06.000Z | 2020-10-10T23:23:06.000Z | pyblas/level1/cswap.py | timleslie/pyblas | 9109f2cc24e674cf59a3b39f95c2d7b8116ae884 | [
"BSD-3-Clause"
] | null | null | null | from ..util import slice_
def cswap(N, CX, INCX, CY, INCY):
"""Swaps the contents of a vector x with a vector y
Parameters
----------
N : int
Number of elements in input vector
CX : numpy.ndarray
A single precision complex array, dimension (1 + (`N` - 1)*abs(`INCX`))
INCX : in... | 27.407407 | 112 | 0.584459 | from ..util import slice_
def cswap(N, CX, INCX, CY, INCY):
if N <= 0:
return
x_slice = slice_(N, INCX)
y_slice = slice_(N, INCY)
X_TEMP = CX[x_slice].copy()
CX[x_slice] = CY[y_slice]
CY[x_slice] = X_TEMP
| true | true |
f72d1e7058caff6214e3cbcab08ed3706f8ab834 | 996 | py | Python | wwpdb/utils/tests_wf/WfDataObjectImportTests.py | epeisach/py-wwpdb_utils_wf | 4069bcc6236c99f99a78f2e0dd681d7971df97f8 | [
"Apache-2.0"
] | null | null | null | wwpdb/utils/tests_wf/WfDataObjectImportTests.py | epeisach/py-wwpdb_utils_wf | 4069bcc6236c99f99a78f2e0dd681d7971df97f8 | [
"Apache-2.0"
] | 1 | 2021-07-06T16:38:16.000Z | 2021-07-06T16:38:16.000Z | wwpdb/utils/tests_wf/WfDataObjectImportTests.py | epeisach/py-wwpdb_utils_wf | 4069bcc6236c99f99a78f2e0dd681d7971df97f8 | [
"Apache-2.0"
] | 1 | 2021-05-25T15:42:51.000Z | 2021-05-25T15:42:51.000Z | ##
# File: WfDataObjectImportTests.py
# Date: 10-Oct-2018 E. Peisach
#
# Updates:
##
"""Test cases for wwpdb.utils.wf - simply import everything to ensure imports work"""
__docformat__ = "restructuredtext en"
__author__ = "Ezra Peisach"
__email__ = "peisach@rcsb.rutgers.edu"
__license__ = "Creative Commons Attributi... | 23.714286 | 85 | 0.699799 |
__docformat__ = "restructuredtext en"
__author__ = "Ezra Peisach"
__email__ = "peisach@rcsb.rutgers.edu"
__license__ = "Creative Commons Attribution 3.0 Unported"
__version__ = "V0.01"
import unittest
if __package__ is None or __package__ == "":
import sys
from os import path
sys.path.append(path.di... | true | true |
f72d1ee40a4fb822de765b3f6b614cbf451598f5 | 2,569 | py | Python | misc/ig/ig/yahoo.py | all3g/pieces | bc378fd22ddc700891fe7f34ab0d5b341141e434 | [
"CNRI-Python"
] | 34 | 2016-10-31T02:05:24.000Z | 2018-11-08T14:33:13.000Z | misc/ig/ig/yahoo.py | join-us/python-programming | bc378fd22ddc700891fe7f34ab0d5b341141e434 | [
"CNRI-Python"
] | 2 | 2017-05-11T03:00:31.000Z | 2017-11-01T23:37:37.000Z | misc/ig/ig/yahoo.py | join-us/python-programming | bc378fd22ddc700891fe7f34ab0d5b341141e434 | [
"CNRI-Python"
] | 21 | 2016-08-19T09:05:45.000Z | 2018-11-08T14:33:16.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
import requests
import time
import lxml.etree
import randoms
import re
from searchengine import searchengine
class yahoo(searchengine):
"""Search resources from yahoo searchengine, include titles/urls."""
def __init__(self):
super(yahoo, self).__init__()
... | 33.363636 | 78 | 0.525886 |
import requests
import time
import lxml.etree
import randoms
import re
from searchengine import searchengine
class yahoo(searchengine):
def __init__(self):
super(yahoo, self).__init__()
def yahoo_dork_search(self, dork, page=0, random_sleep=True):
resources = []
indexs = range(page... | true | true |
f72d1f45574ed5c7672e07db524c2cc553117bc4 | 1,883 | py | Python | api/allennlp_demo/ccg_supertagging/test_api.py | jakpra/allennlp-demo | d9fa5203d2e500499cbd55c244454bed7b68e1f8 | [
"Apache-2.0"
] | null | null | null | api/allennlp_demo/ccg_supertagging/test_api.py | jakpra/allennlp-demo | d9fa5203d2e500499cbd55c244454bed7b68e1f8 | [
"Apache-2.0"
] | null | null | null | api/allennlp_demo/ccg_supertagging/test_api.py | jakpra/allennlp-demo | d9fa5203d2e500499cbd55c244454bed7b68e1f8 | [
"Apache-2.0"
] | null | null | null | from allennlp_demo.common.testing import ModelEndpointTestCase
from allennlp_demo.ccg_supertagging.api import CCGSupertaggingModelEndpoint
class TestCCGSupertaggingModelEndpoint(ModelEndpointTestCase):
endpoint = CCGSupertaggingModelEndpoint()
predict_input = {
"sentence": "Did Uriah honestly think he... | 36.211538 | 109 | 0.627722 | from allennlp_demo.common.testing import ModelEndpointTestCase
from allennlp_demo.ccg_supertagging.api import CCGSupertaggingModelEndpoint
class TestCCGSupertaggingModelEndpoint(ModelEndpointTestCase):
endpoint = CCGSupertaggingModelEndpoint()
predict_input = {
"sentence": "Did Uriah honestly think he... | true | true |
f72d203b944c8b07115f5722c5e0681ea802674a | 53,500 | py | Python | qa/rpc-tests/p2p-fullblocktest.py | Kimax89/wallet-official | e2e804daa66aa82dd85a4e8a0c3f6662d03429ca | [
"MIT"
] | 24 | 2018-05-21T02:53:18.000Z | 2021-12-31T07:03:51.000Z | qa/rpc-tests/p2p-fullblocktest.py | Kimax89/wallet-official | e2e804daa66aa82dd85a4e8a0c3f6662d03429ca | [
"MIT"
] | 8 | 2018-05-28T20:48:26.000Z | 2019-11-26T18:45:00.000Z | qa/rpc-tests/p2p-fullblocktest.py | Kimax89/wallet-official | e2e804daa66aa82dd85a4e8a0c3f6662d03429ca | [
"MIT"
] | 16 | 2018-05-21T02:53:23.000Z | 2020-10-07T16:21:57.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017 The Bitcoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import ComparisonTestFrame... | 40.622627 | 131 | 0.539813 |
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from test_framework.comptool import TestManager, TestInstance, RejectResult
from test_framework.blocktools import *
import time
from test_framework.key import CECKey
from test_framework.script import *
import struc... | true | true |
f72d220cd721047c490c67e94323bd45ebdd24c5 | 6,988 | py | Python | ca/1d-life.py | pghrogue/Sprint-Challenge-BC-Cellular-Automata | 0165bfaf0032de63d244793c069efc7bdb734912 | [
"MIT"
] | null | null | null | ca/1d-life.py | pghrogue/Sprint-Challenge-BC-Cellular-Automata | 0165bfaf0032de63d244793c069efc7bdb734912 | [
"MIT"
] | null | null | null | ca/1d-life.py | pghrogue/Sprint-Challenge-BC-Cellular-Automata | 0165bfaf0032de63d244793c069efc7bdb734912 | [
"MIT"
] | null | null | null | import pygame, random
def get_new_value(old_gen, old_automata):
# TBC - add code to generate the next row of cells,
# then replace the return statement below to
# return the updated automata
# automata = get_new_value(generations-1, automata)
# If each row = 50 cells (0-49) and generations start a... | 35.472081 | 133 | 0.608042 | import pygame, random
def get_new_value(old_gen, old_automata):
automata = old_automata.copy()
new_automata = []
for i in range(old_gen + 1):
working_row = automata[0:SQ_NUM]
new_automata += working_row
if i == old_ge... | true | true |
f72d22c9e5b0c4a483dbc497494b6ab24aa21494 | 13,242 | py | Python | pandas/tests/io/parser/test_python_parser_only.py | luftwurzel/pandas | 8980af7ce9d98713b0f8792e38f0fe43088e8780 | [
"BSD-3-Clause"
] | 1 | 2022-03-29T01:38:03.000Z | 2022-03-29T01:38:03.000Z | pandas/tests/io/parser/test_python_parser_only.py | luftwurzel/pandas | 8980af7ce9d98713b0f8792e38f0fe43088e8780 | [
"BSD-3-Clause"
] | 1 | 2022-03-18T01:26:58.000Z | 2022-03-18T01:26:58.000Z | pandas/tests/io/parser/test_python_parser_only.py | luftwurzel/pandas | 8980af7ce9d98713b0f8792e38f0fe43088e8780 | [
"BSD-3-Clause"
] | 1 | 2022-03-22T11:50:25.000Z | 2022-03-22T11:50:25.000Z | """
Tests that apply specifically to the Python parser. Unless specifically
stated as a Python-specific issue, the goal is to eventually move as many of
these tests out of this module as soon as the C parser can accept further
arguments when parsing.
"""
from __future__ import annotations
import csv
from io import (
... | 28.786957 | 88 | 0.633515 | from __future__ import annotations
import csv
from io import (
BytesIO,
StringIO,
)
import pytest
from pandas.errors import (
ParserError,
ParserWarning,
)
from pandas import (
DataFrame,
Index,
MultiIndex,
)
import pandas._testing as tm
def test_default_separator(python_parser_only):
... | true | true |
f72d26ac34029c16b97220fe6f4e82f84591a1ca | 867 | py | Python | zulip_bots/zulip_bots/bots/tyro/fb_login.py | tuhinspatra/tyro-zulip-bot | 29c149af1b01955e50564e31cff03331fa723880 | [
"MIT"
] | 1 | 2020-05-25T11:52:31.000Z | 2020-05-25T11:52:31.000Z | zulip_bots/zulip_bots/bots/tyro/fb_login.py | armag-pro/tyro-zulip-bot | 29c149af1b01955e50564e31cff03331fa723880 | [
"MIT"
] | 6 | 2020-03-24T16:39:54.000Z | 2021-04-30T20:46:43.000Z | zulip_bots/zulip_bots/bots/tyro/fb_login.py | tuhinspatra/tyro-zulip-bot | 29c149af1b01955e50564e31cff03331fa723880 | [
"MIT"
] | 3 | 2019-01-26T21:40:16.000Z | 2019-02-24T20:16:26.000Z | import requests
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
def fblogin(bot_handler,message):
if len(message)>=2:
e=message[0]
p=message[1]
driver = webdriver.Chrome('/home/jugtaram/Downloads/chromedriver/chromedriver')
driver.get('http://www.google.com/xhtml')
time.slee... | 27.967742 | 83 | 0.739331 | import requests
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
def fblogin(bot_handler,message):
if len(message)>=2:
e=message[0]
p=message[1]
driver = webdriver.Chrome('/home/jugtaram/Downloads/chromedriver/chromedriver')
driver.get('http://www.google.com/xhtml')
time.slee... | true | true |
f72d27381ef9a8326bf0fa9c73f1a02d54aac435 | 51 | py | Python | recognition/learning_error_exception.py | SubmergedTree/SmartMirror | c822469f0d4340a31873fe623290cf4bcd745b5f | [
"MIT"
] | null | null | null | recognition/learning_error_exception.py | SubmergedTree/SmartMirror | c822469f0d4340a31873fe623290cf4bcd745b5f | [
"MIT"
] | 1 | 2021-10-12T22:04:20.000Z | 2021-10-12T22:04:20.000Z | recognition/learning_error_exception.py | SubmergedTree/SmartMirror | c822469f0d4340a31873fe623290cf4bcd745b5f | [
"MIT"
] | null | null | null |
class LearningErrorException(Exception):
pass
| 12.75 | 40 | 0.784314 |
class LearningErrorException(Exception):
pass
| true | true |
f72d2884a4c116033ae93117d3448f7e063ac329 | 323 | py | Python | tests/PartitionerTest/test_geom.py | stu314159/tLBM | 1256c5b12fc315d59e08d704c6cef72200e9f01c | [
"MIT"
] | null | null | null | tests/PartitionerTest/test_geom.py | stu314159/tLBM | 1256c5b12fc315d59e08d704c6cef72200e9f01c | [
"MIT"
] | null | null | null | tests/PartitionerTest/test_geom.py | stu314159/tLBM | 1256c5b12fc315d59e08d704c6cef72200e9f01c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
sys.path.insert(1,'../../python')
import FluidChannel as fc
import numpy as np
aLx_p = 1.0;
aLy_p = 1.0;
aLz_p = 5.0;
aNdivs = 11;
emptyChan = fc.FluidChannel(Lx_p = aLx_p,Ly_p = aLy_p,
Lz_p = aLz_p, N_divs = aNdivs);
emptyChan.write_mat_file('test_geom'... | 17.944444 | 58 | 0.634675 |
import sys
sys.path.insert(1,'../../python')
import FluidChannel as fc
import numpy as np
aLx_p = 1.0;
aLy_p = 1.0;
aLz_p = 5.0;
aNdivs = 11;
emptyChan = fc.FluidChannel(Lx_p = aLx_p,Ly_p = aLy_p,
Lz_p = aLz_p, N_divs = aNdivs);
emptyChan.write_mat_file('test_geom');
| true | true |
f72d28af1ec1193a05b944fcc0ecd4e67dee8ef2 | 3,876 | py | Python | lib/bx/align/tools/thread.py | mr-c/bx-python | 0b2b766eee008d1f7a2814be4ddd2c5dc3787537 | [
"MIT"
] | null | null | null | lib/bx/align/tools/thread.py | mr-c/bx-python | 0b2b766eee008d1f7a2814be4ddd2c5dc3787537 | [
"MIT"
] | null | null | null | lib/bx/align/tools/thread.py | mr-c/bx-python | 0b2b766eee008d1f7a2814be4ddd2c5dc3787537 | [
"MIT"
] | null | null | null | """
Tools for "threading" out specific species from alignments (removing other
species and fixing alignment text).
"""
from copy import deepcopy
def thread(mafs, species):
"""
Restrict an list of alignments to a given list of species by:
1) Removing components for any other species
2) Remove... | 36.914286 | 130 | 0.663829 |
from copy import deepcopy
def thread(mafs, species):
for m in mafs:
new_maf = deepcopy(m)
new_components = get_components_for_species(new_maf, species)
if new_components:
remove_all_gap_columns(new_components)
new_maf.components = new_components
new_maf... | true | true |
f72d28c7ae1172bb24daa73c1333bd9c22f501e4 | 662 | py | Python | hospital/migrations/0014_auto_20180727_1635.py | mohitkyadav/calldoc | ebdcdcfac346e995c44cbf94a3c87c25ba594ee1 | [
"MIT"
] | 9 | 2019-05-19T14:00:03.000Z | 2019-05-21T14:19:56.000Z | hospital/migrations/0014_auto_20180727_1635.py | mohitkyadav/calldoc | ebdcdcfac346e995c44cbf94a3c87c25ba594ee1 | [
"MIT"
] | 8 | 2019-05-20T12:29:08.000Z | 2022-02-10T11:06:55.000Z | hospital/migrations/0014_auto_20180727_1635.py | mohitkyadav/calldoc | ebdcdcfac346e995c44cbf94a3c87c25ba594ee1 | [
"MIT"
] | 1 | 2019-05-20T07:04:20.000Z | 2019-05-20T07:04:20.000Z | # Generated by Django 2.0.5 on 2018-07-27 11:05
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hospital', '0013_hospital_verified'),
]
operations = [
migrations.AlterField(
model_name='hospital... | 33.1 | 288 | 0.663142 |
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('hospital', '0013_hospital_verified'),
]
operations = [
migrations.AlterField(
model_name='hospital',
name='phone_number',
... | true | true |
f72d2969cb4da475bd90bb46276e9d83169e8b9f | 3,113 | py | Python | preprocessing/GTEx/filter_by_tissue.py | arnegebert/splicing | 3e19ce83a9f6d98bc6c2d8b653660d22e453ca77 | [
"MIT"
] | 1 | 2021-05-13T15:30:39.000Z | 2021-05-13T15:30:39.000Z | preprocessing/GTEx/filter_by_tissue.py | arnegebert/splicing | 3e19ce83a9f6d98bc6c2d8b653660d22e453ca77 | [
"MIT"
] | null | null | null | preprocessing/GTEx/filter_by_tissue.py | arnegebert/splicing | 3e19ce83a9f6d98bc6c2d8b653660d22e453ca77 | [
"MIT"
] | null | null | null | import csv
import numpy as np
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--tissue', type=str, default='Brain - Cortex', metavar='tissue',
help='type of tissue filtered for')
parser.add_argument('--save-to', type=str,
default='../../data/gtex_processe... | 39.910256 | 107 | 0.686476 | import csv
import numpy as np
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--tissue', type=str, default='Brain - Cortex', metavar='tissue',
help='type of tissue filtered for')
parser.add_argument('--save-to', type=str,
default='../../data/gtex_processe... | true | true |
f72d29bb6e25f40a831066ee40a2b39e46a84b2d | 14,911 | py | Python | indicator_opt.py | jkterry1/parameter-sharing-paper | cb26ad195b580006f66fd8a60973408d5657b209 | [
"MIT"
] | 1 | 2022-01-28T00:01:44.000Z | 2022-01-28T00:01:44.000Z | indicator_opt.py | jkterry1/parameter-sharing-paper | cb26ad195b580006f66fd8a60973408d5657b209 | [
"MIT"
] | null | null | null | indicator_opt.py | jkterry1/parameter-sharing-paper | cb26ad195b580006f66fd8a60973408d5657b209 | [
"MIT"
] | null | null | null | import sys
import json
import numpy as np
import os
import pickle as pkl
import time
from pprint import pprint
from stable_baselines3 import PPO, DQN
from stable_baselines3.common.utils import set_random_seed
from pettingzoo.butterfly import cooperative_pong_v3, prospector_v4, knights_archers_zombies_v7
from pettingz... | 40.852055 | 148 | 0.66622 | import sys
import json
import numpy as np
import os
import pickle as pkl
import time
from pprint import pprint
from stable_baselines3 import PPO, DQN
from stable_baselines3.common.utils import set_random_seed
from pettingzoo.butterfly import cooperative_pong_v3, prospector_v4, knights_archers_zombies_v7
from pettingz... | true | true |
f72d29c30cce97f016e99c825381c00e3af87148 | 3,105 | py | Python | enhancitizer/tasks/duplication.py | cherusker/enhancitizer | 1f1516f0aeb61262f2de9767a5f4f17cb62bcb26 | [
"MIT"
] | null | null | null | enhancitizer/tasks/duplication.py | cherusker/enhancitizer | 1f1516f0aeb61262f2de9767a5f4f17cb62bcb26 | [
"MIT"
] | null | null | null | enhancitizer/tasks/duplication.py | cherusker/enhancitizer | 1f1516f0aeb61262f2de9767a5f4f17cb62bcb26 | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------------
#
# Author:
# Armin Hasitzka (enhancitizer@hasitzka.com)
#
# Licensed under the MIT license.
# See LICENSE in the project root for license information.
#
# ------------------------------------------------------------------------------
... | 40.324675 | 105 | 0.579066 |
from utils.printer import Printer
class TaskEliminateDuplicateReports(object):
description = 'Eliminating duplicate reports ...'
__tsan_data_race_max_stack_frames = 3
def __init__(self, bank):
self.__bank = bank
def setup(self, options):
self.__printer = Printer(options)
... | true | true |
f72d2a82d4064325d5026f24287d9cbfc1f2c3ae | 15,055 | py | Python | tensorflow_probability/python/distributions/beta.py | sanket-kamthe/probability | c22b6201155c2e58d08a4ad30641d1aff59fbe7c | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/beta.py | sanket-kamthe/probability | c22b6201155c2e58d08a4ad30641d1aff59fbe7c | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/beta.py | sanket-kamthe/probability | c22b6201155c2e58d08a4ad30641d1aff59fbe7c | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Probability 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 law o... | 39.308094 | 100 | 0.69897 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow.compat.v2 as tf
from tensorflow_probability.python.distributions import distribution
from tensorflow_probability.python.distributions import kullback_leible... | true | true |
f72d2c7e7a339b176c424997056def39dbb232ca | 476 | py | Python | data/scripts/templates/object/mobile/shared_dressed_binayre_ruffian_trandoshan_female_01.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/mobile/shared_dressed_binayre_ruffian_trandoshan_female_01.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/mobile/shared_dressed_binayre_ruffian_trandoshan_female_01.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_dressed_binayre_ruffian_trandoshan_female_01.iff"
result.attri... | 28 | 90 | 0.747899 | true | true | |
f72d2d7694c02f9baefa28ab714fa7d648759fe9 | 8,778 | py | Python | groupbunk.py | shine-jayakumar/groupbunk-fb | ddf3d66cd902343e419dd2cf0c86f42850315f08 | [
"MIT"
] | 1 | 2022-02-11T05:31:48.000Z | 2022-02-11T05:31:48.000Z | groupbunk.py | shine-jayakumar/groupbunk-fb | ddf3d66cd902343e419dd2cf0c86f42850315f08 | [
"MIT"
] | null | null | null | groupbunk.py | shine-jayakumar/groupbunk-fb | ddf3d66cd902343e419dd2cf0c86f42850315f08 | [
"MIT"
] | null | null | null | """
GroupBunk v.1.2
Leave your Facebook groups quietly
Author: Shine Jayakumar
Github: https://github.com/shine-jayakumar
LICENSE: MIT
"""
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.chrome.options import Options
from selenium.common.exceptions imp... | 35.97541 | 127 | 0.670084 |
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.chrome.options import Options
from selenium.common.exceptions import StaleElementReferenceException
from webdriver_manager.chrome import ChromeDriverManager
import argparse
import logging
import sys
from date... | true | true |
f72d2dffe680e5fa8e448bd4483a994fa75b8c69 | 631 | py | Python | python/24_swap_nodes_in_pairs.py | dchapp/blind75 | aaa409cf2db4ef6d0f86177f4217eceeb391caa8 | [
"MIT"
] | null | null | null | python/24_swap_nodes_in_pairs.py | dchapp/blind75 | aaa409cf2db4ef6d0f86177f4217eceeb391caa8 | [
"MIT"
] | null | null | null | python/24_swap_nodes_in_pairs.py | dchapp/blind75 | aaa409cf2db4ef6d0f86177f4217eceeb391caa8 | [
"MIT"
] | null | null | null | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
def swapPairs(self, head: Optional[ListNode]) -> Optional[ListNode]:
return self.recursive(head)
def recursive(self, head):
... | 28.681818 | 72 | 0.600634 |
class Solution:
def swapPairs(self, head: Optional[ListNode]) -> Optional[ListNode]:
return self.recursive(head)
def recursive(self, head):
if head is None or head.next is None:
return head
current = head
successor = head.next
subproblem = head.... | true | true |
f72d2e556f8e1a61daf19ae049a8aca684ccd0aa | 4,594 | py | Python | axelrod/tests/strategies/test_human.py | danilobellini/Axelrod | 2c9212553e06095c24adcb82a5979279cbdf45fb | [
"MIT"
] | null | null | null | axelrod/tests/strategies/test_human.py | danilobellini/Axelrod | 2c9212553e06095c24adcb82a5979279cbdf45fb | [
"MIT"
] | null | null | null | axelrod/tests/strategies/test_human.py | danilobellini/Axelrod | 2c9212553e06095c24adcb82a5979279cbdf45fb | [
"MIT"
] | null | null | null | from os import linesep
from unittest import TestCase
from unittest.mock import patch
from axelrod import Action, Cooperator, Player
from axelrod.strategies.human import ActionValidator, Human
from prompt_toolkit.validation import ValidationError
from .test_player import TestPlayer
C, D = Action.C, Action.D
class T... | 34.80303 | 86 | 0.622987 | from os import linesep
from unittest import TestCase
from unittest.mock import patch
from axelrod import Action, Cooperator, Player
from axelrod.strategies.human import ActionValidator, Human
from prompt_toolkit.validation import ValidationError
from .test_player import TestPlayer
C, D = Action.C, Action.D
class T... | true | true |
f72d30c55d3dd51166d633ec61c36e24eaf973af | 4,841 | py | Python | stepper.py | mechkro/Linux_Repo | f71e71814a5496470b731bb32b3be67ab8085f7a | [
"MIT"
] | null | null | null | stepper.py | mechkro/Linux_Repo | f71e71814a5496470b731bb32b3be67ab8085f7a | [
"MIT"
] | null | null | null | stepper.py | mechkro/Linux_Repo | f71e71814a5496470b731bb32b3be67ab8085f7a | [
"MIT"
] | null | null | null | from time import sleep
import RPi.GPIO as GPIO
########################################################################
#SOURCE - https://www.rototron.info/raspberry-pi-stepper-motor-tutorial/
########################################################################
"""
As always I recommend you start with a freshly w... | 32.059603 | 92 | 0.677959 | from time import sleep
import RPi.GPIO as GPIO
| true | true |
f72d310e84eaa324a5380b4aaf86a7da4b908cd0 | 682 | py | Python | spacy/tests/lang/nb/test_tokenizer.py | cedar101/spaCy | 66e22098a8bb77cbe527b1a4a3c69ec1cfb56f95 | [
"MIT"
] | 12 | 2019-03-20T20:43:47.000Z | 2020-04-13T11:10:52.000Z | spacy/tests/lang/nb/test_tokenizer.py | cedar101/spaCy | 66e22098a8bb77cbe527b1a4a3c69ec1cfb56f95 | [
"MIT"
] | 13 | 2018-06-05T11:54:40.000Z | 2019-07-02T11:33:14.000Z | spacy/tests/lang/nb/test_tokenizer.py | cedar101/spaCy | 66e22098a8bb77cbe527b1a4a3c69ec1cfb56f95 | [
"MIT"
] | 2 | 2020-02-15T18:33:35.000Z | 2022-02-13T14:11:41.000Z | # coding: utf8
from __future__ import unicode_literals
import pytest
NB_TOKEN_EXCEPTION_TESTS = [
(
"Smørsausen brukes bl.a. til fisk",
["Smørsausen", "brukes", "bl.a.", "til", "fisk"],
),
(
"Jeg kommer først kl. 13 pga. diverse forsinkelser",
["Jeg", "kommer", "først", "k... | 28.416667 | 83 | 0.673021 |
from __future__ import unicode_literals
import pytest
NB_TOKEN_EXCEPTION_TESTS = [
(
"Smørsausen brukes bl.a. til fisk",
["Smørsausen", "brukes", "bl.a.", "til", "fisk"],
),
(
"Jeg kommer først kl. 13 pga. diverse forsinkelser",
["Jeg", "kommer", "først", "kl.", "13", "pg... | true | true |
f72d313ae90abc9a33fbbe8f201a19f2c2f9ceb1 | 2,825 | py | Python | irobot/openinterface/constants.py | bhargav-nunna/irobot | 9251f71267fa8cf5e9620f70aa892ae1b7a182f9 | [
"Unlicense"
] | 13 | 2018-08-19T07:09:36.000Z | 2021-08-10T22:52:31.000Z | irobot/openinterface/constants.py | bhargav-nunna/irobot | 9251f71267fa8cf5e9620f70aa892ae1b7a182f9 | [
"Unlicense"
] | null | null | null | irobot/openinterface/constants.py | bhargav-nunna/irobot | 9251f71267fa8cf5e9620f70aa892ae1b7a182f9 | [
"Unlicense"
] | 4 | 2019-01-21T20:03:36.000Z | 2021-01-26T23:59:00.000Z | __author__ = 'Matthew Witherwax (lemoneer)'
class Constant(object):
def __init__(self, **kwds):
self.__dict__.update(kwds)
BAUD_RATE = Constant(BAUD_300=0, BAUD_600=1, BAUD_1200=2, BAUD_2400=3, BAUD_4800=4, BAUD_9600=5, BAUD_14400=6,
BAUD_19200=7, BAUD_2... | 65.697674 | 121 | 0.578761 | __author__ = 'Matthew Witherwax (lemoneer)'
class Constant(object):
def __init__(self, **kwds):
self.__dict__.update(kwds)
BAUD_RATE = Constant(BAUD_300=0, BAUD_600=1, BAUD_1200=2, BAUD_2400=3, BAUD_4800=4, BAUD_9600=5, BAUD_14400=6,
BAUD_19200=7, BAUD_2... | true | true |
f72d313cd4ada98558e9158f9a61578f59dfac19 | 1,137 | py | Python | nodebox/ext/psyco/src/test/regrtester2.py | mcjocobe/drawExploration | 2c50526ef14dea5bc3802b7fda08871919d62ac4 | [
"BSD-3-Clause"
] | 76 | 2015-01-21T11:21:08.000Z | 2022-02-04T13:33:19.000Z | nodebox/ext/psyco/src/test/regrtester2.py | pepsipepsi/nodebox_opengl_python3 | cfb2633df1055a028672b11311603cc2241a1378 | [
"BSD-3-Clause"
] | 8 | 2015-11-12T07:42:58.000Z | 2020-06-09T10:01:15.000Z | nodebox/ext/psyco/src/test/regrtester2.py | pepsipepsi/nodebox_opengl_python3 | cfb2633df1055a028672b11311603cc2241a1378 | [
"BSD-3-Clause"
] | 23 | 2015-01-12T12:07:40.000Z | 2020-04-13T16:32:15.000Z | #
# A less memory-exploding version of regrtester.py.
# It runs only a fraction of the tests.
#
import sys, re, psyco
assert len(sys.argv) >= 2
match = re.match(r"(\d+)[/](\d+)", sys.argv[1])
assert match, "syntax: regrtester2.py n/m [-nodump] [seed]"
n = int(match.group(1))
m = int(match.group(2))
assert 0 <= n < m... | 23.204082 | 65 | 0.605101 |
import sys, re, psyco
assert len(sys.argv) >= 2
match = re.match(r"(\d+)[/](\d+)", sys.argv[1])
assert match, "syntax: regrtester2.py n/m [-nodump] [seed]"
n = int(match.group(1))
m = int(match.group(2))
assert 0 <= n < m
import test.regrtest
import regrtester
def confirm_still_in_psyco():
return __in_psy... | false | true |
f72d313fd14aa573c97358c7fd15134cb132ca43 | 79 | py | Python | part1/settings.py | codingfever-anishmishra/Warrior-Game-developement-in-python | ff9bb627251f6b82a08f3bc7d84fb72068fea3db | [
"Apache-2.0"
] | null | null | null | part1/settings.py | codingfever-anishmishra/Warrior-Game-developement-in-python | ff9bb627251f6b82a08f3bc7d84fb72068fea3db | [
"Apache-2.0"
] | null | null | null | part1/settings.py | codingfever-anishmishra/Warrior-Game-developement-in-python | ff9bb627251f6b82a08f3bc7d84fb72068fea3db | [
"Apache-2.0"
] | null | null | null | WIDTH = 1024
HEIGHT = 768
#colours
WHITE = (255,255,255)
RED = (255,0,0)
| 9.875 | 21 | 0.594937 | WIDTH = 1024
HEIGHT = 768
WHITE = (255,255,255)
RED = (255,0,0)
| true | true |
f72d315bd4e174ec29505858afbbabd8ed0a9121 | 2,181 | py | Python | tests/geoNetworks/testAddTimeTravelToEdges.py | ComplexCity/policosm | 548d4d694df49603f91cd45af7fe50ced79aea68 | [
"MIT"
] | 6 | 2017-06-05T07:30:46.000Z | 2022-03-07T00:47:22.000Z | tests/geoNetworks/testAddTimeTravelToEdges.py | ComplexCity/policosm | 548d4d694df49603f91cd45af7fe50ced79aea68 | [
"MIT"
] | 1 | 2017-12-14T05:40:42.000Z | 2017-12-14T05:40:42.000Z | tests/geoNetworks/testAddTimeTravelToEdges.py | ComplexCity/policosm | 548d4d694df49603f91cd45af7fe50ced79aea68 | [
"MIT"
] | 1 | 2020-10-22T19:18:30.000Z | 2020-10-22T19:18:30.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Created in February 2017 in ComplexCity Lab
@author: github.com/fpfaende
what it does
add metric distance between two nodes of an edge
distance is computed in specified projection system
to maximize precision
parameters
graph
epsg code for targeted projection
how i... | 26.597561 | 76 | 0.731774 |
'''
Created in February 2017 in ComplexCity Lab
@author: github.com/fpfaende
what it does
add metric distance between two nodes of an edge
distance is computed in specified projection system
to maximize precision
parameters
graph
epsg code for targeted projection
how it works
1 - prepare coordinate projecti... | false | true |
f72d316388cae4d3fa92f9185ec7e2b07efe7778 | 24,267 | py | Python | source/spktype21.py | whiskie14142/spktype21 | 7ed22365fe92cdb74c416d27634df96a45712953 | [
"MIT"
] | 1 | 2021-10-21T20:07:04.000Z | 2021-10-21T20:07:04.000Z | source/spktype21.py | whiskie14142/spktype21 | 7ed22365fe92cdb74c416d27634df96a45712953 | [
"MIT"
] | 1 | 2020-05-20T05:54:34.000Z | 2020-05-20T05:54:34.000Z | source/spktype21.py | whiskie14142/spktype21 | 7ed22365fe92cdb74c416d27634df96a45712953 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""A supporting module for jplephem to handle data type 21 (Version 0.1.0)
This module computes position and velocity of a celestial small body, from a
NASA SPICE SPK ephemeris kernel file of data type 21 (Extended Modified
Difference Arrays).
http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/FO... | 36.712557 | 108 | 0.588536 |
from numpy import array, zeros, reshape
from jplephem.daf import DAF
from jplephem.names import target_names
T0 = 2451545.0
S_PER_DAY = 86400.0
MAXTRM = 25
def jd(seconds):
return T0 + seconds / S_PER_DAY
class SPKType21(object):
def __init__(self, daf):
self.daf = daf
self.segments = [Se... | true | true |
f72d3177ad5efc5cf08c928ba31c9ec1b2799491 | 119,007 | py | Python | cinder/volume/drivers/ibm/ibm_storage/xiv_proxy.py | yachika-ralhan/cinder | 9d4fd16bcd8eca930910798cc519cb5bc5846c59 | [
"Apache-2.0"
] | 1 | 2018-10-23T17:00:53.000Z | 2018-10-23T17:00:53.000Z | cinder/volume/drivers/ibm/ibm_storage/xiv_proxy.py | vexata/cinder | 7b84c0842b685de7ee012acec40fb4064edde5e9 | [
"Apache-2.0"
] | null | null | null | cinder/volume/drivers/ibm/ibm_storage/xiv_proxy.py | vexata/cinder | 7b84c0842b685de7ee012acec40fb4064edde5e9 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2016 IBM Corporation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | 42.38141 | 79 | 0.561345 |
import datetime
import re
import six
import socket
from oslo_log import log as logging
from oslo_utils import importutils
pyxcli = importutils.try_import("pyxcli")
if pyxcli:
from pyxcli import client
from pyxcli import errors
from pyxcli.events import events
from pyxcli.mirroring impo... | true | true |
f72d3224b042c8c5cc09ea30e0b80e5291a743e2 | 283 | py | Python | source.py | kingsam91/Habari-zote | ab6e41bc37cfa86d319c1fd26e868c32e3712a26 | [
"Unlicense"
] | null | null | null | source.py | kingsam91/Habari-zote | ab6e41bc37cfa86d319c1fd26e868c32e3712a26 | [
"Unlicense"
] | null | null | null | source.py | kingsam91/Habari-zote | ab6e41bc37cfa86d319c1fd26e868c32e3712a26 | [
"Unlicense"
] | null | null | null | class Source:
"""
Class that generates new instances of news api source results
"""
def __init__(self,id,name,category):
'''
define properties for our objects
'''
self.id = id
self.name = name
self.category = category | 21.769231 | 65 | 0.568905 | class Source:
def __init__(self,id,name,category):
self.id = id
self.name = name
self.category = category | true | true |
f72d3258acf4addc09946484e264cdf03539e560 | 441 | py | Python | Mundo_1/Ex012.py | alinenog/Mundo_Python-1-2-3 | 2cfda105eec436ae32394e01c011342515fceff5 | [
"MIT"
] | null | null | null | Mundo_1/Ex012.py | alinenog/Mundo_Python-1-2-3 | 2cfda105eec436ae32394e01c011342515fceff5 | [
"MIT"
] | null | null | null | Mundo_1/Ex012.py | alinenog/Mundo_Python-1-2-3 | 2cfda105eec436ae32394e01c011342515fceff5 | [
"MIT"
] | null | null | null | # Exercício Python 12:
# Faça um algoritmo que leia o preço de um produto e mostre seu novo preço, com 5% de desconto.
print('----------------------------')
print(' LEITOR DE PREÇO ')
print('----------------------------')
print()
vl = float(input('Digite o valor do produto? R$'))
d = (vl * 5) /100
... | 40.090909 | 96 | 0.548753 |
print('----------------------------')
print(' LEITOR DE PREÇO ')
print('----------------------------')
print()
vl = float(input('Digite o valor do produto? R$'))
d = (vl * 5) /100
print('Preço do produto atual R$ {}'.format(vl))
print('|Preço do produto com 5% de desconto é R$ {:.2f}|'.format(vl-d... | true | true |
f72d32a6cc1842bfd53c17bfe61d760812d0fc52 | 3,981 | py | Python | sina_spider/sina_spider/spiders/SinaSpider.py | lj28478416/Sina_News | 13ef1d52ba5c81021cdf73370e12ec84777741e0 | [
"Apache-2.0"
] | null | null | null | sina_spider/sina_spider/spiders/SinaSpider.py | lj28478416/Sina_News | 13ef1d52ba5c81021cdf73370e12ec84777741e0 | [
"Apache-2.0"
] | null | null | null | sina_spider/sina_spider/spiders/SinaSpider.py | lj28478416/Sina_News | 13ef1d52ba5c81021cdf73370e12ec84777741e0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import scrapy
import os
from ..items import SinaSpiderItem
from ..settings import COOKIES
import re
class SinaspiderSpider(scrapy.Spider):
name = 'SinaSpider'
allowed_domains = ["sina.com",'sina.com.cn']
start_urls = ['http://www.sina.com.cn/']
def parse(self, response):
... | 47.963855 | 147 | 0.544587 |
import scrapy
import os
from ..items import SinaSpiderItem
from ..settings import COOKIES
import re
class SinaspiderSpider(scrapy.Spider):
name = 'SinaSpider'
allowed_domains = ["sina.com",'sina.com.cn']
start_urls = ['http://www.sina.com.cn/']
def parse(self, response):
first_lev_node_list ... | true | true |
f72d3365da66cf6a696526d674b481da1da66e77 | 22,009 | py | Python | LibBookbuilder/chapter.py | Siyavula/bookbuilder | 484f344a6b536d01ed51ea719f47c68aae654d5d | [
"MIT"
] | 1 | 2015-07-18T16:24:36.000Z | 2015-07-18T16:24:36.000Z | LibBookbuilder/chapter.py | Siyavula/bookbuilder | 484f344a6b536d01ed51ea719f47c68aae654d5d | [
"MIT"
] | 2 | 2016-02-04T18:26:39.000Z | 2019-05-09T12:23:16.000Z | LibBookbuilder/chapter.py | Siyavula/bookbuilder | 484f344a6b536d01ed51ea719f47c68aae654d5d | [
"MIT"
] | 1 | 2016-01-31T22:26:27.000Z | 2016-01-31T22:26:27.000Z | """Class to handle chapter processing for books."""
from __future__ import print_function
import os
import logging
import hashlib
import subprocess
import inspect
import copy
import lxml
from lxml import etree
try:
from termcolor import colored
except ImportError:
logging.error("Please install termcolor:\n s... | 38.612281 | 105 | 0.509383 | from __future__ import print_function
import os
import logging
import hashlib
import subprocess
import inspect
import copy
import lxml
from lxml import etree
try:
from termcolor import colored
except ImportError:
logging.error("Please install termcolor:\n sudo pip install termcolor")
from XmlValidator impor... | true | true |
f72d33747d7c9c8e08cd2921f18bbde62bc85b8d | 16,578 | py | Python | azure-mgmt-network/azure/mgmt/network/operations/security_rules_operations.py | azuresdkci1x/azure-sdk-for-python-1722 | e08fa6606543ce0f35b93133dbb78490f8e6bcc9 | [
"MIT"
] | 1 | 2018-11-09T06:16:34.000Z | 2018-11-09T06:16:34.000Z | azure-mgmt-network/azure/mgmt/network/operations/security_rules_operations.py | azuresdkci1x/azure-sdk-for-python-1722 | e08fa6606543ce0f35b93133dbb78490f8e6bcc9 | [
"MIT"
] | null | null | null | azure-mgmt-network/azure/mgmt/network/operations/security_rules_operations.py | azuresdkci1x/azure-sdk-for-python-1722 | e08fa6606543ce0f35b93133dbb78490f8e6bcc9 | [
"MIT"
] | 1 | 2018-11-09T06:17:41.000Z | 2018-11-09T06:17:41.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 46.830508 | 192 | 0.670829 |
from msrest.pipeline import ClientRawResponse
from msrestazure.azure_exceptions import CloudError
from msrestazure.azure_operation import AzureOperationPoller
import uuid
from .. import models
class SecurityRulesOperations(object):
def __init__(self, client, config, serializer, deserializer):
... | true | true |
f72d34add56f4240517a10872e4332cb3d2bd4f6 | 907 | py | Python | start_sample.py | ina-foss/stream-index-massive-tweets | 63e6919fa441a24d12f90f42d3045b45a356f6dd | [
"MIT"
] | 4 | 2020-04-10T16:25:19.000Z | 2021-06-26T16:06:57.000Z | start_sample.py | ina-foss/stream-index-massive-tweets | 63e6919fa441a24d12f90f42d3045b45a356f6dd | [
"MIT"
] | null | null | null | start_sample.py | ina-foss/stream-index-massive-tweets | 63e6919fa441a24d12f90f42d3045b45a356f6dd | [
"MIT"
] | 1 | 2020-10-07T16:36:22.000Z | 2020-10-07T16:36:22.000Z | import requests
import logging
import time
logging.basicConfig(format='%(asctime)s - %(levelname)s : %(message)s', level=logging.INFO)
def stream():
"""
Send stream instructions to streamer servers in the form of HTTP POST requests.
The streamer_0 is dedicated to the Twitter sample API, so we don't send ... | 29.258065 | 109 | 0.631753 | import requests
import logging
import time
logging.basicConfig(format='%(asctime)s - %(levelname)s : %(message)s', level=logging.INFO)
def stream():
while True:
try:
r = requests.post("http://streamer_0:5000/stream", json={})
break
except requests.exceptions.ConnectionErro... | true | true |
f72d35520a9df35cca1aca5514b7eef3d130635f | 1,121 | py | Python | tests/test_dipdup/models.py | spruceid/dipdup-py | adc904196cfd66563938feec0f0afcc5f3df03e3 | [
"MIT"
] | null | null | null | tests/test_dipdup/models.py | spruceid/dipdup-py | adc904196cfd66563938feec0f0afcc5f3df03e3 | [
"MIT"
] | null | null | null | tests/test_dipdup/models.py | spruceid/dipdup-py | adc904196cfd66563938feec0f0afcc5f3df03e3 | [
"MIT"
] | null | null | null | # generated by datamodel-codegen:
# filename: storage.json
from __future__ import annotations
from typing import Dict, List, Optional
from pydantic import BaseModel, Extra
class ResourceMap(BaseModel):
class Config:
extra = Extra.forbid
id: str
rate: str
class ResourceCollectorStorage(Bas... | 23.354167 | 117 | 0.613738 |
from __future__ import annotations
from typing import Dict, List, Optional
from pydantic import BaseModel, Extra
class ResourceMap(BaseModel):
class Config:
extra = Extra.forbid
id: str
rate: str
class ResourceCollectorStorage(BaseModel):
class Config:
extra = Extra.forbid
... | true | true |
f72d35e8cf56ef9f7fbf1705d18d66a60efa75a9 | 4,831 | py | Python | test/functional/mempool_reorg.py | arock121/pocketnet.core | bc08bf9dc565c60d7e7d53e3cc615408b76f9bde | [
"ECL-2.0",
"Apache-2.0"
] | 72 | 2019-06-23T07:48:03.000Z | 2022-03-31T03:47:04.000Z | test/functional/mempool_reorg.py | arock121/pocketnet.core | bc08bf9dc565c60d7e7d53e3cc615408b76f9bde | [
"ECL-2.0",
"Apache-2.0"
] | 153 | 2021-01-20T08:10:23.000Z | 2022-03-31T23:30:50.000Z | test/functional/mempool_reorg.py | arock121/pocketnet.core | bc08bf9dc565c60d7e7d53e3cc615408b76f9bde | [
"ECL-2.0",
"Apache-2.0"
] | 20 | 2019-10-10T22:18:25.000Z | 2022-02-12T01:08:29.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2018 The Pocketcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool re-org scenarios.
Test re-org scenarios with a mempool that contains transactions
that... | 47.831683 | 122 | 0.703788 |
from test_framework.blocktools import create_raw_transaction
from test_framework.test_framework import PocketcoinTestFramework
from test_framework.util import assert_equal, assert_raises_rpc_error
class MempoolCoinbaseTest(PocketcoinTestFramework):
def set_test_params(self):
self.num_nodes = 2
d... | true | true |
f72d363eb6000b6d71778b49bc3242e3155db73d | 1,224 | py | Python | main.py | kchandra423/JPEG-Reader | 8298e715dfba338ca6d17e6d9769cdba82256466 | [
"MIT"
] | null | null | null | main.py | kchandra423/JPEG-Reader | 8298e715dfba338ca6d17e6d9769cdba82256466 | [
"MIT"
] | null | null | null | main.py | kchandra423/JPEG-Reader | 8298e715dfba338ca6d17e6d9769cdba82256466 | [
"MIT"
] | null | null | null | import os
from fractions import Fraction
from PIL import Image
from PIL.ExifTags import TAGS
def get_exif(fn):
ret = {}
i = Image.open(fn)
info = i._getexif()
decoded_dict = {}
for tag, value in info.items():
decoded = TAGS.get(tag, tag)
decoded_dict[decoded] = value
ret['ISO'... | 26.042553 | 77 | 0.609477 | import os
from fractions import Fraction
from PIL import Image
from PIL.ExifTags import TAGS
def get_exif(fn):
ret = {}
i = Image.open(fn)
info = i._getexif()
decoded_dict = {}
for tag, value in info.items():
decoded = TAGS.get(tag, tag)
decoded_dict[decoded] = value
ret['ISO'... | true | true |
f72d36baefbadb9b5e6e7da71a7053953f8e03d6 | 245 | py | Python | benchmarks/DNNF-CIFAR-EQ/properties/global_targeted_diff_8_1.py | dlshriver/dnnv-benchmarks | 84b5bf1e046226d269da1cdbd7a7690fd90d024b | [
"MIT"
] | 1 | 2022-03-01T08:59:32.000Z | 2022-03-01T08:59:32.000Z | benchmarks/DNNF-CIFAR-EQ/properties/global_targeted_diff_8_1.py | dlshriver/dnnv-benchmarks | 84b5bf1e046226d269da1cdbd7a7690fd90d024b | [
"MIT"
] | null | null | null | benchmarks/DNNF-CIFAR-EQ/properties/global_targeted_diff_8_1.py | dlshriver/dnnv-benchmarks | 84b5bf1e046226d269da1cdbd7a7690fd90d024b | [
"MIT"
] | null | null | null | from dnnv.properties import *
import numpy as np
N1 = Network("N1")
N2 = Network("N2")
class_1 = 8
class_2 = 1
Forall(
x,
Implies(
(0 <= x <= 1),
(np.argmax(N1(x)) != class_1) | (np.argmax(N2(x)) != class_2),
),
)
| 14.411765 | 70 | 0.530612 | from dnnv.properties import *
import numpy as np
N1 = Network("N1")
N2 = Network("N2")
class_1 = 8
class_2 = 1
Forall(
x,
Implies(
(0 <= x <= 1),
(np.argmax(N1(x)) != class_1) | (np.argmax(N2(x)) != class_2),
),
)
| true | true |
f72d376d64716f4e1292cdae5c874f29c229dbed | 1,022 | py | Python | GeeksForGeeks/SumOfPairs/solution2.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 165 | 2020-10-03T08:01:11.000Z | 2022-03-31T02:42:08.000Z | GeeksForGeeks/SumOfPairs/solution2.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 383 | 2020-10-03T07:39:11.000Z | 2021-11-20T07:06:35.000Z | GeeksForGeeks/SumOfPairs/solution2.py | gbrls/CompetitiveCode | b6f1b817a655635c3c843d40bd05793406fea9c6 | [
"MIT"
] | 380 | 2020-10-03T08:05:04.000Z | 2022-03-19T06:56:59.000Z | # Map Approach [O(n)] :
# Idea is to create a hashmap to store freq of the elements, and lookup those elements while traversing the array to check if their sum is equal to the given sum or not
# GeeksforGeeks Explanation: https://youtu.be/bvKMZXc0jQU
def getPairsCount(arr, n, sum):
m = [0] * 1000
# Store count... | 31.9375 | 168 | 0.671233 |
def getPairsCount(arr, n, sum):
m = [0] * 1000
for i in range(0, n):
m[arr[i]]
m[arr[i]] += 1
twice_count = 0
for i in range(0, n):
twice_count += m[sum - arr[i]]
if (sum - arr[i] == arr[i]):
twice_count -= 1
return int(twice_count / 2)
n = int(input())
arr = li... | true | true |
f72d384225a2566b1d26d248db3515c9b6c34c12 | 746 | py | Python | run.py | raeyoungii/KJ_Emergency | cb044b8b93f80df6e953bd9f298b7c73bac4a8ed | [
"MIT"
] | 1 | 2020-12-30T15:59:23.000Z | 2020-12-30T15:59:23.000Z | run.py | raeyoungii/KJ_Emergency | cb044b8b93f80df6e953bd9f298b7c73bac4a8ed | [
"MIT"
] | null | null | null | run.py | raeyoungii/KJ_Emergency | cb044b8b93f80df6e953bd9f298b7c73bac4a8ed | [
"MIT"
] | 1 | 2020-12-19T06:55:45.000Z | 2020-12-19T06:55:45.000Z | # -*- encoding: utf-8 -*-
"""
Copyright (c) 2019 - present AppSeed.us
"""
from flask_migrate import Migrate
from os import environ
from sys import exit
from decouple import config
from config import config_dict
from app import create_app, db
# WARNING: Don't run with debug turned on in production!
DEBUG = config('DE... | 22.606061 | 78 | 0.733244 |
from flask_migrate import Migrate
from os import environ
from sys import exit
from decouple import config
from config import config_dict
from app import create_app, db
DEBUG = config('DEBUG', default=True)
# The configuration
get_config_mode = 'Debug' if DEBUG else 'Production'
try:
# Load the configuration... | true | true |
f72d38578c529760cc3eebfa7307b5a6fa0eef3a | 19,861 | py | Python | parcels/kernel/basekernel.py | nvogtvincent/parcels | 6f6dbadacaae54949ade9acd4e4a57dd8b5af398 | [
"MIT"
] | null | null | null | parcels/kernel/basekernel.py | nvogtvincent/parcels | 6f6dbadacaae54949ade9acd4e4a57dd8b5af398 | [
"MIT"
] | null | null | null | parcels/kernel/basekernel.py | nvogtvincent/parcels | 6f6dbadacaae54949ade9acd4e4a57dd8b5af398 | [
"MIT"
] | null | null | null | import re
import _ctypes
import inspect
import numpy.ctypeslib as npct
from time import time as ostime
from os import path
from os import remove
from sys import platform
from sys import version_info
from ast import FunctionDef
from hashlib import md5
from parcels.tools.loggers import logger
import numpy as np
from nump... | 42.803879 | 170 | 0.601682 | import re
import _ctypes
import inspect
import numpy.ctypeslib as npct
from time import time as ostime
from os import path
from os import remove
from sys import platform
from sys import version_info
from ast import FunctionDef
from hashlib import md5
from parcels.tools.loggers import logger
import numpy as np
from nump... | true | true |
f72d390cbcef3353b659e18c1886e17ecd60788c | 5,876 | py | Python | MachikoroSimulator/MachikoroSimulator/Game/Game.py | djscheuf/Machikoro-Simulator | e479ef8d27b0396e2f182537926321689c160f7a | [
"MIT"
] | null | null | null | MachikoroSimulator/MachikoroSimulator/Game/Game.py | djscheuf/Machikoro-Simulator | e479ef8d27b0396e2f182537926321689c160f7a | [
"MIT"
] | null | null | null | MachikoroSimulator/MachikoroSimulator/Game/Game.py | djscheuf/Machikoro-Simulator | e479ef8d27b0396e2f182537926321689c160f7a | [
"MIT"
] | null | null | null | import random
from ..CardEnum import *
from copy import deepcopy
class GameResult:
def __init__(self,winner,turns):
self.winner = winner
self.turns = turns
class Game:
def __init__(self, players, engine, deck, logger):
random.seed()
self.winner = None
self.total_turns... | 33.770115 | 109 | 0.607897 | import random
from ..CardEnum import *
from copy import deepcopy
class GameResult:
def __init__(self,winner,turns):
self.winner = winner
self.turns = turns
class Game:
def __init__(self, players, engine, deck, logger):
random.seed()
self.winner = None
self.total_turns... | true | true |
f72d3911465af80a203ccedab020f7e0013fa7da | 6,068 | py | Python | mcdp/mcstring.py | HWServer/Mcdp | 5877d371ffb6ff3ddc13312d65902707e378d026 | [
"Apache-2.0"
] | null | null | null | mcdp/mcstring.py | HWServer/Mcdp | 5877d371ffb6ff3ddc13312d65902707e378d026 | [
"Apache-2.0"
] | null | null | null | mcdp/mcstring.py | HWServer/Mcdp | 5877d371ffb6ff3ddc13312d65902707e378d026 | [
"Apache-2.0"
] | null | null | null | from pydantic import validator, Field
from typing import Dict, List, Any, Literal, Tuple, Union, Optional
from .typings import McdpBaseModel
from .config import check_mc_version, MinecraftVersionError
class MCStringObj(McdpBaseModel):
def json(self, **kw) -> str:
data = self.dict(**kw)
return se... | 28.223256 | 101 | 0.593276 | from pydantic import validator, Field
from typing import Dict, List, Any, Literal, Tuple, Union, Optional
from .typings import McdpBaseModel
from .config import check_mc_version, MinecraftVersionError
class MCStringObj(McdpBaseModel):
def json(self, **kw) -> str:
data = self.dict(**kw)
return se... | true | true |
f72d3a61f612d2a23374b9374aeaf98f51986974 | 680 | py | Python | migrations/versions/bcb4dc0e73e2_lower_activites.py | betagouv/ecosante | cc7dd76bb65405ba44f432197de851dc7e22ed38 | [
"MIT"
] | 3 | 2021-09-24T14:07:51.000Z | 2021-12-14T13:48:34.000Z | migrations/versions/bcb4dc0e73e2_lower_activites.py | betagouv/recosante-api | 4560b2cf2ff4dc19597792fe15a3805f6259201d | [
"MIT"
] | 187 | 2021-03-25T16:43:49.000Z | 2022-03-23T14:40:31.000Z | migrations/versions/bcb4dc0e73e2_lower_activites.py | betagouv/recosante-api | 4560b2cf2ff4dc19597792fe15a3805f6259201d | [
"MIT"
] | 2 | 2020-04-08T11:56:17.000Z | 2020-04-09T14:04:15.000Z | """lower activites
Revision ID: bcb4dc0e73e2
Revises: 25116bbd585c
Create Date: 2020-10-06 11:34:47.860748
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import text
# revision identifiers, used by Alembic.
revision = 'bcb4dc0e73e2'
down_revision = '25116bbd585c'
branch_labels = None
depends... | 18.888889 | 93 | 0.667647 | from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import text
revision = 'bcb4dc0e73e2'
down_revision = '25116bbd585c'
branch_labels = None
depends_on = None
def upgrade():
conn = op.get_bind()
conn.execute(
text(
"""
UPDATE inscription SET activi... | true | true |
f72d3bd5c2745fd8a21e158ba4e738b50066729f | 1,529 | py | Python | Artsy.py | pde-bakk/Artsy | f7c7a9d019b16d193d0418ddd7728ad9026f21e9 | [
"MIT"
] | 1 | 2020-12-22T06:13:52.000Z | 2020-12-22T06:13:52.000Z | Artsy.py | pde-bakk/Artsy | f7c7a9d019b16d193d0418ddd7728ad9026f21e9 | [
"MIT"
] | null | null | null | Artsy.py | pde-bakk/Artsy | f7c7a9d019b16d193d0418ddd7728ad9026f21e9 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# **************************************************************************** #
# #
# :::::::: #
# Artsy.py :+... | 40.236842 | 83 | 0.335513 |
Name)
except FileNotFoundError:
print(f'Problem opening {"imgs/" + imageName}.\nPlease check your path again.')
exit(1)
while True:
for frame in range(im.n_frames):
im.seek(frame)
generate_ascii(im)
time.sleep(4.0 / im.n_frames)
| true | true |
f72d3cd8fc9fdc84dd4cdf801ecc7d6a16740ea9 | 5,233 | py | Python | axelerate/networks/common_utils/callbacks.py | joaopdss/aXeleRate | 791c8b29056ed11bd0ed306e620664577ec9724c | [
"MIT"
] | 148 | 2020-03-18T01:36:20.000Z | 2022-03-24T08:56:45.000Z | axelerate/networks/common_utils/callbacks.py | joaopdss/aXeleRate | 791c8b29056ed11bd0ed306e620664577ec9724c | [
"MIT"
] | 55 | 2020-03-29T14:36:44.000Z | 2022-02-17T22:35:03.000Z | axelerate/networks/common_utils/callbacks.py | joaopdss/aXeleRate | 791c8b29056ed11bd0ed306e620664577ec9724c | [
"MIT"
] | 57 | 2020-04-01T14:22:53.000Z | 2022-01-31T13:09:49.000Z | import numpy as np
from tensorflow import keras
from tensorflow.keras import backend as K
def cosine_decay_with_warmup(global_step,
learning_rate_base,
total_steps,
warmup_learning_rate=0.0,
warmup_steps... | 47.144144 | 105 | 0.620868 | import numpy as np
from tensorflow import keras
from tensorflow.keras import backend as K
def cosine_decay_with_warmup(global_step,
learning_rate_base,
total_steps,
warmup_learning_rate=0.0,
warmup_steps... | true | true |
f72d3d948483dbe026cf497504af1a8d42844da7 | 14,549 | py | Python | grr/core/grr_response_core/lib/rdfvalues/protodict.py | AjitNair2/grr | 2a2ea891b3927775872904cdd402a18e7bb3d143 | [
"Apache-2.0"
] | 1 | 2019-08-17T14:02:44.000Z | 2019-08-17T14:02:44.000Z | grr/core/grr_response_core/lib/rdfvalues/protodict.py | AjitNair2/grr | 2a2ea891b3927775872904cdd402a18e7bb3d143 | [
"Apache-2.0"
] | null | null | null | grr/core/grr_response_core/lib/rdfvalues/protodict.py | AjitNair2/grr | 2a2ea891b3927775872904cdd402a18e7bb3d143 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""A generic serializer for python dictionaries."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import collections
from future.builtins import str
from future.utils import iteritems
from future.utils import itervalues
from futur... | 30.310417 | 83 | 0.679909 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import collections
from future.builtins import str
from future.utils import iteritems
from future.utils import itervalues
from future.utils import python_2_unicode_compatible
from past.builtins import long... | true | true |
f72d3e3660c3afa145347ee9328b2093b79c0d7d | 8,025 | py | Python | Truth-and-Dare.py | sayantan-kuila/Truth-and-Dare_BOT | bf4306e4d526cb33af5ee7003ddc2c809aa7f8a5 | [
"MIT"
] | null | null | null | Truth-and-Dare.py | sayantan-kuila/Truth-and-Dare_BOT | bf4306e4d526cb33af5ee7003ddc2c809aa7f8a5 | [
"MIT"
] | null | null | null | Truth-and-Dare.py | sayantan-kuila/Truth-and-Dare_BOT | bf4306e4d526cb33af5ee7003ddc2c809aa7f8a5 | [
"MIT"
] | null | null | null | from keep_alive import keep_alive
import discord
from discord.ext import commands,tasks
from itertools import cycle
import random
intents = discord.Intents(messages = True , guilds = True , reactions = True , members = True , presences = True)
client = commands.Bot(command_prefix = '.', intents = intents)
... | 29.076087 | 147 | 0.701807 | from keep_alive import keep_alive
import discord
from discord.ext import commands,tasks
from itertools import cycle
import random
intents = discord.Intents(messages = True , guilds = True , reactions = True , members = True , presences = True)
client = commands.Bot(command_prefix = '.', intents = intents)
... | true | true |
f72d3e497e472525f055e00a6ef6329de6c33abd | 3,605 | py | Python | model-optimizer/unit_tests/extensions/front/div_test.py | monroid/openvino | 8272b3857ef5be0aaa8abbf7bd0d5d5615dc40b6 | [
"Apache-2.0"
] | 2,406 | 2020-04-22T15:47:54.000Z | 2022-03-31T10:27:37.000Z | model-optimizer/unit_tests/extensions/front/div_test.py | thomas-yanxin/openvino | 031e998a15ec738c64cc2379d7f30fb73087c272 | [
"Apache-2.0"
] | 4,948 | 2020-04-22T15:12:39.000Z | 2022-03-31T18:45:42.000Z | model-optimizer/unit_tests/extensions/front/div_test.py | thomas-yanxin/openvino | 031e998a15ec738c64cc2379d7f30fb73087c272 | [
"Apache-2.0"
] | 991 | 2020-04-23T18:21:09.000Z | 2022-03-31T18:40:57.000Z | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import unittest
import numpy as np
from extensions.front.div import Div
from mo.utils.ir_engine.compare_graphs import compare_graphs
from unit_tests.utils.graph import build_graph, result, regular_op_with_shaped_data, valued_const_with... | 41.918605 | 119 | 0.615257 |
import unittest
import numpy as np
from extensions.front.div import Div
from mo.utils.ir_engine.compare_graphs import compare_graphs
from unit_tests.utils.graph import build_graph, result, regular_op_with_shaped_data, valued_const_with_data, connect, \
connect_data
nodes = {
**regular_op_with_shaped_data(... | true | true |
f72d3eb7ca0c3e84b7139eab0d79d7cc70f487df | 1,158 | py | Python | oss/ossimport/PUTCONFIGTOOSS.py | yibozhang/aliyunproduct | 770205029c7bf3a0913c08a0e8bed2e0953579f1 | [
"MIT"
] | null | null | null | oss/ossimport/PUTCONFIGTOOSS.py | yibozhang/aliyunproduct | 770205029c7bf3a0913c08a0e8bed2e0953579f1 | [
"MIT"
] | null | null | null | oss/ossimport/PUTCONFIGTOOSS.py | yibozhang/aliyunproduct | 770205029c7bf3a0913c08a0e8bed2e0953579f1 | [
"MIT"
] | 1 | 2020-08-08T01:57:21.000Z | 2020-08-08T01:57:21.000Z | #!/usr/bin/env python
import oss2
class PUTCONFIGTOOSS(object):
def __init__(self,DEST,STORESIZE):
self.AK = ''
self.SK = ''
self.ENDPOINT = 'http://oss-cn-hangzhou.aliyuncs.com'
self.BUCKET = 'ali-hangzhou'
self.DEST = DEST
self.STORESIZE = STORESIZE
def INITIAL(self):
try:
A... | 28.243902 | 89 | 0.630397 |
import oss2
class PUTCONFIGTOOSS(object):
def __init__(self,DEST,STORESIZE):
self.AK = ''
self.SK = ''
self.ENDPOINT = 'http://oss-cn-hangzhou.aliyuncs.com'
self.BUCKET = 'ali-hangzhou'
self.DEST = DEST
self.STORESIZE = STORESIZE
def INITIAL(self):
try:
AUTH = oss2.Auth(self.... | true | true |
f72d3ee94c4789ef5592f0a51b0087799e26cbd9 | 859 | py | Python | src/djangoreactredux/djrenv/lib/python3.5/site-packages/setoptconf/source/yamlfile.py | m2jobe/c_x | ba914449a9a85d82703895fc884733ca20454034 | [
"MIT"
] | 4 | 2016-08-11T20:00:07.000Z | 2020-08-09T01:33:22.000Z | src/djangoreactredux/djrenv/lib/python3.5/site-packages/setoptconf/source/yamlfile.py | m2jobe/c_x | ba914449a9a85d82703895fc884733ca20454034 | [
"MIT"
] | 7 | 2020-02-12T03:06:52.000Z | 2021-06-10T19:33:14.000Z | src/djangoreactredux/djrenv/lib/python3.5/site-packages/setoptconf/source/yamlfile.py | m2jobe/c_x | ba914449a9a85d82703895fc884733ca20454034 | [
"MIT"
] | 2 | 2015-01-27T10:42:03.000Z | 2021-09-09T07:17:52.000Z | import codecs
import yaml
from .filebased import FileBasedSource
__all__ = (
'YamlFileSource',
)
class YamlFileSource(FileBasedSource):
def __init__(self, *args, **kwargs):
self.encoding = kwargs.pop('encoding', 'utf-8')
super(YamlFileSource, self).__init__(*args, **kwargs)
def get_se... | 24.542857 | 75 | 0.633295 | import codecs
import yaml
from .filebased import FileBasedSource
__all__ = (
'YamlFileSource',
)
class YamlFileSource(FileBasedSource):
def __init__(self, *args, **kwargs):
self.encoding = kwargs.pop('encoding', 'utf-8')
super(YamlFileSource, self).__init__(*args, **kwargs)
def get_se... | true | true |
f72d408bda5345b17a849e6391721b7debb832c5 | 7,477 | py | Python | sme_financing/main/apis/funding_project_api.py | BuildForSDG/team-214-backend | f1aff9c27d7b7588b4bbb2bc68956b35051d4506 | [
"MIT"
] | 1 | 2020-05-20T16:32:33.000Z | 2020-05-20T16:32:33.000Z | sme_financing/main/apis/funding_project_api.py | BuildForSDG/team-214-backend | f1aff9c27d7b7588b4bbb2bc68956b35051d4506 | [
"MIT"
] | 23 | 2020-05-19T07:12:53.000Z | 2020-06-21T03:57:54.000Z | sme_financing/main/apis/funding_project_api.py | BuildForSDG/team-214-backend | f1aff9c27d7b7588b4bbb2bc68956b35051d4506 | [
"MIT"
] | 1 | 2020-05-18T14:18:12.000Z | 2020-05-18T14:18:12.000Z | from flask import request
from flask_restx import Resource, reqparse
from flask_restx._http import HTTPStatus
from werkzeug.datastructures import FileStorage
from ..service import funding_detail_service as fd_service
from ..service import funding_project_service as fp_service
from .dto import FundingDetailDTO, Funding... | 40.857923 | 82 | 0.700816 | from flask import request
from flask_restx import Resource, reqparse
from flask_restx._http import HTTPStatus
from werkzeug.datastructures import FileStorage
from ..service import funding_detail_service as fd_service
from ..service import funding_project_service as fp_service
from .dto import FundingDetailDTO, Funding... | true | true |
f72d41922e895ee0d677b880780e2a005c5d83b5 | 1,847 | py | Python | aardvark/conf/nova_conf.py | ttsiouts/aardvark | cbf29f332df86814dd581152faf863c0d29ae41c | [
"Apache-2.0"
] | null | null | null | aardvark/conf/nova_conf.py | ttsiouts/aardvark | cbf29f332df86814dd581152faf863c0d29ae41c | [
"Apache-2.0"
] | null | null | null | aardvark/conf/nova_conf.py | ttsiouts/aardvark | cbf29f332df86814dd581152faf863c0d29ae41c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 European Organization for Nuclear Research.
# 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/LIC... | 29.31746 | 78 | 0.728749 |
from keystoneauth1 import loading as ks_loading
from oslo_config import cfg
SERVICE_TYPE = 'compute'
compute_group = cfg.OptGroup(
'compute',
title='Compute Service Options',
help="Configuration options for connecting to the Nova API service"
)
compute_opts = [
cfg.StrOpt("client_ve... | true | true |
f72d41a3123aa80a954c0db94bd894fab5e71a21 | 285 | py | Python | exercicios-projetos-python/verificador-numero.py | lucaspalmanew/exercicios-projetos-python | fae75ee8f038811d5d869ba16d412ca726d848dc | [
"MIT"
] | null | null | null | exercicios-projetos-python/verificador-numero.py | lucaspalmanew/exercicios-projetos-python | fae75ee8f038811d5d869ba16d412ca726d848dc | [
"MIT"
] | null | null | null | exercicios-projetos-python/verificador-numero.py | lucaspalmanew/exercicios-projetos-python | fae75ee8f038811d5d869ba16d412ca726d848dc | [
"MIT"
] | null | null | null | n1 = int(input('Digite um número: '))
n2 = int(input('Digite outro número: '))
s = n1 + n2
m = n1 * n2
d = n1 / n2
di = n1 // n2
e = n1 ** n2
print(' A soma é {},\n o produto é {},\n a divisão é {:.3f}'.format(s, m, d))
print(' A divisão inteira é {}\n a potencia é {}'.format(di, e))
| 28.5 | 77 | 0.561404 | n1 = int(input('Digite um número: '))
n2 = int(input('Digite outro número: '))
s = n1 + n2
m = n1 * n2
d = n1 / n2
di = n1 // n2
e = n1 ** n2
print(' A soma é {},\n o produto é {},\n a divisão é {:.3f}'.format(s, m, d))
print(' A divisão inteira é {}\n a potencia é {}'.format(di, e))
| true | true |
f72d41a868cc6547b6c435aac59da272194ea120 | 3,299 | py | Python | recipes/Python/475169_Mixnmatching/recipe-475169.py | tdiprima/code | 61a74f5f93da087d27c70b2efe779ac6bd2a3b4f | [
"MIT"
] | 2,023 | 2017-07-29T09:34:46.000Z | 2022-03-24T08:00:45.000Z | recipes/Python/475169_Mixnmatching/recipe-475169.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 32 | 2017-09-02T17:20:08.000Z | 2022-02-11T17:49:37.000Z | recipes/Python/475169_Mixnmatching/recipe-475169.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 780 | 2017-07-28T19:23:28.000Z | 2022-03-25T20:39:41.000Z | #!/usr/bin/env python
# mixnmatch.py - find combination of files/dirs that sum below a given threshold
# -- Jose Fonseca
import os
import os.path
import optparse
import sys
from sets import ImmutableSet as set
def get_size(path, block_size):
if os.path.isdir(path):
result = 0
for name in os.list... | 31.122642 | 90 | 0.581691 |
import os
import os.path
import optparse
import sys
from sets import ImmutableSet as set
def get_size(path, block_size):
if os.path.isdir(path):
result = 0
for name in os.listdir(path):
size = get_size(os.path.join(path, name), block_size)
size = (size + block_size - 1... | false | true |
f72d4226675eac016336d700e165472ce8673a76 | 1,393 | py | Python | speedcord/exceptions.py | MM-coder/speedcord | 9b216a950f9766646bc54ce1cf85a7f11499c076 | [
"MIT"
] | null | null | null | speedcord/exceptions.py | MM-coder/speedcord | 9b216a950f9766646bc54ce1cf85a7f11499c076 | [
"MIT"
] | null | null | null | speedcord/exceptions.py | MM-coder/speedcord | 9b216a950f9766646bc54ce1cf85a7f11499c076 | [
"MIT"
] | null | null | null | """
Created by Epic at 9/1/20
"""
class HTTPException(Exception):
def __init__(self, request, data):
self.request = request
self.data = data
super().__init__(data)
class Forbidden(HTTPException):
pass
class NotFound(HTTPException):
def __init__(self, request):
self.requ... | 23.216667 | 99 | 0.700646 |
class HTTPException(Exception):
def __init__(self, request, data):
self.request = request
self.data = data
super().__init__(data)
class Forbidden(HTTPException):
pass
class NotFound(HTTPException):
def __init__(self, request):
self.request = request
Exception.__... | true | true |
f72d422cd4575a6baaf77c2ff39a10a79d61fedc | 2,219 | py | Python | ServerComponent/Analysers/SubjectRelevance.py | CDU55/FakeNews | 707bd48dd78851081d98ad21bbdadfc2720bd644 | [
"MIT"
] | null | null | null | ServerComponent/Analysers/SubjectRelevance.py | CDU55/FakeNews | 707bd48dd78851081d98ad21bbdadfc2720bd644 | [
"MIT"
] | 37 | 2020-10-20T08:30:53.000Z | 2020-12-22T13:15:45.000Z | ServerComponent/Analysers/SubjectRelevance.py | CDU55/FakeNews | 707bd48dd78851081d98ad21bbdadfc2720bd644 | [
"MIT"
] | 1 | 2020-10-19T14:55:23.000Z | 2020-10-19T14:55:23.000Z | import os
import time
from dask import dataframe as dd
import jellyfish
from TextExtraction.APIs.TextAPI import getListOfSentences
csv_path = os.path.join(os.path.dirname(__file__), "india-news-headlines.csv")
headlines = dd.read_csv(csv_path).headline_text
def get_mean(sentances_scores):
return sum(sentances_sc... | 37.610169 | 120 | 0.706625 | import os
import time
from dask import dataframe as dd
import jellyfish
from TextExtraction.APIs.TextAPI import getListOfSentences
csv_path = os.path.join(os.path.dirname(__file__), "india-news-headlines.csv")
headlines = dd.read_csv(csv_path).headline_text
def get_mean(sentances_scores):
return sum(sentances_sc... | true | true |
f72d425cc6b91707415be9dbb32383c596d493c2 | 646 | py | Python | Code/GUI/config.py | boydj9/CRDB-Project | 4c5612ea50d299bb0fd76947ce18f925c6d03cae | [
"MIT"
] | null | null | null | Code/GUI/config.py | boydj9/CRDB-Project | 4c5612ea50d299bb0fd76947ce18f925c6d03cae | [
"MIT"
] | null | null | null | Code/GUI/config.py | boydj9/CRDB-Project | 4c5612ea50d299bb0fd76947ce18f925c6d03cae | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""
CSC 315
Spring 2020
John DeGood
This code is from:
https://www.postgresqltutorial.com/postgresql-python/
"""
from ConfigParser import ConfigParser
def config(filename='database.ini', section='postgresql'):
# create a parser
parser = ConfigParser()
# read config file
parser.r... | 20.83871 | 90 | 0.654799 |
from ConfigParser import ConfigParser
def config(filename='database.ini', section='postgresql'):
parser = ConfigParser()
parser.read(filename)
db = {}
if parser.has_section(section):
params = parser.items(section)
for param in params:
db[param[0]] = pa... | true | true |
f72d4281dc07073a8e5737e6290b89c1dbc6f12d | 769 | py | Python | viadot/tasks/__init__.py | PanczykowskiK/viadot | 44e269790b3debb02318ff4c4f07638b3a37d800 | [
"MIT"
] | null | null | null | viadot/tasks/__init__.py | PanczykowskiK/viadot | 44e269790b3debb02318ff4c4f07638b3a37d800 | [
"MIT"
] | null | null | null | viadot/tasks/__init__.py | PanczykowskiK/viadot | 44e269790b3debb02318ff4c4f07638b3a37d800 | [
"MIT"
] | null | null | null | from .azure_blob_storage import BlobFromCSV
from .azure_data_lake import (
AzureDataLakeCopy,
AzureDataLakeDownload,
AzureDataLakeList,
AzureDataLakeToDF,
AzureDataLakeUpload,
)
from .azure_key_vault import (
AzureKeyVaultSecret,
CreateAzureKeyVaultSecret,
DeleteAzureKeyVaultSecret,
)
fr... | 29.576923 | 78 | 0.819246 | from .azure_blob_storage import BlobFromCSV
from .azure_data_lake import (
AzureDataLakeCopy,
AzureDataLakeDownload,
AzureDataLakeList,
AzureDataLakeToDF,
AzureDataLakeUpload,
)
from .azure_key_vault import (
AzureKeyVaultSecret,
CreateAzureKeyVaultSecret,
DeleteAzureKeyVaultSecret,
)
fr... | true | true |
f72d4377f739886a09d9defd618c46e865d276c5 | 9,276 | py | Python | example.py | genesiscloud/py-genesiscloud | 8fb1dd1884768d8245a1903a6a8042c650788309 | [
"MIT"
] | 6 | 2020-06-16T15:38:11.000Z | 2021-04-20T20:39:19.000Z | example.py | genesiscloud/py-genesiscloud | 8fb1dd1884768d8245a1903a6a8042c650788309 | [
"MIT"
] | 3 | 2020-06-16T15:38:07.000Z | 2021-04-21T09:50:12.000Z | example.py | genesiscloud/py-genesiscloud | 8fb1dd1884768d8245a1903a6a8042c650788309 | [
"MIT"
] | 1 | 2020-06-20T05:05:04.000Z | 2020-06-20T05:05:04.000Z | # MIT License
#
# Copyright (c) 2020 Genesis Cloud Ltd. <opensource@genesiscloud.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the r... | 38.65 | 221 | 0.691785 |
import os
import textwrap
import time
import subprocess as sp
from genesiscloud.client import Client, INSTANCE_TYPES
def simple_startup_script():
return textwrap.dedent("""
#cloud-config
hostname: mytestubuntu
runcmd:
- [ "apt", "install", "-y", "vim" ]
""")
def get_startup_s... | true | true |
f72d43e040d4b3be6767b65283613caed41078b8 | 32,888 | py | Python | sysinv/sysinv/sysinv/sysinv/api/controllers/v1/service_parameter.py | riddopic/config | 59f027fc42e2b34d9609c5fd6ec956b46a480235 | [
"Apache-2.0"
] | null | null | null | sysinv/sysinv/sysinv/sysinv/api/controllers/v1/service_parameter.py | riddopic/config | 59f027fc42e2b34d9609c5fd6ec956b46a480235 | [
"Apache-2.0"
] | null | null | null | sysinv/sysinv/sysinv/sysinv/api/controllers/v1/service_parameter.py | riddopic/config | 59f027fc42e2b34d9609c5fd6ec956b46a480235 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015-2018 Wind River Systems, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
# vim: tabstop=4 shiftwidth=4 softtabstop=4
# coding=utf-8
#
import copy
import pecan
from pecan import rest
import six
import wsme
from wsme import types as wtypes
import wsmeext.pecan as wsme_pecan
from fm_api import const... | 41.736041 | 97 | 0.608429 |
import copy
import pecan
from pecan import rest
import six
import wsme
from wsme import types as wtypes
import wsmeext.pecan as wsme_pecan
from fm_api import constants as fm_constants
from fm_api import fm_api
from oslo_log import log
from oslo_utils import excutils
from sysinv._i18n import _
from sysinv.api... | true | true |
f72d44f9b5b8affa4141d2af078aa55c0c24cdd1 | 5,572 | py | Python | fastlmm/association/PrecomputeLocoPcs.py | HealthML/FaST-LMM | 3c502ce1c693a934b5f2ff7b63a9577e892cb716 | [
"Apache-2.0"
] | null | null | null | fastlmm/association/PrecomputeLocoPcs.py | HealthML/FaST-LMM | 3c502ce1c693a934b5f2ff7b63a9577e892cb716 | [
"Apache-2.0"
] | null | null | null | fastlmm/association/PrecomputeLocoPcs.py | HealthML/FaST-LMM | 3c502ce1c693a934b5f2ff7b63a9577e892cb716 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2.7
#
# Copyright (C) 2014 Microsoft Research
"""
Created on 2014-04-02
@summary: Helper Module for precomputing principal components for Leave one Chromosme out GWAS
"""
import logging
import numpy as np
import scipy as sp
import pandas as pd
from scipy import stats
import pylab
import fastlmm.p... | 33.769697 | 157 | 0.629397 |
"""
Created on 2014-04-02
@summary: Helper Module for precomputing principal components for Leave one Chromosme out GWAS
"""
import logging
import numpy as np
import scipy as sp
import pandas as pd
from scipy import stats
import pylab
import fastlmm.pyplink.plink as plink
import pysnptools.util.pheno as pstpheno
i... | false | true |
f72d454abe47a21d4da45346d8bde4ef78bc13d9 | 5,237 | py | Python | src/Python/sirf/contrib/kcl/Prior.py | SyneRBI/SIRF-Contribs | 130223d9bc11991eadcd11f9b715aea34c4842fd | [
"Apache-2.0"
] | 1 | 2019-04-18T08:54:12.000Z | 2019-04-18T08:54:12.000Z | src/Python/sirf/contrib/kcl/Prior.py | CCPPETMR/SIRF-Contribs | 3298c1519b3c7d7f0794306061c08dccf339199b | [
"Apache-2.0"
] | 5 | 2018-12-18T10:13:02.000Z | 2018-12-19T16:49:07.000Z | src/Python/sirf/contrib/kcl/Prior.py | SyneRBI/SIRF-Contribs | 130223d9bc11991eadcd11f9b715aea34c4842fd | [
"Apache-2.0"
] | 1 | 2019-09-26T11:48:39.000Z | 2019-09-26T11:48:39.000Z |
import numpy as np
class Prior(object):
def __init__(self,imageSize, sWindowSize=3, imageCropFactor=[0]):
self.imageSize = imageSize if len(imageSize)==3 else imageSize.append(1)
self.imageCropFactor = imageCropFactor
if np.mod(sWindowSize,2):
se... | 37.141844 | 118 | 0.504105 |
import numpy as np
class Prior(object):
def __init__(self,imageSize, sWindowSize=3, imageCropFactor=[0]):
self.imageSize = imageSize if len(imageSize)==3 else imageSize.append(1)
self.imageCropFactor = imageCropFactor
if np.mod(sWindowSize,2):
se... | true | true |
f72d459899b797331f8484c4f146860d8d0ebd33 | 108 | py | Python | server/__init__.py | enotnadoske/JointPython | e335fbf8eba41cf3a29601d0578ff37964b3b8d4 | [
"Apache-2.0"
] | null | null | null | server/__init__.py | enotnadoske/JointPython | e335fbf8eba41cf3a29601d0578ff37964b3b8d4 | [
"Apache-2.0"
] | 27 | 2020-04-07T22:59:39.000Z | 2022-02-23T09:03:13.000Z | server/__init__.py | enotnadoske/JointPython | e335fbf8eba41cf3a29601d0578ff37964b3b8d4 | [
"Apache-2.0"
] | 4 | 2020-03-17T10:53:07.000Z | 2020-04-26T11:29:50.000Z | """A package for http server"""
# pylint: skip-file
__all__ = [
'demo_server',
'http_server',
]
| 15.428571 | 31 | 0.592593 |
__all__ = [
'demo_server',
'http_server',
]
| true | true |
f72d467797d7f4e6a5ea93e34366cacd30a1c9eb | 702 | py | Python | var/spack/repos/builtin/packages/glproto/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/glproto/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/glproto/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.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 Glproto(AutotoolsPackage, XorgPackage):
"""OpenGL Extension to the X Window System.
T... | 31.909091 | 96 | 0.737892 |
from spack import *
class Glproto(AutotoolsPackage, XorgPackage):
homepage = "https://www.x.org/wiki/"
xorg_mirror_path = "proto/glproto-1.4.17.tar.gz"
version('1.4.17', sha256='9d8130fec2b98bd032db7730fa092dd9dec39f3de34f4bb03ceb43b9903dbc96')
depends_on('pkgconfig', type='build')
depends... | true | true |
f72d47de2913cc5694788e68cb664a1c6f4860a0 | 4,356 | py | Python | codestosort/NaturalLanguage/module/bestmodel.py | jimmy-academia/Deeper-Learnings | ac363efe5450dd2751c0c1bea0ee7af457f7ac24 | [
"MIT"
] | 2 | 2019-09-30T04:57:11.000Z | 2020-04-06T04:27:46.000Z | codestosort/NaturalLanguage/module/bestmodel.py | jimmy-academia/Deeper-Learnings | ac363efe5450dd2751c0c1bea0ee7af457f7ac24 | [
"MIT"
] | null | null | null | codestosort/NaturalLanguage/module/bestmodel.py | jimmy-academia/Deeper-Learnings | ac363efe5450dd2751c0c1bea0ee7af457f7ac24 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
class BestNet(torch.nn.Module):
def __init__(self, embedding_dim):
super(BestNet, self).__init__()
self.embedding_dim = embedding_dim
self.hidden_dim = 256
self.embedding_dropout=... | 36.3 | 89 | 0.61685 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
class BestNet(torch.nn.Module):
def __init__(self, embedding_dim):
super(BestNet, self).__init__()
self.embedding_dim = embedding_dim
self.hidden_dim = 256
self.embedding_dropout=... | true | true |
f72d4958dd28a6e9ba69d6907852444ec2ed532f | 6,624 | py | Python | indico/modules/events/papers/models/call_for_papers.py | tobiashuste/indico | c1e6ec0c8c84745988e38c9b1768142a6feb9e0e | [
"MIT"
] | null | null | null | indico/modules/events/papers/models/call_for_papers.py | tobiashuste/indico | c1e6ec0c8c84745988e38c9b1768142a6feb9e0e | [
"MIT"
] | null | null | null | indico/modules/events/papers/models/call_for_papers.py | tobiashuste/indico | c1e6ec0c8c84745988e38c9b1768142a6feb9e0e | [
"MIT"
] | null | null | null | # This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from indico.modules.events.papers.models.competences import Paper... | 39.664671 | 110 | 0.696256 |
from __future__ import unicode_literals
from indico.modules.events.papers.models.competences import PaperCompetence
from indico.modules.events.papers.models.reviews import PaperReviewType
from indico.modules.events.papers.settings import PaperReviewingRole, paper_reviewing_settings
from indico.modules.events.se... | true | true |
f72d4a199674fe45edb35fd243b59bbb77a4e1f8 | 2,592 | py | Python | examples/ppo/agent.py | jaehlee/flax | e01e2bcb012211d48e4c75e78297b8e15d742a37 | [
"Apache-2.0"
] | 2,249 | 2020-03-08T12:13:08.000Z | 2022-03-31T10:25:13.000Z | examples/ppo/agent.py | jaehlee/flax | e01e2bcb012211d48e4c75e78297b8e15d742a37 | [
"Apache-2.0"
] | 1,338 | 2020-03-06T16:56:34.000Z | 2022-03-31T13:46:49.000Z | examples/ppo/agent.py | jaehlee/flax | e01e2bcb012211d48e4c75e78297b8e15d742a37 | [
"Apache-2.0"
] | 343 | 2020-03-06T16:35:39.000Z | 2022-03-27T17:31:45.000Z | # Copyright 2021 The Flax 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 law or agreed to in wri... | 29.123596 | 79 | 0.707948 |
import functools
import multiprocessing
import collections
from typing import Any, Callable
import numpy as np
import jax
import flax
import env_utils
@functools.partial(jax.jit, static_argnums=0)
def policy_action(
apply_fn: Callable[..., Any],
params: flax.core.frozen_dict.FrozenDict,
state: n... | true | true |
f72d4ac16b95c592bb8e27f024b8fa3fe860340e | 542 | py | Python | slot_machine/output_literals.py | gorbulus/Slot_Machine | 9bb3a93d4a3948b92a77c13a6a4ce5026b214ee4 | [
"MIT"
] | null | null | null | slot_machine/output_literals.py | gorbulus/Slot_Machine | 9bb3a93d4a3948b92a77c13a6a4ce5026b214ee4 | [
"MIT"
] | null | null | null | slot_machine/output_literals.py | gorbulus/Slot_Machine | 9bb3a93d4a3948b92a77c13a6a4ce5026b214ee4 | [
"MIT"
] | null | null | null | # output_literals.py
# William Ponton
# 2.10.19
# Import modules
import slot_machine.data_structures
# Constants
WELCOME = "\tWelcome to the Slot Machine!"
RULES = "\tMatch 2 of any kind to win $5\n\tMatch 3 of any fruit to win $10\n\tMatch 3 BELLS to win $50!\n"
ENGAGE = "Do you want to play? (y or n): "
LEVER = "\t... | 28.526316 | 107 | 0.651292 |
import slot_machine.data_structures
WELCOME = "\tWelcome to the Slot Machine!"
RULES = "\tMatch 2 of any kind to win $5\n\tMatch 3 of any fruit to win $10\n\tMatch 3 BELLS to win $50!\n"
ENGAGE = "Do you want to play? (y or n): "
LEVER = "\t OK, pulling the lever!"
DRAW = "\t{} | {} | {}"
DRAW_MAX = 5
EARNED = "... | true | true |
f72d4b6995f7533f7aca12a0af1e7b0c0dacd90c | 2,458 | py | Python | handling-program-flow/code.py | krishnakammari/greyatom-python-for-data-science | 8beab2a5f70304916d2d018c2283bf953db0b503 | [
"MIT"
] | null | null | null | handling-program-flow/code.py | krishnakammari/greyatom-python-for-data-science | 8beab2a5f70304916d2d018c2283bf953db0b503 | [
"MIT"
] | null | null | null | handling-program-flow/code.py | krishnakammari/greyatom-python-for-data-science | 8beab2a5f70304916d2d018c2283bf953db0b503 | [
"MIT"
] | null | null | null | # --------------
##File path for the file
file_path
#Code starts here
def read_file(path):
file1=open(path,"r")
sentence=file1.readline()
return sentence
sample_message=read_file(file_path)
# --------------
#Code starts here
def read_file(path):
fp=open(path,"r")
return fp.readli... | 19.054264 | 71 | 0.663141 |
d_file(path):
file1=open(path,"r")
sentence=file1.readline()
return sentence
sample_message=read_file(file_path)
def read_file(path):
fp=open(path,"r")
return fp.readline()
def fuse_msg(message_a,message_b):
quotient=int(int(message_b)/int(message_a))
return quotient
messa... | true | true |
f72d4bb42b3c82dbcde9ccb416274b8896683766 | 16,657 | py | Python | plotly_study/validators/table/__init__.py | lucasiscovici/plotly_py | 42ab769febb45fbbe0a3c677dc4306a4f59cea36 | [
"MIT"
] | null | null | null | plotly_study/validators/table/__init__.py | lucasiscovici/plotly_py | 42ab769febb45fbbe0a3c677dc4306a4f59cea36 | [
"MIT"
] | null | null | null | plotly_study/validators/table/__init__.py | lucasiscovici/plotly_py | 42ab769febb45fbbe0a3c677dc4306a4f59cea36 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class VisibleValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="visible", parent_name="table", **kwargs):
super(VisibleValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | 35.067368 | 84 | 0.58642 | import _plotly_utils.basevalidators
class VisibleValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(self, plotly_name="visible", parent_name="table", **kwargs):
super(VisibleValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | true | true |
f72d4ca040a06d403beb425e327eeba6d1205c6a | 26,527 | py | Python | py/legacypipe/unwise.py | ameisner/legacypipe | 5ffe6fb2458618b68653580badc4a94e1ecb4f04 | [
"BSD-3-Clause"
] | null | null | null | py/legacypipe/unwise.py | ameisner/legacypipe | 5ffe6fb2458618b68653580badc4a94e1ecb4f04 | [
"BSD-3-Clause"
] | null | null | null | py/legacypipe/unwise.py | ameisner/legacypipe | 5ffe6fb2458618b68653580badc4a94e1ecb4f04 | [
"BSD-3-Clause"
] | null | null | null | import os
import numpy as np
import fitsio
from astrometry.util.fits import fits_table
from astrometry.util.ttime import Time
from wise.unwise import get_unwise_tractor_image
import logging
logger = logging.getLogger('legacypipe.unwise')
def info(*args):
from legacypipe.utils import log_info
log_info(logger, ... | 39.183161 | 123 | 0.529121 | import os
import numpy as np
import fitsio
from astrometry.util.fits import fits_table
from astrometry.util.ttime import Time
from wise.unwise import get_unwise_tractor_image
import logging
logger = logging.getLogger('legacypipe.unwise')
def info(*args):
from legacypipe.utils import log_info
log_info(logger, ... | true | true |
f72d4d256b09e12e5ab72b4beb08439fff8b274f | 3,811 | py | Python | networkx/algorithms/simple_paths.py | tempcyc/networkx | cae83ba501c242567cb2454f97f851898276f06e | [
"BSD-3-Clause"
] | 6 | 2017-08-18T07:30:40.000Z | 2021-07-08T02:57:36.000Z | networkx/algorithms/simple_paths.py | tempcyc/networkx | cae83ba501c242567cb2454f97f851898276f06e | [
"BSD-3-Clause"
] | 2 | 2016-10-06T13:07:05.000Z | 2017-12-20T09:47:08.000Z | networkx/algorithms/simple_paths.py | tempcyc/networkx | cae83ba501c242567cb2454f97f851898276f06e | [
"BSD-3-Clause"
] | 4 | 2016-04-25T22:15:40.000Z | 2017-12-18T14:40:58.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2012 by
# Sergio Nery Simoes <sergionery@gmail.com>
# All rights reserved.
# BSD license.
import networkx as nx
__author__ = """\n""".join(['Sérgio Nery Simões <sergionery@gmail.com>',
'Aric Hagberg <aric.hagberg@gmail.com>'])
__all__ = ['a... | 30.488 | 78 | 0.568617 |
import networkx as nx
__author__ = """\n""".join(['Sérgio Nery Simões <sergionery@gmail.com>',
'Aric Hagberg <aric.hagberg@gmail.com>'])
__all__ = ['all_simple_paths']
def all_simple_paths(G, source, target, cutoff=None):
if source not in G:
raise nx.NetworkXError('source n... | true | true |
f72d4d2fdf905ec644db0080a322da124ae18054 | 3,700 | py | Python | mlp/src/mlp_numpy.py | akashrajkn/sarcastic-gradients | 5a995ab7822dfd49cdc88855c631dcc8f1b0532f | [
"Apache-2.0"
] | null | null | null | mlp/src/mlp_numpy.py | akashrajkn/sarcastic-gradients | 5a995ab7822dfd49cdc88855c631dcc8f1b0532f | [
"Apache-2.0"
] | null | null | null | mlp/src/mlp_numpy.py | akashrajkn/sarcastic-gradients | 5a995ab7822dfd49cdc88855c631dcc8f1b0532f | [
"Apache-2.0"
] | null | null | null | """
This module implements a multi-layer perceptron (MLP) in NumPy.
You should fill in code into indicated sections.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from modules import *
class MLP(object):
"""
This class implements a Multi-laye... | 31.355932 | 95 | 0.609459 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from modules import *
class MLP(object):
def __init__(self, n_inputs, n_hidden, n_classes):
if len(n_hidden) == 0:
self.input_layer = LinearModule(n_inputs, n_classes)
else:
... | true | true |
f72d4ea900979ff121f13afed4e4fdf730a65273 | 5,203 | py | Python | disf_gen_coarse2fine/table/Loss.py | GT-SALT/Disfluency-Generation-and-Detection | 72126172b466aa74277f3cf0f73b915e5dbeefbb | [
"MIT"
] | 11 | 2020-10-19T21:52:58.000Z | 2022-02-23T02:28:57.000Z | disf_gen_coarse2fine/table/Loss.py | JingfengYang/Disfluency-Generation-and-Detection-1 | 72126172b466aa74277f3cf0f73b915e5dbeefbb | [
"MIT"
] | 4 | 2021-07-09T11:59:03.000Z | 2022-02-10T00:58:25.000Z | disf_gen_coarse2fine/table/Loss.py | JingfengYang/Disfluency-Generation-and-Detection-1 | 72126172b466aa74277f3cf0f73b915e5dbeefbb | [
"MIT"
] | 5 | 2021-06-18T08:05:51.000Z | 2022-02-18T04:09:17.000Z | """
This file handles the details of the loss function during training.
This includes: LossComputeBase and the standard NMTLossCompute, and
sharded loss compute stuff.
"""
from __future__ import division
from itertools import count
import torch
import torch.nn as nn
import random as rnd
import table
d... | 38.540741 | 121 | 0.610994 | from __future__ import division
from itertools import count
import torch
import torch.nn as nn
import random as rnd
import table
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
class CopyGeneratorLoss(nn.Module):
def __init__(self, vocab_size, force_copy, only_disf_loss, unk_index=0,
... | true | true |
f72d4f5f379c640e9958f7aad5d2a4526ab22302 | 1,325 | py | Python | apps/rss_feeds/management/commands/mark_read.py | Paul3MK/NewsBlur | f912d100c2867e5366fca92abadc50d4253a41d8 | [
"MIT"
] | 3,073 | 2015-01-01T07:20:18.000Z | 2022-03-31T20:33:41.000Z | apps/rss_feeds/management/commands/mark_read.py | Paul3MK/NewsBlur | f912d100c2867e5366fca92abadc50d4253a41d8 | [
"MIT"
] | 1,054 | 2015-01-02T13:32:35.000Z | 2022-03-30T04:21:21.000Z | apps/rss_feeds/management/commands/mark_read.py | Paul3MK/NewsBlur | f912d100c2867e5366fca92abadc50d4253a41d8 | [
"MIT"
] | 676 | 2015-01-03T16:40:29.000Z | 2022-03-30T14:00:40.000Z | from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from apps.reader.models import UserSubscription
import datetime
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument("-d", "--days", dest="days", nargs=1, default=1, help="Days of un... | 44.166667 | 111 | 0.626415 | from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from apps.reader.models import UserSubscription
import datetime
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument("-d", "--days", dest="days", nargs=1, default=1, help="Days of un... | true | true |
f72d4f7e7d807286e5c6688975bbbba1e0d587a4 | 3,185 | py | Python | Lab/adventofcode2020/day12.py | hscspring/TheAlgorithms-Python | 5c2faea1d2d25a9a81a4786e053b0cc58ab46c6f | [
"MIT"
] | 10 | 2020-07-06T11:00:58.000Z | 2022-01-29T09:25:24.000Z | Lab/adventofcode2020/day12.py | hscspring/TheAlgorithms-Python | 5c2faea1d2d25a9a81a4786e053b0cc58ab46c6f | [
"MIT"
] | null | null | null | Lab/adventofcode2020/day12.py | hscspring/TheAlgorithms-Python | 5c2faea1d2d25a9a81a4786e053b0cc58ab46c6f | [
"MIT"
] | 3 | 2020-07-13T06:39:23.000Z | 2020-08-15T16:29:48.000Z | import pnlp
DIRECTS = ["E", "S", "W", "N"]
SIGNS = ["++", "+-", "--", "-+"]
def get_direct(directs: list, direct: str, num: int, rotate: str):
count = num // 90
idx = directs.index(direct)
if rotate == "R":
new_idx = idx + count
return directs[new_idx % 4]
else:
new_idx = idx ... | 25.277778 | 66 | 0.475039 | import pnlp
DIRECTS = ["E", "S", "W", "N"]
SIGNS = ["++", "+-", "--", "-+"]
def get_direct(directs: list, direct: str, num: int, rotate: str):
count = num // 90
idx = directs.index(direct)
if rotate == "R":
new_idx = idx + count
return directs[new_idx % 4]
else:
new_idx = idx ... | true | true |
f72d4fd3cbefd1e5e02930d93c37bbd0e45283f5 | 13,700 | py | Python | openconcept/components/splitter.py | vrsub/openconcept | 459aa24269cf54122ee4cfb3edf173c79c880be9 | [
"MIT"
] | null | null | null | openconcept/components/splitter.py | vrsub/openconcept | 459aa24269cf54122ee4cfb3edf173c79c880be9 | [
"MIT"
] | null | null | null | openconcept/components/splitter.py | vrsub/openconcept | 459aa24269cf54122ee4cfb3edf173c79c880be9 | [
"MIT"
] | null | null | null | from __future__ import division
import numpy as np
from openmdao.api import ExplicitComponent
from openmdao.api import Group
class PowerSplit(ExplicitComponent):
"""
A power split mechanism for mechanical or electrical power.
Inputs
------
power_in : float
Power fed to the splitter. (vect... | 44.625407 | 136 | 0.606788 | from __future__ import division
import numpy as np
from openmdao.api import ExplicitComponent
from openmdao.api import Group
class PowerSplit(ExplicitComponent):
def initialize(self):
self.options.declare('num_nodes', default=1, desc='Number of flight/control conditions')
self.options.dec... | true | true |
f72d50746d095eb7757591129699b6a2bf403e6e | 1,956 | py | Python | 56_interactive_watershed.py | amit-bohra/Interactive-Image-Segmentation-with-OpenCV-Watershed-Algorithm-in-Python3 | 9fd6e2551fe19af76f1c91c714ba029d2d8599ca | [
"MIT"
] | null | null | null | 56_interactive_watershed.py | amit-bohra/Interactive-Image-Segmentation-with-OpenCV-Watershed-Algorithm-in-Python3 | 9fd6e2551fe19af76f1c91c714ba029d2d8599ca | [
"MIT"
] | null | null | null | 56_interactive_watershed.py | amit-bohra/Interactive-Image-Segmentation-with-OpenCV-Watershed-Algorithm-in-Python3 | 9fd6e2551fe19af76f1c91c714ba029d2d8599ca | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from copy import deepcopy as dp
aqua=(255,255,0)
marine=(116,139,69)
banana=(87,207,277)
blue=(255,0,0)
almond=(205,235,255)
brown=(64,64,255)
blue1=(255,245,152)
green=(0,100,0)
orange=(0,140,255)
orchid=(139,34,104)
pink=(147,20,255)
gold=(0,215,255)
gray=(127,127,127)
... | 25.076923 | 72 | 0.625767 | import cv2
import numpy as np
from copy import deepcopy as dp
aqua=(255,255,0)
marine=(116,139,69)
banana=(87,207,277)
blue=(255,0,0)
almond=(205,235,255)
brown=(64,64,255)
blue1=(255,245,152)
green=(0,100,0)
orange=(0,140,255)
orchid=(139,34,104)
pink=(147,20,255)
gold=(0,215,255)
gray=(127,127,127)
... | true | true |
f72d5149c0def6142cc248614e148e566f00322a | 2,120 | py | Python | rllib/examples/serving/cartpole_server.py | brechtmann/ray | 0c76ebd676f794847ea990aecced22b88717d09e | [
"Apache-2.0"
] | 4 | 2019-10-18T17:44:58.000Z | 2021-04-14T14:37:21.000Z | rllib/examples/serving/cartpole_server.py | Eric2Hamel/ray | bfaee49880611a65d16a4561c94c60851573b6f2 | [
"Apache-2.0"
] | 1 | 2022-03-30T17:52:44.000Z | 2022-03-30T17:52:44.000Z | rllib/examples/serving/cartpole_server.py | Eric2Hamel/ray | bfaee49880611a65d16a4561c94c60851573b6f2 | [
"Apache-2.0"
] | 1 | 2020-06-26T07:54:25.000Z | 2020-06-26T07:54:25.000Z | """Example of running a policy server. Copy this file for your use case.
To try this out, in two separate shells run:
$ python cartpole_server.py
$ python cartpole_client.py
"""
import os
from gym import spaces
import numpy as np
import ray
from ray.rllib.agents.dqn import DQNTrainer
from ray.rllib.env.exter... | 31.641791 | 77 | 0.658019 |
import os
from gym import spaces
import numpy as np
import ray
from ray.rllib.agents.dqn import DQNTrainer
from ray.rllib.env.external_env import ExternalEnv
from ray.rllib.utils.policy_server import PolicyServer
from ray.tune.logger import pretty_print
from ray.tune.registry import register_env
SERVER_ADDRESS = "lo... | true | true |
f72d5366075c57378dcb950830cdf43d266193ee | 5,681 | py | Python | neurst/data/datasets/parallel_text_dataset.py | emailandxu/neurst | 235bddfc93b7784df01eddccec6791e1281651cf | [
"Apache-2.0"
] | null | null | null | neurst/data/datasets/parallel_text_dataset.py | emailandxu/neurst | 235bddfc93b7784df01eddccec6791e1281651cf | [
"Apache-2.0"
] | null | null | null | neurst/data/datasets/parallel_text_dataset.py | emailandxu/neurst | 235bddfc93b7784df01eddccec6791e1281651cf | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 ByteDance 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... | 35.285714 | 88 | 0.620313 |
from abc import ABCMeta, abstractmethod
import six
import tensorflow as tf
from absl import logging
from neurst.data.datasets import register_dataset
from neurst.data.datasets.dataset import TFRecordDataset
from neurst.data.datasets.text_gen_dataset import TextGenDataset
from neurst.utils.compat import D... | true | true |
f72d53847ce5a7ccd7789359de36e77c4eea6916 | 6,583 | py | Python | tests/providers/airbyte/hooks/test_airbyte.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 15,947 | 2019-01-05T13:51:02.000Z | 2022-03-31T23:33:16.000Z | tests/providers/airbyte/hooks/test_airbyte.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 14,603 | 2019-01-05T09:43:19.000Z | 2022-03-31T23:11:59.000Z | tests/providers/airbyte/hooks/test_airbyte.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 8,429 | 2019-01-05T19:45:47.000Z | 2022-03-31T22:13:01.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... | 41.664557 | 109 | 0.705453 |
import unittest
from unittest import mock
import pytest
import requests_mock
from airflow.exceptions import AirflowException
from airflow.models import Connection
from airflow.providers.airbyte.hooks.airbyte import AirbyteHook
from airflow.utils import db
class TestAirbyteHook(unittest.TestCase):
... | true | true |
f72d5492165937b6bde071a810e477e645ff83f7 | 68,601 | py | Python | scripts/sampleOutputs/bkup/cmp_bwavesgcccactusADMgromacs/power.py | TugberkArkose/MLScheduler | e493b6cbf7b9d29a2c9300d7dd6f0c2f102e4061 | [
"Unlicense"
] | null | null | null | scripts/sampleOutputs/bkup/cmp_bwavesgcccactusADMgromacs/power.py | TugberkArkose/MLScheduler | e493b6cbf7b9d29a2c9300d7dd6f0c2f102e4061 | [
"Unlicense"
] | null | null | null | scripts/sampleOutputs/bkup/cmp_bwavesgcccactusADMgromacs/power.py | TugberkArkose/MLScheduler | e493b6cbf7b9d29a2c9300d7dd6f0c2f102e4061 | [
"Unlicense"
] | null | null | null | power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
'Gate... | 75.055799 | 124 | 0.682045 | power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
'Gate... | true | true |
f72d54cc192e42e146e0bea3d8aa115af59dd401 | 128,875 | py | Python | FWCore/ParameterSet/python/SequenceTypes.py | menglu21/cmssw | c3d6cb102c0aaddf652805743370c28044d53da6 | [
"Apache-2.0"
] | null | null | null | FWCore/ParameterSet/python/SequenceTypes.py | menglu21/cmssw | c3d6cb102c0aaddf652805743370c28044d53da6 | [
"Apache-2.0"
] | null | null | null | FWCore/ParameterSet/python/SequenceTypes.py | menglu21/cmssw | c3d6cb102c0aaddf652805743370c28044d53da6 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
import sys
from builtins import range
from .Mixins import _ConfigureComponent, PrintOptions
from .Mixins import _Labelable, _Unlabelable
from .Mixins import _ValidatingParameterListBase
from .ExceptionHandling import *
from .OrderedSet import OrderedSet
class _HardDependency(obj... | 43.642059 | 250 | 0.587189 | from __future__ import absolute_import
import sys
from builtins import range
from .Mixins import _ConfigureComponent, PrintOptions
from .Mixins import _Labelable, _Unlabelable
from .Mixins import _ValidatingParameterListBase
from .ExceptionHandling import *
from .OrderedSet import OrderedSet
class _HardDependency(obj... | true | true |
f72d55398fb004b998a56639bb271afa5e8e1c9c | 167 | py | Python | eswar4.py | Eswar12345/training-kit | 294e622eed175144faead24206d4241e25fbda35 | [
"CC-BY-4.0"
] | null | null | null | eswar4.py | Eswar12345/training-kit | 294e622eed175144faead24206d4241e25fbda35 | [
"CC-BY-4.0"
] | null | null | null | eswar4.py | Eswar12345/training-kit | 294e622eed175144faead24206d4241e25fbda35 | [
"CC-BY-4.0"
] | null | null | null | n=int(input("enter the size"))
a=[]
for i in range(n):
b=input("enter")
a.append(b)
for i in range(n):
count=a.count(i)
if(count==1):
print(i)
| 16.7 | 30 | 0.54491 | n=int(input("enter the size"))
a=[]
for i in range(n):
b=input("enter")
a.append(b)
for i in range(n):
count=a.count(i)
if(count==1):
print(i)
| true | true |
f72d562143f7bbb140a16c6d0887b2f083f9e29c | 342 | py | Python | utility.py | sahabi/opt | 79f82bd9e0db77dada9554950b0b95d4e1435ca0 | [
"MIT"
] | 26 | 2018-12-30T20:32:45.000Z | 2022-03-15T06:11:40.000Z | utility.py | sahabi/opt | 79f82bd9e0db77dada9554950b0b95d4e1435ca0 | [
"MIT"
] | 20 | 2018-08-29T10:34:48.000Z | 2022-03-11T23:16:24.000Z | utility.py | sahabi/opt | 79f82bd9e0db77dada9554950b0b95d4e1435ca0 | [
"MIT"
] | 13 | 2019-05-11T01:59:58.000Z | 2022-03-15T14:12:40.000Z | #!/usr/bin/python
# -*- encoding=utf-8 -*-
# author: Ian
# e-mail: stmayue@gmail.com
# description:
def list_to_dict(in_list):
return dict((i, in_list[i]) for i in range(0, len(in_list)))
def exchange_key_value(in_dict):
return dict((in_dict[i], i) for i in in_dict)
def main():
pass
if __name__ == ... | 16.285714 | 64 | 0.643275 |
def list_to_dict(in_list):
return dict((i, in_list[i]) for i in range(0, len(in_list)))
def exchange_key_value(in_dict):
return dict((in_dict[i], i) for i in in_dict)
def main():
pass
if __name__ == '__main__':
main() | true | true |
f72d5641bc821b12e049ec960ca9abbb3155f191 | 18,824 | py | Python | ddf_utils/model/package.py | semio/ddf_utils | e10c4cb6dc7722415a5863579a552cc7b7e3668d | [
"MIT"
] | 2 | 2016-11-23T12:28:15.000Z | 2019-03-04T16:06:25.000Z | ddf_utils/model/package.py | semio/ddf_utils | e10c4cb6dc7722415a5863579a552cc7b7e3668d | [
"MIT"
] | 124 | 2016-07-14T13:39:41.000Z | 2021-12-24T01:45:23.000Z | ddf_utils/model/package.py | semio/ddf_utils | e10c4cb6dc7722415a5863579a552cc7b7e3668d | [
"MIT"
] | 1 | 2016-11-30T23:42:56.000Z | 2016-11-30T23:42:56.000Z | # -*- coding: utf-8 -*-
"""datapackage model"""
import os.path as osp
from typing import List, Tuple, Dict, Union, Callable
import attr
import json
from itertools import product
from collections import OrderedDict
from tqdm import tqdm
import pandas as pd
from .ddf import DDF, Concept, EntityDomain, Entity, DaskDat... | 39.216667 | 132 | 0.565555 |
import os.path as osp
from typing import List, Tuple, Dict, Union, Callable
import attr
import json
from itertools import product
from collections import OrderedDict
from tqdm import tqdm
import pandas as pd
from .ddf import DDF, Concept, EntityDomain, Entity, DaskDataPoint, Synonym
from .utils import absolute_pat... | true | true |
f72d56c518536eba5d7a4ad14d86ac8df50a02d5 | 561 | py | Python | util/gen_jdisk.py | iburinoc/gr-trace | 3639b8e9d8309a7296aff2c1aea0bab6c066fca6 | [
"MIT"
] | 5 | 2016-09-15T04:35:53.000Z | 2020-06-07T18:07:09.000Z | util/gen_jdisk.py | iburinoc/gr_trace | 3639b8e9d8309a7296aff2c1aea0bab6c066fca6 | [
"MIT"
] | null | null | null | util/gen_jdisk.py | iburinoc/gr_trace | 3639b8e9d8309a7296aff2c1aea0bab6c066fca6 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import noise
import numpy as np
from PIL import Image
size = (2000, 2000)
ratio = 16
bb_col = Image.open("../resources/bb-scale.jpg", 'r')
out_img = Image.new('RGBA', size, (0, 0, 0, 0))
for y in range(0, size[1]):
if y % 100 == 0:
print y
for x in range(0, size[0]):
val = noise.snoise2(flo... | 18.7 | 53 | 0.600713 |
import noise
import numpy as np
from PIL import Image
size = (2000, 2000)
ratio = 16
bb_col = Image.open("../resources/bb-scale.jpg", 'r')
out_img = Image.new('RGBA', size, (0, 0, 0, 0))
for y in range(0, size[1]):
if y % 100 == 0:
print y
for x in range(0, size[0]):
val = noise.snoise2(float(x)/size[0] * r... | false | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.