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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
474932dbda9864fddc4432b01c34354f26e33b07 | 9,710 | py | Python | aesara/compile/nanguardmode.py | zaxtax/aesara | ef256e526e313f9e7916f8c9b2c4802c44d0b44a | [
"BSD-3-Clause"
] | null | null | null | aesara/compile/nanguardmode.py | zaxtax/aesara | ef256e526e313f9e7916f8c9b2c4802c44d0b44a | [
"BSD-3-Clause"
] | null | null | null | aesara/compile/nanguardmode.py | zaxtax/aesara | ef256e526e313f9e7916f8c9b2c4802c44d0b44a | [
"BSD-3-Clause"
] | null | null | null | import logging
from collections.abc import ValuesView
from io import StringIO
import numpy as np
import aesara
from aesara.compile.mode import Mode, get_mode
from aesara.configdefaults import config
from aesara.tensor.math import abs as at_abs
from aesara.tensor.math import max as at_max
from aesara.tensor.math impor... | 31.836066 | 86 | 0.59104 |
80973b7336d93df00c4e6a4388dde47ccb10bd81 | 11,067 | py | Python | airflow/utils/cli.py | jkugiya/airflow | 1dfbb8d2031cb8a3e95e4bf91aa478857c5c3a85 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 3 | 2021-01-29T20:33:56.000Z | 2021-08-06T17:35:16.000Z | airflow/utils/cli.py | jkugiya/airflow | 1dfbb8d2031cb8a3e95e4bf91aa478857c5c3a85 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 210 | 2021-07-17T00:25:52.000Z | 2021-12-29T00:44:48.000Z | airflow/utils/cli.py | jkugiya/airflow | 1dfbb8d2031cb8a3e95e4bf91aa478857c5c3a85 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2021-05-05T07:36:36.000Z | 2021-11-10T17:32:39.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... | 34.584375 | 106 | 0.662691 |
207ad4eea49922952bf9a39630cdcd5919138f72 | 5,478 | py | Python | vkwave/api/methods/leads.py | YorkDW/vkwave | 86b0278f15f398217a8211007c44651b6145831b | [
"MIT"
] | null | null | null | vkwave/api/methods/leads.py | YorkDW/vkwave | 86b0278f15f398217a8211007c44651b6145831b | [
"MIT"
] | null | null | null | vkwave/api/methods/leads.py | YorkDW/vkwave | 86b0278f15f398217a8211007c44651b6145831b | [
"MIT"
] | null | null | null | from vkwave.types.responses import *
from ._category import Category
from ._utils import get_params
class Leads(Category):
async def check_user(
self,
lead_id: int,
return_raw_response: bool = False,
test_result: typing.Optional[int] = None,
test_mode: typing.Optional[bool... | 33.2 | 169 | 0.607886 |
ee96a360468d9b8e5b145213aea158ecebf27e65 | 1,026 | py | Python | staicoin/util/vdf_prover.py | d00kSI/staicoin-blockchain | 5783a48271c8145c8eea93169df13a9ed32817ad | [
"Apache-2.0"
] | 1 | 2021-12-03T02:39:29.000Z | 2021-12-03T02:39:29.000Z | staicoin/util/vdf_prover.py | d00kSI/staicoin-blockchain | 5783a48271c8145c8eea93169df13a9ed32817ad | [
"Apache-2.0"
] | null | null | null | staicoin/util/vdf_prover.py | d00kSI/staicoin-blockchain | 5783a48271c8145c8eea93169df13a9ed32817ad | [
"Apache-2.0"
] | null | null | null | from typing import Tuple
from chiavdf import prove
from staicoin.consensus.constants import ConsensusConstants
from staicoin.types.blockchain_format.classgroup import ClassgroupElement
from staicoin.types.blockchain_format.sized_bytes import bytes32
from staicoin.types.blockchain_format.vdf import VDFInfo, VDFProof
f... | 34.2 | 113 | 0.774854 |
426d25441e87deaa24024091fe7e0a0e622bd6e3 | 1,981 | py | Python | API/onepanman_api/pagination.py | CMS0503/CodeOnBoard | 2df8c9d934f6ffb05dbfbde329f84c66f2348618 | [
"MIT"
] | null | null | null | API/onepanman_api/pagination.py | CMS0503/CodeOnBoard | 2df8c9d934f6ffb05dbfbde329f84c66f2348618 | [
"MIT"
] | 12 | 2020-11-19T09:24:02.000Z | 2020-12-02T11:07:22.000Z | API/onepanman_api/pagination.py | CMS0503/CodeOnBoard | 2df8c9d934f6ffb05dbfbde329f84c66f2348618 | [
"MIT"
] | null | null | null | from rest_framework import pagination
from rest_framework.response import Response
from rest_framework.utils.urls import remove_query_param, replace_query_param
class AppPagination(pagination.PageNumberPagination):
def get_paginated_response(self, data):
next_url = self.get_next_link()
previous_ur... | 31.951613 | 77 | 0.614841 |
45f03a2ca6dabc16c3ade63a40d62313560cbc4d | 8,774 | py | Python | earth_enterprise/src/scons/getversion.py | art926/earthenterprise | e59a95a395fa0522920048dbadd82204407c15b1 | [
"Apache-2.0"
] | 1 | 2018-11-06T02:40:59.000Z | 2018-11-06T02:40:59.000Z | earth_enterprise/src/scons/getversion.py | pyx61198/earthenterprise | 628271e15c32d0faffc1e67d1df16ff9ec4a4336 | [
"Apache-2.0"
] | null | null | null | earth_enterprise/src/scons/getversion.py | pyx61198/earthenterprise | 628271e15c32d0faffc1e67d1df16ff9ec4a4336 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import argparse
import git
import sys
from datetime import datetime
def GetVersion(backupFile, label=''):
"""As getLongVersion(), but only return the leading *.*.* value."""
raw = GetLongVersion(backupFile, label)
final = raw.split("-")[0]
return final
def GetLongV... | 31.67509 | 166 | 0.676772 |
6c4370a9e23c5c57b35b74a67feebae246467bb2 | 15,172 | py | Python | pytype/tests/test_typevar.py | ashwinprasadme/pytype | fed209c73aacfcab15efc33deef3b4016a67cfe5 | [
"Apache-2.0"
] | null | null | null | pytype/tests/test_typevar.py | ashwinprasadme/pytype | fed209c73aacfcab15efc33deef3b4016a67cfe5 | [
"Apache-2.0"
] | null | null | null | pytype/tests/test_typevar.py | ashwinprasadme/pytype | fed209c73aacfcab15efc33deef3b4016a67cfe5 | [
"Apache-2.0"
] | null | null | null | """Tests for TypeVar."""
from pytype import file_utils
from pytype.tests import test_base
class TypeVarTest(test_base.TargetIndependentTest):
"""Tests for TypeVar."""
def test_unused_typevar(self):
ty = self.Infer("""
from typing import TypeVar
T = TypeVar("T")
""", deep=False)
self.asse... | 30.774848 | 90 | 0.546797 |
c22e034d458d18eae13425ea65f80c98ee5f6afc | 3,185 | py | Python | organizing/efficient_storage.py | Elaech/Fruits-262 | a03052473402fcff4adddd65517e34583e9d9c73 | [
"MIT"
] | 1 | 2021-06-25T17:53:31.000Z | 2021-06-25T17:53:31.000Z | organizing/efficient_storage.py | Elaech/Fruits-262 | a03052473402fcff4adddd65517e34583e9d9c73 | [
"MIT"
] | null | null | null | organizing/efficient_storage.py | Elaech/Fruits-262 | a03052473402fcff4adddd65517e34583e9d9c73 | [
"MIT"
] | null | null | null | import numpy as np
import os
import json
import PIL.Image as Image
import time
import sys
label_to_number_dict = None
number_to_label_dict = None
def load_dictionaries():
"""
Loads the dictionaries that map the name of the fruit to a number and vice versa
"""
global label_to_number_dict
global nu... | 34.619565 | 93 | 0.649608 |
96c7d6731e1840b6646521372208dfc056d8ef8d | 1,209 | py | Python | test/test_ad_group_ex.py | wangjoshuah/Amazon-Ads-Sponsored-Products-API-Python-Client | 98a511a0544d28aac06529c13f4921c19ae8ec66 | [
"MIT"
] | null | null | null | test/test_ad_group_ex.py | wangjoshuah/Amazon-Ads-Sponsored-Products-API-Python-Client | 98a511a0544d28aac06529c13f4921c19ae8ec66 | [
"MIT"
] | null | null | null | test/test_ad_group_ex.py | wangjoshuah/Amazon-Ads-Sponsored-Products-API-Python-Client | 98a511a0544d28aac06529c13f4921c19ae8ec66 | [
"MIT"
] | null | null | null | """
Amazon Ads API - Sponsored Products
Use the Amazon Ads API for Sponsored Products for campaign, ad group, keyword, negative keyword, and product ad management operations. For more information about Sponsored Products, see the [Sponsored Products Support Center](https://advertising.amazon.com/help?entityId=... | 31.815789 | 423 | 0.735318 |
d4bc23bd8b04ecaf7bb26780a60043b79251b408 | 2,548 | py | Python | uai/operation/stop_uaiservice/stop_uaiservice.py | FinchZHU/uai-sdk | 78e06bebba2d18233ce6dcb5be619e940f7a7ef3 | [
"Apache-2.0"
] | 38 | 2017-04-26T04:00:09.000Z | 2022-02-10T02:51:05.000Z | uai/operation/stop_uaiservice/stop_uaiservice.py | FinchZHU/uai-sdk | 78e06bebba2d18233ce6dcb5be619e940f7a7ef3 | [
"Apache-2.0"
] | 17 | 2017-11-20T20:47:09.000Z | 2022-02-09T23:48:46.000Z | uai/operation/stop_uaiservice/stop_uaiservice.py | FinchZHU/uai-sdk | 78e06bebba2d18233ce6dcb5be619e940f7a7ef3 | [
"Apache-2.0"
] | 28 | 2017-07-08T05:23:13.000Z | 2020-08-18T03:12:27.000Z | # Copyright 2017 The UAI-SDK 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... | 34.432432 | 103 | 0.64325 |
dc5b90196edc767b44e8c2725745feb2046844b8 | 1,811 | py | Python | sdks/python/apache_beam/examples/complete/estimate_pi_test.py | ravwojdyla/beam | fbcde4cdc7d68de8734bf540c079b2747631a854 | [
"Apache-2.0"
] | 2 | 2017-02-22T03:35:11.000Z | 2017-04-05T09:38:16.000Z | sdks/python/apache_beam/examples/complete/estimate_pi_test.py | kavyasmj/beam0.6 | d59dfeb339bd56feb7569531e5c421a297b0d3dc | [
"Apache-2.0"
] | 2 | 2017-04-24T20:32:25.000Z | 2022-03-29T12:59:55.000Z | sdks/python/apache_beam/examples/complete/estimate_pi_test.py | kavyasmj/beam0.6 | d59dfeb339bd56feb7569531e5c421a297b0d3dc | [
"Apache-2.0"
] | 2 | 2019-03-04T02:12:46.000Z | 2021-08-10T20:29:37.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 us... | 34.169811 | 79 | 0.751518 |
f4bab4bb9fa07022dbbcf99b12ebbe2dc0358599 | 10,555 | py | Python | perfkitbenchmarker/linux_packages/cassandra.py | justinuang/PerfKitBenchmarker | 0730a7a6ebcd9447c7667ff6a3902c203d85fadb | [
"Apache-2.0"
] | null | null | null | perfkitbenchmarker/linux_packages/cassandra.py | justinuang/PerfKitBenchmarker | 0730a7a6ebcd9447c7667ff6a3902c203d85fadb | [
"Apache-2.0"
] | null | null | null | perfkitbenchmarker/linux_packages/cassandra.py | justinuang/PerfKitBenchmarker | 0730a7a6ebcd9447c7667ff6a3902c203d85fadb | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 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... | 32.278287 | 79 | 0.696163 |
ee9276cfe1ae2654db19c95b8031bc378728abc6 | 425 | py | Python | ln/util.py | ksons/ln.py | ee3dcc3c77dd54d1cabb0a5d6d036fcd7803c4f8 | [
"MIT"
] | 2 | 2020-12-15T07:40:35.000Z | 2022-01-13T21:06:23.000Z | ln/util.py | ksons/ln.py | ee3dcc3c77dd54d1cabb0a5d6d036fcd7803c4f8 | [
"MIT"
] | null | null | null | ln/util.py | ksons/ln.py | ee3dcc3c77dd54d1cabb0a5d6d036fcd7803c4f8 | [
"MIT"
] | null | null | null | from pyrr import Vector3
import numpy as np
def vector_min(v1: Vector3, v2: Vector3):
return np.minimum(v1, v2)
def vector_max(v1: Vector3, v2: Vector3):
return np.maximum(v1, v2)
def vector_min_axis(v1: Vector3) -> Vector3:
x, y, z = [abs(v) for v in v1]
if x <= y and x <= z:
return Vecto... | 20.238095 | 44 | 0.590588 |
cca90bdb7a48a74bde002ebca7ad1ef832f98d3a | 936 | py | Python | examples/ner/service/ner.py | aashish24/tangelo | fcaf2542d48904055558fa43c8d50533afc9ad71 | [
"Apache-2.0"
] | 1 | 2015-06-13T09:28:36.000Z | 2015-06-13T09:28:36.000Z | examples/ner/service/ner.py | aashish24/tangelo | fcaf2542d48904055558fa43c8d50533afc9ad71 | [
"Apache-2.0"
] | null | null | null | examples/ner/service/ner.py | aashish24/tangelo | fcaf2542d48904055558fa43c8d50533afc9ad71 | [
"Apache-2.0"
] | null | null | null | import cherrypy
import nltk
import nltk.chunk.named_entity
from tangelo import empty_response
# This service performs named entity recognition on input text.
def run(text=""):
# Create an empty result container.
response = empty_response();
response['result'] = [];
# If nothing passed in, return an e... | 33.428571 | 105 | 0.683761 |
c454b2fefc7bed57e38b1e3750ce8d380a6b90d7 | 256 | py | Python | problems/009.py | JoshKarpel/Euler | 9c4a89cfe4b0114d84a82e2b2894c7b8af815e93 | [
"MIT"
] | 1 | 2017-09-20T22:26:24.000Z | 2017-09-20T22:26:24.000Z | problems/009.py | JoshKarpel/euler-python | 9c4a89cfe4b0114d84a82e2b2894c7b8af815e93 | [
"MIT"
] | null | null | null | problems/009.py | JoshKarpel/euler-python | 9c4a89cfe4b0114d84a82e2b2894c7b8af815e93 | [
"MIT"
] | null | null | null | def solve():
target = 1000
for a in range(1, target):
for b in range(1, target - a):
c = target - a - b
if a ** 2 + b ** 2 == c ** 2:
return a * b * c
if __name__ == '__main__':
print(solve())
| 19.692308 | 41 | 0.425781 |
b3569e1a298c0cc9bc81c3a250174cfc2a7939ce | 12,880 | py | Python | client/v2_2/docker_session_.py | tungstenfabric-infra/containerregistry | 24e0565cf56b967a263423c08992426593dc7256 | [
"Apache-2.0"
] | null | null | null | client/v2_2/docker_session_.py | tungstenfabric-infra/containerregistry | 24e0565cf56b967a263423c08992426593dc7256 | [
"Apache-2.0"
] | null | null | null | client/v2_2/docker_session_.py | tungstenfabric-infra/containerregistry | 24e0565cf56b967a263423c08992426593dc7256 | [
"Apache-2.0"
] | 1 | 2019-08-01T05:22:36.000Z | 2019-08-01T05:22:36.000Z | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 35.58011 | 89 | 0.659938 |
03f352d925c7a7c8feb27f10604cd1615b8e994f | 1,470 | py | Python | proxme/__main__.py | nbargnesi/proxme | c223c4d61ea1477bb56e7f1b6f2d0775c210acd5 | [
"MIT"
] | 1 | 2017-10-09T16:36:28.000Z | 2017-10-09T16:36:28.000Z | proxme/__main__.py | nbargnesi/proxme | c223c4d61ea1477bb56e7f1b6f2d0775c210acd5 | [
"MIT"
] | null | null | null | proxme/__main__.py | nbargnesi/proxme | c223c4d61ea1477bb56e7f1b6f2d0775c210acd5 | [
"MIT"
] | null | null | null | # coding: utf-8
"""Proxme main."""
import os
import sys
import proxme
import proxme.lib
import signal
import tornado
import tornado.options
import tornado.web
import tornado.ioloop
from optparse import OptionParser
X_NS_PROXY_AUTOCONFIG = 'application/x-ns-proxy-autoconfig'
content = {
'proxy': '127.0.0.1:1080'
... | 22.615385 | 70 | 0.638095 |
5adebb1e861b73d198820fef419ce237951884a8 | 23,914 | py | Python | clogd/app.py | zanardo/clog | 390e56dd8bab472532d5ff77d1dfb0acfdb72518 | [
"BSD-2-Clause"
] | null | null | null | clogd/app.py | zanardo/clog | 390e56dd8bab472532d5ff77d1dfb0acfdb72518 | [
"BSD-2-Clause"
] | null | null | null | clogd/app.py | zanardo/clog | 390e56dd8bab472532d5ff77d1dfb0acfdb72518 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2013-2018, Antonio Zanardo <zanardo@gmail.com>
#
from bottle import route, view, get, post, redirect, \
response, request, static_file, abort
from functools import wraps
from hashlib import sha1
from uuid import uuid4
from base64 import b64decode
import os
import re
impor... | 29.414514 | 82 | 0.535335 |
daeb51607ca51cd3294dcd49ec9a3ef44d85c7ca | 286 | py | Python | app/user/urls.py | royandri/recipe-app-api | 5eb7fd433946f6c25fb84d063a46173ee595adf5 | [
"MIT"
] | null | null | null | app/user/urls.py | royandri/recipe-app-api | 5eb7fd433946f6c25fb84d063a46173ee595adf5 | [
"MIT"
] | null | null | null | app/user/urls.py | royandri/recipe-app-api | 5eb7fd433946f6c25fb84d063a46173ee595adf5 | [
"MIT"
] | null | null | null | from django.urls import path
from user import views
app_name = 'user'
urlpatterns = [
path('create/', views.CreateUserView.as_view(), name='create'),
path('token/', views .CreateTokenView.as_view(), name='token'),
path('me/', views.ManageUserView.as_view(), name='me'),
]
| 26 | 67 | 0.681818 |
bfe4e48778b2838d2ed8649e416de44a13497c04 | 1,326 | py | Python | transaction-optimizer/UtxoService.py | akvelon/Bitcoin-Transaction-Optimization | e3740fe37869a0b84a472b19dbc5d879ec857837 | [
"Apache-2.0"
] | 5 | 2019-03-21T12:57:56.000Z | 2019-09-15T00:00:35.000Z | transaction-optimizer/UtxoService.py | akvelon/Bitcoin-Transaction-Optimization | e3740fe37869a0b84a472b19dbc5d879ec857837 | [
"Apache-2.0"
] | 25 | 2019-04-01T09:23:10.000Z | 2022-02-10T00:10:23.000Z | transaction-optimizer/UtxoService.py | akvelon/Bitcoin-Transaction-Optimization | e3740fe37869a0b84a472b19dbc5d879ec857837 | [
"Apache-2.0"
] | 1 | 2019-03-15T13:54:51.000Z | 2019-03-15T13:54:51.000Z | """
Copyright 2019 Akvelon 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 writing, soft... | 40.181818 | 307 | 0.711916 |
2388b8156f4f24ed22f4fa58ed595d205d0bcbe1 | 11,032 | py | Python | napalm_yang/models/openconfig/network_instances/network_instance/fdb/mac_table/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 64 | 2016-10-20T15:47:18.000Z | 2021-11-11T11:57:32.000Z | napalm_yang/models/openconfig/network_instances/network_instance/fdb/mac_table/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 126 | 2016-10-05T10:36:14.000Z | 2019-05-15T08:43:23.000Z | napalm_yang/models/openconfig/network_instances/network_instance/fdb/mac_table/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 63 | 2016-11-07T15:23:08.000Z | 2021-09-22T14:41:16.000Z | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | 37.52381 | 380 | 0.611675 |
931cb83ffaf71d5a8ee80d14fa9121c2fceb7bf6 | 1,770 | py | Python | facepalm.py | dropbox/pep8squad | b4260bd268d8fdfd0ee1aecb6e12bd90b9ea7a66 | [
"Apache-2.0"
] | 15 | 2015-04-08T18:12:06.000Z | 2021-07-13T10:49:07.000Z | facepalm.py | dropbox/pep8squad | b4260bd268d8fdfd0ee1aecb6e12bd90b9ea7a66 | [
"Apache-2.0"
] | 2 | 2015-04-09T19:44:44.000Z | 2015-04-10T16:55:04.000Z | facepalm.py | dropbox/pep8squad | b4260bd268d8fdfd0ee1aecb6e12bd90b9ea7a66 | [
"Apache-2.0"
] | 6 | 2015-04-08T18:12:08.000Z | 2020-11-18T18:23:57.000Z | print """Something went wrong, probably because of you. Was the Python file actually valid?
............................................________
....................................,.-'"...................``~.,
.............................,.-"..................................."-.,
.........................,/......... | 70.8 | 91 | 0.061582 |
cb53ec57dd8fb2666b8772f8704baa97b18dc2b9 | 146 | py | Python | my_lambdata/ds_utilities.py | charlie-may86/Lambdata-DSPT6 | 7ae3807e5b4daf4c0264660febc92e5bd0fc066f | [
"MIT"
] | null | null | null | my_lambdata/ds_utilities.py | charlie-may86/Lambdata-DSPT6 | 7ae3807e5b4daf4c0264660febc92e5bd0fc066f | [
"MIT"
] | null | null | null | my_lambdata/ds_utilities.py | charlie-may86/Lambdata-DSPT6 | 7ae3807e5b4daf4c0264660febc92e5bd0fc066f | [
"MIT"
] | null | null | null | def enlarge(n):
'''This function will multiply the input by 100'''
return n*100
y = int(input('Choose a number: '))
print(y, enlarge(y)) | 20.857143 | 54 | 0.643836 |
b6a51a7c9b599899608c1b4a2f1f1025a7124970 | 1,353 | py | Python | arc109/a.py | nishio/atcoder | 8db36537b5d8580745d5f98312162506ad7d7ab4 | [
"MIT"
] | 1 | 2021-03-09T04:28:13.000Z | 2021-03-09T04:28:13.000Z | arc109/a.py | nishio/atcoder | 8db36537b5d8580745d5f98312162506ad7d7ab4 | [
"MIT"
] | null | null | null | arc109/a.py | nishio/atcoder | 8db36537b5d8580745d5f98312162506ad7d7ab4 | [
"MIT"
] | null | null | null | # included from snippets/main.py
def debug(*x, msg=""):
import sys
print(msg, *x, file=sys.stderr)
def solve(a, b, x, y):
ret = x
if b < a:
a -= 1
if 2 * x < y:
up = 2 * x
else:
up = y
ret += abs(a - b) * up
return ret
def main():
# parse input
a, b... | 15.202247 | 59 | 0.512195 |
b75b10a21abb27e9f4e11d286781892449e3859c | 705 | py | Python | base/views.py | stenwire/todo_list-app | 1ec6f0d738f89be27c5e66d102c9b4b513515e2e | [
"MIT"
] | null | null | null | base/views.py | stenwire/todo_list-app | 1ec6f0d738f89be27c5e66d102c9b4b513515e2e | [
"MIT"
] | null | null | null | base/views.py | stenwire/todo_list-app | 1ec6f0d738f89be27c5e66d102c9b4b513515e2e | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.views.generic.list import ListView
from django.views.generic.detail import DetailView
from django.views.generic.edit import CreateView, UpdateView
from django.urls import reverse_lazy
from .models import Task
# Create your views here.
class TaskList(ListView):
mode... | 22.741935 | 60 | 0.743262 |
2ad2e45e787e211b2351fcb8749b7bdbcda8b9ba | 2,405 | py | Python | Modules/Embeddings/HotEncodingEmbedding.py | PierreOreistein/MVA-Kernels | 51759ba72e5f1ad8bd3fdaa08dbf8b1e05ed1a7e | [
"MIT"
] | null | null | null | Modules/Embeddings/HotEncodingEmbedding.py | PierreOreistein/MVA-Kernels | 51759ba72e5f1ad8bd3fdaa08dbf8b1e05ed1a7e | [
"MIT"
] | null | null | null | Modules/Embeddings/HotEncodingEmbedding.py | PierreOreistein/MVA-Kernels | 51759ba72e5f1ad8bd3fdaa08dbf8b1e05ed1a7e | [
"MIT"
] | null | null | null | import itertools
import pandas as pd
import numpy as np
from numba import jit
from tqdm import tqdm
def HotEncodingEmbedding(X, d=[5, 6, 7]):
"""Implementation of the HotEncoding Embedding with DimismatchEmbedding."""
# Shape
n = np.shape(X)[0]
# Convert X as a DataFrame to deal with numba
X_df ... | 27.965116 | 80 | 0.525988 |
42842b0e1b6f0a7c3478f8c5dfe18687c96b9c59 | 3,887 | py | Python | run_pancancer_analysis.py | martynaut/pancancer_mirnome | 4cfc3794afd590958493cb9af45c099868dd9cca | [
"MIT"
] | null | null | null | run_pancancer_analysis.py | martynaut/pancancer_mirnome | 4cfc3794afd590958493cb9af45c099868dd9cca | [
"MIT"
] | null | null | null | run_pancancer_analysis.py | martynaut/pancancer_mirnome | 4cfc3794afd590958493cb9af45c099868dd9cca | [
"MIT"
] | null | null | null | import pandas as pd
import click
import os
@click.command()
@click.argument('input_folder')
@click.argument('output_folder')
def main(input_folder, output_folder):
if not os.path.exists(output_folder):
os.makedirs(output_folder)
files = [[(x[0] + '/' + y, x[0].split('/')[-1].replace('DATA_', '').rep... | 41.351064 | 115 | 0.673013 |
67bd1f8754181b55ee92fe777411ff7bfad11ff5 | 393 | py | Python | server/config.py | dcalacci/weclocked | 27a8175d3d7d6d581714849df67fe0a8e6f7636e | [
"MIT"
] | null | null | null | server/config.py | dcalacci/weclocked | 27a8175d3d7d6d581714849df67fe0a8e6f7636e | [
"MIT"
] | null | null | null | server/config.py | dcalacci/weclocked | 27a8175d3d7d6d581714849df67fe0a8e6f7636e | [
"MIT"
] | null | null | null | class Config(object):
DEBUG = True
DEVELOPMENT = True
SECRET_KEY = 'do-i-really-need-this'
FLASK_SECRET = SECRET_KEY
TESTING = False
class ProductionConfig(Config):
DEVELOPMENT = False
DEBUG = False
class DevelopmentConfig(Config):
DEVELOPMENT = True
DEBUG = True
class TestingCon... | 19.65 | 40 | 0.676845 |
782d14a2091c04e2f78f8ef32e03e70284621a6d | 13,606 | py | Python | mmtbx/command_line/model_vs_map.py | hbrunie/cctbx_project | 2d8cb383d50fe20cdbbe4bebae8ed35fabce61e5 | [
"BSD-3-Clause-LBNL"
] | 2 | 2021-03-18T12:31:57.000Z | 2022-03-14T06:27:06.000Z | mmtbx/command_line/model_vs_map.py | hbrunie/cctbx_project | 2d8cb383d50fe20cdbbe4bebae8ed35fabce61e5 | [
"BSD-3-Clause-LBNL"
] | null | null | null | mmtbx/command_line/model_vs_map.py | hbrunie/cctbx_project | 2d8cb383d50fe20cdbbe4bebae8ed35fabce61e5 | [
"BSD-3-Clause-LBNL"
] | 1 | 2021-03-26T12:52:30.000Z | 2021-03-26T12:52:30.000Z | from __future__ import absolute_import, division, print_function
# LIBTBX_SET_DISPATCHER_NAME phenix.model_vs_map
from scitbx.array_family import flex
import iotbx.pdb
from libtbx.utils import Sorry
from libtbx.str_utils import make_sub_header
from cctbx import maptbx
from cctbx import miller
import mmtbx.utils
import... | 36.575269 | 94 | 0.646847 |
45df8aeb85f5138ed03b42971ddf67c5f18482e7 | 15,287 | py | Python | neuralprophet/plot_forecast.py | marco-mazzoli/neural_prophet | 151a1404e3141a3f6a77f04ab7ae02f6bf7810ac | [
"MIT"
] | 2,144 | 2020-06-12T00:50:31.000Z | 2022-03-31T13:51:30.000Z | neuralprophet/plot_forecast.py | marco-mazzoli/neural_prophet | 151a1404e3141a3f6a77f04ab7ae02f6bf7810ac | [
"MIT"
] | 306 | 2020-06-12T21:15:18.000Z | 2022-03-31T23:07:13.000Z | neuralprophet/plot_forecast.py | marco-mazzoli/neural_prophet | 151a1404e3141a3f6a77f04ab7ae02f6bf7810ac | [
"MIT"
] | 285 | 2020-08-21T00:42:14.000Z | 2022-03-29T12:21:59.000Z | import numpy as np
import pandas as pd
import logging
from neuralprophet.utils import set_y_as_percent
from neuralprophet.plot_model_parameters import plot_yearly, plot_weekly, plot_daily, plot_custom_season
log = logging.getLogger("NP.plotting")
try:
from matplotlib import pyplot as plt
from matplotlib.dates... | 36.836145 | 119 | 0.566494 |
af3cc33dcc492609cd131380aec042e6470f8125 | 2,225 | py | Python | PyFlow/Packages/PyFlowBase/Nodes/doOnce.py | luzpaz/PyFlow | e00642794051b1d9b7b2665eee38567e9763558d | [
"Apache-2.0"
] | 1,463 | 2019-07-29T15:45:22.000Z | 2022-03-31T23:32:13.000Z | PyFlow/Packages/PyFlowBase/Nodes/doOnce.py | luzpaz/PyFlow | e00642794051b1d9b7b2665eee38567e9763558d | [
"Apache-2.0"
] | 58 | 2019-07-31T07:58:57.000Z | 2022-02-23T05:46:08.000Z | PyFlow/Packages/PyFlowBase/Nodes/doOnce.py | luzpaz/PyFlow | e00642794051b1d9b7b2665eee38567e9763558d | [
"Apache-2.0"
] | 169 | 2019-08-03T16:38:57.000Z | 2022-03-31T14:20:12.000Z | ## Copyright 2015-2019 Ilgar Lunin, Pedro Cabrera
## 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... | 34.230769 | 82 | 0.694831 |
74b1dbb85158cd58e4467db965d09bc318813ab4 | 21,403 | py | Python | ginga/canvas/types/image.py | profxj/ginga | a5f447b760ac38dafa52181b3f99156545a6f2e7 | [
"BSD-3-Clause"
] | null | null | null | ginga/canvas/types/image.py | profxj/ginga | a5f447b760ac38dafa52181b3f99156545a6f2e7 | [
"BSD-3-Clause"
] | 2 | 2017-07-25T15:22:13.000Z | 2020-04-25T19:34:30.000Z | ginga/canvas/types/image.py | profxj/ginga | a5f447b760ac38dafa52181b3f99156545a6f2e7 | [
"BSD-3-Clause"
] | 3 | 2018-02-09T20:06:30.000Z | 2020-03-30T02:31:44.000Z | #
# images.py -- classes for images drawn on ginga canvases.
#
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import time
import numpy as np
from ginga.canvas.CanvasObject import (CanvasObjectBase, _bool, _color,
Poin... | 39.127971 | 82 | 0.545952 |
7a3dab0c90a4251f5762053ed8ed15c5aadd62f6 | 849 | py | Python | search/util.py | casperschmit/cct-selector | 46d6e7524fa0d53fd389d136ef33fa92b20e4c03 | [
"MIT"
] | null | null | null | search/util.py | casperschmit/cct-selector | 46d6e7524fa0d53fd389d136ef33fa92b20e4c03 | [
"MIT"
] | null | null | null | search/util.py | casperschmit/cct-selector | 46d6e7524fa0d53fd389d136ef33fa92b20e4c03 | [
"MIT"
] | null | null | null | import spacy
import re
from gensim.parsing.preprocessing import remove_stopwords, strip_multiple_whitespaces
# Also function used in search package
def split_content(content):
sentence_structure = re.compile(r'([A-Z\xc4\xc5\xd6][^\.!?]*[\.!?])', re.M)
sentences = sentence_structure.findall(content)
return ... | 36.913043 | 112 | 0.709069 |
196822d6359430481b373df03bbf9f842144e83f | 3,356 | py | Python | examples/Redfish/ex22_dump_iml.py | killionadmin/ILOscripts | 951f53df9bf58bc7b186a501e2d123645f0e55a3 | [
"Apache-2.0"
] | 27 | 2015-04-07T13:44:20.000Z | 2016-03-26T01:23:58.000Z | examples/Redfish/ex22_dump_iml.py | killionadmin/ILOscripts | 951f53df9bf58bc7b186a501e2d123645f0e55a3 | [
"Apache-2.0"
] | 5 | 2017-05-11T23:36:34.000Z | 2018-05-27T09:11:17.000Z | examples/Redfish/ex22_dump_iml.py | killionadmin/ILOscripts | 951f53df9bf58bc7b186a501e2d123645f0e55a3 | [
"Apache-2.0"
] | 13 | 2015-03-25T19:03:36.000Z | 2016-03-11T13:21:18.000Z | # Copyright 2016 Hewlett Packard Enterprise Development, LP.
#
# 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 re... | 44.746667 | 89 | 0.568832 |
dfb03ed0f14633e9290e89ccad9ca0a47ed4fd4a | 506 | py | Python | scripts/simple_collectible/show_tokenuri.py | litvinaugang/nft-ipfs-metamask | 7b48cecb337a1c5abbd19b425d0ddcd0e9f5445e | [
"MIT"
] | null | null | null | scripts/simple_collectible/show_tokenuri.py | litvinaugang/nft-ipfs-metamask | 7b48cecb337a1c5abbd19b425d0ddcd0e9f5445e | [
"MIT"
] | null | null | null | scripts/simple_collectible/show_tokenuri.py | litvinaugang/nft-ipfs-metamask | 7b48cecb337a1c5abbd19b425d0ddcd0e9f5445e | [
"MIT"
] | null | null | null | from brownie import ArtBot, accounts, network, config
from metadata import sample_metadata
from scripts.helpful_scripts import OPENSEA_FORMAT
def main():
print("Working on " + network.show_active())
simple_collectible = ArtBot[len(ArtBot) - 1]
number_of_tokens = simple_collectible.tokenIdCounter()
pri... | 42.166667 | 76 | 0.76087 |
8eb1040dc779c42036c5c4946cfa45bf03eb95bd | 8,187 | py | Python | pandapower/plotting/plotly/vlevel_plotly.py | Zamwell/pandapower | ce51946342109e969b87b60c8883d7eec02d3060 | [
"BSD-3-Clause"
] | 1 | 2019-06-16T05:06:03.000Z | 2019-06-16T05:06:03.000Z | pandapower/plotting/plotly/vlevel_plotly.py | Zamwell/pandapower | ce51946342109e969b87b60c8883d7eec02d3060 | [
"BSD-3-Clause"
] | null | null | null | pandapower/plotting/plotly/vlevel_plotly.py | Zamwell/pandapower | ce51946342109e969b87b60c8883d7eec02d3060 | [
"BSD-3-Clause"
] | 1 | 2022-02-07T14:11:03.000Z | 2022-02-07T14:11:03.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2016-2019 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
import pandas as pd
from pandapower.plotting.generic_geodata import create_generic_coordinates
from pandapower.plotting.plotly.tr... | 44.737705 | 120 | 0.670942 |
b2441f8881f119997863cbae1a54fb3a96a7993c | 1,930 | py | Python | src/fuse_eval_mpeg.py | mauriceqch/pcc_geo_cnn | 22bbf081ffe7b77c9308f54c15490da60e78803c | [
"MIT"
] | 46 | 2019-06-17T21:13:57.000Z | 2022-03-29T07:52:11.000Z | src/fuse_eval_mpeg.py | mauriceqch/pcc_geo_cnn | 22bbf081ffe7b77c9308f54c15490da60e78803c | [
"MIT"
] | 11 | 2019-07-05T09:51:08.000Z | 2022-02-06T14:00:03.000Z | src/fuse_eval_mpeg.py | mauriceqch/pcc_geo_cnn | 22bbf081ffe7b77c9308f54c15490da60e78803c | [
"MIT"
] | 14 | 2019-04-10T01:09:36.000Z | 2022-03-30T01:24:57.000Z | ################################################################################
### Init
################################################################################
import logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s.%(msecs)03d %(levelname)s %(module)s - %(funcName)s: %(message)s... | 35.740741 | 91 | 0.570466 |
a035d48566831f781be6f57b10078b0f8adcdb31 | 31,318 | py | Python | metaci/build/models.py | cidarm/MetaCI | bef250b1c8a9fb14e7dd950e90b40fdba71405f8 | [
"BSD-3-Clause"
] | null | null | null | metaci/build/models.py | cidarm/MetaCI | bef250b1c8a9fb14e7dd950e90b40fdba71405f8 | [
"BSD-3-Clause"
] | 504 | 2020-08-30T05:09:11.000Z | 2021-03-24T05:40:01.000Z | metaci/build/models.py | cidarm/MetaCI | bef250b1c8a9fb14e7dd950e90b40fdba71405f8 | [
"BSD-3-Clause"
] | null | null | null | import json
import os
import shutil
import sys
import tempfile
import traceback
import zipfile
from glob import iglob
from io import BytesIO
from cumulusci import __version__ as cumulusci_version
from cumulusci.core.config import FAILED_TO_CREATE_SCRATCH_ORG
from cumulusci.core.exceptions import (
ApexTestExceptio... | 34.377607 | 103 | 0.608244 |
52febd080bb15150560db68fe4c7556fc7438a05 | 6,718 | py | Python | tools/train.py | Wellleee/mm | 99b43550fa67d4f68438cf7991d41842f13740f8 | [
"Apache-2.0"
] | null | null | null | tools/train.py | Wellleee/mm | 99b43550fa67d4f68438cf7991d41842f13740f8 | [
"Apache-2.0"
] | null | null | null | tools/train.py | Wellleee/mm | 99b43550fa67d4f68438cf7991d41842f13740f8 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) OpenMMLab. All rights reserved.
import argparse
import copy
import os
import os.path as osp
import time
import warnings
import mmcv
import torch
from mmcv import Config, DictAction
from mmcv.runner import get_dist_info, init_dist
from mmcls import __version__
from mmcls.apis import set_random_seed, tr... | 36.912088 | 177 | 0.653915 |
80900d9f7049c572252ac1881332d84cd3c349e5 | 5,288 | py | Python | third_party/webrtc/src/tools/python_charts/data/vp8_hw.py | bopopescu/webrtc-streaming-node | 727a441204344ff596401b0253caac372b714d91 | [
"MIT"
] | 8 | 2016-02-08T11:59:31.000Z | 2020-05-31T15:19:54.000Z | third_party/webrtc/src/tools/python_charts/data/vp8_hw.py | bopopescu/webrtc-streaming-node | 727a441204344ff596401b0253caac372b714d91 | [
"MIT"
] | 1 | 2021-05-05T11:11:31.000Z | 2021-05-05T11:11:31.000Z | third_party/webrtc/src/tools/python_charts/data/vp8_hw.py | bopopescu/webrtc-streaming-node | 727a441204344ff596401b0253caac372b714d91 | [
"MIT"
] | 7 | 2016-02-09T09:28:14.000Z | 2020-07-25T19:03:36.000Z | # Sample output from the video_quality_measurment program, included only for
# reference. Geneate your own by running with the --python flag and then change
# the filenames in main.py
test_configuration = [{'name': 'name', 'value': 'VP8 hardware test'},
{'name': 'description', 'value... | 103.686275 | 338 | 0.671142 |
147c9987217b3b62b794c33c46afca72e9090c62 | 15,591 | py | Python | examples/simultaneous_translation/stacl/model.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/simultaneous_translation/stacl/model.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | examples/simultaneous_translation/stacl/model.py | mukaiu/PaddleNLP | 0315365dbafa6e3b1c7147121ba85e05884125a5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 42.137838 | 95 | 0.519402 |
2ad3af7f911a821dcb642aecd5529fdc0942f7f4 | 7,177 | py | Python | easy_rec/python/compat/embedding_ops.py | xia-huang-411303/EasyRec | 7b2050dddc0bfec9e551e2199a36414a3ee82588 | [
"Apache-2.0"
] | 285 | 2021-10-11T03:39:43.000Z | 2022-03-31T09:12:33.000Z | easy_rec/python/compat/embedding_ops.py | xia-huang-411303/EasyRec | 7b2050dddc0bfec9e551e2199a36414a3ee82588 | [
"Apache-2.0"
] | 84 | 2021-10-15T03:48:58.000Z | 2022-03-31T12:38:53.000Z | easy_rec/python/compat/embedding_ops.py | xia-huang-411303/EasyRec | 7b2050dddc0bfec9e551e2199a36414a3ee82588 | [
"Apache-2.0"
] | 71 | 2021-10-15T03:33:44.000Z | 2022-03-31T08:37:11.000Z | # -*- encoding:utf-8 -*-
# Copyright (c) Alibaba, Inc. and its affiliates.
"""Add embedding column for EmbeddingVariable which is only available on pai."""
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.framework import sparse_tensor
from tensorflow.py... | 44.030675 | 80 | 0.689285 |
ee7a84e7769d07c04d87a0523daf2565e0f36f15 | 226 | py | Python | douglas/__init__.py | willkg/douglas | 7e46919d0baefecba414f41980cbe9c0529a884e | [
"MIT"
] | 1 | 2016-02-12T15:26:24.000Z | 2016-02-12T15:26:24.000Z | douglas/__init__.py | willkg/douglas | 7e46919d0baefecba414f41980cbe9c0529a884e | [
"MIT"
] | 1 | 2015-04-20T13:33:39.000Z | 2015-04-20T13:33:39.000Z | douglas/__init__.py | willkg/douglas | 7e46919d0baefecba414f41980cbe9c0529a884e | [
"MIT"
] | null | null | null | # valid version formats:
# * x.y - final release
# * x.ya1 - alpha 1
# * x.yb1 - beta 1
# * x.yrc1 - release candidate 1
# * x.y.dev - dev
# see http://www.python.org/dev/peps/pep-0386/
__version__ = "0.1.dev"
| 20.545455 | 46 | 0.579646 |
4f37487d3d7bb2ca87736b18ab51705938bde3e4 | 1,335 | py | Python | HW3/mnistLoader.py | nick-terry/interactive-learning | aa247a68aa7562f638629b680bc4a0b485bfd759 | [
"MIT"
] | null | null | null | HW3/mnistLoader.py | nick-terry/interactive-learning | aa247a68aa7562f638629b680bc4a0b485bfd759 | [
"MIT"
] | null | null | null | HW3/mnistLoader.py | nick-terry/interactive-learning | aa247a68aa7562f638629b680bc4a0b485bfd759 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Mar 5 11:32:03 2021
@author: nick
"""
import numpy as np
from mnist import MNIST
def loadMNIST():
mndata = MNIST('./data/')
X_train, y_train = map(np.array, mndata.load_training())
X_test, y_test = map(np.array, mndata.load_testing()... | 20.859375 | 60 | 0.605993 |
8128c89cdf51da8fca39db95a95c7059979952bc | 2,256 | py | Python | SCRIPTS/naive_bayes.py | kennedyCzar/SEMI-SUPERVISED-NAIVE-BAYES-FOR-TEXT-CLASSIFICATION | 599930ace3d3a5432ef5687c0eec6ccb2f35b918 | [
"MIT"
] | null | null | null | SCRIPTS/naive_bayes.py | kennedyCzar/SEMI-SUPERVISED-NAIVE-BAYES-FOR-TEXT-CLASSIFICATION | 599930ace3d3a5432ef5687c0eec6ccb2f35b918 | [
"MIT"
] | null | null | null | SCRIPTS/naive_bayes.py | kennedyCzar/SEMI-SUPERVISED-NAIVE-BAYES-FOR-TEXT-CLASSIFICATION | 599930ace3d3a5432ef5687c0eec6ccb2f35b918 | [
"MIT"
] | 2 | 2019-08-12T08:08:25.000Z | 2019-12-23T17:06:07.000Z | import csv
import random
import nltk
def get_labeled_reviews(path_to_csv):
labeled_reviews = []
with open(path_to_csv, newline='', encoding='utf-8') as csvfile:
review_reader = csv.reader(csvfile, delimiter=',', quotechar='"')
next(review_reader, None) # Skip csv headers
for row in re... | 33.176471 | 95 | 0.615248 |
6e95fbbd721634fb87fd317250f9f2302f3bc1da | 3,730 | py | Python | wpa_project/student_app/views/search_view.py | s-amundson/wpa_2p1 | 43deb859123e5ef2eab3652e403c8d2f53d43b77 | [
"MIT"
] | 1 | 2022-01-03T02:46:34.000Z | 2022-01-03T02:46:34.000Z | wpa_project/student_app/views/search_view.py | s-amundson/wpa_2p1 | 43deb859123e5ef2eab3652e403c8d2f53d43b77 | [
"MIT"
] | 31 | 2021-12-29T17:43:06.000Z | 2022-03-25T01:03:17.000Z | wpa_project/student_app/views/search_view.py | s-amundson/wpa_2p1 | 43deb859123e5ef2eab3652e403c8d2f53d43b77 | [
"MIT"
] | null | null | null | from allauth.account.models import EmailAddress
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.http import HttpResponseForbidden
from django.shortcuts import render
from django.views.generic.base import View
import logging
from ..forms import SearchEmailForm, SearchNameForm,... | 50.405405 | 108 | 0.629223 |
0e81130444c65ad91d3627608b1eece4c56fc96a | 6,192 | py | Python | poller/poller.py | broadcaststorm/maestro-poller-service | 39064050327f8df0a9d4e1bd2d9da1cb35a8a24a | [
"MIT"
] | null | null | null | poller/poller.py | broadcaststorm/maestro-poller-service | 39064050327f8df0a9d4e1bd2d9da1cb35a8a24a | [
"MIT"
] | null | null | null | poller/poller.py | broadcaststorm/maestro-poller-service | 39064050327f8df0a9d4e1bd2d9da1cb35a8a24a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Stop gap measure to poll WebEx Teams for messages
"""
from os import environ
from time import sleep
from webexteamssdk import WebexTeamsAPI
from webexteamssdk.exceptions import RateLimitWarning, RateLimitError
from webexteamssdk.generator_containers import GeneratorContainer
from webexteams... | 32.418848 | 96 | 0.672158 |
ed06906976db9a6a9f9b1362fe409a5f52a8b110 | 1,523 | py | Python | problem_8.py | alfonsokim/project-euler | cdc5a271c22f3ad78681ac920f2d9be6e75cdbc5 | [
"Unlicense"
] | null | null | null | problem_8.py | alfonsokim/project-euler | cdc5a271c22f3ad78681ac920f2d9be6e75cdbc5 | [
"Unlicense"
] | null | null | null | problem_8.py | alfonsokim/project-euler | cdc5a271c22f3ad78681ac920f2d9be6e75cdbc5 | [
"Unlicense"
] | null | null | null |
STR_NUMBER = '''
73167176531330624919225119674426574742355349194934
96983520312774506326239578318016984801869478851843
85861560789112949495459501737958331952853208805511
12540698747158523863050715693290963295227443043557
66896648950445244523161731856403098711121722383113
62229893423380308135336276614282806444486645238... | 36.261905 | 76 | 0.794485 |
cacf10c782d166a43cd3f24ff5df4c977d922dfc | 16,407 | py | Python | google/cloud/gaming_v1/services/game_server_configs_service/transports/grpc.py | LaudateCorpus1/python-game-servers | 9e22e6dd4e2543d694e33eb1ec2c4f9a05d8b940 | [
"Apache-2.0"
] | 11 | 2020-07-13T22:22:10.000Z | 2022-03-17T07:21:36.000Z | google/cloud/gaming_v1/services/game_server_configs_service/transports/grpc.py | LaudateCorpus1/python-game-servers | 9e22e6dd4e2543d694e33eb1ec2c4f9a05d8b940 | [
"Apache-2.0"
] | 83 | 2020-03-23T20:31:56.000Z | 2022-03-07T16:24:02.000Z | google/cloud/gaming_v1/services/game_server_configs_service/transports/grpc.py | LaudateCorpus1/python-game-servers | 9e22e6dd4e2543d694e33eb1ec2c4f9a05d8b940 | [
"Apache-2.0"
] | 7 | 2020-03-20T20:55:03.000Z | 2022-01-29T08:11:07.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 44.104839 | 100 | 0.647833 |
7f37d3a70bb484cfc921194dd4bfb5dd10a46ab1 | 11,942 | py | Python | sdks/python/client/argo_workflows/model/node_selector_term.py | roofurmston/argo-workflows | 79a95f223396ecab408d831781ab2d38d1fa6de0 | [
"Apache-2.0"
] | 7,643 | 2017-08-22T22:10:45.000Z | 2021-02-09T17:13:12.000Z | sdks/python/client/argo_workflows/model/node_selector_term.py | roofurmston/argo-workflows | 79a95f223396ecab408d831781ab2d38d1fa6de0 | [
"Apache-2.0"
] | 4,183 | 2017-08-22T22:45:29.000Z | 2021-02-09T17:41:29.000Z | sdks/python/client/argo_workflows/model/node_selector_term.py | isubasinghe/argo-workflows | 1a6e94f1d490e2265c977514d698a1ca70e14fe3 | [
"Apache-2.0"
] | 1,524 | 2017-08-22T22:10:53.000Z | 2021-02-09T16:26:16.000Z | """
Argo Server API
You can get examples of requests and responses by using the CLI with `--gloglevel=9`, e.g. `argo list --gloglevel=9` # noqa: E501
The version of the OpenAPI document: VERSION
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from ... | 44.894737 | 139 | 0.582817 |
5ab1fea35e0ec899493904d7ca79c1d76c886202 | 1,723 | py | Python | managerie_test_app/settings.py | akx/django-managerie | 170255f2f26a821f213d762a4102d1ebc890e8ab | [
"MIT"
] | 2 | 2020-06-03T11:36:25.000Z | 2021-11-28T15:36:06.000Z | managerie_test_app/settings.py | akx/django-managerie | 170255f2f26a821f213d762a4102d1ebc890e8ab | [
"MIT"
] | null | null | null | managerie_test_app/settings.py | akx/django-managerie | 170255f2f26a821f213d762a4102d1ebc890e8ab | [
"MIT"
] | null | null | null | import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'vpf9qs8wv6b8k(%6%=0)six1u4z6g@gb0l5(duj$hw_lg_45$l'
DEBUG = True
ALLOWED_HOSTS = []
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
... | 26.921875 | 70 | 0.673244 |
73669953a6293a330b4e249df7ae5cfa9ec774ed | 8,325 | py | Python | bruno_api/bruno_api/api.py | kwzrd/bruno | b343d47b76f612e9c40d92b9fb563d3cf4cee4e3 | [
"MIT"
] | null | null | null | bruno_api/bruno_api/api.py | kwzrd/bruno | b343d47b76f612e9c40d92b9fb563d3cf4cee4e3 | [
"MIT"
] | null | null | null | bruno_api/bruno_api/api.py | kwzrd/bruno | b343d47b76f612e9c40d92b9fb563d3cf4cee4e3 | [
"MIT"
] | null | null | null | import asyncio
import logging
import typing as t
from datetime import datetime
from operator import itemgetter
from os import environ
import asyncpg
from fastapi import FastAPI, HTTPException, Request
from fastapi.responses import RedirectResponse, Response
from bruno_api.database import Database
from bruno_api.model... | 34.543568 | 98 | 0.695375 |
a67d015ecb95c897776caf364afa555a4b61873f | 2,585 | py | Python | Scheduler/Datasets/RRG/random_regular_graph.py | dsdn/tssdn | bc4f320d7d483d3852597c44676060aa70e8b2b2 | [
"Apache-2.0"
] | 4 | 2021-11-13T11:38:02.000Z | 2022-01-21T19:05:26.000Z | Scheduler/Datasets/RRG/random_regular_graph.py | dsdn/tssdn | bc4f320d7d483d3852597c44676060aa70e8b2b2 | [
"Apache-2.0"
] | null | null | null | Scheduler/Datasets/RRG/random_regular_graph.py | dsdn/tssdn | bc4f320d7d483d3852597c44676060aa70e8b2b2 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/python
'''
Generates a random regular graph and creates a random set of flows with period
Output -
links.dat -> (n1, n2)
flows.dat -> (src, dst, p)
readme
Author - Naresh Nayak
Date - 15.02.2016
'''
import networkx as nx
import random, os, sys
# Input data required for topology generation
nS... | 25.343137 | 165 | 0.616248 |
b9505f8639731379156c57ebbd36512c8b30ac02 | 2,154 | py | Python | iota/transaction/utils.py | JakeSCahill/iota.py | 1e691ba02ccf7687f06d1a39a8ae4babdfaacc26 | [
"MIT"
] | null | null | null | iota/transaction/utils.py | JakeSCahill/iota.py | 1e691ba02ccf7687f06d1a39a8ae4babdfaacc26 | [
"MIT"
] | null | null | null | iota/transaction/utils.py | JakeSCahill/iota.py | 1e691ba02ccf7687f06d1a39a8ae4babdfaacc26 | [
"MIT"
] | null | null | null | # coding=utf-8
from __future__ import absolute_import, division, print_function, \
unicode_literals
from calendar import timegm as unix_timestamp
from datetime import datetime
from typing import Text
from iota import STANDARD_UNITS
from iota.exceptions import with_context
__all__ = [
'convert_value_to_standa... | 27.615385 | 71 | 0.637883 |
d1a2088589a0fd125f1f8f6170be86959b87703e | 2,863 | py | Python | instana/instrumentation/cassandra_inst.py | instana/python-sensor | 1005ad0012e126d504b3670bbca7fe90ecc949bd | [
"MIT"
] | 61 | 2017-09-27T02:50:17.000Z | 2022-03-22T12:13:37.000Z | instana/instrumentation/cassandra_inst.py | instana/python-sensor | 1005ad0012e126d504b3670bbca7fe90ecc949bd | [
"MIT"
] | 82 | 2017-07-11T13:47:33.000Z | 2022-03-22T10:10:38.000Z | instana/instrumentation/cassandra_inst.py | instana/python-sensor | 1005ad0012e126d504b3670bbca7fe90ecc949bd | [
"MIT"
] | 27 | 2017-09-11T16:22:32.000Z | 2022-03-11T17:21:49.000Z | # (c) Copyright IBM Corp. 2021
# (c) Copyright Instana Inc. 2020
"""
cassandra instrumentation
https://docs.datastax.com/en/developer/python-driver/3.20/
https://github.com/datastax/python-driver
"""
from __future__ import absolute_import
import wrapt
from ..log import logger
from ..util.traceutils import get_active_t... | 32.534091 | 85 | 0.592036 |
dc37bc723564c177bd363aa2030093cfc6d12851 | 5,387 | py | Python | saleor/cart/__init__.py | X10project/rob_photography | baaeed11e13d1f4977c24f5f6601b1c6fbcf39b5 | [
"BSD-3-Clause"
] | 3 | 2015-12-30T19:06:27.000Z | 2021-10-06T04:23:36.000Z | saleor/cart/__init__.py | X10project/rob_photography | baaeed11e13d1f4977c24f5f6601b1c6fbcf39b5 | [
"BSD-3-Clause"
] | null | null | null | saleor/cart/__init__.py | X10project/rob_photography | baaeed11e13d1f4977c24f5f6601b1c6fbcf39b5 | [
"BSD-3-Clause"
] | 4 | 2019-09-17T11:39:41.000Z | 2022-01-24T10:22:50.000Z | from __future__ import unicode_literals
from django.conf import settings
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import pgettext
from prices import Price
from satchless import cart
from satchless.item import ItemList, partition
CART_SESSION_KEY = 'cart'
class Prod... | 34.532051 | 83 | 0.664563 |
5ad9219be7f163da39820bf0abead491de259278 | 5,025 | py | Python | util/checkpoint-tester.py | He-Liu-ooo/Computer-Architecture-THUEE-2022-spring- | 9d36aaacbc7eea357608524113bec97bae2ea229 | [
"BSD-3-Clause"
] | 8 | 2021-12-17T08:07:14.000Z | 2022-03-23T11:49:06.000Z | util/checkpoint-tester.py | He-Liu-ooo/Computer-Architecture-THUEE-2022-spring- | 9d36aaacbc7eea357608524113bec97bae2ea229 | [
"BSD-3-Clause"
] | 3 | 2022-01-09T07:50:03.000Z | 2022-02-05T14:46:57.000Z | util/checkpoint-tester.py | He-Liu-ooo/Computer-Architecture-THUEE-2022-spring- | 9d36aaacbc7eea357608524113bec97bae2ea229 | [
"BSD-3-Clause"
] | 5 | 2021-12-27T08:39:13.000Z | 2022-03-08T10:21:37.000Z | #! /usr/bin/env python2.7
# Copyright (c) 2010 Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# noti... | 36.948529 | 78 | 0.70806 |
c674b3e16c825deb086a0ded923654386b19352c | 6,545 | py | Python | templates/zeroboot_reservation/zeroboot_reservation_test.py | threefoldtech/0-templates | 4106bb3d4d1de305557bf4748a7d77ffeb302abb | [
"Apache-2.0"
] | 1 | 2019-01-20T17:50:53.000Z | 2019-01-20T17:50:53.000Z | templates/zeroboot_reservation/zeroboot_reservation_test.py | threefoldtech/0-templates | 4106bb3d4d1de305557bf4748a7d77ffeb302abb | [
"Apache-2.0"
] | 192 | 2018-08-01T13:31:16.000Z | 2020-05-29T09:41:06.000Z | templates/zeroboot_reservation/zeroboot_reservation_test.py | threefoldtech/0-templates | 4106bb3d4d1de305557bf4748a7d77ffeb302abb | [
"Apache-2.0"
] | 1 | 2018-08-09T12:30:52.000Z | 2018-08-09T12:30:52.000Z | import os
import pytest
from unittest.mock import MagicMock
from jumpscale import j
from zerorobot.template.state import StateCheckError
from JumpscaleZrobot.test.utils import ZrobotBaseTest
from zeroboot_reservation import ZerobootReservation
class TestZerobootReservationTemplate(ZrobotBaseTest):
@classmethod
... | 36.977401 | 126 | 0.668449 |
76dd52f14b261da577c3aa33a93188b39ce2dd1f | 138 | py | Python | 04/04_P17.py | endowp/Python101 | 9c29387f4ed53d10579613ecf5153b71abf7ccd7 | [
"MIT"
] | null | null | null | 04/04_P17.py | endowp/Python101 | 9c29387f4ed53d10579613ecf5153b71abf7ccd7 | [
"MIT"
] | null | null | null | 04/04_P17.py | endowp/Python101 | 9c29387f4ed53d10579613ecf5153b71abf7ccd7 | [
"MIT"
] | null | null | null | s=input()
temp=""
for i in s:
for j in s:
count=0
if j==i and count==1:
print(j, end="")
count+=1
| 15.333333 | 29 | 0.42029 |
61989ac0407ecccb4b8d3dc24484214619f89e60 | 1,719 | py | Python | profiles_api/migrations/0001_initial.py | mamalfender/profile-rest-api | b3b8366d89e8a9d2c9664395c2fd7617bad6ae1f | [
"MIT"
] | null | null | null | profiles_api/migrations/0001_initial.py | mamalfender/profile-rest-api | b3b8366d89e8a9d2c9664395c2fd7617bad6ae1f | [
"MIT"
] | null | null | null | profiles_api/migrations/0001_initial.py | mamalfender/profile-rest-api | b3b8366d89e8a9d2c9664395c2fd7617bad6ae1f | [
"MIT"
] | null | null | null | # Generated by Django 3.2.3 on 2021-06-03 14:50
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
migrations.CreateModel(
name='UserProfile'... | 50.558824 | 266 | 0.64107 |
3ec62c76f37ac2f42b5f711824419970887e5b66 | 1,020 | py | Python | test_package/conanfile.py | Konijnendijk/conan-liblinear | 54387019ac85c64cfc1482dc52383faaf4123e15 | [
"MIT"
] | null | null | null | test_package/conanfile.py | Konijnendijk/conan-liblinear | 54387019ac85c64cfc1482dc52383faaf4123e15 | [
"MIT"
] | null | null | null | test_package/conanfile.py | Konijnendijk/conan-liblinear | 54387019ac85c64cfc1482dc52383faaf4123e15 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
from conans import ConanFile, CMake, tools, RunEnvironment
import os
class TestPackageConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
def build(self):
cmak... | 31.875 | 105 | 0.573529 |
fef6752cbbbdde30b4197c6926c31b68e1747b12 | 2,872 | py | Python | corpus-utils/conllu2json.py | recognai/spacy-dev-resources | 9cc3989cb516dd94cfda0d99367ab3f4b92b8170 | [
"MIT"
] | 1 | 2017-04-20T13:00:32.000Z | 2017-04-20T13:00:32.000Z | corpus-utils/conllu2json.py | recognai/spacy-dev-resources | 9cc3989cb516dd94cfda0d99367ab3f4b92b8170 | [
"MIT"
] | null | null | null | corpus-utils/conllu2json.py | recognai/spacy-dev-resources | 9cc3989cb516dd94cfda0d99367ab3f4b92b8170 | [
"MIT"
] | 4 | 2018-03-20T01:39:32.000Z | 2021-06-24T15:55:55.000Z | """Convert conluu files into JSON format for use with train cli.
use_morphology parameter enables appending morphology to tags, which is
useful for languages such as Spanish, where UD tags are not so rich.
"""
from spacy.gold import read_json_file, merge_sents
import io, json, plac
def read_conllx(loc, use_morphology=... | 33.011494 | 91 | 0.547006 |
b615ffaf9b7da0a85e1b8848b492d8de59db2580 | 6,130 | py | Python | cli/cook/subcommands/tail.py | dposada/Cook | 0d7def46e50dad5f172970a80faac9cd9b17f77b | [
"Apache-2.0"
] | null | null | null | cli/cook/subcommands/tail.py | dposada/Cook | 0d7def46e50dad5f172970a80faac9cd9b17f77b | [
"Apache-2.0"
] | null | null | null | cli/cook/subcommands/tail.py | dposada/Cook | 0d7def46e50dad5f172970a80faac9cd9b17f77b | [
"Apache-2.0"
] | null | null | null | import time
from functools import partial
from cook.mesos import read_file
from cook.querying import query_unique_and_run, parse_entity_refs
from cook.util import check_positive, guard_no_cluster
CHUNK_SIZE = 4096
LINE_DELIMITER = '\n'
DEFAULT_NUM_LINES = 10
DEFAULT_FOLLOW_SLEEP_SECS = 1.0
DEFAULT_PATH = 'stdout'
#... | 38.797468 | 118 | 0.674225 |
00a962de1b09f6198c0d6137e0de0adbc2725c02 | 6,959 | py | Python | ipt/ipt_threshold_otsu_overthinked.py | tpmp-inra/ipapi | b0f6be8960a20dbf95ef9df96efdd22bd6e031c5 | [
"MIT"
] | 1 | 2020-06-30T06:53:36.000Z | 2020-06-30T06:53:36.000Z | ipt/ipt_threshold_otsu_overthinked.py | tpmp-inra/ipapi | b0f6be8960a20dbf95ef9df96efdd22bd6e031c5 | [
"MIT"
] | null | null | null | ipt/ipt_threshold_otsu_overthinked.py | tpmp-inra/ipapi | b0f6be8960a20dbf95ef9df96efdd22bd6e031c5 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import logging
logger = logging.getLogger(__name__)
from ipso_phen.ipapi.base.ip_common import (
create_channel_generator,
get_hr_channel_name,
CHANNELS_FLAT,
)
from ipso_phen.ipapi.base.ipt_abstract import IptBase
from ipso_phen.ipapi.base.ip_common import Tool... | 36.820106 | 94 | 0.503233 |
6df4c86abd29b0823a5ca673cc3f4c210b7f8918 | 214 | py | Python | cyclerental/cyclerental/doctype/kinisi_cycle_rental/test_kinisi_cycle_rental.py | bala0321/cyclerental | f0ce73cbcbbbd511cca88bc08f0030871cf8b350 | [
"MIT"
] | null | null | null | cyclerental/cyclerental/doctype/kinisi_cycle_rental/test_kinisi_cycle_rental.py | bala0321/cyclerental | f0ce73cbcbbbd511cca88bc08f0030871cf8b350 | [
"MIT"
] | null | null | null | cyclerental/cyclerental/doctype/kinisi_cycle_rental/test_kinisi_cycle_rental.py | bala0321/cyclerental | f0ce73cbcbbbd511cca88bc08f0030871cf8b350 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Hari and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestKinisiCycleRental(unittest.TestCase):
pass
| 19.454545 | 47 | 0.766355 |
603b0e0d7b12e5a904d62a1b27eb4b3053463f5e | 552 | py | Python | cybox/objects/gui_object.py | Mattlk13/python-cybox | ee82c7da40ca4638e3ca8d70766150c0dace1b55 | [
"BSD-3-Clause"
] | 40 | 2015-03-05T18:22:51.000Z | 2022-03-06T07:29:25.000Z | cybox/objects/gui_object.py | Mattlk13/python-cybox | ee82c7da40ca4638e3ca8d70766150c0dace1b55 | [
"BSD-3-Clause"
] | 106 | 2015-01-12T18:52:20.000Z | 2021-04-25T22:57:52.000Z | cybox/objects/gui_object.py | Mattlk13/python-cybox | ee82c7da40ca4638e3ca8d70766150c0dace1b55 | [
"BSD-3-Clause"
] | 30 | 2015-03-25T07:24:40.000Z | 2021-07-23T17:10:11.000Z | # Copyright (c) 2017, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
from mixbox import fields
import cybox.bindings.gui_object as gui_binding
from cybox.common import ObjectProperties, Integer
class GUI(ObjectProperties):
_binding = gui_binding
_binding_class = gui_bindin... | 29.052632 | 65 | 0.751812 |
0e03ea68223d42c1af9ea2d9930d32c1af27b27f | 6,870 | py | Python | parsedatetime/pdt_locales/fr_FR.py | iAmPlus/parsedatetime | a648c90843a9e941ce2b6d65719fbf7ad4ff22cb | [
"Apache-2.0"
] | null | null | null | parsedatetime/pdt_locales/fr_FR.py | iAmPlus/parsedatetime | a648c90843a9e941ce2b6d65719fbf7ad4ff22cb | [
"Apache-2.0"
] | null | null | null | parsedatetime/pdt_locales/fr_FR.py | iAmPlus/parsedatetime | a648c90843a9e941ce2b6d65719fbf7ad4ff22cb | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from .base import * # noqa
# don't use an unicode string
localeID = 'fr_FR'
dateSep = ['\/']
timeSep = [':', 'h']
meridian = ['du matin', 'du soir']
usesMeridian = True
uses24 = True
WeekdayOffsets = {}
MonthOffsets = {}
# always lowercase any lookup va... | 25.730337 | 120 | 0.518777 |
13d1f50c4780862c4c652a5981b36538d82124c5 | 94 | py | Python | fifth/languages.py | pakoito/randomcharacter | 4a3302b5ae157ccebb5e9a7e616315626ad4c614 | [
"MIT"
] | 65 | 2015-02-04T13:50:00.000Z | 2022-03-27T03:32:08.000Z | fifth/languages.py | pakoito/randomcharacter | 4a3302b5ae157ccebb5e9a7e616315626ad4c614 | [
"MIT"
] | 14 | 2015-02-04T04:00:02.000Z | 2021-04-09T13:53:07.000Z | fifth/languages.py | pakoito/randomcharacter | 4a3302b5ae157ccebb5e9a7e616315626ad4c614 | [
"MIT"
] | 39 | 2015-01-28T21:38:09.000Z | 2022-01-04T15:46:47.000Z | LANGUAGES = ['Common', 'Dwarfish', 'Elvish', 'Giant', 'Gnomish', 'Goblin', 'Halfling', 'Orc']
| 47 | 93 | 0.617021 |
b5e53cb8e9b4046acd0bc04b15cc326cf7e18126 | 1,380 | py | Python | src/base_image_preprocessor.py | elangovana/object-tracking | a9359ac3e3926102f9998eb20500746343e14826 | [
"Apache-2.0"
] | 1 | 2019-12-17T01:17:01.000Z | 2019-12-17T01:17:01.000Z | src/base_image_preprocessor.py | elangovana/object-tracking | a9359ac3e3926102f9998eb20500746343e14826 | [
"Apache-2.0"
] | 2 | 2021-09-08T01:37:46.000Z | 2022-03-12T00:13:53.000Z | src/base_image_preprocessor.py | elangovana/object-tracking | a9359ac3e3926102f9998eb20500746343e14826 | [
"Apache-2.0"
] | null | null | null | # *****************************************************************************
# * Copyright 2019 Amazon.com, Inc. and its affiliates. All Rights Reserved. *
# *
# Licensed under the Amazon Software License (the "License"). *
... | 51.111111 | 79 | 0.427536 |
5b453e30f25fe25f5970714b34f07c8c77d2af31 | 141 | py | Python | sip/tango_control/tango_mysql/_version.py | SKA-ScienceDataProcessor/integration-prototype | 5875dc0489f707232534ce75daf3707f909bcd15 | [
"BSD-3-Clause"
] | 3 | 2016-11-08T02:27:05.000Z | 2018-01-22T13:26:11.000Z | sip/tango_control/tango_mysql/_version.py | SKA-ScienceDataProcessor/integration-prototype | 5875dc0489f707232534ce75daf3707f909bcd15 | [
"BSD-3-Clause"
] | 87 | 2016-11-24T11:09:01.000Z | 2021-03-25T22:23:59.000Z | sip/tango_control/tango_mysql/_version.py | SKA-ScienceDataProcessor/integration-prototype | 5875dc0489f707232534ce75daf3707f909bcd15 | [
"BSD-3-Clause"
] | 10 | 2016-05-18T09:41:36.000Z | 2019-07-04T10:19:24.000Z | # -*- coding: utf-8 -*-
"""SIP Tango MySQL image version."""
__version_info__ = (1, 0, 3)
__version__ = '.'.join(map(str, __version_info__))
| 28.2 | 50 | 0.64539 |
399199d0a16c984571355c3cc9686ab19908ab42 | 3,255 | py | Python | examples/reports/report_core_compay.py | Evergreen2020/zvt | 446a2512d716a38a12164b6d4468a6c9de01b986 | [
"MIT"
] | null | null | null | examples/reports/report_core_compay.py | Evergreen2020/zvt | 446a2512d716a38a12164b6d4468a6c9de01b986 | [
"MIT"
] | null | null | null | examples/reports/report_core_compay.py | Evergreen2020/zvt | 446a2512d716a38a12164b6d4468a6c9de01b986 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
import time
import eastmoneypy
from apscheduler.schedulers.background import BackgroundScheduler
from examples.factors.fundamental_selector import FundamentalSelector
from examples.reports import subscriber_emails
from zvdata.api import get_entities
from zvdata.utils.time_utils ... | 36.573034 | 118 | 0.602458 |
4d7fb53af7a25956637c36f4bea09b657292cdef | 262 | py | Python | SatPlot/is_leap_year.py | lff5985/share-from-zhao | b1a6e3513db10e6da18ed6884d4fab9fb68e51b4 | [
"MIT"
] | 2 | 2018-06-13T02:27:22.000Z | 2020-12-27T09:55:50.000Z | SatPlot/is_leap_year.py | lff5985/share-from-zhao | b1a6e3513db10e6da18ed6884d4fab9fb68e51b4 | [
"MIT"
] | null | null | null | SatPlot/is_leap_year.py | lff5985/share-from-zhao | b1a6e3513db10e6da18ed6884d4fab9fb68e51b4 | [
"MIT"
] | 2 | 2016-11-09T14:06:30.000Z | 2019-06-01T02:46:15.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def is_leap_year(year):
if year % 400 == 0:
return True
elif year % 4 == 0:
if year % 100 != 0:
return True
else:
return False
else:
return False
| 18.714286 | 27 | 0.477099 |
81232ef53d4d84e972c379e78c78b22bf189139e | 3,629 | py | Python | UnPackIps/UnPackIps.py | cober2019/Network-Automation | 796b7760ca1f1e496a841c613eaff05ddba71b16 | [
"MIT"
] | 48 | 2019-08-22T19:42:46.000Z | 2022-03-22T07:05:02.000Z | UnPackIps/UnPackIps.py | muhammad-rafi/Network-Automation | 856b4390250b602e5350706666a33e290ea7afef | [
"MIT"
] | 2 | 2019-09-04T15:42:14.000Z | 2020-05-07T15:21:20.000Z | UnPackIps/UnPackIps.py | muhammad-rafi/Network-Automation | 856b4390250b602e5350706666a33e290ea7afef | [
"MIT"
] | 16 | 2020-01-22T20:21:36.000Z | 2021-12-25T06:08:48.000Z | """Helper functions to deal with IP ranges. Also can be used a ping tool with logging"""
import ipaddress
import subprocess as sp
import logging
import time
logging.basicConfig(filename='ping.log', level=logging.INFO)
def _diagnose(ip, status) -> logging:
"""Parse ping results. Print and save to ping... | 32.693694 | 139 | 0.538991 |
1d2d65476b1a9ee624c21bbf299e974dcf5251d4 | 881 | py | Python | Hash Table/561. Array Partition I.py | beckswu/Leetcode | 480e8dc276b1f65961166d66efa5497d7ff0bdfd | [
"MIT"
] | 138 | 2020-02-08T05:25:26.000Z | 2021-11-04T11:59:28.000Z | Hash Table/561. Array Partition I.py | beckswu/Leetcode | 480e8dc276b1f65961166d66efa5497d7ff0bdfd | [
"MIT"
] | null | null | null | Hash Table/561. Array Partition I.py | beckswu/Leetcode | 480e8dc276b1f65961166d66efa5497d7ff0bdfd | [
"MIT"
] | 24 | 2021-01-02T07:18:43.000Z | 2022-03-20T08:17:54.000Z | """
561. Array Partition I
Given an array of 2n integers, your task is to group these integers into n pairs of integer,
say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as large as possible.
Input: [1,4,3,2]
Output: 4
Explanation: n is 2, and the maximum sum of pairs is 4... | 23.184211 | 112 | 0.502838 |
23d93e875ff5aba177bdcfef2180c62347420097 | 77 | py | Python | shouqianba/__init__.py | kogwang/mongo- | 2249a5a3363398e799e250be1e93f9aaef143210 | [
"Apache-2.0"
] | null | null | null | shouqianba/__init__.py | kogwang/mongo- | 2249a5a3363398e799e250be1e93f9aaef143210 | [
"Apache-2.0"
] | null | null | null | shouqianba/__init__.py | kogwang/mongo- | 2249a5a3363398e799e250be1e93f9aaef143210 | [
"Apache-2.0"
] | null | null | null | from .client import ShouqianbaClient
from .log import *
from . import config
| 19.25 | 36 | 0.792208 |
4c4b18075d1203ce238cf0655cbeb4ff221e1860 | 88,137 | py | Python | src/sentry/south_migrations/0356_auto__add_useridentity__add_unique_useridentity_user_identity__add_ide.py | apragacz/sf-sentry | 2fdd6c1195c29a1d401d1cd538c22ea68556699a | [
"BSD-3-Clause"
] | 1 | 2018-03-05T15:40:12.000Z | 2018-03-05T15:40:12.000Z | src/sentry/south_migrations/0356_auto__add_useridentity__add_unique_useridentity_user_identity__add_ide.py | pkaminski/sentry | 27e948283e27d93ca5192ca7b580830e092c25c7 | [
"BSD-3-Clause"
] | 1 | 2018-08-22T16:49:48.000Z | 2018-08-22T16:49:48.000Z | src/sentry/south_migrations/0356_auto__add_useridentity__add_unique_useridentity_user_identity__add_ide.py | pkaminski/sentry | 27e948283e27d93ca5192ca7b580830e092c25c7 | [
"BSD-3-Clause"
] | 1 | 2018-07-02T09:46:44.000Z | 2018-07-02T09:46:44.000Z | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
# Flag to indicate if this migration is too risky
# to run online and needs to be coordinated for offline
... | 89.388438 | 233 | 0.591091 |
9a3a27dd7e173a560bbe1090579941be81b87f3f | 17,640 | py | Python | myven/lib/python3.8/site-packages/ansible/modules/cloud/amazon/redshift.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | 1 | 2021-04-02T08:08:39.000Z | 2021-04-02T08:08:39.000Z | myven/lib/python3.8/site-packages/ansible/modules/cloud/amazon/redshift.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | null | null | null | myven/lib/python3.8/site-packages/ansible/modules/cloud/amazon/redshift.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | 1 | 2020-05-03T01:13:16.000Z | 2020-05-03T01:13:16.000Z | #!/usr/bin/python
# Copyright 2014 Jens Carl, Hothead Games Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'stat... | 34.186047 | 153 | 0.655782 |
d8e947f98717b74d5ac3f81a751cba07b4c74f3d | 1,081 | py | Python | lineage/figures/figure12.py | meyer-lab/tHMM | 22e51a2035e76c39a2b1355d1e44ad9ed977dfd4 | [
"MIT"
] | 1 | 2022-03-17T21:05:23.000Z | 2022-03-17T21:05:23.000Z | lineage/figures/figure12.py | meyer-lab/tHMM | 22e51a2035e76c39a2b1355d1e44ad9ed977dfd4 | [
"MIT"
] | 310 | 2020-07-08T14:14:08.000Z | 2022-03-23T18:04:57.000Z | lineage/figures/figure12.py | meyer-lab/tHMM | 22e51a2035e76c39a2b1355d1e44ad9ed977dfd4 | [
"MIT"
] | 1 | 2020-12-21T04:54:56.000Z | 2020-12-21T04:54:56.000Z | """ This file depicts the distribution of phase lengths versus the states for each concentration of gemcitabine. """
import pickle
from string import ascii_lowercase
from .figureCommon import getSetup, subplotLabel, plot_all
from ..plotTree import plot_networkx
concs = ["control", "gemcitabine 5 nM", "gemcitabine 10 ... | 33.78125 | 123 | 0.691027 |
e3718eec76a6057b2bfc858af653e6a142ffa1dd | 8,731 | py | Python | usaspending_api/etl/award_helpers.py | toolness/usaspending-api | ed9a396e20a52749f01f43494763903cc371f9c2 | [
"CC0-1.0"
] | 1 | 2021-06-17T05:09:00.000Z | 2021-06-17T05:09:00.000Z | usaspending_api/etl/award_helpers.py | toolness/usaspending-api | ed9a396e20a52749f01f43494763903cc371f9c2 | [
"CC0-1.0"
] | null | null | null | usaspending_api/etl/award_helpers.py | toolness/usaspending-api | ed9a396e20a52749f01f43494763903cc371f9c2 | [
"CC0-1.0"
] | null | null | null | from django.db import connection
from usaspending_api.awards.models import Transaction
def update_awards(award_tuple=None):
"""
Awards can have one or more transactions. We maintain some information
on the award model that needs to be updated as its child transactions
change. For example, an award's ... | 41.379147 | 93 | 0.689268 |
248d7ff3528a2c941d2ccd7d74449d95ccb76e4d | 955 | py | Python | my_python_module/backup/longest_common_subsequence.py | a358003542/wanze_python_project | db52515af80319000e9a47a7b02f3ccd2cf46afd | [
"MIT"
] | 1 | 2020-10-30T08:54:22.000Z | 2020-10-30T08:54:22.000Z | my_python_module/backup/longest_common_subsequence.py | a358003542/wanze_python_project | db52515af80319000e9a47a7b02f3ccd2cf46afd | [
"MIT"
] | null | null | null | my_python_module/backup/longest_common_subsequence.py | a358003542/wanze_python_project | db52515af80319000e9a47a7b02f3ccd2cf46afd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*-coding:utf-8-*-
"""
动态规划法解最长公共子序列问题,经典案例,还是很实用的。
子序列不一定要求递增的,更多的是比较相似度
"""
import pandas as pd
def longest_common_subsequence(seq_one, seq_two):
df = pd.DataFrame(index=[item for item in seq_one], columns=[item for item in seq_two])
df = df.fillna(0)
for i, c1 in enumera... | 24.487179 | 91 | 0.436649 |
1c3365e3b522bc4f34c72ef66f784cc0cc49dbf1 | 10,574 | py | Python | tools/harness-automation/autothreadharness/open_thread_controller.py | ctan-g/openthread | 376f35a49e5c0a5b8170c117d7a930e3a8b3b210 | [
"BSD-3-Clause"
] | 1 | 2020-08-12T06:15:53.000Z | 2020-08-12T06:15:53.000Z | tools/harness-automation/autothreadharness/open_thread_controller.py | ctan-g/openthread | 376f35a49e5c0a5b8170c117d7a930e3a8b3b210 | [
"BSD-3-Clause"
] | null | null | null | tools/harness-automation/autothreadharness/open_thread_controller.py | ctan-g/openthread | 376f35a49e5c0a5b8170c117d7a930e3a8b3b210 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2016, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# notic... | 27.322997 | 92 | 0.56847 |
3f47d072719757aeca4ddb311581726820c95a14 | 3,304 | py | Python | hubspot/cms/blogs/tags/models/forward_paging.py | fakepop/hubspot-api-python | f04103a09f93f5c26c99991b25fa76801074f3d3 | [
"Apache-2.0"
] | null | null | null | hubspot/cms/blogs/tags/models/forward_paging.py | fakepop/hubspot-api-python | f04103a09f93f5c26c99991b25fa76801074f3d3 | [
"Apache-2.0"
] | null | null | null | hubspot/cms/blogs/tags/models/forward_paging.py | fakepop/hubspot-api-python | f04103a09f93f5c26c99991b25fa76801074f3d3 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Blog Post endpoints
\"Use these endpoints for interacting with Blog Posts, Blog Authors, and Blog Tags\" # noqa: E501
The version of the OpenAPI document: v3
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from hubspot.cms.blo... | 27.764706 | 102 | 0.562349 |
69a5da6e8a59d2d7b68cc021f273fcfb5de04a33 | 4,685 | py | Python | AI.py | sourabhjo7/ZEST.IO | bb53ef98c39b76a5fae14914b395fd0b8fffc999 | [
"MIT"
] | 2 | 2021-05-07T16:55:20.000Z | 2021-06-28T10:18:23.000Z | AI.py | sourabhjo7/ZEST.IO | bb53ef98c39b76a5fae14914b395fd0b8fffc999 | [
"MIT"
] | null | null | null | AI.py | sourabhjo7/ZEST.IO | bb53ef98c39b76a5fae14914b395fd0b8fffc999 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import math
global cap
faceCascade = cv2.CascadeClassifier('Face.xml')
def duke(x,y,w,h,frame):
area=w*h
font = cv2.FONT_HERSHEY_SIMPLEX
if area>20000 and area<30000:
cv2.putText(frame, 'Go Back!', (0, 450), font, 2, (255, 0, 0), 3, cv2.LINE_AA)
return 0
... | 36.889764 | 100 | 0.476414 |
eb6b85809da9e3e5760d2ddbd47cce7e907ac91b | 30,227 | py | Python | auditlog_tests/tests.py | washdrop/django-auditlog | b0717a52d3883a03f0f0ddcc7b5329924a81c423 | [
"MIT"
] | 252 | 2020-09-23T13:32:49.000Z | 2022-03-29T18:38:59.000Z | auditlog_tests/tests.py | washdrop/django-auditlog | b0717a52d3883a03f0f0ddcc7b5329924a81c423 | [
"MIT"
] | 121 | 2020-09-23T12:56:39.000Z | 2022-03-31T06:59:09.000Z | auditlog_tests/tests.py | washdrop/django-auditlog | b0717a52d3883a03f0f0ddcc7b5329924a81c423 | [
"MIT"
] | 89 | 2020-09-25T07:22:52.000Z | 2022-03-29T07:59:35.000Z | import datetime
import json
import django
from dateutil.tz import gettz
from django.conf import settings
from django.contrib import auth
from django.contrib.auth.models import AnonymousUser, User
from django.core.exceptions import ValidationError
from django.db.models.signals import pre_save
from django.http import Ht... | 35.353216 | 107 | 0.609753 |
c528d34d52df2a1306e2c6fddf8e3bd1f2c54397 | 9,940 | py | Python | akaocr/models/modules/utils.py | qai-research/Efficient_Text_Detection | e5cfe51148cc4fbf4c4f3afede040e4ebd624e8b | [
"MIT"
] | 2 | 2021-04-28T04:13:09.000Z | 2021-06-05T04:11:11.000Z | akaocr/models/modules/utils.py | qai-research/Efficient_Text_Detection | e5cfe51148cc4fbf4c4f3afede040e4ebd624e8b | [
"MIT"
] | 2 | 2021-05-06T13:49:52.000Z | 2021-05-14T08:45:13.000Z | akaocr/models/modules/utils.py | qai-research/Efficient_Text_Detection | e5cfe51148cc4fbf4c4f3afede040e4ebd624e8b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
_____________________________________________________________________________
Created By : Nguyen Ngoc Nghia - Nghiann3
Created Date: Fri March 12 13:00:00 VNT 2021
Project : AkaOCR core
_____________________________________________________________________________
Th... | 36.014493 | 116 | 0.630483 |
62bd0d5bebb416c6215d47512f13c7c7bad5ce62 | 1,689 | py | Python | sarafan/distance.py | sarafanio/sarafan | 1c15bcdb61c13558ca1d833547222530dd363333 | [
"MIT"
] | 2 | 2021-02-07T17:08:32.000Z | 2022-01-21T06:39:50.000Z | sarafan/distance.py | sarafanio/sarafan | 1c15bcdb61c13558ca1d833547222530dd363333 | [
"MIT"
] | 2 | 2021-02-07T15:22:57.000Z | 2021-02-07T15:24:49.000Z | sarafan/distance.py | sarafanio/sarafan | 1c15bcdb61c13558ca1d833547222530dd363333 | [
"MIT"
] | null | null | null | """Hash distance helpers.
Helps to calculate distance between two integers. Also provides helpers to convert
ascii strings and hex strings to integer.
Used to calculate distance between peers and magnets.
"""
import math
from functools import lru_cache
from Cryptodome.Hash import keccak
def ascii_to_hash(value) ->... | 25.984615 | 82 | 0.705743 |
9c4666ac510f0906d063d47804f318fad708d487 | 4,431 | py | Python | paropy/plot_utils.py | jnywong/paropy | 74232e295962ee80e49ccf3d090fbad8697808c3 | [
"MIT"
] | null | null | null | paropy/plot_utils.py | jnywong/paropy | 74232e295962ee80e49ccf3d090fbad8697808c3 | [
"MIT"
] | null | null | null | paropy/plot_utils.py | jnywong/paropy | 74232e295962ee80e49ccf3d090fbad8697808c3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Jan 8 16:10:19 2021
@author: wongj
"""
import numpy as np
import scipy.special as sp
import math
from scipy.integrate import cumtrapz
from matplotlib import ticker
from paropy.coreproperties import icb_radius, cmb_radius
def y_axis_sci(ax):
'''
... | 29.738255 | 128 | 0.618371 |
399570dd7dfb89302f9e100a3319bf917148d8f6 | 263 | py | Python | categoria/views.py | Emerson-MM-Filho/finance-control | 0d6b20501f9f601ab373b67f9c9bff9c42839f66 | [
"MIT"
] | null | null | null | categoria/views.py | Emerson-MM-Filho/finance-control | 0d6b20501f9f601ab373b67f9c9bff9c42839f66 | [
"MIT"
] | null | null | null | categoria/views.py | Emerson-MM-Filho/finance-control | 0d6b20501f9f601ab373b67f9c9bff9c42839f66 | [
"MIT"
] | null | null | null | from rest_framework import viewsets
from .models import Categoria
from.serializers import CategoriaSerializer
class CategoriasView(viewsets.ModelViewSet):
queryset = Categoria.objects.all().order_by('-created_at')
serializer_class = CategoriaSerializer | 29.222222 | 62 | 0.821293 |
33826b8435946389581cd9fd4e3aaae5effe3c4c | 2,031 | py | Python | pyexlatex/models/title/frame.py | whoopnip/py-ex-latex | 66f5fadc35a0bfdce5f1ccb3c80dce8885b061b6 | [
"MIT"
] | 4 | 2020-06-08T07:17:12.000Z | 2021-11-04T21:39:52.000Z | pyexlatex/models/title/frame.py | nickderobertis/py-ex-latex | 66f5fadc35a0bfdce5f1ccb3c80dce8885b061b6 | [
"MIT"
] | 24 | 2020-02-17T17:20:44.000Z | 2021-12-20T00:10:19.000Z | pyexlatex/models/title/frame.py | nickderobertis/py-ex-latex | 66f5fadc35a0bfdce5f1ccb3c80dce8885b061b6 | [
"MIT"
] | null | null | null | from typing import Optional, Sequence, Union
from pyexlatex.presentation.beamer.frame.frame import Frame
from pyexlatex.models.title.title import Title
from pyexlatex.models.title.subtitle import Subtitle
from pyexlatex.models.credits.author import Author
from pyexlatex.models.date import Date
from pyexlatex.models.tit... | 46.159091 | 132 | 0.669621 |
8bdc761f410e1343043eab9109e219a401df16e8 | 3,591 | py | Python | data_processing/g_pareto_plot.py | WybeKoper/PASAF | b7052eecb686f50a1988bdb7b1a88a26fc2240b5 | [
"Apache-2.0"
] | null | null | null | data_processing/g_pareto_plot.py | WybeKoper/PASAF | b7052eecb686f50a1988bdb7b1a88a26fc2240b5 | [
"Apache-2.0"
] | null | null | null | data_processing/g_pareto_plot.py | WybeKoper/PASAF | b7052eecb686f50a1988bdb7b1a88a26fc2240b5 | [
"Apache-2.0"
] | null | null | null | import matplotlib.pyplot as plt
from matplotlib.transforms import Bbox
import pandas as pd
from adjustText import adjust_text
import os
from mpl_toolkits.axes_grid1.inset_locator import zoomed_inset_axes
from mpl_toolkits.axes_grid1.inset_locator import mark_inset
def pareto_plot(query, zoomed, latency_limit, zoomed_... | 44.8875 | 251 | 0.66054 |
76776f9496cfbf80d3263d9d2f7c39217602f38e | 666 | py | Python | skbio/io/_warning.py | JWDebelius/scikit-bio | 9df3edb46eb728f6efbd4f2db74529200ad40a77 | [
"BSD-3-Clause"
] | null | null | null | skbio/io/_warning.py | JWDebelius/scikit-bio | 9df3edb46eb728f6efbd4f2db74529200ad40a77 | [
"BSD-3-Clause"
] | null | null | null | skbio/io/_warning.py | JWDebelius/scikit-bio | 9df3edb46eb728f6efbd4f2db74529200ad40a77 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, division, print_function
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, scikit-bio development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed ... | 33.3 | 78 | 0.575075 |
ed9a4738c118253f0d8891ac045d4a2d659e26b6 | 970 | py | Python | Lib/lib-stdwin/VUMeter.py | 1byte2bytes/cpython | 7fbaeb819ca7b20dca048217ff585ec195e999ec | [
"Unlicense",
"TCL",
"DOC",
"AAL",
"X11"
] | 1 | 2019-10-25T21:41:07.000Z | 2019-10-25T21:41:07.000Z | Lib/lib-stdwin/VUMeter.py | 1byte2bytes/cpython | 7fbaeb819ca7b20dca048217ff585ec195e999ec | [
"Unlicense",
"TCL",
"DOC",
"AAL",
"X11"
] | null | null | null | Lib/lib-stdwin/VUMeter.py | 1byte2bytes/cpython | 7fbaeb819ca7b20dca048217ff585ec195e999ec | [
"Unlicense",
"TCL",
"DOC",
"AAL",
"X11"
] | null | null | null | # Module 'VUMeter'
import audio
from StripChart import StripChart
K = 1024
Rates = [0, 32*K, 16*K, 8*K]
class VUMeter(StripChart):
#
# Override define() and timer() methods
#
def define(self, parent):
self = StripChart.define(self, (parent, 128))
self.parent.need_timer(self)
self.sampling = 0
self.rate =... | 20.208333 | 47 | 0.66701 |
c7ac144573b9ab0c170797e0e3b87dbe0846fa74 | 1,412 | py | Python | utilities/video_frame.py | syniosis76/fmb | 09e38fc6959f77ab60ba90ea075146e31568f60e | [
"MIT"
] | null | null | null | utilities/video_frame.py | syniosis76/fmb | 09e38fc6959f77ab60ba90ea075146e31568f60e | [
"MIT"
] | null | null | null | utilities/video_frame.py | syniosis76/fmb | 09e38fc6959f77ab60ba90ea075146e31568f60e | [
"MIT"
] | null | null | null | from PIL import Image
from ffpyplayer.player import MediaPlayer
from ffpyplayer.pic import SWScale
import os
import sys
import time
import traceback
def get_frame_image(frame):
frame_size = frame.get_size()
width = frame_size[0]
height = frame_size[1]
frame_converter = SWScale(width, height, frame.get_pixel_fo... | 29.416667 | 102 | 0.642351 |
83c6f0f7f9776bf4572efd2f618f0aff18a47f85 | 1,852 | py | Python | src/secml/ml/stats/c_distribution_gaussian.py | zangobot/secml | 95a293e1201c24256eb7fe2f1d2125cd5f318c8c | [
"Apache-2.0"
] | 63 | 2020-04-20T16:31:16.000Z | 2022-03-29T01:05:35.000Z | src/secml/ml/stats/c_distribution_gaussian.py | zangobot/secml | 95a293e1201c24256eb7fe2f1d2125cd5f318c8c | [
"Apache-2.0"
] | 5 | 2020-04-21T11:31:39.000Z | 2022-03-24T13:42:56.000Z | src/secml/ml/stats/c_distribution_gaussian.py | zangobot/secml | 95a293e1201c24256eb7fe2f1d2125cd5f318c8c | [
"Apache-2.0"
] | 8 | 2020-04-21T09:16:42.000Z | 2022-02-23T16:28:43.000Z | """
.. module:: GaussianDistribution
:synopsis: A dataset with an array of patterns and corresponding labels
.. moduleauthor:: Ambra Demontis <ambra.demontis@unica.it>
.. moduleauthor:: Marco Melis <marco.melis@unica.it>
"""
from scipy.stats import multivariate_normal
from secml.array import CArray
from secml.core... | 26.457143 | 74 | 0.575594 |
40860853ba793ad4eaca7c4de44bfa697de1fa2c | 279 | py | Python | tests/test_skeleton.py | jojo-31/smarter | f26712c349768606dbd7f23342e22c3f1a954c34 | [
"MIT"
] | null | null | null | tests/test_skeleton.py | jojo-31/smarter | f26712c349768606dbd7f23342e22c3f1a954c34 | [
"MIT"
] | null | null | null | tests/test_skeleton.py | jojo-31/smarter | f26712c349768606dbd7f23342e22c3f1a954c34 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
from smarter.skeleton import fib
__author__ = "mjo"
__copyright__ = "mjo"
__license__ = "mit"
def test_fib():
assert fib(1) == 1
assert fib(2) == 1
assert fib(7) == 13
with pytest.raises(AssertionError):
fib(-10)
| 16.411765 | 39 | 0.620072 |
54014a50966a1b94a6e9d3a7d98769b8dba775a7 | 3,204 | py | Python | chinilla/cmds/netspace_funcs.py | Chinilla/chinilla-blockchain | 59bebcf94e65b74fbb53ad4929bbd79cb28be619 | [
"Apache-2.0"
] | null | null | null | chinilla/cmds/netspace_funcs.py | Chinilla/chinilla-blockchain | 59bebcf94e65b74fbb53ad4929bbd79cb28be619 | [
"Apache-2.0"
] | null | null | null | chinilla/cmds/netspace_funcs.py | Chinilla/chinilla-blockchain | 59bebcf94e65b74fbb53ad4929bbd79cb28be619 | [
"Apache-2.0"
] | null | null | null | from typing import Optional
import aiohttp
from chinilla.rpc.full_node_rpc_client import FullNodeRpcClient
from chinilla.util.byte_types import hexstr_to_bytes
from chinilla.util.config import load_config
from chinilla.util.default_root import DEFAULT_ROOT_PATH
from chinilla.util.ints import uint16
from chinilla.util... | 42.72 | 107 | 0.617041 |
1f9ef334f267b5cae68ea3c5f07f0d599c159a63 | 485 | py | Python | tests/test_movie.py | beckynayere/Movie_List | 4301e3b4e5d28a7cd0e7c09104f4d4131317f7b4 | [
"MIT"
] | 1 | 2020-10-19T06:22:09.000Z | 2020-10-19T06:22:09.000Z | tests/test_movie.py | beckynayere/Movie_List | 4301e3b4e5d28a7cd0e7c09104f4d4131317f7b4 | [
"MIT"
] | null | null | null | tests/test_movie.py | beckynayere/Movie_List | 4301e3b4e5d28a7cd0e7c09104f4d4131317f7b4 | [
"MIT"
] | null | null | null | import unittest
from app.models import Movie
from app import db
class MovieTest(unittest.TestCase):
'''
Test Class to test the behaviour of the Movie class
'''
def setUp(self):
'''
Set up method that will run before every Test
'''
self.new_movie = Movie(1234, 'Python M... | 25.526316 | 121 | 0.657732 |
e9f3fe9dbbb6d45bca7313f7c13ed042b208e497 | 8,310 | py | Python | sentry_sdk/integrations/logging.py | targhs/sentry-python | 50ddda7b40c2d09b853b3fa2d595438c608a7eb0 | [
"BSD-2-Clause"
] | null | null | null | sentry_sdk/integrations/logging.py | targhs/sentry-python | 50ddda7b40c2d09b853b3fa2d595438c608a7eb0 | [
"BSD-2-Clause"
] | null | null | null | sentry_sdk/integrations/logging.py | targhs/sentry-python | 50ddda7b40c2d09b853b3fa2d595438c608a7eb0 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import absolute_import
import logging
import datetime
from fnmatch import fnmatch
from sentry_sdk.hub import Hub
from sentry_sdk.utils import (
to_string,
event_from_exception,
current_stacktrace,
capture_internal_exceptions,
)
from sentry_sdk.integrations import Integration
from sentr... | 30.108696 | 110 | 0.596871 |
dad39531784e0a31650adaf82fdedb0ed0160601 | 81 | py | Python | rse/apps.py | willfurnass/RSEAdmin | 28df855e417dfb279505ae8d57b20b0eaf8ff55f | [
"MIT"
] | 13 | 2019-11-04T15:41:42.000Z | 2022-01-19T19:38:35.000Z | rse/apps.py | willfurnass/RSEAdmin | 28df855e417dfb279505ae8d57b20b0eaf8ff55f | [
"MIT"
] | 152 | 2019-07-15T15:37:31.000Z | 2022-02-09T10:50:58.000Z | rse/apps.py | willfurnass/RSEAdmin | 28df855e417dfb279505ae8d57b20b0eaf8ff55f | [
"MIT"
] | 3 | 2020-02-18T11:56:24.000Z | 2021-04-06T08:18:26.000Z | from django.apps import AppConfig
class RseConfig(AppConfig):
name = 'rse'
| 13.5 | 33 | 0.728395 |
53e52201c1934896690b7be806684fdec6283cd9 | 4,864 | py | Python | test/test_client_ip.py | leeyangjie/unit | 02f50533c4a476b91e4b39a7a2d052095d970983 | [
"Apache-2.0"
] | null | null | null | test/test_client_ip.py | leeyangjie/unit | 02f50533c4a476b91e4b39a7a2d052095d970983 | [
"Apache-2.0"
] | null | null | null | test/test_client_ip.py | leeyangjie/unit | 02f50533c4a476b91e4b39a7a2d052095d970983 | [
"Apache-2.0"
] | null | null | null | from unit.applications.lang.python import TestApplicationPython
class TestClientIP(TestApplicationPython):
prerequisites = {'modules': {'python': 'any'}}
def client_ip(self, options):
assert 'success' in self.conf(
{
"127.0.0.1:7081": {
"client_ip": opt... | 35.246377 | 77 | 0.476563 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.