hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7008e5c02694d2642ce94ad63ea171b35f0c2ae5 | 1,549 | py | Python | src/pretix/helpers/jsonlogic_query.py | prereg/prereg | 5000c279a801fa2260009b15dd90e3bd4f447785 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/helpers/jsonlogic_query.py | prereg/prereg | 5000c279a801fa2260009b15dd90e3bd4f447785 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/pretix/helpers/jsonlogic_query.py | prereg/prereg | 5000c279a801fa2260009b15dd90e3bd4f447785 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import logging
from datetime import timedelta
from django.db.models import Func, Value
logger = logging.getLogger(__name__)
class Equal(Func):
arg_joiner = ' = '
arity = 2
function = ''
class GreaterThan(Func):
arg_joiner = ' > '
arity = 2
function = ''
class GreaterEqualThan(Func):
... | 25.816667 | 129 | 0.656553 |
588026f20248c378c7a8eb883e0574d96ead26d2 | 904 | py | Python | 03_perfectly_spherical_houses_in_vacuum.py | KanegaeGabriel/advent-of-code-2015 | e6c7beb18fb708d3494125b189530cd0ed4c5d57 | [
"MIT"
] | 1 | 2020-10-22T18:07:44.000Z | 2020-10-22T18:07:44.000Z | 03_perfectly_spherical_houses_in_vacuum.py | KanegaeGabriel/advent-of-code-2015 | e6c7beb18fb708d3494125b189530cd0ed4c5d57 | [
"MIT"
] | null | null | null | 03_perfectly_spherical_houses_in_vacuum.py | KanegaeGabriel/advent-of-code-2015 | e6c7beb18fb708d3494125b189530cd0ed4c5d57 | [
"MIT"
] | null | null | null | #########################################################
# --- Day 3: Perfectly Spherical Houses in a Vacuum --- #
#########################################################
import AOCUtils
#########################################################
directions = AOCUtils.loadInput(3)
moves = {"^": (0, -1), "v": (0, 1... | 23.179487 | 62 | 0.460177 |
fdee06f67f88086f3e205c6bc60f5ead704f97d6 | 13,103 | py | Python | Sketches/MPS/BugReports/FixTests/Axon/Axon/Introspector.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 12 | 2015-10-20T10:22:01.000Z | 2021-07-19T10:09:44.000Z | Sketches/MPS/BugReports/FixTests/Axon/Axon/Introspector.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 2 | 2015-10-20T10:22:55.000Z | 2017-02-13T11:05:25.000Z | Sketches/MPS/BugReports/FixTests/Axon/Axon/Introspector.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 6 | 2015-03-09T12:51:59.000Z | 2020-03-01T13:06:21.000Z | #!/usr/bin/env python
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Version 2.0 (the "Licen... | 41.596825 | 131 | 0.600168 |
6220745990745355e096f0d3dd8aaf513161e450 | 2,514 | py | Python | test/test_texts_api.py | dialmycalls/python-sdk-v2 | ab6ac61d305ea1729b618bc2530d6101136aa6ea | [
"Apache-2.0"
] | 2 | 2020-07-29T08:51:36.000Z | 2021-01-21T11:18:24.000Z | test/test_texts_api.py | dialmycalls/python-sdk-v2 | ab6ac61d305ea1729b618bc2530d6101136aa6ea | [
"Apache-2.0"
] | null | null | null | test/test_texts_api.py | dialmycalls/python-sdk-v2 | ab6ac61d305ea1729b618bc2530d6101136aa6ea | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
DialMyCalls API
The DialMyCalls API
OpenAPI spec version: 2.0.1
Contact: support@dialmycalls.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compli... | 20.95 | 76 | 0.631663 |
030f068479e68b67e060c0a9002a7d3edf40d028 | 3,626 | py | Python | bindings/python/ensmallen/datasets/string/candidatusuhrbacteriabacteriumrifoxyb2full4511.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/candidatusuhrbacteriabacteriumrifoxyb2full4511.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/candidatusuhrbacteriabacteriumrifoxyb2full4511.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 Candidatus Uhrbacteria bacterium RIFOXYB2_FULL_45_11.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title... | 34.533333 | 223 | 0.689741 |
bf8448e54c38d8540dd24df60f9b7b61bfa2116b | 8,776 | py | Python | backend/src/contaxy/schema/deployment.py | ml-tooling/contaxy | 3317a866c2ef641667a2d318885c8b0f5096b56a | [
"MIT"
] | 3 | 2021-10-17T23:25:05.000Z | 2022-02-03T21:40:59.000Z | backend/src/contaxy/schema/deployment.py | ml-tooling/contaxy | 3317a866c2ef641667a2d318885c8b0f5096b56a | [
"MIT"
] | 14 | 2021-11-09T15:24:29.000Z | 2022-03-11T13:26:04.000Z | backend/src/contaxy/schema/deployment.py | ml-tooling/contaxy | 3317a866c2ef641667a2d318885c8b0f5096b56a | [
"MIT"
] | 3 | 2022-01-27T08:31:57.000Z | 2022-02-11T13:38:00.000Z | from datetime import datetime
from enum import Enum
from typing import Dict, List, Optional
from fastapi import Path
from pydantic import BaseModel, Field
from contaxy.schema.shared import Resource, ResourceInput
SERVICE_ID_PARAM = Path(
...,
title="Service ID",
description="A valid Service ID.",
# T... | 34.14786 | 203 | 0.661577 |
affe7129150cd640414b66651c83c7741f24dc6f | 2,612 | py | Python | scripts/lemmatize_doc.py | blodstone/Topic_Summ | 43e578f6567fe4f1fa6d3d32372120e12fb21e12 | [
"MIT"
] | null | null | null | scripts/lemmatize_doc.py | blodstone/Topic_Summ | 43e578f6567fe4f1fa6d3d32372120e12fb21e12 | [
"MIT"
] | null | null | null | scripts/lemmatize_doc.py | blodstone/Topic_Summ | 43e578f6567fe4f1fa6d3d32372120e12fb21e12 | [
"MIT"
] | null | null | null | import re
import json
from stanfordcorenlp import StanfordCoreNLP
nlp = StanfordCoreNLP(r'/home/acp16hh/Projects/Others/stanford-corenlp-full-2018-10-05')
finished_files_dir = "../data/smallbbc-split"
def parse_sentences(sentences):
joined_sentence = ''
for sentence in sentences:
sentence = '<sos> {}... | 38.985075 | 88 | 0.616386 |
c5608bdc4b02c091f38a89d0266ff6a2fd80283f | 6,548 | py | Python | extraPackages/pyzmq-17.1.2/buildutils/bundle.py | dolboBobo/python3_ios | 877f8c2c5890f26292ddd14909bea62a04fe2889 | [
"BSD-3-Clause"
] | 130 | 2018-02-03T10:25:54.000Z | 2022-03-25T22:27:22.000Z | extraPackages/pyzmq-17.1.2/buildutils/bundle.py | spacetime314/python3_ios | e149f1bc2e50046c8810f83dae7739a8dea939ee | [
"BSD-3-Clause"
] | 9 | 2018-12-14T07:31:42.000Z | 2020-12-09T20:29:28.000Z | extraPackages/pyzmq-17.1.2/buildutils/bundle.py | spacetime314/python3_ios | e149f1bc2e50046c8810f83dae7739a8dea939ee | [
"BSD-3-Clause"
] | 64 | 2018-04-25T08:51:57.000Z | 2022-01-29T14:13:57.000Z | """utilities for fetching build dependencies."""
#-----------------------------------------------------------------------------
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
#
# This bundling code is largely adapted from pyzmq-static's get.sh by
# Brandon Craig-Rhodes,... | 34.463158 | 91 | 0.567807 |
092d7b160711ea95b44c682ad660b8ddb0e66742 | 352 | py | Python | src/test_instrumenter/if_expr.py | joeldentici/python_stepper | ab32c62d0d0333ad901d7329fb198c7a23988007 | [
"MIT"
] | 1 | 2020-11-29T20:00:39.000Z | 2020-11-29T20:00:39.000Z | src/test_instrumenter/if_expr.py | joeldentici/python_stepper | ab32c62d0d0333ad901d7329fb198c7a23988007 | [
"MIT"
] | null | null | null | src/test_instrumenter/if_expr.py | joeldentici/python_stepper | ab32c62d0d0333ad901d7329fb198c7a23988007 | [
"MIT"
] | null | null | null | import instrumenter
import unittest
class TestIfExpr(unittest.TestCase):
def test_if_expr(self):
src = """
5 if x > 7 else 10
""".strip()
expected = """
stepper_lib.if_expr(x > 7, 5, 10)
""".strip()
actual = instrumenter.instrument(src, "ifexpr").strip()
self.assertEqual(actual, expected)
if __name__... | 17.6 | 57 | 0.676136 |
f2eae85acff1c5b206c994f03dafb875e63dd8c0 | 1,575 | py | Python | Atari/experiments/ide/enjoy_atari.py | risk-and-uncertainty/paper | 73c013478d82d13c0e51c4dcccff7f8d9b64cd4c | [
"MIT"
] | 19 | 2019-05-28T14:30:23.000Z | 2022-03-31T03:14:31.000Z | Atari/experiments/ide/enjoy_atari.py | risk-and-uncertainty/paper | 73c013478d82d13c0e51c4dcccff7f8d9b64cd4c | [
"MIT"
] | 4 | 2021-06-08T20:53:26.000Z | 2022-03-12T00:14:06.000Z | Atari/experiments/ide/enjoy_atari.py | risk-and-uncertainty/paper | 73c013478d82d13c0e51c4dcccff7f8d9b64cd4c | [
"MIT"
] | 3 | 2019-07-20T14:40:03.000Z | 2021-02-26T04:09:03.000Z |
import pickle
import torch
import time
import gym
import matplotlib.pyplot as plt
import numpy as np
from rl_baselines.baselines import IDE
from rl_baselines.common.networks import CNNDeepmind_Threehead
from rl_baselines.envs.atari_wrappers import make_atari, wrap_deepmind
AGENT_PATH = '???'
env = make_atari("Alie... | 30.288462 | 76 | 0.674921 |
d5e502c0dcb8c7931a5bddf934e7c302c5bdee78 | 78 | py | Python | sslcommerz_sdk/contrib/django_app/__init__.py | monim67/sslcommerz-sdk | 77219fc90ab12222df2c03abc95c8d2b19768eeb | [
"MIT"
] | 6 | 2021-01-15T13:31:37.000Z | 2021-12-06T13:44:39.000Z | sslcommerz_sdk/contrib/django_app/__init__.py | monim67/sslcommerz-sdk | 77219fc90ab12222df2c03abc95c8d2b19768eeb | [
"MIT"
] | null | null | null | sslcommerz_sdk/contrib/django_app/__init__.py | monim67/sslcommerz-sdk | 77219fc90ab12222df2c03abc95c8d2b19768eeb | [
"MIT"
] | null | null | null | default_app_config = "sslcommerz_sdk.contrib.django_app.apps.DjangoAppConfig"
| 39 | 77 | 0.871795 |
6cfafae8c0a35b59994ed880c2509f1110382c28 | 2,273 | py | Python | samples/Reporting/Reports/create-adhoc-report.py | broadpay/cybersource-rest-samples-python | f7af6f58c70ea3bf725d34929b40ee4b5fd4d77c | [
"MIT"
] | 1 | 2021-12-23T16:53:13.000Z | 2021-12-23T16:53:13.000Z | samples/Reporting/Reports/create-adhoc-report.py | broadpay/cybersource-rest-samples-python | f7af6f58c70ea3bf725d34929b40ee4b5fd4d77c | [
"MIT"
] | null | null | null | samples/Reporting/Reports/create-adhoc-report.py | broadpay/cybersource-rest-samples-python | f7af6f58c70ea3bf725d34929b40ee4b5fd4d77c | [
"MIT"
] | null | null | null | from CyberSource import *
import os
import json
from importlib.machinery import SourceFileLoader
config_file = os.path.join(os.getcwd(), "data", "Configuration.py")
configuration = SourceFileLoader("module.name", config_file).load_module()
# To delete None values in Input Request Json body
def del_none(d):
for ke... | 32.942029 | 106 | 0.707875 |
0ebd03d325d18555cbe241152b0fe0606c576422 | 520 | py | Python | src/craterstats/__init__.py | AndrewAnnex/craterstats | d54ab421b2690a2d061ed59b140012d502fa5636 | [
"BSD-3-Clause"
] | 11 | 2021-03-11T03:58:23.000Z | 2022-02-19T01:19:53.000Z | src/craterstats/__init__.py | AndrewAnnex/craterstats | d54ab421b2690a2d061ed59b140012d502fa5636 | [
"BSD-3-Clause"
] | 9 | 2021-03-17T16:43:55.000Z | 2021-12-29T21:29:43.000Z | src/craterstats/__init__.py | AndrewAnnex/craterstats | d54ab421b2690a2d061ed59b140012d502fa5636 | [
"BSD-3-Clause"
] | 6 | 2021-03-18T13:21:22.000Z | 2021-10-31T05:25:43.000Z | # Copyright (c) 2021, Greg Michael
# Licensed under BSD 3-Clause License. See LICENSE.txt for details.
from .Chronologyfn import Chronologyfn
from .Productionfn import Productionfn
from .Cratercount import Cratercount
from .Craterplotset import Craterplotset
from .Craterplot import Craterplot
from .Craterpdf import ... | 26 | 68 | 0.828846 |
7834575217d51b25f981a31f45a06c0c655a219c | 457 | py | Python | test/venv/Scripts/easy_install-3.7-script.py | DiceDn/XgbTest | 7e32a5adf9c27608518264caf93bc6b723ce0168 | [
"MIT"
] | null | null | null | test/venv/Scripts/easy_install-3.7-script.py | DiceDn/XgbTest | 7e32a5adf9c27608518264caf93bc6b723ce0168 | [
"MIT"
] | null | null | null | test/venv/Scripts/easy_install-3.7-script.py | DiceDn/XgbTest | 7e32a5adf9c27608518264caf93bc6b723ce0168 | [
"MIT"
] | null | null | null | #!C:\Users\Richard\PycharmProjects\test\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==39.1.0','console_scripts','easy_install-3.7'
__requires__ = 'setuptools==39.1.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?... | 35.153846 | 87 | 0.693654 |
cb9f3445da265a31807c69e64873aa7a86693c0b | 1,685 | py | Python | umeboshi/runner.py | makingspace/ticker | 01917bb0234c40903fc4db4aff93f28e0125d087 | [
"BSD-3-Clause"
] | 7 | 2015-12-30T21:34:06.000Z | 2022-01-31T09:18:03.000Z | umeboshi/runner.py | makingspace/ticker | 01917bb0234c40903fc4db4aff93f28e0125d087 | [
"BSD-3-Clause"
] | 2 | 2021-04-15T06:26:05.000Z | 2021-04-16T15:35:07.000Z | umeboshi/runner.py | makingspace/ticker | 01917bb0234c40903fc4db4aff93f28e0125d087 | [
"BSD-3-Clause"
] | 1 | 2021-12-21T08:33:55.000Z | 2021-12-21T08:33:55.000Z | import logging
from django.utils.module_loading import import_string
from umeboshi.exceptions import UnknownTriggerException, RoutineRunException, NoRoutineTriggerException
class Runner(object):
"""
The Umeboshi Runner is responsible for registering and retrieving Routines.
It provides a wrapper around Ro... | 33.039216 | 103 | 0.648665 |
1cfaa8ae31d198111f09327f68a20c9527ae3e96 | 164 | py | Python | Pandas-CalculatingColumnStats.py | H2oPtic/Codecademy-Education | 454ecff36a055fa17b4b338e1c6f1e9b3b94ef66 | [
"MIT"
] | null | null | null | Pandas-CalculatingColumnStats.py | H2oPtic/Codecademy-Education | 454ecff36a055fa17b4b338e1c6f1e9b3b94ef66 | [
"MIT"
] | null | null | null | Pandas-CalculatingColumnStats.py | H2oPtic/Codecademy-Education | 454ecff36a055fa17b4b338e1c6f1e9b3b94ef66 | [
"MIT"
] | null | null | null | import pandas as pd
orders = pd.read_csv('orders.csv')
print(orders.head(10))
most_expensive = orders.price.max()
num_colors = orders.shoe_color.nunique() | 20.5 | 40 | 0.72561 |
5413f848c1f96ccfdd1bc2480cabf5912dc27f27 | 21,134 | py | Python | msticpy/sectools/tiproviders/ti_provider_base.py | Noezor/msticpy | f0d6d0d0bbaeba1ca060787b9929350804fa6dc5 | [
"MIT"
] | 2 | 2020-11-03T05:56:10.000Z | 2020-11-03T05:56:17.000Z | msticpy/sectools/tiproviders/ti_provider_base.py | Noezor/msticpy | f0d6d0d0bbaeba1ca060787b9929350804fa6dc5 | [
"MIT"
] | null | null | null | msticpy/sectools/tiproviders/ti_provider_base.py | Noezor/msticpy | f0d6d0d0bbaeba1ca060787b9929350804fa6dc5 | [
"MIT"
] | 1 | 2022-02-06T18:56:15.000Z | 2022-02-06T18:56:15.000Z | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
"""
Module... | 29.070151 | 88 | 0.602536 |
a3bf50961cd371e09f24ebacac003ab9e41bcb1c | 75,234 | py | Python | kafka/conn.py | informatique-cdc/kafka-python | d73bd6fc2f8825e2fddb7c4f091af7b266e37aea | [
"Apache-2.0"
] | null | null | null | kafka/conn.py | informatique-cdc/kafka-python | d73bd6fc2f8825e2fddb7c4f091af7b266e37aea | [
"Apache-2.0"
] | null | null | null | kafka/conn.py | informatique-cdc/kafka-python | d73bd6fc2f8825e2fddb7c4f091af7b266e37aea | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import, division
import copy
import errno
import io
import logging
from random import shuffle, uniform
# selectors in stdlib as of py3.4
try:
import selectors # pylint: disable=import-error
except ImportError:
# vendored backport module
from kafka.vendor import selectors34... | 45.023339 | 133 | 0.593203 |
c3f55e4181ffb8432f96f2204113a1fd9acaa004 | 2,513 | py | Python | alipay/aop/api/domain/AlipayFundCouponOperationQueryModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayFundCouponOperationQueryModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayFundCouponOperationQueryModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class AlipayFundCouponOperationQueryModel(object):
def __init__(self):
self._auth_no = None
self._operation_id = None
self._out_order_no = None
self._out_r... | 29.22093 | 79 | 0.606844 |
44a7a6fd9c42fde3d292575d943a6c7a76a3d06f | 3,999 | py | Python | sdks/python/appcenter_sdk/models/StepReport.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | null | null | null | sdks/python/appcenter_sdk/models/StepReport.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 6 | 2019-10-23T06:38:53.000Z | 2022-01-22T07:57:58.000Z | sdks/python/appcenter_sdk/models/StepReport.py | Brantone/appcenter-sdks | eeb063ecf79908b6e341fb00196d2cd9dc8f3262 | [
"MIT"
] | 2 | 2019-10-23T06:31:05.000Z | 2021-08-21T17:32:47.000Z | # coding: utf-8
"""
App Center Client
Microsoft Visual Studio App Center API # noqa: E501
OpenAPI spec version: preview
Contact: benedetto.abbenanti@gmail.com
Project Repository: https://github.com/b3nab/appcenter-sdks
"""
import pprint
import re # noqa: F401
import six
class StepReport(obj... | 29.622222 | 91 | 0.604401 |
329f6843fdcae99692e34306445c93f7097bfdda | 1,225 | py | Python | mayan/apps/statistics/classes.py | camerondphillips/MAYAN | b8cd44af50f0b2f2b59286d9c88e2f7aa573a93f | [
"Apache-2.0"
] | null | null | null | mayan/apps/statistics/classes.py | camerondphillips/MAYAN | b8cd44af50f0b2f2b59286d9c88e2f7aa573a93f | [
"Apache-2.0"
] | 1 | 2022-03-12T01:03:39.000Z | 2022-03-12T01:03:39.000Z | mayan/apps/statistics/classes.py | camerondphillips/MAYAN | b8cd44af50f0b2f2b59286d9c88e2f7aa573a93f | [
"Apache-2.0"
] | null | null | null | class StatisticNamespace(object):
_registry = {}
@classmethod
def get_all(cls):
return cls._registry.values()
@classmethod
def get(cls, name):
return cls._registry[name]
def __init__(self, name, label):
self.name = name
self.label = label
self._statisti... | 20.762712 | 45 | 0.613878 |
181af8de6ba8e890f8ef5b972481f45105252dbd | 3,176 | py | Python | api_site/src/api_x/zyt/evas/lianlian_pay/__init__.py | webee/pay | b48c6892686bf3f9014bb67ed119506e41050d45 | [
"W3C"
] | 1 | 2019-10-14T11:51:49.000Z | 2019-10-14T11:51:49.000Z | api_site/src/api_x/zyt/evas/lianlian_pay/__init__.py | webee/pay | b48c6892686bf3f9014bb67ed119506e41050d45 | [
"W3C"
] | null | null | null | api_site/src/api_x/zyt/evas/lianlian_pay/__init__.py | webee/pay | b48c6892686bf3f9014bb67ed119506e41050d45 | [
"W3C"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from flask import url_for
from .commons import generate_absolute_url
from pytoolbox.util.sign import Signer
from pytoolbox.util.log import get_logger
from ..error import PaymentTypeNotSupportedError
from api_x.config import lianlian_pay as config
logger... | 37.809524 | 115 | 0.723552 |
49c581f8e3435e92045486cbb069f4150e488932 | 19,115 | py | Python | scripts/deduplicate_similar_inputs.py | annikagable/annotation_system_assessment | 0b2cc5245fdf02ef8089278ac0c887505db41122 | [
"MIT"
] | null | null | null | scripts/deduplicate_similar_inputs.py | annikagable/annotation_system_assessment | 0b2cc5245fdf02ef8089278ac0c887505db41122 | [
"MIT"
] | null | null | null | scripts/deduplicate_similar_inputs.py | annikagable/annotation_system_assessment | 0b2cc5245fdf02ef8089278ac0c887505db41122 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import sys
import scipy.stats
import sklearn.cluster
import os
import multiprocessing as mp
def _spearman(data_matrix, i, j, min_overlap, absolute):
'''
Internal function, called by calculate_spearman. Get the two rows of the data matrix
that correspond to the two us... | 43.841743 | 142 | 0.562229 |
24c51f248d7070a3c192a2c317eeb0e035edf3bb | 16,798 | py | Python | sw_joystick.py | SequentialBase9915/Autodmax | a5cfcf87b607bf2a4e0e92b74c7010ee6ac23a0f | [
"MIT"
] | null | null | null | sw_joystick.py | SequentialBase9915/Autodmax | a5cfcf87b607bf2a4e0e92b74c7010ee6ac23a0f | [
"MIT"
] | null | null | null | sw_joystick.py | SequentialBase9915/Autodmax | a5cfcf87b607bf2a4e0e92b74c7010ee6ac23a0f | [
"MIT"
] | null | null | null | import pygame
import wx
from pygame.math import Vector2
from sw_serial import *
import cv2
import numpy as np
from datetime import date
# Initialize the serial connection and then joysticks
pygame.joystick.init()
joy_count = pygame.joystick.get_count()
if joy_count > 0:
xbox_360 = pygame.joystick.Joystick(0)
... | 33.866935 | 90 | 0.545303 |
3e0bb6294f59e9d93e9432354676d3120bd61735 | 9,593 | py | Python | app/api/organizations.py | EandrewJones/srdp-database | 22b9f5bcbffcd14b17cd62c6b268e5be079bf4fe | [
"MIT"
] | null | null | null | app/api/organizations.py | EandrewJones/srdp-database | 22b9f5bcbffcd14b17cd62c6b268e5be079bf4fe | [
"MIT"
] | null | null | null | app/api/organizations.py | EandrewJones/srdp-database | 22b9f5bcbffcd14b17cd62c6b268e5be079bf4fe | [
"MIT"
] | null | null | null | from flask import jsonify, request, url_for
from app import db
from app.api import bp
from app.api.groups import get_group
from app.api.auth import token_auth
from app.api.errors import bad_request
from app.api_spec import (
NonviolentTacticsSchema,
OrganizationSchema,
ViolentTacticsSchema,
)
from app.model... | 29.069697 | 92 | 0.607735 |
e5fd252ee35652a1f4b85c3b789128667e42b54b | 3,574 | py | Python | bindings/python/ensmallen/datasets/string/corynebacteriumdiphtheriae.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/corynebacteriumdiphtheriae.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/corynebacteriumdiphtheriae.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 Corynebacterium diphtheriae.
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--pr... | 33.092593 | 223 | 0.67991 |
ae950234c6a37f0eb3fceddf63dfe684aa771a9d | 16,857 | py | Python | tests/unit/cirrus/package_tests.py | Maxsparrow/cirrus | ae9639daba4f2d8d9285e98d5b11a89eac573f96 | [
"Apache-2.0"
] | 12 | 2016-04-30T16:13:55.000Z | 2021-01-20T23:42:31.000Z | tests/unit/cirrus/package_tests.py | Maxsparrow/cirrus | ae9639daba4f2d8d9285e98d5b11a89eac573f96 | [
"Apache-2.0"
] | 153 | 2015-02-12T15:25:42.000Z | 2020-03-09T07:16:15.000Z | tests/unit/cirrus/package_tests.py | Maxsparrow/cirrus | ae9639daba4f2d8d9285e98d5b11a89eac573f96 | [
"Apache-2.0"
] | 7 | 2015-06-15T21:30:38.000Z | 2020-02-17T02:13:00.000Z | #!/usr/bin/env python
"""tests for package commands """
import unittest
import mock
import os
import json
import tempfile
import argparse
from cirrus._2to3 import ConfigParser, to_str
from cirrus.package import (
create_files,
setup_branches,
commit_and_tag,
build_parser,
backup_file,
init_pack... | 35.339623 | 105 | 0.601234 |
5c9fd61f090c03cd64b4a64eeb81f7236d797cdb | 333 | py | Python | src/core/aws/data/message.py | zaxmks/demo-data-compliance-service | 372e612c570aaf5b512bec17627f825e880add67 | [
"CNRI-Python",
"CECILL-B"
] | null | null | null | src/core/aws/data/message.py | zaxmks/demo-data-compliance-service | 372e612c570aaf5b512bec17627f825e880add67 | [
"CNRI-Python",
"CECILL-B"
] | null | null | null | src/core/aws/data/message.py | zaxmks/demo-data-compliance-service | 372e612c570aaf5b512bec17627f825e880add67 | [
"CNRI-Python",
"CECILL-B"
] | null | null | null | from dataclasses import dataclass
from uuid import UUID
from dataclasses_json import LetterCase, dataclass_json
from src.core.aws.data.file_message import FileMessage
@dataclass_json(letter_case=LetterCase.PASCAL)
@dataclass
class AwsMessage:
message_id: UUID
receipt_handle: str
MD5OfBody: str
body:... | 20.8125 | 55 | 0.804805 |
1485bf3d0456ace95183a96dad05df6ee701fec0 | 4,960 | py | Python | automlToolkit/components/hpo_optimizer/utils/acquisition.py | zwt233/automl-toolkit | 67d057f5e0c74bec5b3cbde1440ec014696737ef | [
"MIT"
] | null | null | null | automlToolkit/components/hpo_optimizer/utils/acquisition.py | zwt233/automl-toolkit | 67d057f5e0c74bec5b3cbde1440ec014696737ef | [
"MIT"
] | 1 | 2020-04-28T15:34:27.000Z | 2020-04-28T15:34:27.000Z | automlToolkit/components/hpo_optimizer/utils/acquisition.py | zwt233/automl-toolkit | 67d057f5e0c74bec5b3cbde1440ec014696737ef | [
"MIT"
] | null | null | null | import abc
import logging
import numpy as np
from scipy.stats import norm
from automlToolkit.components.hpo_optimizer.utils.base_epm import AbstractEPM
class AbstractAcquisitionFunction(object, metaclass=abc.ABCMeta):
"""Abstract base class for acquisition function
Attributes
----------
model
l... | 29.700599 | 103 | 0.553427 |
8fba32d12111f85dc80af9dc8bb2227ff00fd5d8 | 1,814 | py | Python | tests/v2/test_parser.py | balloob/aiohue | f50478027ccf3b8ee6b804abb9fb48ea436e1561 | [
"Apache-2.0"
] | 14 | 2018-03-02T15:39:19.000Z | 2020-02-25T12:52:40.000Z | tests/v2/test_parser.py | balloob/aiohue | f50478027ccf3b8ee6b804abb9fb48ea436e1561 | [
"Apache-2.0"
] | 16 | 2018-03-19T15:02:18.000Z | 2020-02-08T02:06:07.000Z | tests/v2/test_parser.py | balloob/aiohue | f50478027ccf3b8ee6b804abb9fb48ea436e1561 | [
"Apache-2.0"
] | 14 | 2018-03-17T10:43:30.000Z | 2020-03-12T10:49:51.000Z | """Test parser functions that converts the incoming json from API into dataclass models."""
from dataclasses import dataclass
from typing import Optional
import pytest
from aiohue.util import dataclass_from_dict
@dataclass
class BasicModelChild:
"""Basic test model."""
a: int
b: str
c: str
d: Op... | 25.549296 | 91 | 0.624035 |
7e0f06cddda074ff02ce88a20972a5cdab502bd6 | 15,872 | py | Python | pyatop/structs/atop_230.py | dfrtz/pyatop | d12001caf685fe04d501f10d78f1c6c113440c6f | [
"Apache-2.0"
] | null | null | null | pyatop/structs/atop_230.py | dfrtz/pyatop | d12001caf685fe04d501f10d78f1c6c113440c6f | [
"Apache-2.0"
] | null | null | null | pyatop/structs/atop_230.py | dfrtz/pyatop | d12001caf685fe04d501f10d78f1c6c113440c6f | [
"Apache-2.0"
] | null | null | null | """Structs and definitions used serialize/deserialize ATOP statistics directly from log files.
Structs are declared in a way that will help provide as close to a 1 to 1 match as possible for debuggability
and maintenance. The _fields_ of every struct match their original name, however the struct names have been update... | 24.158295 | 115 | 0.575416 |
ca7e9067092edcad5d977e36e23658fb3ef43ff7 | 553 | py | Python | load_word_2vec_model.py | rathee/Siamese_Text_Similaity | 11dfdb620770c9e43ca85af8a5788852fa2920ae | [
"MIT"
] | 2 | 2019-09-02T23:04:04.000Z | 2021-08-19T13:22:05.000Z | load_word_2vec_model.py | rathee/Siamese_Text_Similaity | 11dfdb620770c9e43ca85af8a5788852fa2920ae | [
"MIT"
] | null | null | null | load_word_2vec_model.py | rathee/Siamese_Text_Similaity | 11dfdb620770c9e43ca85af8a5788852fa2920ae | [
"MIT"
] | null | null | null | from gensim.models import Word2Vec
import numpy as np
model = Word2Vec.load('/home/rathee/projects/quora_similar_questions/data/300features_40minwords_10context_new')
def get_model_embeddings () :
w2v = np.zeros((len(model.wv.index2word) + 1, 300))
model_dict = {}
index_to_word = {}
w2v[0] = np.zeros(300)
for i,... | 27.65 | 112 | 0.743219 |
5d2d148a8b2bcf3629704a0a60ca1f3aed7b342f | 51 | py | Python | symmetric_case/full_sym_base/base_flow.py | aero-cfd/Cylinder2DFlowControlDRL | fd174085fb8621d6906bfdf394c49776dc5ce515 | [
"MIT"
] | 112 | 2019-02-20T15:24:16.000Z | 2022-03-21T02:17:56.000Z | symmetric_case/full_sym_base/base_flow.py | aero-cfd/Cylinder2DFlowControlDRL | fd174085fb8621d6906bfdf394c49776dc5ce515 | [
"MIT"
] | 24 | 2019-03-12T14:12:18.000Z | 2022-03-11T11:11:37.000Z | symmetric_case/full_sym_base/base_flow.py | aero-cfd/Cylinder2DFlowControlDRL | fd174085fb8621d6906bfdf394c49776dc5ce515 | [
"MIT"
] | 61 | 2019-02-20T13:54:49.000Z | 2022-03-28T12:29:02.000Z | import env
env.resume_env(plot=False, remesh=True)
| 17 | 39 | 0.803922 |
30bf2d4381b50d69090f0c3eca16b39b5be6ee00 | 920 | py | Python | io_base/pickle_io.py | miguelgfierro/pybase | de8e4f11ed5c655e748178e65195c7e70a9c98af | [
"BSD-3-Clause"
] | 14 | 2020-02-07T21:36:39.000Z | 2022-03-12T22:37:04.000Z | io_base/pickle_io.py | miguelgfierro/pybase | de8e4f11ed5c655e748178e65195c7e70a9c98af | [
"BSD-3-Clause"
] | 19 | 2019-05-18T23:58:30.000Z | 2022-01-09T16:45:35.000Z | io_base/pickle_io.py | miguelgfierro/pybase | de8e4f11ed5c655e748178e65195c7e70a9c98af | [
"BSD-3-Clause"
] | 5 | 2020-10-06T06:10:27.000Z | 2021-07-08T12:58:46.000Z | import pickle
def save_file(data, filename):
"""Save data as pickle. The standard pickle file name is ``*.pk``.
See a `benchmark on IO performance <http://stackoverflow.com/a/41425878/5620182>`_
Args:
data (np.array or dict): Data to save.
filename (str): Name of the file.
E... | 21.904762 | 86 | 0.538043 |
43e27e375f6d2119eecbba569490eea643b1bd45 | 3,387 | py | Python | sdk/python/pulumi_aws/swf/domain.py | Charliekenney23/pulumi-aws | 55bd0390160d27350b297834026fee52114a2d41 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/swf/domain.py | Charliekenney23/pulumi-aws | 55bd0390160d27350b297834026fee52114a2d41 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_aws/swf/domain.py | Charliekenney23/pulumi-aws | 55bd0390160d27350b297834026fee52114a2d41 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import json
import warnings
import pulumi
import pulumi.runtime
from .. import utilities, tables
class Domain(pulumi.CustomResource):
... | 43.987013 | 239 | 0.702096 |
b1b493e4782c793974ca0eafb212437dcd4e1748 | 10,312 | py | Python | kolibri/core/analytics/utils.py | nucleogenesis/kolibri | 7b653a28f014ed9d0f29d116e120d1a02eb62b4c | [
"MIT"
] | null | null | null | kolibri/core/analytics/utils.py | nucleogenesis/kolibri | 7b653a28f014ed9d0f29d116e120d1a02eb62b4c | [
"MIT"
] | null | null | null | kolibri/core/analytics/utils.py | nucleogenesis/kolibri | 7b653a28f014ed9d0f29d116e120d1a02eb62b4c | [
"MIT"
] | null | null | null | import base64
import datetime
import hashlib
import json
import re
import semver
from django.core.serializers.json import DjangoJSONEncoder
from django.db import transaction
from django.db.models import Count
from django.db.models import Max
from django.db.models import Min
from django.db.models import Sum
from .mode... | 36.567376 | 151 | 0.671936 |
66f44cad288925ab97681b6a789b4d3eab1246c5 | 1,277 | py | Python | test/functional/p2p-mempool.py | Frusop/copper | a5e9d15ef68231bc28ce0a394b1e967a6cf0b1dd | [
"MIT"
] | null | null | null | test/functional/p2p-mempool.py | Frusop/copper | a5e9d15ef68231bc28ce0a394b1e967a6cf0b1dd | [
"MIT"
] | 1 | 2019-01-11T07:01:14.000Z | 2019-01-12T18:14:49.000Z | test/functional/p2p-mempool.py | Frusop/copper | a5e9d15ef68231bc28ce0a394b1e967a6cf0b1dd | [
"MIT"
] | 1 | 2019-01-11T06:00:53.000Z | 2019-01-11T06:00:53.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Copyright (c) 2017 The Copper Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test p2p mempool message.
Test that nodes are disconne... | 32.74359 | 75 | 0.708692 |
80e134ea6bd5e7757e2ec4c69f2ccf4a41d36682 | 3,367 | py | Python | ckan/ckanext-dcatapit/ckanext/dcatapit/tests/test_dcatapit_profile_serialize.py | lorenzoeusepi77/ckan | 3a620e9c81ba1750d12941c02184092d507f71df | [
"Apache-2.0"
] | null | null | null | ckan/ckanext-dcatapit/ckanext/dcatapit/tests/test_dcatapit_profile_serialize.py | lorenzoeusepi77/ckan | 3a620e9c81ba1750d12941c02184092d507f71df | [
"Apache-2.0"
] | null | null | null | ckan/ckanext-dcatapit/ckanext/dcatapit/tests/test_dcatapit_profile_serialize.py | lorenzoeusepi77/ckan | 3a620e9c81ba1750d12941c02184092d507f71df | [
"Apache-2.0"
] | null | null | null | import json
import nose
from pylons import config
from dateutil.parser import parse as parse_date
from rdflib import URIRef, BNode, Literal
from rdflib.namespace import RDF
from geomet import wkt
try:
from ckan.tests import helpers, factories
except ImportError:
from ckan.new_tests import helpers, factorie... | 35.072917 | 97 | 0.627265 |
3a7871bc9df3ea2e7acecedc5a1ca39ac31c5cd8 | 1,511 | py | Python | ML/website-scraping-w-python-master/Chapter 4/06_csv_pipeline/06_csv_pipeline/sainsburys/sainsburys/pipelines.py | praveenpmin/Python | 513fcde7430b03a187e2c7e58302b88645388eed | [
"MIT"
] | null | null | null | ML/website-scraping-w-python-master/Chapter 4/06_csv_pipeline/06_csv_pipeline/sainsburys/sainsburys/pipelines.py | praveenpmin/Python | 513fcde7430b03a187e2c7e58302b88645388eed | [
"MIT"
] | null | null | null | ML/website-scraping-w-python-master/Chapter 4/06_csv_pipeline/06_csv_pipeline/sainsburys/sainsburys/pipelines.py | praveenpmin/Python | 513fcde7430b03a187e2c7e58302b88645388eed | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from sainsburys.items import SainsburysItem
class CsvItemPipeline:
fieldnames_standard = ['item_code', 'product_name', 'url', 'price_per_unit', 'unit', 'rating', 'product_reviews',
'product_origin', 'product_image']
def __init__(self, csv_filename):
... | 32.847826 | 117 | 0.602912 |
ba79e19f7fe8301911524075af6d302bf55ceab7 | 21,523 | py | Python | synapse/storage/databases/main/transactions.py | mlakkadshaw/synapse | 74a2365bd5066955567cc551e72632d6cece94b9 | [
"Apache-2.0"
] | 1 | 2022-02-22T21:40:29.000Z | 2022-02-22T21:40:29.000Z | synapse/storage/databases/main/transactions.py | mlakkadshaw/synapse | 74a2365bd5066955567cc551e72632d6cece94b9 | [
"Apache-2.0"
] | 2 | 2022-03-01T08:22:45.000Z | 2022-03-11T08:13:55.000Z | synapse/storage/databases/main/transactions.py | mlakkadshaw/synapse | 74a2365bd5066955567cc551e72632d6cece94b9 | [
"Apache-2.0"
] | 1 | 2022-03-31T09:03:27.000Z | 2022-03-31T09:03:27.000Z | # 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 applicable law or agreed to in w... | 34.602894 | 88 | 0.596803 |
d8452eee9313a1431fb76970bf74e1d7445fda57 | 23,774 | py | Python | nova/objects/migrate_data.py | sapcc/nova | ad71af7307365d6aabd122e140f56df4db1e6182 | [
"Apache-2.0"
] | 2 | 2021-10-11T04:56:25.000Z | 2022-02-16T08:49:29.000Z | nova/objects/migrate_data.py | sapcc/nova | ad71af7307365d6aabd122e140f56df4db1e6182 | [
"Apache-2.0"
] | 132 | 2017-03-27T11:31:52.000Z | 2022-03-30T08:45:02.000Z | nova/objects/migrate_data.py | sapcc/nova | ad71af7307365d6aabd122e140f56df4db1e6182 | [
"Apache-2.0"
] | 8 | 2017-03-27T07:50:38.000Z | 2020-02-14T16:55:56.000Z | # Copyright 2015 Red Hat, 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 a... | 42.227353 | 79 | 0.662446 |
1b71a65f398c9feea9a469bb862a7252339134b1 | 1,578 | py | Python | utilities/testWriteSummaryTopology.py | LLNL/hdtopology | 303a0740d59831073b2af69be698dbe19932ec7b | [
"BSD-3-Clause"
] | null | null | null | utilities/testWriteSummaryTopology.py | LLNL/hdtopology | 303a0740d59831073b2af69be698dbe19932ec7b | [
"BSD-3-Clause"
] | null | null | null | utilities/testWriteSummaryTopology.py | LLNL/hdtopology | 303a0740d59831073b2af69be698dbe19932ec7b | [
"BSD-3-Clause"
] | null | null | null | import ngl
import numpy as np
from hdff import *
import hdtopology as hdt
n = 1000
d = 3
sample = np.random.uniform(-1.0,1.0,n*d).astype('f')
sample = sample.reshape(n, d)
###### test function ######
def ackley(domain, d=3):
# print "domain", domain.shape
Sum = np.zeros(domain.shape[0], dtype=float)
for i... | 28.690909 | 134 | 0.644487 |
4078619c49b423dbc777f0408855acca87b00d7a | 1,230 | py | Python | pyzoo/zoo/chronos/detector/anomaly/abstract.py | limn2o4/analytics-zoo | 78d6ce10976a7e1320ff5ebdf431db93a439ec56 | [
"Apache-2.0"
] | 2,970 | 2017-06-08T00:24:43.000Z | 2022-03-30T12:14:55.000Z | pyzoo/zoo/chronos/detector/anomaly/abstract.py | limn2o4/analytics-zoo | 78d6ce10976a7e1320ff5ebdf431db93a439ec56 | [
"Apache-2.0"
] | 3,530 | 2017-05-09T08:29:10.000Z | 2022-03-21T02:11:45.000Z | pyzoo/zoo/chronos/detector/anomaly/abstract.py | limn2o4/analytics-zoo | 78d6ce10976a7e1320ff5ebdf431db93a439ec56 | [
"Apache-2.0"
] | 972 | 2017-05-09T07:03:50.000Z | 2022-03-23T07:48:48.000Z | #
# Copyright 2018 Analytics Zoo 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... | 26.170213 | 74 | 0.656911 |
c3cb4534025fff01366dcd89ca3d438827539225 | 13,054 | py | Python | workers/base/wait_jobs.py | dperezrada/poliglo-base | 7460cf1a16e66d155baa8aff93b4a540360e1328 | [
"MIT"
] | null | null | null | workers/base/wait_jobs.py | dperezrada/poliglo-base | 7460cf1a16e66d155baa8aff93b4a540360e1328 | [
"MIT"
] | null | null | null | workers/base/wait_jobs.py | dperezrada/poliglo-base | 7460cf1a16e66d155baa8aff93b4a540360e1328 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#req:
#end req
import os
import uuid
from datetime import datetime
import json
import hashlib
from time import time
import poliglo
from poliglo.utils import to_json
POLIGLO_SERVER_URL = os.environ.get('POLIGLO_SERVER_URL')
META_WORKER = 'wait_jobs'
def check_if_waiting... | 34.534392 | 138 | 0.63222 |
6494521444d0dd607d00d68b3a7463d9212eca5c | 2,774 | py | Python | tests/model/test_summarizer_transformer.py | audriusuzkuraitis/headliner | f915306fd80218949a6447aa915c93ef4b44fdd0 | [
"MIT"
] | null | null | null | tests/model/test_summarizer_transformer.py | audriusuzkuraitis/headliner | f915306fd80218949a6447aa915c93ef4b44fdd0 | [
"MIT"
] | null | null | null | tests/model/test_summarizer_transformer.py | audriusuzkuraitis/headliner | f915306fd80218949a6447aa915c93ef4b44fdd0 | [
"MIT"
] | null | null | null | import os
import shutil
import tempfile
import unittest
import numpy as np
import tensorflow as tf
from headliner.losses import masked_crossentropy
from headliner.model.transformer_summarizer import TransformerSummarizer
from headliner.preprocessing.keras_tokenizer import KerasTokenizer
from headliner.preprocessing.p... | 44.741935 | 103 | 0.695025 |
f186a7e6a5ffafca15176c82a51cac5017a40770 | 6,407 | py | Python | zerver/lib/markdown/api_arguments_table_generator.py | savish28/zulip | cf5ededa3566b14c44375786ffeadacaec693e53 | [
"Apache-2.0"
] | 4 | 2020-09-26T17:46:27.000Z | 2021-06-24T16:56:17.000Z | zerver/lib/markdown/api_arguments_table_generator.py | savish28/zulip | cf5ededa3566b14c44375786ffeadacaec693e53 | [
"Apache-2.0"
] | null | null | null | zerver/lib/markdown/api_arguments_table_generator.py | savish28/zulip | cf5ededa3566b14c44375786ffeadacaec693e53 | [
"Apache-2.0"
] | 1 | 2020-11-26T14:09:56.000Z | 2020-11-26T14:09:56.000Z | import json
import os
import re
from typing import Any, Dict, List, Mapping, Sequence
import markdown
from django.utils.html import escape as escape_html
from markdown.extensions import Extension
from markdown.preprocessors import Preprocessor
from zerver.openapi.openapi import get_openapi_parameters, likely_deprecat... | 41.335484 | 184 | 0.563758 |
17ae6f187afc4ad9caf92427521287e310f971b3 | 57,036 | py | Python | tests/hub_test.py | stevepbyrne/dbus-systemcalc-py | 4d50ca36af51bbe1e3040cb63f60ef262da5d397 | [
"MIT"
] | null | null | null | tests/hub_test.py | stevepbyrne/dbus-systemcalc-py | 4d50ca36af51bbe1e3040cb63f60ef262da5d397 | [
"MIT"
] | null | null | null | tests/hub_test.py | stevepbyrne/dbus-systemcalc-py | 4d50ca36af51bbe1e3040cb63f60ef262da5d397 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import math
# This adapts sys.path to include all relevant packages
import context
# our own packages
from base import TestSystemCalcBase
# Monkey patching for unit tests
import patches
class TestHubSystem(TestSystemCalcBase):
def __init__(self, methodName='runTest'):
TestSystemCalcBase.__i... | 36.58499 | 112 | 0.705572 |
d01a67fe9e7ca5a044bf90cdc4ed6d374afe27ef | 2,446 | py | Python | sktime/dists_kernels/compose_from_align.py | mikofski/sktime | 87bdf36dbc0990f29942eb6f7fa56a8e6c5fa7b7 | [
"BSD-3-Clause"
] | 2 | 2021-12-28T10:48:11.000Z | 2022-03-06T18:08:01.000Z | sktime/dists_kernels/compose_from_align.py | mikofski/sktime | 87bdf36dbc0990f29942eb6f7fa56a8e6c5fa7b7 | [
"BSD-3-Clause"
] | null | null | null | sktime/dists_kernels/compose_from_align.py | mikofski/sktime | 87bdf36dbc0990f29942eb6f7fa56a8e6c5fa7b7 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""Composer that creates distance from aligner."""
__author__ = ["fkiraly"]
import numpy as np
from sklearn import clone
from sktime.dists_kernels._base import BasePairwiseTransformerPanel
class DistFromAligner(BasePairwiseTransformerPanel):
"""Distance transformer from aligner.
Be... | 28.114943 | 84 | 0.584219 |
5b2ad0ef35346a3aa7e1feaa7b79c5e92869b7ae | 4,707 | py | Python | Cap12/modulos/utils.py | CezarPoeta/Python-Fundamentos | 53972d21bea86fdba90a3fafa487be6959ccebb8 | [
"MIT"
] | 1 | 2019-02-03T10:53:55.000Z | 2019-02-03T10:53:55.000Z | 12-Introducao_a_Deep_Learning/modulos/utils.py | alineAssuncao/Python_Fundamentos_Analise_Dados | 872781f2cec24487b0f29f62afeb60650a451bfd | [
"MIT"
] | null | null | null | 12-Introducao_a_Deep_Learning/modulos/utils.py | alineAssuncao/Python_Fundamentos_Analise_Dados | 872781f2cec24487b0f29f62afeb60650a451bfd | [
"MIT"
] | null | null | null | # Imports
import pandas as pd
import numpy as np
import os, sys, inspect
from six.moves import cPickle as pickle
import scipy.misc as misc
# Parâmetros
IMAGE_SIZE = 48
NUM_LABELS = 7
# Usando 10% dos dados para validação
VALIDATION_PERCENT = 0.1
# Normalização
IMAGE_LOCATION_NORM = IMAGE_SIZE // 2
# Seed
np.rando... | 34.610294 | 117 | 0.596346 |
af8d93cb519cac4ca1bc71007767f74c93b1ddf7 | 6,362 | py | Python | catalyst/dl/metrics.py | stalkermustang/catalyst | 687bc6c31dfdc44ae3ff62938e11e69ce1999cd4 | [
"MIT"
] | null | null | null | catalyst/dl/metrics.py | stalkermustang/catalyst | 687bc6c31dfdc44ae3ff62938e11e69ce1999cd4 | [
"MIT"
] | null | null | null | catalyst/dl/metrics.py | stalkermustang/catalyst | 687bc6c31dfdc44ae3ff62938e11e69ce1999cd4 | [
"MIT"
] | null | null | null | import numpy as np
import torch
from .utils import get_activation_by_name
def accuracy(outputs, targets, topk=(1, )):
"""
Computes the accuracy@k for the specified values of k
"""
max_k = max(topk)
batch_size = targets.size(0)
_, pred = outputs.topk(max_k, 1, True, True)
pred = pred.t()
... | 28.657658 | 76 | 0.615687 |
e54b23d8b5ab770cf680fd278a771bfcf0ea612d | 4,227 | py | Python | HeavyFlavorAnalysis/Onia2MuMu/python/oniaPATMuonsWithTrigger_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | HeavyFlavorAnalysis/Onia2MuMu/python/oniaPATMuonsWithTrigger_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | HeavyFlavorAnalysis/Onia2MuMu/python/oniaPATMuonsWithTrigger_cff.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
#this is our version of the patMuonsWithTrigger from MuonAnalysis, we have rename all methods to avoid any clash, and remove
#all dependencies othen than to PatAlgos.
### ==== Make PAT Muons ====
import PhysicsTools.PatAlgos.producersLayer1.muonProducer_cfi
oniaPATMuonsWithou... | 45.945652 | 152 | 0.706884 |
a8783f17bd6ea2b8dae7aa735e20eaedb9bf483c | 983 | py | Python | vessels_info/baltic/baltic/spiders/Baltic_Only_IMO.py | ParveshDhawan/Scrapping_Spiders | 7139ed60af9a2982d4ac085a98fa648b796bdadd | [
"MIT"
] | null | null | null | vessels_info/baltic/baltic/spiders/Baltic_Only_IMO.py | ParveshDhawan/Scrapping_Spiders | 7139ed60af9a2982d4ac085a98fa648b796bdadd | [
"MIT"
] | null | null | null | vessels_info/baltic/baltic/spiders/Baltic_Only_IMO.py | ParveshDhawan/Scrapping_Spiders | 7139ed60af9a2982d4ac085a98fa648b796bdadd | [
"MIT"
] | null | null | null | import scrapy
from scrapy_selenium import SeleniumRequest
from selenium.common.exceptions import NoSuchElementException
class BalticOnlyImoSpider(scrapy.Spider):
name = 'Baltic_Only_IMO'
def start_requests(self):
yield SeleniumRequest(
url='http://www.balticshipping.com/vessels/',
... | 37.807692 | 136 | 0.568667 |
e10d2f466158feb49f4440d571199f99be62a94c | 524 | py | Python | app/core/management/utils/xse_client.py | OpenLXP/openlxp-xis | b15244d5885c4367d661247462d865e7a30d8996 | [
"Apache-2.0"
] | null | null | null | app/core/management/utils/xse_client.py | OpenLXP/openlxp-xis | b15244d5885c4367d661247462d865e7a30d8996 | [
"Apache-2.0"
] | 17 | 2020-12-15T18:33:30.000Z | 2022-03-18T02:46:15.000Z | app/core/management/utils/xse_client.py | OpenLXP/openlxp-xis | b15244d5885c4367d661247462d865e7a30d8996 | [
"Apache-2.0"
] | null | null | null | import logging
from core.models import XISConfiguration
logger = logging.getLogger('dict_config_logger')
def get_elasticsearch_endpoint():
"""Setting API endpoint for XIS and XSE communication """
configuration = XISConfiguration.objects.first()
api_es_endpoint = configuration.xse_host
return api_e... | 26.2 | 62 | 0.769084 |
d9e42f0d1fe751179b5d4fe38c7115b0282c6154 | 305 | py | Python | 2016/program-stream-schedule/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 14 | 2015-05-08T13:41:51.000Z | 2021-02-24T12:34:55.000Z | 2016/program-stream-schedule/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | null | null | null | 2016/program-stream-schedule/graphic_config.py | nprapps/graphics-archive | 97b0ef326b46a959df930f5522d325e537f7a655 | [
"FSFAP"
] | 7 | 2015-04-04T04:45:54.000Z | 2021-02-18T11:12:48.000Z | #!/usr/bin/env python
import base_filters
COPY_GOOGLE_DOC_KEY = '1b2Km3mfrn5IEXr2RbRJ1WUarzzYSAJosdRcNdXLnjqk'
USE_ASSETS = False
# Use these variables to override the default cache timeouts for this graphic
# DEFAULT_MAX_AGE = 20
# ASSETS_MAX_AGE = 300
JINJA_FILTER_FUNCTIONS = base_filters.FILTERS
| 21.785714 | 77 | 0.819672 |
b52cb6675b2aef569dd31f5896ce310a7749af0d | 7,367 | py | Python | composer/utils/reproducibility.py | growlix/composer | 27418a3c65dca26d90ac09c6ae67cbd5d0202ccf | [
"Apache-2.0"
] | 945 | 2021-10-13T16:24:20.000Z | 2022-03-31T21:21:54.000Z | composer/utils/reproducibility.py | growlix/composer | 27418a3c65dca26d90ac09c6ae67cbd5d0202ccf | [
"Apache-2.0"
] | 544 | 2021-10-13T20:23:27.000Z | 2022-03-31T02:47:54.000Z | composer/utils/reproducibility.py | growlix/composer | 27418a3c65dca26d90ac09c6ae67cbd5d0202ccf | [
"Apache-2.0"
] | 39 | 2021-10-13T14:33:33.000Z | 2022-03-31T11:13:19.000Z | # Copyright 2022 MosaicML Composer authors
# SPDX-License-Identifier: Apache-2.0
"""Helper utilities for configuring deterministic training to ensure reproducibility.
.. note::
For deterministic model initialization, :func:`~.seed_all` and/or
:func:`~.configure_deterministic_mode` should be
invoked befor... | 32.888393 | 119 | 0.659156 |
89faba85a27852d9fd81aa541f88d5aec23ef96a | 326 | py | Python | mikhailova_daria_dz_2/task_4.py | DariaShidova/1824_GB_Python_1 | 23ab1829260caa092cbf10b06f766fe95937cecf | [
"MIT"
] | null | null | null | mikhailova_daria_dz_2/task_4.py | DariaShidova/1824_GB_Python_1 | 23ab1829260caa092cbf10b06f766fe95937cecf | [
"MIT"
] | null | null | null | mikhailova_daria_dz_2/task_4.py | DariaShidova/1824_GB_Python_1 | 23ab1829260caa092cbf10b06f766fe95937cecf | [
"MIT"
] | null | null | null | worker_list = ['инженер-конструктор Игорь', 'главный бухгалтер МАРИНА', 'токарь высшего разряда нИКОЛАй', 'директор '
'аэлита']
for i in worker_list:
name = (i.split()[-1]).capitalize()
print(f'Привет,{name... | 54.333333 | 117 | 0.46319 |
8482ecbe8e1310e26dd0dbda55a2ed57d4edef69 | 5,355 | py | Python | bin/find_basename_res.py | cirosantilli/python-utils | 3854d2c7973c6382f76e311423c219bccacb8c1d | [
"MIT"
] | 1 | 2018-10-04T15:29:04.000Z | 2018-10-04T15:29:04.000Z | bin/find_basename_res.py | cirosantilli/python-utils | 3854d2c7973c6382f76e311423c219bccacb8c1d | [
"MIT"
] | null | null | null | bin/find_basename_res.py | cirosantilli/python-utils | 3854d2c7973c6382f76e311423c219bccacb8c1d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import re
import sys
import os
import itertools
import termcolor
from cirosantilli import files
from cirosantilli import argparse_extras
if __name__ == '__main__':
parser = argparse_extras.ArgumentParser(
description="find recursivelly paths whose basenames match all given regexes... | 27.603093 | 103 | 0.513352 |
c1720e86042a0d253d0197cb8adba45ac4fe395e | 8,661 | py | Python | kubernetes_asyncio/client/models/v1_persistent_volume_claim_condition.py | weltonrodrigo/kubernetes_asyncio | b793f3e9ea43cbd0f4ff40ace1b0b677682f4042 | [
"Apache-2.0"
] | null | null | null | kubernetes_asyncio/client/models/v1_persistent_volume_claim_condition.py | weltonrodrigo/kubernetes_asyncio | b793f3e9ea43cbd0f4ff40ace1b0b677682f4042 | [
"Apache-2.0"
] | 13 | 2021-04-12T02:03:48.000Z | 2022-03-28T02:08:46.000Z | kubernetes_asyncio/client/models/v1_persistent_volume_claim_condition.py | weltonrodrigo/kubernetes_asyncio | b793f3e9ea43cbd0f4ff40ace1b0b677682f4042 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: v1.16.14
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
f... | 33.183908 | 232 | 0.637802 |
dfd9d4a7f2a59de9253d22d1fd14126cb7c5a7ae | 3,991 | py | Python | corridor_experiments/resqbot_2d_simulator.py | roni-permana-saputra/HiDO-MPC-ResQbot | eb6dfabf348bed412bdb0212c8cda032f4c184d4 | [
"MIT"
] | 1 | 2021-03-01T09:27:52.000Z | 2021-03-01T09:27:52.000Z | corridor_experiments/resqbot_2d_simulator.py | roni-permana-saputra/HiDO-MPC-ResQbot | eb6dfabf348bed412bdb0212c8cda032f4c184d4 | [
"MIT"
] | null | null | null | corridor_experiments/resqbot_2d_simulator.py | roni-permana-saputra/HiDO-MPC-ResQbot | eb6dfabf348bed412bdb0212c8cda032f4c184d4 | [
"MIT"
] | null | null | null | """
ResQbot 2D Simulator model
- Robot/Vehicle model 2D model
- Casualty 2D model
author: R Saputra
"""
import numpy as np
import matplotlib.pyplot as plt
import math
import random
class Vehicle():
def __init__(self, ix, iy, iyaw):
self.x = ix
self.y = iy
self.yaw = iyaw
s... | 36.281818 | 69 | 0.432974 |
421e652e0c67555b1a75ce3ea7e253e2f6e3eb6a | 103 | py | Python | fastapi_rest_jsonapi/data/__init__.py | Zenor27/fastapi-rest-jsonapi | 1c6eaad0791949bbaf9f4032fb7ecd483e80a02a | [
"MIT"
] | 2 | 2022-03-01T00:59:04.000Z | 2022-03-03T06:17:51.000Z | fastapi_rest_jsonapi/data/__init__.py | Zenor27/fastapi-rest-jsonapi | 1c6eaad0791949bbaf9f4032fb7ecd483e80a02a | [
"MIT"
] | 9 | 2022-01-16T15:47:35.000Z | 2022-03-28T18:47:18.000Z | fastapi_rest_jsonapi/data/__init__.py | Zenor27/fastapi-rest-jsonapi | 1c6eaad0791949bbaf9f4032fb7ecd483e80a02a | [
"MIT"
] | null | null | null | # flake8: noqa
from .data_layer import DataLayer
from .sqlachemy_data_layer import SQLAlchemyDataLayer
| 25.75 | 53 | 0.854369 |
a9d6c998a509e7f2491b1fb562acd0fdaf57361f | 12,089 | py | Python | google/appengine/api/memcache/memcache_stub.py | luduvigo/app-blog-code | 2de41573955f8dfb5f6d964d3cae2bbee6db2f9a | [
"Apache-2.0"
] | null | null | null | google/appengine/api/memcache/memcache_stub.py | luduvigo/app-blog-code | 2de41573955f8dfb5f6d964d3cae2bbee6db2f9a | [
"Apache-2.0"
] | null | null | null | google/appengine/api/memcache/memcache_stub.py | luduvigo/app-blog-code | 2de41573955f8dfb5f6d964d3cae2bbee6db2f9a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2007 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 30.918159 | 80 | 0.67152 |
c2bcd606f66a4ffe573427b5838b9b49f35ebc15 | 3,517 | py | Python | flash/image/detection/model.py | LoopGlitch26/lightning-flash | a1bece4361a7cb5449715bef9975696e96c5f9ae | [
"Apache-2.0"
] | null | null | null | flash/image/detection/model.py | LoopGlitch26/lightning-flash | a1bece4361a7cb5449715bef9975696e96c5f9ae | [
"Apache-2.0"
] | null | null | null | flash/image/detection/model.py | LoopGlitch26/lightning-flash | a1bece4361a7cb5449715bef9975696e96c5f9ae | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 40.895349 | 113 | 0.688371 |
bf9e05ed3e461f716ab030eb22ceaa72207b9763 | 4,264 | py | Python | object_detection.py | rktayal/object-detection-demo | 3bc69ecdfbf9ac3f6d6f34f08a87c4b02c5eb910 | [
"MIT"
] | 1 | 2020-04-12T16:12:52.000Z | 2020-04-12T16:12:52.000Z | object_detection.py | rktayal/object-detection-demo | 3bc69ecdfbf9ac3f6d6f34f08a87c4b02c5eb910 | [
"MIT"
] | null | null | null | object_detection.py | rktayal/object-detection-demo | 3bc69ecdfbf9ac3f6d6f34f08a87c4b02c5eb910 | [
"MIT"
] | 4 | 2019-12-26T07:55:12.000Z | 2020-09-29T01:52:58.000Z | """
The script loads the model into memory,
performs detections on your webcam
"""
import os
import sys
import cv2
import argparse
#import utils as ut
import numpy as np
import tensorflow as tf
#from PIL import Image
#from io import StringIO
#from collections import defaultdict
#from matplotlib import pyplot as pl... | 36.135593 | 95 | 0.640478 |
532c944cc78b9bf07d6b48281ab92c157f32db60 | 418 | py | Python | schnitzler_zeitungen/wsgi.py | martinantonmueller/schnitzler-zeitungen | f677fe0ed0e92f2fa054e43f5a3c88c1175f5ab5 | [
"MIT"
] | null | null | null | schnitzler_zeitungen/wsgi.py | martinantonmueller/schnitzler-zeitungen | f677fe0ed0e92f2fa054e43f5a3c88c1175f5ab5 | [
"MIT"
] | 9 | 2021-03-19T01:56:45.000Z | 2022-03-29T08:12:30.000Z | schnitzler_zeitungen/wsgi.py | martinantonmueller/schnitzler-zeitungen | f677fe0ed0e92f2fa054e43f5a3c88c1175f5ab5 | [
"MIT"
] | 1 | 2019-10-03T06:20:36.000Z | 2019-10-03T06:20:36.000Z | """
WSGI config for schnitzler_zeitungen project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault... | 24.588235 | 80 | 0.799043 |
8740e9e4fc94ab140ac814e71eaa063136310a28 | 1,310 | py | Python | app/core/tests/tests_admin.py | NatikaKV/recipe-app-api | c5c0b1fc9d49aaf1fbe4547a485919a40e0ec1e0 | [
"MIT"
] | null | null | null | app/core/tests/tests_admin.py | NatikaKV/recipe-app-api | c5c0b1fc9d49aaf1fbe4547a485919a40e0ec1e0 | [
"MIT"
] | null | null | null | app/core/tests/tests_admin.py | NatikaKV/recipe-app-api | c5c0b1fc9d49aaf1fbe4547a485919a40e0ec1e0 | [
"MIT"
] | null | null | null | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email='admin@email.com',
... | 31.95122 | 68 | 0.638931 |
d95acb524992ab1ca2a3395a52d48a793ab3f132 | 270 | py | Python | djangofiltertest/djangofiltertest/apps/posts_areas/api_v1/views.py | gonzaloamadio/django-filter-test | 7b9dbc36ca248e2113deaac03e824b123a31a4ba | [
"MIT"
] | null | null | null | djangofiltertest/djangofiltertest/apps/posts_areas/api_v1/views.py | gonzaloamadio/django-filter-test | 7b9dbc36ca248e2113deaac03e824b123a31a4ba | [
"MIT"
] | 3 | 2020-06-05T19:44:12.000Z | 2022-03-08T21:09:34.000Z | djangofiltertest/djangofiltertest/apps/posts_areas/api_v1/views.py | gonzaloamadio/django-filter-test | 7b9dbc36ca248e2113deaac03e824b123a31a4ba | [
"MIT"
] | null | null | null | from posts_areas.api_v1.serializers import PostAreaSerializer
from posts_areas.models import PostArea
from djangofiltertest.libs.views import APIViewSet
class PostAreaViewSet(APIViewSet):
queryset = PostArea.objects.all()
serializer_class = PostAreaSerializer
| 30 | 61 | 0.837037 |
86128c070ba9381cd37db881012a88b93bda1cae | 6,744 | py | Python | CaptionGenerator.py | ttengwang/ECHR | aa55a3e00d45f65d7dc01a392a7895d4b7a34163 | [
"MIT"
] | 8 | 2020-10-21T13:09:41.000Z | 2021-01-14T11:25:42.000Z | CaptionGenerator.py | ttengwang/ECHR | aa55a3e00d45f65d7dc01a392a7895d4b7a34163 | [
"MIT"
] | 1 | 2020-12-01T12:44:29.000Z | 2020-12-05T10:37:32.000Z | CaptionGenerator.py | ttengwang/ECHR | aa55a3e00d45f65d7dc01a392a7895d4b7a34163 | [
"MIT"
] | 3 | 2020-10-20T08:59:22.000Z | 2021-01-10T02:42:51.000Z | import pdb
import torch
from torch import nn
from torch.autograd import Variable
import models
import time
class CaptionGenerator(nn.Module):
def __init__(self, opt):
super(CaptionGenerator, self).__init__()
self.opt = opt
self.change_context_dim()
if 'TSRM' in opt.fusion_... | 39.905325 | 139 | 0.602758 |
74d49678a32b62f0bee837f70720184ea5665bf4 | 294 | py | Python | src/api/tables/semester_info.py | 123joshuawu/yacs.n | 5e5b4e4447953a6e88916f38a3c8720264cfc6f9 | [
"MIT"
] | 20 | 2020-02-29T19:03:31.000Z | 2022-02-18T21:13:12.000Z | src/api/tables/semester_info.py | 123joshuawu/yacs.n | 5e5b4e4447953a6e88916f38a3c8720264cfc6f9 | [
"MIT"
] | 465 | 2020-02-29T19:08:18.000Z | 2022-03-18T22:21:49.000Z | src/api/tables/semester_info.py | 123joshuawu/yacs.n | 5e5b4e4447953a6e88916f38a3c8720264cfc6f9 | [
"MIT"
] | 19 | 2020-02-29T01:22:23.000Z | 2022-02-14T01:47:09.000Z | from sqlalchemy import Column, PrimaryKeyConstraint
from sqlalchemy.dialects.postgresql import VARCHAR, BOOLEAN
from .database import Base
class SemesterInfo(Base):
__tablename__ = "semester_info"
semester = Column(VARCHAR(length=255), primary_key=True)
public = Column(BOOLEAN)
| 26.727273 | 60 | 0.785714 |
b3b45a75a79b15e182ec1477f241812a48179257 | 13,723 | py | Python | scripts/common.py | danigrim/oppia | e54f5cef31bb8c9e2802ba2b62695b4352774bf9 | [
"Apache-2.0"
] | 1 | 2020-06-14T23:20:14.000Z | 2020-06-14T23:20:14.000Z | scripts/common.py | danigrim/oppia | e54f5cef31bb8c9e2802ba2b62695b4352774bf9 | [
"Apache-2.0"
] | null | null | null | scripts/common.py | danigrim/oppia | e54f5cef31bb8c9e2802ba2b62695b4352774bf9 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 The Oppia Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 36.594667 | 79 | 0.663193 |
673d694615fde0ce4ba64e70600bf1754b9dc83f | 14,217 | py | Python | datasets/captioning_dataset.py | Harbar-Inbound/BMT | ec8826f0633db754c7ea8d206672aa0b6b6048fd | [
"MIT"
] | null | null | null | datasets/captioning_dataset.py | Harbar-Inbound/BMT | ec8826f0633db754c7ea8d206672aa0b6b6048fd | [
"MIT"
] | null | null | null | datasets/captioning_dataset.py | Harbar-Inbound/BMT | ec8826f0633db754c7ea8d206672aa0b6b6048fd | [
"MIT"
] | null | null | null | import pandas as pd
import spacy
import torch
from torch.nn.utils.rnn import pad_sequence
from torch.utils.data.dataset import Dataset
from torchtext.legacy import data
from datasets.load_features import fill_missing_features, load_features_from_npy
def caption_iterator(cfg, batch_size, phase):
print(f'Contructi... | 37.81117 | 100 | 0.615671 |
66c214c215fd2efbfc04c6a66994e84b0e2b6377 | 1,155 | py | Python | src/awsCluster/util/FastqcParser.py | AspirinCode/jupyter-genomics | d45526fab3de8fcc3d9fef005d4e39368ff3dfdc | [
"MIT"
] | 2 | 2019-01-04T08:17:27.000Z | 2021-04-10T02:59:35.000Z | src/cirrus_ngs/deprecated/util/FastqcParser.py | miko-798/cirrus-ngs | 2c005f0fe29e298652ed2164e08ada75e908229b | [
"MIT"
] | null | null | null | src/cirrus_ngs/deprecated/util/FastqcParser.py | miko-798/cirrus-ngs | 2c005f0fe29e298652ed2164e08ada75e908229b | [
"MIT"
] | 2 | 2021-09-10T02:57:51.000Z | 2021-09-21T00:16:56.000Z | __author__ = 'Guorong Xu<g1xu@ucsd.edu>'
import zipfile
import re
import os
def read_data_file(workspace, file_name):
archive = zipfile.ZipFile(workspace + "/" + file_name, 'r')
data_file = archive.read(file_name[:-4] + "/fastqc_data.txt")
percentages = 0.0
lines = re.split(r'\n+', data_file)
p... | 28.170732 | 103 | 0.587013 |
9f3293c9123a3f57888439e723f3797b9c7676b1 | 949 | py | Python | shiksha_buddy/shiksha_buddy/urls.py | emopankaj/shiksha-buddy | a178e5be8b2da5fdaca33e7385b0115d5361e55c | [
"MIT"
] | 1 | 2020-01-12T06:35:28.000Z | 2020-01-12T06:35:28.000Z | shiksha_buddy/shiksha_buddy/urls.py | emopankaj/shiksha-buddy | a178e5be8b2da5fdaca33e7385b0115d5361e55c | [
"MIT"
] | 4 | 2021-03-10T02:40:28.000Z | 2022-02-26T21:39:34.000Z | shiksha_buddy/shiksha_buddy/urls.py | emopankaj/shiksha-buddy | a178e5be8b2da5fdaca33e7385b0115d5361e55c | [
"MIT"
] | null | null | null | """shiksha_buddy URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class... | 36.5 | 77 | 0.719705 |
f75a3f329682d190ddeb46937a0d3eaf4fce8d33 | 615 | py | Python | Mundo1/026.py | eliascastrosousa/exerciciospythonmundo1 | ec6326952e69ca60d018476308b96959b92a24d8 | [
"MIT"
] | null | null | null | Mundo1/026.py | eliascastrosousa/exerciciospythonmundo1 | ec6326952e69ca60d018476308b96959b92a24d8 | [
"MIT"
] | null | null | null | Mundo1/026.py | eliascastrosousa/exerciciospythonmundo1 | ec6326952e69ca60d018476308b96959b92a24d8 | [
"MIT"
] | null | null | null | # desafio 026: Faça um programa que leia uma frase pelo teclado e mostre quantas vezes aparece a letra "A", em que posição ela aparece a
# primeira vez e em que posição ela aparece a última vez.
autor = input('Digite o seu autor preferido: ').strip()
autor_lower = (autor.lower())
quantidade = (autor_lower.count('a'))
... | 47.307692 | 136 | 0.715447 |
f9b6e67c0e7aaf44b705a82893ad782d1c457d76 | 4,497 | py | Python | perfkitbenchmarker/network.py | gsee2000/PerfKitBenchmarker | c49fff81040cbc2383d8f4d9513e4f610b65c2db | [
"Apache-2.0"
] | null | null | null | perfkitbenchmarker/network.py | gsee2000/PerfKitBenchmarker | c49fff81040cbc2383d8f4d9513e4f610b65c2db | [
"Apache-2.0"
] | null | null | null | perfkitbenchmarker/network.py | gsee2000/PerfKitBenchmarker | c49fff81040cbc2383d8f4d9513e4f610b65c2db | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 PerfKitBenchmarker Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 31.893617 | 79 | 0.71203 |
2afce7f2a18dee8ba1ff820796237f9e030383aa | 107 | py | Python | python_crash_course/2-5.py | poplol240/programs | 73660555b866702091141a7c2231f96f18894cf5 | [
"MIT"
] | null | null | null | python_crash_course/2-5.py | poplol240/programs | 73660555b866702091141a7c2231f96f18894cf5 | [
"MIT"
] | null | null | null | python_crash_course/2-5.py | poplol240/programs | 73660555b866702091141a7c2231f96f18894cf5 | [
"MIT"
] | null | null | null | message = '"A small step of human, a huge step for humanity"'
print("Neil Amstrong once said: " + message) | 53.5 | 62 | 0.71028 |
4b454b678fef1df5cd89bdb08413cc65545c6169 | 23,089 | py | Python | tests/integration/test_pr_comment.py | FrNecas/packit-service | f7101d20e2e09c4940009225f0cd9ccf644f646f | [
"MIT"
] | 11 | 2020-08-12T12:51:32.000Z | 2022-02-05T09:48:11.000Z | tests/integration/test_pr_comment.py | FrNecas/packit-service | f7101d20e2e09c4940009225f0cd9ccf644f646f | [
"MIT"
] | 727 | 2020-08-03T07:53:44.000Z | 2022-03-31T12:51:19.000Z | tests/integration/test_pr_comment.py | FrNecas/packit-service | f7101d20e2e09c4940009225f0cd9ccf644f646f | [
"MIT"
] | 9 | 2021-01-08T13:54:07.000Z | 2022-02-14T14:33:08.000Z | # Copyright Contributors to the Packit project.
# SPDX-License-Identifier: MIT
import json
from typing import List
import pytest
from celery.canvas import Signature
from flexmock import flexmock
from github import Github
from packit_service.worker.monitoring import Pushgateway
from ogr.services.github import GithubP... | 37.060995 | 88 | 0.69977 |
5eb911306d7de607a044b7f27d55a31a802a6388 | 3,620 | py | Python | tests/client/track.py | Allerter/tekore | 20cf68280fb5b691126600a5b474ee841f7be199 | [
"MIT"
] | 135 | 2020-01-14T17:47:26.000Z | 2022-03-25T18:30:04.000Z | tests/client/track.py | Allerter/tekore | 20cf68280fb5b691126600a5b474ee841f7be199 | [
"MIT"
] | 135 | 2020-01-13T22:56:35.000Z | 2022-03-11T19:41:36.000Z | tests/client/track.py | Allerter/tekore | 20cf68280fb5b691126600a5b474ee841f7be199 | [
"MIT"
] | 21 | 2020-01-16T16:01:23.000Z | 2022-02-17T12:46:32.000Z | import pytest
from ._resources import (
track_id,
track_ids,
track_relinked,
track_restricted,
track_no_audio_features,
album_id,
)
from tekore import HTTPError
class TestSpotifyTrack:
def test_track_with_market(self, app_client):
track = app_client.track(track_id, market='US')
... | 38.105263 | 78 | 0.710221 |
e05303d3bed41a24785a1568d319f2e845001d6c | 844 | py | Python | tests/deprecation_rules/boolean_field_default_value/test_checked_file.py | iwoca/django-seven | c7be98b73c139c9e74a9be94a0f20a723c739c80 | [
"BSD-3-Clause"
] | 9 | 2016-05-25T22:33:17.000Z | 2021-05-29T18:38:07.000Z | tests/deprecation_rules/boolean_field_default_value/test_checked_file.py | iwoca/django-upgrade-tools | c7be98b73c139c9e74a9be94a0f20a723c739c80 | [
"BSD-3-Clause"
] | 3 | 2016-06-19T21:17:06.000Z | 2016-07-20T20:26:14.000Z | tests/deprecation_rules/boolean_field_default_value/test_checked_file.py | iwoca/django-upgrade-tools | c7be98b73c139c9e74a9be94a0f20a723c739c80 | [
"BSD-3-Clause"
] | 1 | 2016-08-11T07:27:30.000Z | 2016-08-11T07:27:30.000Z |
from django.test import TestCase
from django.test.utils import override_settings
from django_seven.deprecated_rules.rules import BOOLEAN_DEFAULT
from tests.deprecation_rules.mixins import RuleCheckMixin
class TestBooleanFieldDefaultRule(RuleCheckMixin, TestCase):
@override_settings(DEPRECATED_RULES=[BOOLEAN_DEF... | 33.76 | 110 | 0.565166 |
6038d7983f3695253a003db3ad7f1a2da4e67dfb | 191,724 | py | Python | airflow/models.py | ychantit/incubator-airflow | 11e670ddbce419489c798f26d3e94e7d3a00f5eb | [
"Apache-2.0"
] | 1 | 2021-10-11T11:12:59.000Z | 2021-10-11T11:12:59.000Z | airflow/models.py | ychantit/incubator-airflow | 11e670ddbce419489c798f26d3e94e7d3a00f5eb | [
"Apache-2.0"
] | null | null | null | airflow/models.py | ychantit/incubator-airflow | 11e670ddbce419489c798f26d3e94e7d3a00f5eb | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# 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
#... | 36.742813 | 90 | 0.59353 |
bd45c92f735e8dd8af1506e1ee47af7870a38442 | 5,804 | py | Python | release/stubs.min/System/Windows/Forms/__init___parts/DataGridViewCellCollection.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Forms/__init___parts/DataGridViewCellCollection.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/Windows/Forms/__init___parts/DataGridViewCellCollection.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | class DataGridViewCellCollection(BaseCollection,ICollection,IEnumerable,IList):
"""
Represents a collection of cells in a System.Windows.Forms.DataGridViewRow.
DataGridViewCellCollection(dataGridViewRow: DataGridViewRow)
"""
def Instance(self):
""" This function has been arbitrarily put into the stubs... | 38.437086 | 402 | 0.721054 |
a98c5a95bd386988dbeeb855bc543196884b4ab5 | 311 | py | Python | twint/debug.py | mehrdad-shokri/twint | 17a1746c9210fc89181f2f773646bbb42fd05d7f | [
"MIT"
] | 3 | 2019-12-17T15:37:35.000Z | 2021-04-15T12:56:12.000Z | twint/debug.py | mehrdad-shokri/twint | 17a1746c9210fc89181f2f773646bbb42fd05d7f | [
"MIT"
] | null | null | null | twint/debug.py | mehrdad-shokri/twint | 17a1746c9210fc89181f2f773646bbb42fd05d7f | [
"MIT"
] | null | null | null | import datetime
import sys
def Write(e, func, output):
now = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
msg = "[{}] {} - {}".format(now, func, e)
if output:
print(msg, file=open(output, "a", encoding="utf-8"))
print(msg, file=open("twint_debug.log", "a", encoding="utf-8"))
print(msg)
| 28.272727 | 65 | 0.607717 |
c5621f34dfcf975e034a5ac560697a3b9286a4a7 | 796 | py | Python | components/Reddit.py | tehstun/Reddit-Imgur-scraping | 9261c812bc306412924b59a5b463fd4640779d24 | [
"MIT"
] | 7 | 2016-12-29T13:59:08.000Z | 2019-04-04T10:36:11.000Z | components/Reddit.py | tehstun/Reddit-Imgur-scraping | 9261c812bc306412924b59a5b463fd4640779d24 | [
"MIT"
] | 1 | 2016-12-29T17:37:34.000Z | 2016-12-29T17:56:35.000Z | components/Reddit.py | tehstun/Reddit-Imgur-scraping | 9261c812bc306412924b59a5b463fd4640779d24 | [
"MIT"
] | 2 | 2016-12-29T03:35:40.000Z | 2016-12-29T06:50:31.000Z | # pylint: disable=W1401, C0301
import re
from feedparser import parse as feedparser
class Reddit:
""" A basic reddit class to do some information gathering """
def __init__(self):
self.reddit_core_url = "https://www.reddit.com/"
self.frontpage = self.gather_frontpage()
def gather_frontpa... | 36.181818 | 114 | 0.633166 |
32932bb636298cbeab10d3b990d5e50c7a849ca0 | 20,649 | py | Python | Python/python3_version/klampt/model/multipath.py | ipa-rmb-mr/Klampt | 71793b54eead788811b4e62bcf8dadb49b68ff17 | [
"BSD-3-Clause"
] | null | null | null | Python/python3_version/klampt/model/multipath.py | ipa-rmb-mr/Klampt | 71793b54eead788811b4e62bcf8dadb49b68ff17 | [
"BSD-3-Clause"
] | null | null | null | Python/python3_version/klampt/model/multipath.py | ipa-rmb-mr/Klampt | 71793b54eead788811b4e62bcf8dadb49b68ff17 | [
"BSD-3-Clause"
] | null | null | null | """This module defines the MultiPath class, and methods for loading and
saving multipaths from xml files.
"""
from ..model.contact import Hold
from ..io.loader import *
from ..math import vectorops
import xml.etree.ElementTree as ET
from xml.sax.saxutils import escape
from xml.dom import minidom
class MultiPath:
... | 42.400411 | 116 | 0.560221 |
3730eef3e8374b6627aaaf5f260c55571e2bce5f | 1,674 | py | Python | setup.py | priv-kweihmann/ensurecvs | 0fde2ea3d3b37baa8518a499051bd5b7044c7b94 | [
"BSD-2-Clause"
] | 1 | 2019-11-20T19:50:54.000Z | 2019-11-20T19:50:54.000Z | setup.py | priv-kweihmann/ensurecvs | 0fde2ea3d3b37baa8518a499051bd5b7044c7b94 | [
"BSD-2-Clause"
] | 3 | 2019-12-21T15:22:25.000Z | 2020-02-27T19:08:20.000Z | setup.py | priv-kweihmann/ensurecvs | 0fde2ea3d3b37baa8518a499051bd5b7044c7b94 | [
"BSD-2-Clause"
] | null | null | null | import setuptools
import subprocess
_long_description = "See https://github.com/priv-kweihmann/ensurecvs for documentation"
_long_description_content_type = "text/plain"
try:
_long_description = subprocess.check_output(
["pandoc", "--from", "markdown", "--to", "rst", "README.md"]).decode("utf-8")
_long... | 36.391304 | 87 | 0.663082 |
06ff546051fe4c9d40b28059b735bd5e56e5a083 | 950 | py | Python | visual-chatbot/visdial/urls.py | hzhucn/Visual_Dialogue.pytorch | 74a4d52f87afae7eafe3e8af6d4dc8809398000f | [
"MIT"
] | null | null | null | visual-chatbot/visdial/urls.py | hzhucn/Visual_Dialogue.pytorch | 74a4d52f87afae7eafe3e8af6d4dc8809398000f | [
"MIT"
] | null | null | null | visual-chatbot/visdial/urls.py | hzhucn/Visual_Dialogue.pytorch | 74a4d52f87afae7eafe3e8af6d4dc8809398000f | [
"MIT"
] | 1 | 2018-09-15T06:00:27.000Z | 2018-09-15T06:00:27.000Z | """visdial URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.10/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | 38 | 79 | 0.717895 |
581fa49403be3481a843bb11c5664df8711af345 | 537 | py | Python | piper/functional/elbo_module.py | branislav1991/piper | 88fede157912445e982bbcc832253c30ec86ca6b | [
"MIT"
] | null | null | null | piper/functional/elbo_module.py | branislav1991/piper | 88fede157912445e982bbcc832253c30ec86ca6b | [
"MIT"
] | 11 | 2020-11-24T21:09:58.000Z | 2020-12-01T15:53:18.000Z | piper/functional/elbo_module.py | branislav1991/piper | 88fede157912445e982bbcc832253c30ec86ca6b | [
"MIT"
] | null | null | null | # Copyright (c) 2020 Branislav Holländer. All rights reserved.
# See the file LICENSE for copying permission.
from piper import tree
def elbo(model_tree: tree.Tree, q_tree: tree.Tree):
"""Calculates evidence lower bound given the model tree
and q tree.
"""
elbo = 0.
for name, node in model_tree.... | 25.571429 | 62 | 0.67784 |
d3f8f94c16f3ca029ae62637e9d68bb4e200971d | 336 | py | Python | tests/test_dates.py | aellerton/gilt-python | a57e7f8f3af5eecb994cabdcd9fb4866c2a3af20 | [
"Apache-2.0"
] | 1 | 2017-04-25T09:10:30.000Z | 2017-04-25T09:10:30.000Z | tests/test_dates.py | aellerton/gilt-python | a57e7f8f3af5eecb994cabdcd9fb4866c2a3af20 | [
"Apache-2.0"
] | 1 | 2016-11-26T02:31:14.000Z | 2016-11-27T07:23:53.000Z | tests/test_dates.py | aellerton/gilt-python | a57e7f8f3af5eecb994cabdcd9fb4866c2a3af20 | [
"Apache-2.0"
] | null | null | null |
# "begins": "2012-02-24T17:00:00Z",
# "ends": "2012-02-26T05:00:00Z",
import iso8601
d = iso8601.parse_date("2012-02-24T17:00:00Z")
print "2012-02-24T17:00:00Z", d
assert str(d)=="2012-02-24 17:00:00+00:00"
d = iso8601.parse_date("2012-02-26T05:00:00Z")
print "2012-02-26T05:00:00Z", d
assert str(d)=="2012-02-26 0... | 22.4 | 46 | 0.66369 |
e72b41de3c7c13b2b87f290b3bb4bf188f1b5e0e | 78,608 | py | Python | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py | timgates42/azure-sdk-for-python | 12dc44eb39f6d1e3e21356cfcfb4f42f1d03fdf1 | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py | timgates42/azure-sdk-for-python | 12dc44eb39f6d1e3e21356cfcfb4f42f1d03fdf1 | [
"MIT"
] | null | null | null | sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_models.py | timgates42/azure-sdk-for-python | 12dc44eb39f6d1e3e21356cfcfb4f42f1d03fdf1 | [
"MIT"
] | null | null | null | # coding=utf-8 pylint: disable=too-many-lines
# ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import re
from enum import Enum
from ._generated.models import (
LanguageInput,
MultiLanguageInput,
)
from ._gene... | 45.808858 | 142 | 0.686113 |
0415f2dec54208ad478c239ed38b100a6e3df5fe | 725 | py | Python | peering/fields.py | charlesmonson/peering-manager | b67532ebb245a6384106385f8dbf0d87dbf87a13 | [
"Apache-2.0"
] | null | null | null | peering/fields.py | charlesmonson/peering-manager | b67532ebb245a6384106385f8dbf0d87dbf87a13 | [
"Apache-2.0"
] | null | null | null | peering/fields.py | charlesmonson/peering-manager | b67532ebb245a6384106385f8dbf0d87dbf87a13 | [
"Apache-2.0"
] | 1 | 2020-03-31T02:04:39.000Z | 2020-03-31T02:04:39.000Z | from django.core.validators import MinValueValidator, MaxValueValidator, RegexValidator
from django.db import models
class ASNField(models.BigIntegerField):
description = "32-bit ASN field"
default_validators = [MinValueValidator(1), MaxValueValidator(4294967295)]
class CommunityField(models.CharField):
... | 34.52381 | 87 | 0.731034 |
5eaab3542f7dd884e61c77f8af27b9d8e0da5a84 | 39 | py | Python | job/schedule_funcs/__init__.py | RockFeng0/flask_demo | cf5631935de628f65c37f32aa7875cecc37f707b | [
"MIT"
] | null | null | null | job/schedule_funcs/__init__.py | RockFeng0/flask_demo | cf5631935de628f65c37f32aa7875cecc37f707b | [
"MIT"
] | null | null | null | job/schedule_funcs/__init__.py | RockFeng0/flask_demo | cf5631935de628f65c37f32aa7875cecc37f707b | [
"MIT"
] | 1 | 2020-06-27T14:04:53.000Z | 2020-06-27T14:04:53.000Z | #! python3
# -*- encoding: utf-8 -*-
| 7.8 | 25 | 0.487179 |
4fca296c707fb5408d6ee409dbbf1da27366343e | 2,333 | py | Python | Env/opter.py | hassaanakram/Resource-Allocation-using-deeprl | f36bfb6ba9956a0b072421a8feb8034428571403 | [
"MIT"
] | 33 | 2020-05-19T10:56:45.000Z | 2022-03-08T11:40:53.000Z | Env/opter.py | chisyliu/Resource-Allocation-using-deeprl | fec93a99177115ee32652483fd1005cdbf67ae56 | [
"MIT"
] | 5 | 2020-05-11T12:41:12.000Z | 2022-03-01T10:49:36.000Z | Env/opter.py | chisyliu/Resource-Allocation-using-deeprl | fec93a99177115ee32652483fd1005cdbf67ae56 | [
"MIT"
] | 17 | 2020-02-09T10:50:41.000Z | 2022-03-16T01:57:54.000Z | from cvxopt import matrix, spmatrix, spdiag, solvers
class CvxOpt:
def __init__(self):
self.NUM_RRH = 0
self.NUM_USR = 0
self.H = matrix()
self.__clear__()
def __clear__(self):
self._G = []
self._hq = []
self.c = matrix(0., (self.NUM_RRH * self.NUM_USR ... | 32.859155 | 116 | 0.487355 |
a28e087339b66f42a3091bb11e275ccbf3d645c0 | 3,186 | py | Python | misc/python_sealog/misc.py | WHOIGit/ndsf-sealog-server | e57843e3e23a924ccf6fc1ef1e40d92f36a3b612 | [
"MIT"
] | 4 | 2019-10-29T21:53:13.000Z | 2021-12-02T00:38:42.000Z | misc/python_sealog/misc.py | WHOIGit/ndsf-sealog-server | e57843e3e23a924ccf6fc1ef1e40d92f36a3b612 | [
"MIT"
] | 14 | 2020-05-28T16:39:30.000Z | 2021-05-22T06:01:40.000Z | misc/python_sealog/misc.py | WHOIGit/ndsf-sealog-server | e57843e3e23a924ccf6fc1ef1e40d92f36a3b612 | [
"MIT"
] | 1 | 2020-01-31T00:00:42.000Z | 2020-01-31T00:00:42.000Z | #!/usr/bin/env python3
'''
FILE: misc.py
DESCRIPTION: This script contains miscellaneous wrapper functions for the
sealog-server api routes.
BUGS:
NOTES:
AUTHOR: Webb Pinner
COMPANY: OceanDataTools.org
VERSION: 0.1
CREATED: 2021-01-01
REVISION:
LICENSE INFO: This code is l... | 30.342857 | 111 | 0.645951 |
6b03ae40aca0177af209394a1fb16dbf4d54975a | 6,974 | py | Python | tests/adapter/test_file.py | raember/spoofbot | 64575eb515ae9eb293efa7380830e38ead602efa | [
"MIT"
] | null | null | null | tests/adapter/test_file.py | raember/spoofbot | 64575eb515ae9eb293efa7380830e38ead602efa | [
"MIT"
] | null | null | null | tests/adapter/test_file.py | raember/spoofbot | 64575eb515ae9eb293efa7380830e38ead602efa | [
"MIT"
] | null | null | null | import logging
import unittest
from pathlib import Path
from requests import Session
from urllib3.util import parse_url
from spoofbot.adapter import FileCache
from spoofbot.util import to_filepath
logging.basicConfig(level=logging.DEBUG)
logging.getLogger('urllib3.connectionpool').setLevel(logging.INFO)
DUCKDUCKGO ... | 47.767123 | 112 | 0.71107 |
32e4f37e915b98bf0a7f50ac065491effbd5c068 | 60 | py | Python | examples/mappings/__init__.py | diSimplex/tex2tex | f262a6b16b8e41b3c2701f0a85b89f16c12e4fbc | [
"Apache-2.0"
] | null | null | null | examples/mappings/__init__.py | diSimplex/tex2tex | f262a6b16b8e41b3c2701f0a85b89f16c12e4fbc | [
"Apache-2.0"
] | null | null | null | examples/mappings/__init__.py | diSimplex/tex2tex | f262a6b16b8e41b3c2701f0a85b89f16c12e4fbc | [
"Apache-2.0"
] | null | null | null | # This file simply marks this directory as a Python package
| 30 | 59 | 0.8 |
4cd987b81c272ac7bcd121c6420fc0c02f87b2cb | 77,263 | py | Python | meerk40t/gui/rasterwizard.py | joerlane/meerk40t | a75d78848ff1682640e112111fb6ac4e23e08616 | [
"MIT"
] | null | null | null | meerk40t/gui/rasterwizard.py | joerlane/meerk40t | a75d78848ff1682640e112111fb6ac4e23e08616 | [
"MIT"
] | null | null | null | meerk40t/gui/rasterwizard.py | joerlane/meerk40t | a75d78848ff1682640e112111fb6ac4e23e08616 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# generated by wxGlade 0.9.6 on Wed Jul 22 19:31:45 2020
#
import threading
from copy import deepcopy
from math import ceil
import wx
from meerk40t.kernel import signal_listener
from ..core.units import (
UNITS_CM,
UNITS_INCH,
UNITS_MM,
UNITS_PER_CM,
... | 38.962683 | 92 | 0.632929 |
d71b1e55267b749fd6db1d5dd0e80b07ff2a0278 | 666 | py | Python | google/cloud/__init__.py | tmdiep/python-pubsublite | 8edef6708fab60ce29c040f3de60783fe31b55ae | [
"Apache-2.0"
] | 15 | 2020-11-10T15:36:52.000Z | 2022-03-06T15:00:25.000Z | google/cloud/__init__.py | tmdiep/python-pubsublite | 8edef6708fab60ce29c040f3de60783fe31b55ae | [
"Apache-2.0"
] | 110 | 2020-11-11T18:14:31.000Z | 2022-03-30T22:42:17.000Z | google/cloud/__init__.py | tmdiep/python-pubsublite | 8edef6708fab60ce29c040f3de60783fe31b55ae | [
"Apache-2.0"
] | 6 | 2020-11-13T19:24:27.000Z | 2022-01-29T08:13:14.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 33.3 | 74 | 0.75976 |
3a88cd407e6271bd09e3362616f570b23579f0dd | 2,466 | py | Python | PyScripts/New-KeeperSharedFolder.py | tonylanglet/keepersecurity-powershell | 5446e6ff789372d92bc7e7c9e22e4179dcec6c0f | [
"MIT"
] | 2 | 2021-09-08T03:00:24.000Z | 2022-02-07T17:52:28.000Z | PyScripts/New-KeeperSharedFolder.py | tonylanglet/keepersecurity-powershell | 5446e6ff789372d92bc7e7c9e22e4179dcec6c0f | [
"MIT"
] | 1 | 2022-02-07T13:49:38.000Z | 2022-02-07T13:49:38.000Z | PyScripts/New-KeeperSharedFolder.py | tonylanglet/keepersecurity-powershell | 5446e6ff789372d92bc7e7c9e22e4179dcec6c0f | [
"MIT"
] | 1 | 2021-12-09T23:29:22.000Z | 2021-12-09T23:29:22.000Z | import sys
import getopt
import getpass
import string
import argparse
from keepercommander.record import Record
from keepercommander.commands.folder import FolderMakeCommand
from keepercommander.params import KeeperParams
from keepercommander import display, api
my_params = KeeperParams()
# MAIN FUNCTION
def m... | 36.80597 | 122 | 0.710462 |
be214f87ef07a5ec226cf71b88fd79b84aba8677 | 6,537 | py | Python | py/src/cfn/api.py | mpaulweeks/fgc | 2fa77896a59f55be0a68a7dffef76e3dc29f2497 | [
"MIT"
] | 20 | 2016-06-30T05:48:30.000Z | 2021-06-05T21:42:41.000Z | py/src/cfn/api.py | mpaulweeks/fgc | 2fa77896a59f55be0a68a7dffef76e3dc29f2497 | [
"MIT"
] | null | null | null | py/src/cfn/api.py | mpaulweeks/fgc | 2fa77896a59f55be0a68a7dffef76e3dc29f2497 | [
"MIT"
] | 9 | 2016-07-04T04:44:07.000Z | 2019-10-12T21:20:35.000Z | #!/usr/bin/env python3
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
import json
from py.src.logger import (
log,
log_exception,
)
from py.src.settings import (
DATABASE,
)
from py.src.error import (
CookieInvalidException,
MatchQueryException,
)
from py.s... | 29.313901 | 93 | 0.646474 |
ccb9241290c89ad59eaceed482187c9812cd6eb3 | 523 | py | Python | api/apps/nodes/migrations/0002_notes_parent.py | DjangoStudyTeam/django-China-api | 80e88e85ddfeee96a2562cbc42b7e37985c17c2d | [
"MIT"
] | 1 | 2021-10-15T03:58:34.000Z | 2021-10-15T03:58:34.000Z | api/apps/nodes/migrations/0002_notes_parent.py | DjangoStudyTeam/django-China-api | 80e88e85ddfeee96a2562cbc42b7e37985c17c2d | [
"MIT"
] | 19 | 2021-10-14T13:36:23.000Z | 2022-03-22T13:47:05.000Z | api/apps/nodes/migrations/0002_notes_parent.py | DjangoStudyTeam/django-China-api | 80e88e85ddfeee96a2562cbc42b7e37985c17c2d | [
"MIT"
] | 1 | 2021-10-19T05:34:05.000Z | 2021-10-19T05:34:05.000Z | # Generated by Django 3.2.8 on 2021-12-14 22:35
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('nodes', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='notes',
... | 26.15 | 170 | 0.644359 |
20714bc7fcdfde0bdc6bbd2fe59b2008e064f064 | 3,424 | py | Python | uniauth/decorators.py | omizrahi99/uniAuth | be33d3be10f82e955deffe7ad4b34eeafca4195a | [
"Apache-2.0"
] | null | null | null | uniauth/decorators.py | omizrahi99/uniAuth | be33d3be10f82e955deffe7ad4b34eeafca4195a | [
"Apache-2.0"
] | null | null | null | uniauth/decorators.py | omizrahi99/uniAuth | be33d3be10f82e955deffe7ad4b34eeafca4195a | [
"Apache-2.0"
] | null | null | null | import logging
from django.conf import settings
from django.contrib.auth import logout
from django.http import HttpResponseBadRequest
from django.utils.datastructures import MultiValueDictKeyError
from django.utils.translation import gettext as _
from django.shortcuts import render
from saml2 import BINDING_HTTP_POST,... | 39.813953 | 97 | 0.631133 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.