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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
4f998544e1bf65dd869d23c1ec8abe9ab6331a85 | 2,418 | py | Python | probabll/distributions/exponential.py | EelcovdW/dists.pt | 994c698c846226ccf1905302f2bab860a2b24ca4 | [
"MIT"
] | null | null | null | probabll/distributions/exponential.py | EelcovdW/dists.pt | 994c698c846226ccf1905302f2bab860a2b24ca4 | [
"MIT"
] | null | null | null | probabll/distributions/exponential.py | EelcovdW/dists.pt | 994c698c846226ccf1905302f2bab860a2b24ca4 | [
"MIT"
] | null | null | null | import torch
from torch.distributions.uniform import Uniform
from torch.distributions.exponential import Exponential
from torch.distributions.utils import broadcast_all
from torch.distributions.kl import register_kl
EPS = 1e-5
class RightTruncatedExponential(torch.distributions.Distribution):
def __init__(... | 35.558824 | 99 | 0.659222 |
87a81354932a4578af03bd329da0f265f6a86961 | 1,207 | py | Python | angel-ps/python/pyangel/ml/factorizationmachines/runner.py | weien8899/angel | 829ce1a02e147d1f93b6375c2d07208ea31e53a2 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2017-11-24T07:40:30.000Z | 2017-11-24T07:40:30.000Z | angel-ps/python/pyangel/ml/factorizationmachines/runner.py | weien8899/angel | 829ce1a02e147d1f93b6375c2d07208ea31e53a2 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | angel-ps/python/pyangel/ml/factorizationmachines/runner.py | weien8899/angel | 829ce1a02e147d1f93b6375c2d07208ea31e53a2 | [
"Apache-2.0",
"BSD-3-Clause"
] | 1 | 2018-09-28T00:31:04.000Z | 2018-09-28T00:31:04.000Z | #
# Tencent is pleased to support the open source community by making Angel available.
#
# Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
#
# Licensed under the BSD 3-Clause License (the "License") you may not use this file except in
# compliance with the License. You may obtain a copy of t... | 40.233333 | 174 | 0.769677 |
50eb198654b70e38c282d162b5b60da038440e07 | 845 | py | Python | label_studio_withoutsignin/data_import/views.py | DimaVinnitsa/label-studio | b33ef9edc5efef5f5a073e3a457832278afbf2cf | [
"Apache-2.0"
] | null | null | null | label_studio_withoutsignin/data_import/views.py | DimaVinnitsa/label-studio | b33ef9edc5efef5f5a073e3a457832278afbf2cf | [
"Apache-2.0"
] | null | null | null | label_studio_withoutsignin/data_import/views.py | DimaVinnitsa/label-studio | b33ef9edc5efef5f5a073e3a457832278afbf2cf | [
"Apache-2.0"
] | null | null | null | """This file and its contents are licensed under the Apache License 2.0. Please see the included NOTICE for copyright information and LICENSE for a copy of the license.
"""
import os
import io
import logging
from django.http import FileResponse
from django.conf import settings
from core.permissions import IsBusiness, ... | 35.208333 | 168 | 0.771598 |
9ba0c9646f0c14aca1753adfcc21b7284286d741 | 3,039 | py | Python | backend/src/analyser/common/config.py | 3ll3d00d/vibe | 124b029f13ac746723e92cb47e9cb56edd2e54b5 | [
"MIT"
] | 4 | 2018-05-21T20:32:34.000Z | 2019-11-20T10:09:17.000Z | backend/src/analyser/common/config.py | 3ll3d00d/vibe | 124b029f13ac746723e92cb47e9cb56edd2e54b5 | [
"MIT"
] | 31 | 2017-01-19T22:20:10.000Z | 2019-04-14T12:00:37.000Z | backend/src/analyser/common/config.py | 3ll3d00d/vibe | 124b029f13ac746723e92cb47e9cb56edd2e54b5 | [
"MIT"
] | 2 | 2019-06-30T00:22:22.000Z | 2019-10-08T11:38:59.000Z | import os
from core.BaseConfig import BaseConfig
class Config(BaseConfig):
def __init__(self):
super().__init__('analyser', defaultPort=8080)
self.targetState = loadTargetState(self.config.get('targetState'))
self.upload = self.config.get('upload', self.getDefaultUpload())
self.da... | 34.534091 | 87 | 0.617966 |
3110be7b92215fcda831926e2c522182ac865eae | 34,759 | py | Python | pattern/tests/test_recognition.py | IKATS/op-pattern | ee9c06b2494a949739e249414a7d6f964f2b5fe2 | [
"Apache-2.0"
] | null | null | null | pattern/tests/test_recognition.py | IKATS/op-pattern | ee9c06b2494a949739e249414a7d6f964f2b5fe2 | [
"Apache-2.0"
] | null | null | null | pattern/tests/test_recognition.py | IKATS/op-pattern | ee9c06b2494a949739e249414a7d6f964f2b5fe2 | [
"Apache-2.0"
] | 1 | 2019-10-29T08:08:11.000Z | 2019-10-29T08:08:11.000Z | """
Copyright 2018-2019 CS Systèmes d'Information
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 wr... | 46.971622 | 114 | 0.506459 |
2c499614f9dda5f7fc3bfc625f476c43273ec2d7 | 10,272 | py | Python | test/python/test_layer.py | dataviral/incubator-singa | 9b06c29712e4fbfe955d3c7a7f651da037c09693 | [
"Apache-2.0"
] | null | null | null | test/python/test_layer.py | dataviral/incubator-singa | 9b06c29712e4fbfe955d3c7a7f651da037c09693 | [
"Apache-2.0"
] | null | null | null | test/python/test_layer.py | dataviral/incubator-singa | 9b06c29712e4fbfe955d3c7a7f651da037c09693 | [
"Apache-2.0"
] | null | null | null | from builtins import str
#
# 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
... | 39.206107 | 80 | 0.606114 |
cdc9ac17a51e7d7e2504ed634fe45f458ae5760b | 1,394 | py | Python | config/wsgi.py | maddevsio/yourcast-web | c3e897f28dc16f71e4f625564270c0d3b72fa53f | [
"MIT"
] | 8 | 2017-05-12T10:08:03.000Z | 2020-12-22T00:01:39.000Z | config/wsgi.py | maddevsio/yourcast-web | c3e897f28dc16f71e4f625564270c0d3b72fa53f | [
"MIT"
] | null | null | null | config/wsgi.py | maddevsio/yourcast-web | c3e897f28dc16f71e4f625564270c0d3b72fa53f | [
"MIT"
] | 6 | 2017-05-12T13:35:43.000Z | 2021-08-09T13:43:31.000Z | """
WSGI config for devtv_webui project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATIO... | 44.967742 | 79 | 0.804161 |
692a69b37549c0bd6749cb85b1d26f29b9b2688e | 21,081 | py | Python | fairseq_cli/train.py | MANGA-UOFA/NAUS | 8c0c0815a280d0661adf588302848c7f1ecc56da | [
"MIT"
] | null | null | null | fairseq_cli/train.py | MANGA-UOFA/NAUS | 8c0c0815a280d0661adf588302848c7f1ecc56da | [
"MIT"
] | null | null | null | fairseq_cli/train.py | MANGA-UOFA/NAUS | 8c0c0815a280d0661adf588302848c7f1ecc56da | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Train a new model on one or across multiple GPUs.
"""
import argparse
import logging
import math
import os
import sy... | 36.726481 | 111 | 0.639676 |
04044cd54d155a6f516a4ad005e4ddb9eb7d2ab3 | 4,946 | py | Python | Challenge3/arpPoisoning.py | damiencassu/TLS-SEC_SecurityChallenge | ba62175bc992c860e1d6327442d76c64de6a3ec0 | [
"MIT"
] | null | null | null | Challenge3/arpPoisoning.py | damiencassu/TLS-SEC_SecurityChallenge | ba62175bc992c860e1d6327442d76c64de6a3ec0 | [
"MIT"
] | null | null | null | Challenge3/arpPoisoning.py | damiencassu/TLS-SEC_SecurityChallenge | ba62175bc992c860e1d6327442d76c64de6a3ec0 | [
"MIT"
] | null | null | null | #!/usr/bin/python2
# -*-coding:Utf-8 -*
"""
arpPoisoning is a small program used to perform HTTPS denial of service on local targets. It's based on Man In The Middle attack using arp poisoning. This program is designed to run on UNIX system and must only be used for testing or academic use.
"""
import logging
logging... | 27.631285 | 268 | 0.591185 |
be8b607ffaf3bcc805a67c1dc4095dfe362716de | 3,062 | py | Python | api/FacialBeauty/opencvJob.py | nathanbangwa243/FacialBeauty-AI | 550cc133fad2f4c9e522144de61ee0ece9b07bf2 | [
"MIT"
] | null | null | null | api/FacialBeauty/opencvJob.py | nathanbangwa243/FacialBeauty-AI | 550cc133fad2f4c9e522144de61ee0ece9b07bf2 | [
"MIT"
] | null | null | null | api/FacialBeauty/opencvJob.py | nathanbangwa243/FacialBeauty-AI | 550cc133fad2f4c9e522144de61ee0ece9b07bf2 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import imutils
import dlib
import sys
import os
# CONFIG
OPENCV_FKP_MODEL = os.path.join(
os.getcwd(), "models", "shape_predictor_68_face_landmarks.dat")
def renderFace2(image, landmarks, color=(0, 255, 0), radius=3):
"""Draw Facial landmarks
Args:
image (np.ar... | 22.188406 | 81 | 0.541476 |
3d72efd39a7ee8adda490b3889fc7cdfd9269afa | 2,516 | py | Python | userbot/plugins/speedtest.py | thecyberbyte-tech/Secktor-Userbot | 5ede9c98e4480ec48ad5dd114a5bf2da3df6dc3f | [
"MIT"
] | 44 | 2021-01-11T13:33:48.000Z | 2022-02-05T17:53:33.000Z | userbot/plugins/speedtest.py | Kishoth-45/TamilBot | 498a6716f897ba83975c43ce4fc18c875e6aa4ec | [
"MIT"
] | 1 | 2021-01-20T11:45:03.000Z | 2021-01-20T11:45:03.000Z | userbot/plugins/speedtest.py | Kishoth-45/TamilBot | 498a6716f897ba83975c43ce4fc18c875e6aa4ec | [
"MIT"
] | 59 | 2021-01-08T07:34:55.000Z | 2022-02-06T10:28:38.000Z | """Check your internet speed powered by speedtest.net
Syntax: .speedtest
Available Options: image, file, text"""
from telethon import events
from datetime import datetime
import io
import speedtest
from userbot.utils import admin_cmd
@borg.on(admin_cmd("speed ?(.*)"))
async def _(event):
if event.fwd_from:
... | 29.6 | 133 | 0.619634 |
1483fa6000b0ee61316619f577b423ae02e7cb08 | 138 | py | Python | pyvlm/__init__.py | Xero64/pyvlm | f373ac826cc65281245a69979eb28786fbf67bd0 | [
"MIT"
] | 2 | 2019-06-21T16:01:38.000Z | 2019-09-06T11:36:08.000Z | pyvlm/__init__.py | tackoo/pyvlm | f665b28877bff00087ba060b318be1404b334851 | [
"MIT"
] | 5 | 2019-09-06T11:37:50.000Z | 2021-05-12T16:36:10.000Z | pyvlm/__init__.py | tackoo/pyvlm | f665b28877bff00087ba060b318be1404b334851 | [
"MIT"
] | 2 | 2021-03-20T19:51:22.000Z | 2022-01-11T07:50:28.000Z | from .classes.latticesystem import LatticeSystem, latticesystem_from_json
from .classes import LatticeResult, LatticeTrim, LatticeOptimum
| 46 | 73 | 0.876812 |
859d98003a269194010c960a400c6068e883f8ba | 252 | py | Python | tensortrade/orders/__init__.py | Kukunin/tensortrade | c5b5c40232a334d9b38359eab0c0ce0e4c9e43ed | [
"Apache-2.0"
] | 6 | 2020-03-05T14:49:01.000Z | 2022-02-28T01:55:50.000Z | tensortrade/orders/__init__.py | Machine-Learning-Labs/tensortrade | 3fe7793a6c1d3d7bfe772166578f624f3f572eca | [
"Apache-2.0"
] | null | null | null | tensortrade/orders/__init__.py | Machine-Learning-Labs/tensortrade | 3fe7793a6c1d3d7bfe772166578f624f3f572eca | [
"Apache-2.0"
] | null | null | null | from .broker import Broker
from .order import Order, OrderStatus
from .order_listener import OrderListener
from .order_spec import OrderSpec
from .create import market_order, limit_order, hidden_limit_order, risk_managed_order
from . import criteria
| 28 | 85 | 0.84127 |
9463caab6139262d692e638b1d98062c10ad3761 | 12,586 | py | Python | lib/third_party/dulwich/patch.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | lib/third_party/dulwich/patch.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | null | null | null | lib/third_party/dulwich/patch.py | google-cloud-sdk-unofficial/google-cloud-sdk | 2a48a04df14be46c8745050f98768e30474a1aac | [
"Apache-2.0"
] | 1 | 2020-07-25T01:40:19.000Z | 2020-07-25T01:40:19.000Z | # patch.py -- For dealing with packed-style patches.
# Copyright (C) 2009-2013 Jelmer Vernooij <jelmer@jelmer.uk>
#
# Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU
# General Public License as public by the Free Software Foundation; version 2.0
# or (at your option) any later version. You ca... | 30.923833 | 88 | 0.600985 |
4a5c4aeba953f639c9b4cb39277cc9dac1d4b9ad | 2,047 | py | Python | accelbyte_py_sdk/api/cloudsave/wrappers/__init__.py | encyphered/accelbyte-python-sdk | 09c1e989d7251de308150fdcd3119d662ca2d205 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/api/cloudsave/wrappers/__init__.py | encyphered/accelbyte-python-sdk | 09c1e989d7251de308150fdcd3119d662ca2d205 | [
"MIT"
] | null | null | null | accelbyte_py_sdk/api/cloudsave/wrappers/__init__.py | encyphered/accelbyte-python-sdk | 09c1e989d7251de308150fdcd3119d662ca2d205 | [
"MIT"
] | null | null | null | """Auto-generated package that contains utility functions for the cloudsave API."""
__version__ = "3.38.0"
__author__ = "AccelByte"
__email__ = "dev@accelbyte.net"
# pylint: disable=line-too-long
from ._admin_game_record import list_game_records_handler_v1
from ._admin_game_record import get_game_record_handler_by_ke... | 52.487179 | 83 | 0.90767 |
991abfafde4c47b7e451a566c7b24cba04191338 | 14,408 | py | Python | sympy/plotting/plot_implicit.py | pbrady/sympy | 7163137e22fbefbb645147a15147b26dad220d49 | [
"BSD-3-Clause"
] | null | null | null | sympy/plotting/plot_implicit.py | pbrady/sympy | 7163137e22fbefbb645147a15147b26dad220d49 | [
"BSD-3-Clause"
] | null | null | null | sympy/plotting/plot_implicit.py | pbrady/sympy | 7163137e22fbefbb645147a15147b26dad220d49 | [
"BSD-3-Clause"
] | null | null | null | """Implicit plotting module for SymPy
The module implements a data series called ImplicitSeries which is used by
``Plot`` class to plot implicit plots for different backends. The module,
by default, implements plotting using interval arithmetic. It switches to a
fall back algorithm if the expression cannot be plotted ... | 38.217507 | 83 | 0.613201 |
1f5f33780cc40819d0c1cd7be0f4e03dd7869ade | 14,467 | py | Python | .history/src/Simulador_20200710171707.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | .history/src/Simulador_20200710171707.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | .history/src/Simulador_20200710171707.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from Matriz_esferica import Matriz_esferica
from Individuo import Individuo, Fabrica_individuo
import random
from itertools import permutations
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from scipy.sparse import csr_matrix, lil_matrix
class S... | 40.186111 | 135 | 0.657013 |
d5ec1813506cb8f49e1801bb5780295ed0ee1aa5 | 631 | py | Python | main.py | MelissaLaskowski/appengine-flask-skeleton | f1d8771e5e9c944dd61495c10b6bf90fc8c37966 | [
"Apache-2.0"
] | null | null | null | main.py | MelissaLaskowski/appengine-flask-skeleton | f1d8771e5e9c944dd61495c10b6bf90fc8c37966 | [
"Apache-2.0"
] | null | null | null | main.py | MelissaLaskowski/appengine-flask-skeleton | f1d8771e5e9c944dd61495c10b6bf90fc8c37966 | [
"Apache-2.0"
] | null | null | null | """`main` is the top level module for your Flask application."""
# Import the Flask Framework
from flask import Flask, render_template, request
app = Flask(__name__)
# Note: We don't need to call run() since our application is embedded within
# the App Engine WSGI application server.
@app.route('/')
def hello():
re... | 26.291667 | 76 | 0.711569 |
ad65fe26ed3c510debcef14773da48864d528593 | 2,558 | py | Python | hummingbot/connector/exchange/peatio/peatio_order_book_message.py | huuhait/hummingbot-peatio | 669170d13f742a3c941c3c6bfe91464a4de03cb8 | [
"Apache-2.0"
] | null | null | null | hummingbot/connector/exchange/peatio/peatio_order_book_message.py | huuhait/hummingbot-peatio | 669170d13f742a3c941c3c6bfe91464a4de03cb8 | [
"Apache-2.0"
] | null | null | null | hummingbot/connector/exchange/peatio/peatio_order_book_message.py | huuhait/hummingbot-peatio | 669170d13f742a3c941c3c6bfe91464a4de03cb8 | [
"Apache-2.0"
] | 1 | 2022-03-08T14:15:45.000Z | 2022-03-08T14:15:45.000Z | #!/usr/bin/env python
from typing import (
Dict,
List,
Optional,
)
from hummingbot.core.data_type.order_book_row import OrderBookRow
from hummingbot.core.data_type.order_book_message import (
OrderBookMessage,
OrderBookMessageType,
)
from .peatio_utils import (
convert_from_exchange_trading_pa... | 30.452381 | 99 | 0.618843 |
2b993ed2cd3112b61d0fbfe3902d09b2c772b7e3 | 107 | py | Python | MGCosmoPop/posteriors/__init__.py | nicoborghi/MGCosmoPop | ebf07744caed1ac6694e7c750c1147ac30442fe5 | [
"BSD-3-Clause"
] | 4 | 2022-01-31T02:00:30.000Z | 2022-03-22T08:00:00.000Z | MGCosmoPop/posteriors/__init__.py | nicoborghi/MGCosmoPop | ebf07744caed1ac6694e7c750c1147ac30442fe5 | [
"BSD-3-Clause"
] | null | null | null | MGCosmoPop/posteriors/__init__.py | nicoborghi/MGCosmoPop | ebf07744caed1ac6694e7c750c1147ac30442fe5 | [
"BSD-3-Clause"
] | 5 | 2021-12-13T03:33:48.000Z | 2022-03-22T08:00:02.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Mar 3 10:05:14 2021
@author: Michi
"""
| 13.375 | 35 | 0.588785 |
2682862e104bc2425bd7d5a78f67880e4a7852c5 | 12,844 | py | Python | locust/test/test_stats.py | sanga/locust | a41b22367d19e560f4eb0da16161d3d5be57eaf5 | [
"MIT"
] | 1 | 2019-03-03T15:52:12.000Z | 2019-03-03T15:52:12.000Z | locust/test/test_stats.py | sanga/locust | a41b22367d19e560f4eb0da16161d3d5be57eaf5 | [
"MIT"
] | null | null | null | locust/test/test_stats.py | sanga/locust | a41b22367d19e560f4eb0da16161d3d5be57eaf5 | [
"MIT"
] | null | null | null | import time
import unittest
from locust.core import HttpLocust, TaskSet, task
from locust.inspectlocust import get_task_ratio_dict
from locust.rpc.protocol import Message
from locust.stats import CachedResponseTimes, RequestStats, StatsEntry, diff_response_time_dicts, global_stats
from six.moves import xrange
from .t... | 37.014409 | 171 | 0.592962 |
59a847ee2ef10ad35b0387eb097fc07d8d17fdb4 | 5,634 | py | Python | lib/python3.9/site-packages/telethon/tl/functions/photos.py | ichomchom/Telegram-Media-Downloader | 3656c894a1d25bde753bd6fb0b68f54f40a6e93a | [
"MIT"
] | null | null | null | lib/python3.9/site-packages/telethon/tl/functions/photos.py | ichomchom/Telegram-Media-Downloader | 3656c894a1d25bde753bd6fb0b68f54f40a6e93a | [
"MIT"
] | null | null | null | lib/python3.9/site-packages/telethon/tl/functions/photos.py | ichomchom/Telegram-Media-Downloader | 3656c894a1d25bde753bd6fb0b68f54f40a6e93a | [
"MIT"
] | null | null | null | """File generated by TLObjects' generator. All changes will be ERASED"""
from ...tl.tlobject import TLObject
from ...tl.tlobject import TLRequest
from typing import Optional, List, Union, TYPE_CHECKING
import os
import struct
from datetime import datetime
if TYPE_CHECKING:
from ...tl.types import TypeInputFile, Typ... | 31.127072 | 219 | 0.600639 |
3f60e8177c8020dc9cd600cc2ee99f3d52e1a2c3 | 42,901 | py | Python | reconcile/queries.py | sugarraysam/qontract-reconcile | a7a8e9ac2e4521d81a21b228547e52a49e071c15 | [
"Apache-2.0"
] | null | null | null | reconcile/queries.py | sugarraysam/qontract-reconcile | a7a8e9ac2e4521d81a21b228547e52a49e071c15 | [
"Apache-2.0"
] | null | null | null | reconcile/queries.py | sugarraysam/qontract-reconcile | a7a8e9ac2e4521d81a21b228547e52a49e071c15 | [
"Apache-2.0"
] | null | null | null | import logging
import itertools
from textwrap import indent
from jinja2 import Template
from reconcile.utils import gql
APP_INTERFACE_SETTINGS_QUERY = """
{
settings: app_interface_settings_v1 {
vault
kubeBinary
mergeRequestGateway
saasDeployJobTemplate
hashLength
dependencies {
typ... | 17.250101 | 79 | 0.491154 |
0adf77dceb7e870da6c2e36ee348ae138895d401 | 6,328 | py | Python | src/scs_core/osio/config/project_topic.py | south-coast-science/scs_core | 81ad4010abb37ca935f3a31ac805639ef53b1bcf | [
"MIT"
] | 3 | 2019-03-12T01:59:58.000Z | 2020-09-12T07:27:42.000Z | src/scs_core/osio/config/project_topic.py | south-coast-science/scs_core | 81ad4010abb37ca935f3a31ac805639ef53b1bcf | [
"MIT"
] | 1 | 2018-04-20T07:58:38.000Z | 2021-03-27T08:52:45.000Z | src/scs_core/osio/config/project_topic.py | south-coast-science/scs_core | 81ad4010abb37ca935f3a31ac805639ef53b1bcf | [
"MIT"
] | 4 | 2017-09-29T13:08:43.000Z | 2019-10-09T09:13:58.000Z | """
Created on 22 Mar 2017
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
schemas:
{"id": 33, "name": "south-coast-science-climate",
"description": "South Coast Science Air Quality Sensor; climate"}
{"id": 29, "name": "south-coast-science-particulates", "description":
"South Coast Science Air Quality Sen... | 37.223529 | 118 | 0.462231 |
f6b63fa8962f0cc8ea121f13fe6f0deabd1915c3 | 47,263 | py | Python | src/transformers/file_utils.py | nicola-decao/transformers | f6f4da8dd4cfe255002dc642a8bb27dd64ed294e | [
"Apache-2.0"
] | 12 | 2021-09-13T18:31:09.000Z | 2022-03-31T12:10:28.000Z | src/transformers/file_utils.py | nicola-decao/transformers | f6f4da8dd4cfe255002dc642a8bb27dd64ed294e | [
"Apache-2.0"
] | 5 | 2021-12-01T04:34:07.000Z | 2022-01-28T08:28:18.000Z | src/transformers/file_utils.py | nicola-decao/transformers | f6f4da8dd4cfe255002dc642a8bb27dd64ed294e | [
"Apache-2.0"
] | 3 | 2022-01-18T10:56:05.000Z | 2022-01-28T01:46:43.000Z | """
Utilities for working with the local dataset cache. This file is adapted from the AllenNLP library at
https://github.com/allenai/allennlp Copyright by the AllenNLP authors.
"""
import fnmatch
import io
import json
import os
import re
import shutil
import sys
import tarfile
import tempfile
from collections import O... | 35.616428 | 150 | 0.659078 |
1d10603572924d45fe3c29df98cdd90f3db7e569 | 5,956 | py | Python | benchmark/internal/20eval.py | elcorto/findsame | f4923bf965dd69cea6c5667c0cb72827525e0fd3 | [
"BSD-3-Clause"
] | 2 | 2018-08-31T09:49:34.000Z | 2019-08-12T20:35:18.000Z | benchmark/internal/20eval.py | elcorto/findsame | f4923bf965dd69cea6c5667c0cb72827525e0fd3 | [
"BSD-3-Clause"
] | null | null | null | benchmark/internal/20eval.py | elcorto/findsame | f4923bf965dd69cea6c5667c0cb72827525e0fd3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import os, sys, collections, itertools, functools
import numpy as np
from matplotlib import pyplot as plt
# for projection='3d'
from mpl_toolkits.mplot3d import Axes3D
from psweep import psweep as ps
def to_seq(arg):
if isinstance(arg, collections.abc.Sequence) and not isinstance(arg, s... | 41.361111 | 135 | 0.54869 |
9d212419983afbfcebd8cc8c0bb3e35220f6c9af | 1,206 | py | Python | obtain_kmeans_clusters_using_embeddings.py | francescoferretto/Investigating-relationships-between-Twitter-latent-topics-and-political-orientation | c6f1ff05ac8960885f26a153d7c0c8ecf1364a6a | [
"MIT"
] | null | null | null | obtain_kmeans_clusters_using_embeddings.py | francescoferretto/Investigating-relationships-between-Twitter-latent-topics-and-political-orientation | c6f1ff05ac8960885f26a153d7c0c8ecf1364a6a | [
"MIT"
] | null | null | null | obtain_kmeans_clusters_using_embeddings.py | francescoferretto/Investigating-relationships-between-Twitter-latent-topics-and-political-orientation | c6f1ff05ac8960885f26a153d7c0c8ecf1364a6a | [
"MIT"
] | null | null | null | import pandas as pd
import os
import logging
from pathlib import Path
import sys
#
# Configure the path
#FILE_PATH = Path(__file__).resolve().parent
FILE_PATH = '/home/emi/unipd/Sartori_CBSD/project/cbsdproject'
DATA_PATH = FILE_PATH + '/data'
DATA_FILE = DATA_PATH + '/tweets_cleaned.csv'
UTILS_PATH = FILE_PATH + '/u... | 26.217391 | 125 | 0.801824 |
758fb761a9fac4851eec01b91c3adf3135c4a6ba | 4,189 | py | Python | examples/minimqtt_certificate.py | jimbobbennett/Adafruit_CircuitPython_MiniMQTT | 2ab1f1eaa63df2c0f327d6701518656197597a91 | [
"MIT"
] | null | null | null | examples/minimqtt_certificate.py | jimbobbennett/Adafruit_CircuitPython_MiniMQTT | 2ab1f1eaa63df2c0f327d6701518656197597a91 | [
"MIT"
] | null | null | null | examples/minimqtt_certificate.py | jimbobbennett/Adafruit_CircuitPython_MiniMQTT | 2ab1f1eaa63df2c0f327d6701518656197597a91 | [
"MIT"
] | null | null | null | import board
import busio
from digitalio import DigitalInOut
import neopixel
from adafruit_esp32spi import adafruit_esp32spi
from adafruit_esp32spi import adafruit_esp32spi_wifimanager
import adafruit_esp32spi.adafruit_esp32spi_socket as socket
import adafruit_minimqtt as MQTT
### WiFi ###
# Get wifi details and mor... | 30.355072 | 93 | 0.755073 |
c7003ae699f3e9ae781a9d49b8adfeca5f8e9f8b | 1,419 | py | Python | malaysiancrime/monitor/management/commands/send_all.py | renyi/malaysiacrime | 0f8708b8a2f79ea9ea82d635e7c625bcca1fb41d | [
"MIT"
] | 1 | 2019-01-24T04:56:36.000Z | 2019-01-24T04:56:36.000Z | malaysiancrime/monitor/management/commands/send_all.py | renyi/malaysiacrime | 0f8708b8a2f79ea9ea82d635e7c625bcca1fb41d | [
"MIT"
] | null | null | null | malaysiancrime/monitor/management/commands/send_all.py | renyi/malaysiacrime | 0f8708b8a2f79ea9ea82d635e7c625bcca1fb41d | [
"MIT"
] | null | null | null | import logging, smtplib
from datetime import datetime, timedelta
from django.core.mail import send_mail
from django.core.management.base import BaseCommand
from django.db.models import get_model
from django.template import Context
from django.template.loader import get_template
from crime.models import Crime
from mon... | 40.542857 | 123 | 0.656096 |
f59e86bbeebab346a69d744c75d8db7213404f9c | 129,965 | py | Python | parser/fase2/team17/Traduccion/Parser/Ascendente/gramatica.py | Gabriel-15/tytus | fb00718bf3fcc5211a3604fba1a551f44bdc6deb | [
"MIT"
] | 35 | 2020-12-07T03:11:43.000Z | 2021-04-15T17:38:16.000Z | parser/fase2/team17/Traduccion/Parser/Ascendente/gramatica.py | Gabriel-15/tytus | fb00718bf3fcc5211a3604fba1a551f44bdc6deb | [
"MIT"
] | 47 | 2020-12-09T01:29:09.000Z | 2021-01-13T05:37:50.000Z | parser/fase2/team17/Traduccion/Parser/Ascendente/gramatica.py | Gabriel-15/tytus | fb00718bf3fcc5211a3604fba1a551f44bdc6deb | [
"MIT"
] | 556 | 2020-12-07T03:13:31.000Z | 2021-06-17T17:41:10.000Z | from InterpreteF2.DML.create.createdatabase import CreateDatabase
from InterpreteF2.DML.create.createtable import CreateTable
from InterpreteF2.DML.drops.dropdatabase import DropDatabase
from Interprete.DROP_TABLE.drop_table import DropTable
from Interprete.OperacionesConExpresiones.Opera_Relacionales import Opera_Rela... | 33.196679 | 406 | 0.462224 |
66d2f65d425b52fb45c13dd99f2a24aeb8f52445 | 19,053 | py | Python | lib-python/modified-2.4.1/test/test_deque.py | camillobruni/pygirl | ddbd442d53061d6ff4af831c1eab153bcc771b5a | [
"MIT"
] | 12 | 2016-01-06T07:10:28.000Z | 2021-05-13T23:02:02.000Z | lib-python/modified-2.4.1/test/test_deque.py | camillobruni/pygirl | ddbd442d53061d6ff4af831c1eab153bcc771b5a | [
"MIT"
] | null | null | null | lib-python/modified-2.4.1/test/test_deque.py | camillobruni/pygirl | ddbd442d53061d6ff4af831c1eab153bcc771b5a | [
"MIT"
] | 2 | 2016-07-29T07:09:50.000Z | 2016-10-16T08:50:26.000Z | from collections import deque
import unittest
from test import test_support
#from weakref import proxy
import copy
import cPickle as pickle
from cStringIO import StringIO
import random
import os
BIG = 10
def fail():
raise SyntaxError
yield 1
class TestBasic(unittest.TestCase):
def test_basics(self):
... | 29.044207 | 82 | 0.512675 |
87b5ab19b46fba98a1e518d890f7ac6b8f3c452a | 2,863 | py | Python | content_gallery/templatetags/content_gallery.py | jenia0jenia/django-content-gallery | e96c6972fc3a0c4c7b95855d9c3e2af030ce01c1 | [
"BSD-3-Clause"
] | 25 | 2017-07-03T13:58:17.000Z | 2020-10-31T11:44:49.000Z | content_gallery/templatetags/content_gallery.py | jenia0jenia/django-content-gallery | e96c6972fc3a0c4c7b95855d9c3e2af030ce01c1 | [
"BSD-3-Clause"
] | 5 | 2017-07-30T20:34:00.000Z | 2020-08-17T18:52:38.000Z | content_gallery/templatetags/content_gallery.py | jenia0jenia/django-content-gallery | e96c6972fc3a0c4c7b95855d9c3e2af030ce01c1 | [
"BSD-3-Clause"
] | 15 | 2017-07-31T09:29:33.000Z | 2020-10-02T08:23:15.000Z | import json
from django import template
from django.utils import html
from .. import settings
from .. import utils
register = template.Library()
@register.simple_tag
def gallery_image_data(obj):
"""
Returns data of the image related to the object.
Used to construct previews.
"""
# get the first ... | 30.136842 | 74 | 0.676912 |
20b460f82864b249252514c6dfd4cf76750c285c | 2,847 | py | Python | chapter10/docker/images/movielens-fetch/scripts/fetch_ratings.py | add54/Data_PipeLine_Apache_Airflow | 40b52ba6fcda3203b194be9e1c2850135997215a | [
"BSD-Source-Code"
] | 303 | 2019-09-30T10:59:15.000Z | 2022-03-30T17:03:27.000Z | chapter10/docker/images/movielens-fetch/scripts/fetch_ratings.py | andreaschandra/data-pipelines-with-apache-airflow | 40b52ba6fcda3203b194be9e1c2850135997215a | [
"BSD-Source-Code"
] | 13 | 2020-04-08T12:28:30.000Z | 2021-12-30T06:40:37.000Z | chapter10/docker/images/movielens-fetch/scripts/fetch_ratings.py | andreaschandra/data-pipelines-with-apache-airflow | 40b52ba6fcda3203b194be9e1c2850135997215a | [
"BSD-Source-Code"
] | 148 | 2020-01-03T03:30:39.000Z | 2022-03-28T04:19:43.000Z | #!/usr/bin/env python
from pathlib import Path
import logging
import json
import click
import requests
logging.basicConfig(level=logging.INFO)
@click.command()
@click.option(
"--start_date",
type=click.DateTime(formats=["%Y-%m-%d"]),
required=True,
help="Start date for ratings.",
)
@click.option(... | 23.528926 | 84 | 0.62522 |
ca183d9e77f0f7a7dce0051513699c463c7e60a1 | 1,952 | py | Python | scripts/position_experiment/reader.py | sarnthil/emotion-classification-roles | 1fdd3a8cbdac5ab2ad9598a101b763882df78280 | [
"MIT"
] | 1 | 2022-02-17T14:16:20.000Z | 2022-02-17T14:16:20.000Z | scripts/position_experiment/reader.py | sarnthil/emotion-classification-roles | 1fdd3a8cbdac5ab2ad9598a101b763882df78280 | [
"MIT"
] | null | null | null | scripts/position_experiment/reader.py | sarnthil/emotion-classification-roles | 1fdd3a8cbdac5ab2ad9598a101b763882df78280 | [
"MIT"
] | null | null | null | import json
import math
from random import random
from typing import Dict, List, Iterable, Any, Tuple
import numpy as np
from allennlp.common.file_utils import cached_path
from allennlp.data import DatasetReader, TokenIndexer, Instance, Token
from allennlp.data.fields import SequenceLabelField, MetadataField, TextFiel... | 38.27451 | 114 | 0.684939 |
1d5aa8f7cedc0d65dd750753a3d8a4d7af0e43f6 | 172 | py | Python | slnee_monitoring/slnee_monitoring/doctype/satellite_channels_monitoring/test_satellite_channels_monitoring.py | erpcloudsystems/slnee_monitoring | 173037379b3b22ef121c0e24471771a7cdba9728 | [
"MIT"
] | null | null | null | slnee_monitoring/slnee_monitoring/doctype/satellite_channels_monitoring/test_satellite_channels_monitoring.py | erpcloudsystems/slnee_monitoring | 173037379b3b22ef121c0e24471771a7cdba9728 | [
"MIT"
] | null | null | null | slnee_monitoring/slnee_monitoring/doctype/satellite_channels_monitoring/test_satellite_channels_monitoring.py | erpcloudsystems/slnee_monitoring | 173037379b3b22ef121c0e24471771a7cdba9728 | [
"MIT"
] | null | null | null | # Copyright (c) 2021, erpcloud.systems and Contributors
# See license.txt
# import frappe
import unittest
class TestSatelliteChannelsMonitoring(unittest.TestCase):
pass
| 19.111111 | 57 | 0.80814 |
018dc120cfad714287c789a6479fd030243d0a9f | 11,022 | py | Python | classy_vision/dataset/transforms/util_video.py | jdsgomes/ClassyVision-1 | 309d4f12431c6b4d8540010a781dc2aa25fe88e7 | [
"MIT"
] | null | null | null | classy_vision/dataset/transforms/util_video.py | jdsgomes/ClassyVision-1 | 309d4f12431c6b4d8540010a781dc2aa25fe88e7 | [
"MIT"
] | null | null | null | classy_vision/dataset/transforms/util_video.py | jdsgomes/ClassyVision-1 | 309d4f12431c6b4d8540010a781dc2aa25fe88e7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import random
from typing import Any, Callable, Dict, List, Optional, Union
import torch
import torchvision.transfor... | 34.123839 | 88 | 0.654056 |
feb439d04a160a2a8269426b99025f71f9262ea2 | 673 | py | Python | sensive_blog/urls.py | aevtikheev/dvmn-sensive-blog | 1bc3e0f1753310050189b0795f02768c38ab8015 | [
"MIT"
] | null | null | null | sensive_blog/urls.py | aevtikheev/dvmn-sensive-blog | 1bc3e0f1753310050189b0795f02768c38ab8015 | [
"MIT"
] | null | null | null | sensive_blog/urls.py | aevtikheev/dvmn-sensive-blog | 1bc3e0f1753310050189b0795f02768c38ab8015 | [
"MIT"
] | null | null | null | import debug_toolbar
from django.contrib import admin
from django.urls import include, path
from django.conf.urls.static import static
from django.conf import settings
from blog import views
urlpatterns = [
path('admin/', admin.site.urls),
path('page/<int:page>', views.index, name='index'),
path('post/<s... | 32.047619 | 76 | 0.72214 |
db68ad778ea60166b6661962bb9bcfd4d3a2ced5 | 3,055 | py | Python | dump_net.py | graphbuilder/BNN | d99eb5c7ef19f8b0c14a135d40a489f154a3c894 | [
"MIT"
] | 1 | 2021-05-04T06:38:00.000Z | 2021-05-04T06:38:00.000Z | dump_net.py | graphbuilder/BNN | d99eb5c7ef19f8b0c14a135d40a489f154a3c894 | [
"MIT"
] | null | null | null | dump_net.py | graphbuilder/BNN | d99eb5c7ef19f8b0c14a135d40a489f154a3c894 | [
"MIT"
] | 1 | 2021-05-24T06:43:47.000Z | 2021-05-24T06:43:47.000Z | import numpy as np
from numpy.lib.stride_tricks import as_strided
import os
import argparse
from PIL import Image
def conv_np(input_fm, conv_filter, cond=(0, 0, 0)):
input_fm = input_fm.squeeze()
# fm = np.pad(input_fm, ((0, 0), (1, 1), (1, 1)), 'constant', constant_values=(1, 1))
fm = input_fm # first ... | 33.571429 | 132 | 0.551882 |
433bb74e7e114fe76be76ae9296698d5fee56d70 | 722 | py | Python | src/examples.py | justin-schachter/cfl_eddy_eps_driver | 67972e034fd0fb524365a022948d97b7e20ab7e0 | [
"MIT"
] | null | null | null | src/examples.py | justin-schachter/cfl_eddy_eps_driver | 67972e034fd0fb524365a022948d97b7e20ab7e0 | [
"MIT"
] | null | null | null | src/examples.py | justin-schachter/cfl_eddy_eps_driver | 67972e034fd0fb524365a022948d97b7e20ab7e0 | [
"MIT"
] | null | null | null | from eddy_eps import EddyEps
eps = EddyEps(smbus_num=1)
eps.print_measurement_table()
print( ['V VBATT RAW', eps.get_voltage_vbatt_raw(), 'V'],
['I VBATT RAW', eps.get_current_vbatt_raw(), 'A'],
['V 3V3', eps.get_voltage_3v3(), 'V'],
['I 3V3', eps.get_current_3v3(), 'A'],
['V 5V0', eps.ge... | 38 | 61 | 0.581717 |
11dc71479efc75dfb1b94a26877a412b534d3308 | 46,947 | py | Python | zipline/algorithm.py | joequant/zipline | dd1f9221f937909b4d99be3e44ba0e4f8c19662e | [
"Apache-2.0"
] | 1 | 2015-10-22T03:38:19.000Z | 2015-10-22T03:38:19.000Z | zipline/algorithm.py | joequant/zipline | dd1f9221f937909b4d99be3e44ba0e4f8c19662e | [
"Apache-2.0"
] | null | null | null | zipline/algorithm.py | joequant/zipline | dd1f9221f937909b4d99be3e44ba0e4f8c19662e | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2014 Quantopian, 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 wr... | 35.810069 | 98 | 0.598824 |
684b06623fb27bc543c30f4228c3acf6422d117e | 7,636 | py | Python | sensor_insights.py | blockchainnetwork/telegramcrypto | 9158a1c21059915d94b2babbf5f0ff303a3b4308 | [
"MIT"
] | 2 | 2018-08-15T20:16:43.000Z | 2018-08-21T04:03:03.000Z | sensor_insights.py | blockchainnetwork/telegramcrypto | 9158a1c21059915d94b2babbf5f0ff303a3b4308 | [
"MIT"
] | null | null | null | sensor_insights.py | blockchainnetwork/telegramcrypto | 9158a1c21059915d94b2babbf5f0ff303a3b4308 | [
"MIT"
] | null | null | null | import pynmea2
import pandas as pd
import numpy as np
import math
from datetime import datetime
import time
from datetime import timedelta
def getSpeedTests():
fileSensorInsights = 'sensor_insights_output.csv'
countCheck = 0
countParse = 0
#Declaracion variables
tim = []
lat = []
lon = []
alt = []
delta_latit... | 31.816667 | 140 | 0.673389 |
1128c2131b2c50551e69290446d9a309e0657b57 | 7,631 | py | Python | veripress/model/toc.py | BlogTANG/veripress | 5cb555c037904855e0c9a94fce0eaf867c2e4639 | [
"MIT"
] | 68 | 2017-03-18T14:32:12.000Z | 2020-07-28T14:14:29.000Z | veripress/model/toc.py | BlogTANG/veripress | 5cb555c037904855e0c9a94fce0eaf867c2e4639 | [
"MIT"
] | 9 | 2018-08-22T16:47:40.000Z | 2020-03-03T14:30:46.000Z | veripress/model/toc.py | BlogTANG/veripress | 5cb555c037904855e0c9a94fce0eaf867c2e4639 | [
"MIT"
] | 10 | 2017-03-22T04:27:38.000Z | 2020-03-03T08:32:15.000Z | import re
from html.parser import HTMLParser
class _HtmlHeaderNode(object):
"""Represents a header element when parsing the HTML string."""
def __init__(self, level):
"""Initialize attributes."""
# header level of the element, e.g. 1 for <h1>, 2 for <h2>, etc
self.level = level
... | 33.469298 | 79 | 0.543048 |
a32b5e7620bf0dcfe44ebbb7b2e0978c5f33a9d1 | 1,814 | py | Python | client/bahub/bahubapp/entity/encryption.py | FeatureToggleStudy/file-repository | a11955c1d20b36bf5e67a811525fe1e179b9beff | [
"Apache-2.0"
] | null | null | null | client/bahub/bahubapp/entity/encryption.py | FeatureToggleStudy/file-repository | a11955c1d20b36bf5e67a811525fe1e179b9beff | [
"Apache-2.0"
] | null | null | null | client/bahub/bahubapp/entity/encryption.py | FeatureToggleStudy/file-repository | a11955c1d20b36bf5e67a811525fe1e179b9beff | [
"Apache-2.0"
] | null | null | null | from ..exceptions import ConfigurationFactoryException
class Encryption:
""" Cryptography support (using OpenSSL command implementation) """
_supported_crypto = [
'aes-256-cbc', 'aes-256-ecb', 'aes-128-cbc', 'aes-128-cbc', 'des-ecb', 'des-cbc'
]
_passphrase = "" # type: str
_method = ... | 33.592593 | 113 | 0.602536 |
4f8f24fc048f68cac613626c8e6d91fb79acdbfd | 7,646 | py | Python | starthinker/task/dv_editor/patch.py | arbrown/starthinker | 1a14664fb1a8f2a757b100363ea8958833b7754c | [
"Apache-2.0"
] | 138 | 2018-11-28T21:42:44.000Z | 2022-03-30T17:26:35.000Z | starthinker/task/dv_editor/patch.py | arbrown/starthinker | 1a14664fb1a8f2a757b100363ea8958833b7754c | [
"Apache-2.0"
] | 36 | 2019-02-19T18:33:20.000Z | 2022-01-24T18:02:44.000Z | starthinker/task/dv_editor/patch.py | arbrown/starthinker | 1a14664fb1a8f2a757b100363ea8958833b7754c | [
"Apache-2.0"
] | 54 | 2018-12-06T05:47:32.000Z | 2022-02-21T22:01:01.000Z | ###########################################################################
#
# 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/l... | 25.744108 | 84 | 0.54146 |
160df180213996b83e44244137f19735e800f47c | 3,151 | py | Python | scripts/core/FacialDisplay.py | supercatex/home_edu | 6368967917892eb43164ca79fd4faeafb085be37 | [
"MIT"
] | 3 | 2019-05-12T00:20:06.000Z | 2021-06-27T02:12:10.000Z | scripts/core/FacialDisplay.py | supercatex/home_edu | 6368967917892eb43164ca79fd4faeafb085be37 | [
"MIT"
] | 25 | 2019-05-12T14:53:05.000Z | 2019-05-12T16:00:44.000Z | scripts/core/FacialDisplay.py | supercatex/home_edu | 6368967917892eb43164ca79fd4faeafb085be37 | [
"MIT"
] | 1 | 2021-05-23T06:46:37.000Z | 2021-05-23T06:46:37.000Z | #!/usr/bin/env python
import rospy
import os
import cv2 as cv
import numpy as np
from std_msgs.msg import String
class FacialDisplay(object):
def __init__(self, path="emoji", name="happy", fullscreen=False):
self.dir = os.path.dirname(os.path.abspath(__file__))
self.path = path
self.n... | 27.884956 | 91 | 0.484608 |
8fcd362056b5c61f89154e593ea3d274ab8a6267 | 1,163 | py | Python | stratasys/cartridge.py | zyrcon/strasy | 4e9266742d31358ff7aaac46c9c0e05c0d23e917 | [
"BSD-3-Clause"
] | 1 | 2019-02-26T07:36:06.000Z | 2019-02-26T07:36:06.000Z | stratasys/cartridge.py | zyrcon/strasy | 4e9266742d31358ff7aaac46c9c0e05c0d23e917 | [
"BSD-3-Clause"
] | null | null | null | stratasys/cartridge.py | zyrcon/strasy | 4e9266742d31358ff7aaac46c9c0e05c0d23e917 | [
"BSD-3-Clause"
] | null | null | null | #
# See the LICENSE file
#
from datetime import datetime
class Cartridge:
def __init__(self, serial_number=0, material_name=None, manufacturing_lot="", manufacturing_date=datetime.today(), use_date=datetime.today(), initial_material_quantity=0.0, current_material_quantity=0.0, key_fragment=bytearray(8), version=0... | 35.242424 | 271 | 0.693895 |
06963e3a628331ea53495fc8e9e51e5e1186786c | 2,813 | py | Python | app/fednlp/data/advanced_partition/util/visualization_quantity_displot.py | ray-ruisun/FedML | 24ff30d636bb70f64e94e9ca205375033597d3dd | [
"Apache-2.0"
] | null | null | null | app/fednlp/data/advanced_partition/util/visualization_quantity_displot.py | ray-ruisun/FedML | 24ff30d636bb70f64e94e9ca205375033597d3dd | [
"Apache-2.0"
] | null | null | null | app/fednlp/data/advanced_partition/util/visualization_quantity_displot.py | ray-ruisun/FedML | 24ff30d636bb70f64e94e9ca205375033597d3dd | [
"Apache-2.0"
] | null | null | null | import os
import h5py
import argparse
import pandas as pd
import numpy as np
import json
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.spatial import distance
parser = argparse.ArgumentParser()
parser.add_argument(
"--partition_file",
type=str,
default="data/partition_fil... | 24.25 | 89 | 0.67117 |
7908958cd40a79eff1a370dfe566122bbf36b6ca | 540 | py | Python | hospital/manage.py | thirdgroup/Hospital | 4d8c84600a56eccfcdbf9482927ce2f36ee59f96 | [
"Apache-2.0"
] | null | null | null | hospital/manage.py | thirdgroup/Hospital | 4d8c84600a56eccfcdbf9482927ce2f36ee59f96 | [
"Apache-2.0"
] | null | null | null | hospital/manage.py | thirdgroup/Hospital | 4d8c84600a56eccfcdbf9482927ce2f36ee59f96 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == '__main__':
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'hospital.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are... | 33.75 | 73 | 0.687037 |
dd3f2deb14ebe81fbd10e112492636f309a5fe51 | 3,973 | py | Python | python_model_code/exploreModelCode/plotSingleRun.py | simonvanvliet/MLS_GroupDynamics | ae1efc53210e1de544072daec408613d80c14ff9 | [
"MIT"
] | null | null | null | python_model_code/exploreModelCode/plotSingleRun.py | simonvanvliet/MLS_GroupDynamics | ae1efc53210e1de544072daec408613d80c14ff9 | [
"MIT"
] | null | null | null | python_model_code/exploreModelCode/plotSingleRun.py | simonvanvliet/MLS_GroupDynamics | ae1efc53210e1de544072daec408613d80c14ff9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Nov 13 2019
Last Update Nov 13 2019
Create plots of single model run
@author: Simon van Vliet & Gil Henriques
Department of Zoology
University of Britisch Columbia
vanvliet@zoology.ubc.ca
henriques@zoology.ubc.ca
Plots result of single run
"""
"""============================... | 26.66443 | 114 | 0.583942 |
ccd6f7febe32dfbec8beab9c0d5ab022c33b2c85 | 22,752 | py | Python | tests/test_cfn_stack.py | AndersonLovelace/taskcat | d189bf7497da008388fc262427e6a3c92c3e9df8 | [
"Apache-2.0"
] | null | null | null | tests/test_cfn_stack.py | AndersonLovelace/taskcat | d189bf7497da008388fc262427e6a3c92c3e9df8 | [
"Apache-2.0"
] | null | null | null | tests/test_cfn_stack.py | AndersonLovelace/taskcat | d189bf7497da008388fc262427e6a3c92c3e9df8 | [
"Apache-2.0"
] | null | null | null | import unittest
import uuid
from datetime import datetime
from pathlib import Path
from threading import Timer
import mock
from taskcat import Config
from taskcat._cfn.stack import (
Event,
Events,
Output,
Parameter,
Resource,
Resources,
Stack,
Tags,
TestRegion,
criteria_matches... | 38.432432 | 87 | 0.610496 |
0c5cf093f64680ad0e3cdc06590fdc25d4de7686 | 1,686 | py | Python | backend/modules/conf/apps.py | OrenZhang/iWiki | 3c89bf2dbcde1eb75472c1d900e3eba55ec18698 | [
"MIT"
] | 2 | 2021-12-18T13:12:47.000Z | 2021-12-20T11:35:16.000Z | backend/modules/conf/apps.py | OrenZhang/iWiki | 3c89bf2dbcde1eb75472c1d900e3eba55ec18698 | [
"MIT"
] | 142 | 2021-12-18T13:21:51.000Z | 2022-03-31T12:40:30.000Z | backend/modules/conf/apps.py | OrenZhang/iWiki | 3c89bf2dbcde1eb75472c1d900e3eba55ec18698 | [
"MIT"
] | 2 | 2021-12-27T15:57:22.000Z | 2022-01-26T11:44:32.000Z | # -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2021 Oren Zhang
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, mo... | 36.652174 | 78 | 0.775208 |
a621ca730bfb67df330cca6842de4869a6b94434 | 315 | py | Python | gameProj/gameApp/forms.py | cs-fullstack-2019-spring/django-mini-project4-i-tayanna-and-enricka | 78314f0ce172aba1a470eb6884e07bf374d94efc | [
"Apache-2.0"
] | null | null | null | gameProj/gameApp/forms.py | cs-fullstack-2019-spring/django-mini-project4-i-tayanna-and-enricka | 78314f0ce172aba1a470eb6884e07bf374d94efc | [
"Apache-2.0"
] | null | null | null | gameProj/gameApp/forms.py | cs-fullstack-2019-spring/django-mini-project4-i-tayanna-and-enricka | 78314f0ce172aba1a470eb6884e07bf374d94efc | [
"Apache-2.0"
] | null | null | null | from django import forms
from .models import NewgameModel, CreateNewUserModel
class NewGameForm(forms.ModelForm):
class Meta:
exclude = ['collector']
model = NewgameModel
class CreateNewUserForm(forms.ModelForm):
class Meta:
exclude = ['user']
model = CreateNewUserModel | 21 | 52 | 0.692063 |
958de45995c95a6a5a7a5c9284350ee0bf5ed8da | 34,067 | py | Python | selfdrive/controls/controlsd.py | herman5/openpilot | b7ddce8bacde6de2f708af0b70ea8a20d61396f2 | [
"MIT"
] | null | null | null | selfdrive/controls/controlsd.py | herman5/openpilot | b7ddce8bacde6de2f708af0b70ea8a20d61396f2 | [
"MIT"
] | null | null | null | selfdrive/controls/controlsd.py | herman5/openpilot | b7ddce8bacde6de2f708af0b70ea8a20d61396f2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import math
from numbers import Number
from cereal import car, log
from common.numpy_fast import clip
from common.realtime import sec_since_boot, config_realtime_process, Priority, Ratekeeper, DT_CTRL
from common.profiler import Profiler
from common.params import Params, put_nonblockin... | 41.851351 | 140 | 0.701265 |
b7e1afa8833aeab7fbf2a8cb4becca39684ce174 | 3,443 | py | Python | python/pyarrow/tests/test_plasma_tf_op.py | tanyaschlusser/arrow | 77c6cd3237a2b305cf9c086cbf8d0a49be016701 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | python/pyarrow/tests/test_plasma_tf_op.py | tanyaschlusser/arrow | 77c6cd3237a2b305cf9c086cbf8d0a49be016701 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | python/pyarrow/tests/test_plasma_tf_op.py | tanyaschlusser/arrow | 77c6cd3237a2b305cf9c086cbf8d0a49be016701 | [
"Apache-2.0",
"CC0-1.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 33.427184 | 73 | 0.67296 |
9b70770190e44b17a77ec46e6746b4398bf9fb5a | 1,402 | py | Python | xos/xos/wsgi.py | wathsalav/xos | f6bcaa37a948ee41729236afe7fce0802e002404 | [
"Apache-2.0"
] | null | null | null | xos/xos/wsgi.py | wathsalav/xos | f6bcaa37a948ee41729236afe7fce0802e002404 | [
"Apache-2.0"
] | null | null | null | xos/xos/wsgi.py | wathsalav/xos | f6bcaa37a948ee41729236afe7fce0802e002404 | [
"Apache-2.0"
] | null | null | null | """
WSGI config for XOS.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` setting.
Us... | 42.484848 | 79 | 0.800999 |
a599b89e21d95a2dc11afe6b78cb179a3d1f0ec9 | 367 | py | Python | myapp/views.py | Shamsuzzaman321/djangoimageupload- | b5162e720ca86e2676d785369c3c43ae4f84b6b2 | [
"MIT"
] | 7 | 2021-02-28T17:53:19.000Z | 2022-01-18T23:06:55.000Z | myapp/views.py | Shamsuzzaman321/djangoimageupload- | b5162e720ca86e2676d785369c3c43ae4f84b6b2 | [
"MIT"
] | null | null | null | myapp/views.py | Shamsuzzaman321/djangoimageupload- | b5162e720ca86e2676d785369c3c43ae4f84b6b2 | [
"MIT"
] | 6 | 2021-03-25T05:53:05.000Z | 2021-09-06T15:57:13.000Z | from django.shortcuts import render
from .forms import ImageForm
from .models import Image
# Create your views here.
def home(request):
if request.method == "POST":
form = ImageForm(request.POST, request.FILES)
if form.is_valid():
form.save()
form = ImageForm()
img = Image.objects.all()
return render(reques... | 28.230769 | 68 | 0.716621 |
cdf5c70b5c4cf00299fc05c0a7c2d20dd9b2f06e | 87,201 | py | Python | pymatgen/core/surface.py | nicon2000/pymatgen | ca6a6110f9fa0076e2088050cd96b14d702c0801 | [
"MIT"
] | 1 | 2021-07-23T05:38:15.000Z | 2021-07-23T05:38:15.000Z | pymatgen/core/surface.py | nicon2000/pymatgen | ca6a6110f9fa0076e2088050cd96b14d702c0801 | [
"MIT"
] | null | null | null | pymatgen/core/surface.py | nicon2000/pymatgen | ca6a6110f9fa0076e2088050cd96b14d702c0801 | [
"MIT"
] | null | null | null | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from functools import reduce
from math import gcd
import math
import itertools
import logging
import warnings
import copy
import os
import json
import numpy as np
from scipy.spatial.distance import squareform
... | 44.995356 | 112 | 0.600486 |
18b4abb1f201d05eff4c03bbe74425d8ab92a62e | 3,672 | py | Python | tests/publickeyhashtest.py | zerodine/krypton | 3876b37739f0b9110f460bf1d0aec668d216a7b7 | [
"Apache-2.0"
] | 1 | 2020-11-17T16:29:52.000Z | 2020-11-17T16:29:52.000Z | tests/publickeyhashtest.py | zerodine/krypton | 3876b37739f0b9110f460bf1d0aec668d216a7b7 | [
"Apache-2.0"
] | null | null | null | tests/publickeyhashtest.py | zerodine/krypton | 3876b37739f0b9110f460bf1d0aec668d216a7b7 | [
"Apache-2.0"
] | null | null | null | import StringIO
__author__ = 'tspycher'
import unittest
#from operator import itemgetter
#import hashlib, bitstring
#import binascii
import pgpdump
from pgpdump.utils import sksHash
class PublickeyHashTest(unittest.TestCase):
pubkey = """-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: SKS 1.1.4
Comment: Hostname... | 45.9 | 72 | 0.883715 |
8f78db63071acdfec5b48228b572f6c158a6dc6c | 1,085 | py | Python | Arrays/SortArrayByParity.py | rpparas/LeetCode-Programming-Problems | d7dd4076361677a45f07c3a709b8f6188dc29e55 | [
"MIT"
] | 1 | 2019-02-18T05:01:02.000Z | 2019-02-18T05:01:02.000Z | Arrays/SortArrayByParity.py | rpparas/LeetCode-Programming-Problems | d7dd4076361677a45f07c3a709b8f6188dc29e55 | [
"MIT"
] | null | null | null | Arrays/SortArrayByParity.py | rpparas/LeetCode-Programming-Problems | d7dd4076361677a45f07c3a709b8f6188dc29e55 | [
"MIT"
] | null | null | null | # Problem Statement: https://leetcode.com/problems/sort-array-by-parity-ii/
class Solution:
def sortArrayByParityII(self, A: 'List[int]') -> 'List[int]':
odd = -1
even = -1
for i in range(len(A)):
if i % 2 == 1:
if A[i] % 2 != 1:
odd = self.f... | 26.463415 | 75 | 0.448848 |
b23d8293a2520d16d70514ce8c85e53a1c396877 | 55 | py | Python | mopidy_juliana/mem.py | schlunsen/mopidy-juliana | a771653b91875bd8ddb71923632ea05e31da3c68 | [
"Apache-2.0"
] | null | null | null | mopidy_juliana/mem.py | schlunsen/mopidy-juliana | a771653b91875bd8ddb71923632ea05e31da3c68 | [
"Apache-2.0"
] | 4 | 2020-04-08T10:08:19.000Z | 2022-01-22T10:49:52.000Z | mopidy_juliana/mem.py | schlunsen/mopidy-juliana | a771653b91875bd8ddb71923632ea05e31da3c68 | [
"Apache-2.0"
] | null | null | null | from .core import JulianaCore
juliana = JulianaCore()
| 13.75 | 29 | 0.781818 |
85dbd55510718e688159bbe430e10fff5a5ab35f | 529 | py | Python | mathgenerator/funcs/volumeCone.py | mahimadubey/mathgenerator | 32d7fe0da1cc6d80a9e6ea241b1968866044db3f | [
"MIT"
] | null | null | null | mathgenerator/funcs/volumeCone.py | mahimadubey/mathgenerator | 32d7fe0da1cc6d80a9e6ea241b1968866044db3f | [
"MIT"
] | null | null | null | mathgenerator/funcs/volumeCone.py | mahimadubey/mathgenerator | 32d7fe0da1cc6d80a9e6ea241b1968866044db3f | [
"MIT"
] | null | null | null | from .__init__ import *
from ..__init__ import Generator
def volumeCone(maxRadius=20, maxHeight=50, unit='m'):
a = random.randint(1, maxHeight)
b = random.randint(1, maxRadius)
problem = f"Volume of cone with height = {a}{unit} and radius = {b}{unit} is"
ans = int(math.pi * b * b * a * (1 / 3))
s... | 27.842105 | 81 | 0.637051 |
dfee5ab992f34421ae5596f1570f9525fb971721 | 3,180 | py | Python | testdj/testdj/settings.py | MyRookie/DjangoLearning | 1cd0a78743a7a6d00cae2a7044d657cfe5b374a8 | [
"MIT"
] | null | null | null | testdj/testdj/settings.py | MyRookie/DjangoLearning | 1cd0a78743a7a6d00cae2a7044d657cfe5b374a8 | [
"MIT"
] | null | null | null | testdj/testdj/settings.py | MyRookie/DjangoLearning | 1cd0a78743a7a6d00cae2a7044d657cfe5b374a8 | [
"MIT"
] | null | null | null | """
Django settings for testdj project.
Generated by 'django-admin startproject' using Django 1.9.6.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import os
# ... | 25.853659 | 91 | 0.698428 |
233a181273370998f18fe7feafd63d7ec9d33a79 | 821 | py | Python | generateur/pdf/catalogue.py | loleni/genpdf-python3 | 31a1dfa0ef53f3c6f7a1fa6ea6d4e775bf189890 | [
"MIT"
] | null | null | null | generateur/pdf/catalogue.py | loleni/genpdf-python3 | 31a1dfa0ef53f3c6f7a1fa6ea6d4e775bf189890 | [
"MIT"
] | null | null | null | generateur/pdf/catalogue.py | loleni/genpdf-python3 | 31a1dfa0ef53f3c6f7a1fa6ea6d4e775bf189890 | [
"MIT"
] | 1 | 2021-12-17T09:35:56.000Z | 2021-12-17T09:35:56.000Z | from .nom import NomPDF
from .dictionnaire import DictionnairePDF
class CataloguePDF(DictionnairePDF):
"""Un catalogue PDF est un dictionnaire avec des clés obligatoires.
Clés obligatoires :
- Type = Catalog
- Pages = une référence vers la page racine du document
Exemple :
<<
/T... | 23.457143 | 71 | 0.639464 |
952af14788fb1ba4b76c1e7c81f5d2e86479f4e5 | 365 | py | Python | setup/plumed.py | SinHouse/qm3 | b2436ad813dd13c0c14bdee5d95f30436bc0a04d | [
"MIT"
] | null | null | null | setup/plumed.py | SinHouse/qm3 | b2436ad813dd13c0c14bdee5d95f30436bc0a04d | [
"MIT"
] | null | null | null | setup/plumed.py | SinHouse/qm3 | b2436ad813dd13c0c14bdee5d95f30436bc0a04d | [
"MIT"
] | null | null | null | from distutils.core import setup, Extension
plumed = "/Users/smarti/Devel/plumed2/dist_gnu"
setup(
name = "Plumed hooks",
ext_modules = [
Extension( "_plumed",
sources = [ "qm3/engines/plumed.c" ],
include_dirs = [ plumed + "/include/plumed/wrapper", plumed + "/include" ],
library_dirs = [ plumed + "/... | 22.8125 | 78 | 0.635616 |
90f38108265f5b09cd5bbf5691e147bd32d71717 | 23,771 | py | Python | src/dataops/ops.py | japesone/ontask_b | 17af441f9893c521d2e14011e7790ba4077e3318 | [
"MIT"
] | null | null | null | src/dataops/ops.py | japesone/ontask_b | 17af441f9893c521d2e14011e7790ba4077e3318 | [
"MIT"
] | null | null | null | src/dataops/ops.py | japesone/ontask_b | 17af441f9893c521d2e14011e7790ba4077e3318 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from builtins import zip
import numpy as np
import pandas as pd
from django.conf import settings
from django.utils.translation import ugettext_lazy as _, gettext
from action.models import Condition, Action
from dataops import formula_evaluation
from dataops.pandas_db import (
create_table... | 38.77814 | 80 | 0.643641 |
3433e3570d37e7b60aedda91ff0088767c6d5c02 | 1,284 | py | Python | data_mine/nlp/RACE/utils.py | SebiSebi/DataMine | d2dd9ed7e2608918dd2908fa29238f600c768eb3 | [
"Apache-2.0"
] | 9 | 2020-07-01T21:53:36.000Z | 2020-12-15T08:49:08.000Z | data_mine/nlp/RACE/utils.py | ChewKokWah/DataMine | d2dd9ed7e2608918dd2908fa29238f600c768eb3 | [
"Apache-2.0"
] | 7 | 2020-04-04T19:30:16.000Z | 2020-06-26T12:18:10.000Z | data_mine/nlp/RACE/utils.py | ChewKokWah/DataMine | d2dd9ed7e2608918dd2908fa29238f600c768eb3 | [
"Apache-2.0"
] | 2 | 2020-03-21T13:55:27.000Z | 2020-07-01T21:53:38.000Z | import os
from .types import RACEType
from .constants import RACE_CACHE_DIR
def next_question_id(next_ids, id_base):
"""
Incrementally fetches the next question ID based on the base passage ID.
Some questions have the same ID in the RACE dataset (if they are
in the same file). We try to make those u... | 31.317073 | 76 | 0.696262 |
799efa1555c408b1ddcec61ad9acab1c9479769d | 294 | py | Python | tests/y2018/test_2018_d6.py | ErikThorsell/advent-of-code-python | 8afb3d2dd731b77a421eff9dbd33d1f6a9dfbee3 | [
"MIT"
] | 2 | 2021-12-03T16:17:13.000Z | 2022-01-27T12:29:45.000Z | tests/y2018/test_2018_d6.py | ErikThorsell/advent-of-code-python | 8afb3d2dd731b77a421eff9dbd33d1f6a9dfbee3 | [
"MIT"
] | null | null | null | tests/y2018/test_2018_d6.py | ErikThorsell/advent-of-code-python | 8afb3d2dd731b77a421eff9dbd33d1f6a9dfbee3 | [
"MIT"
] | 1 | 2021-12-29T20:38:38.000Z | 2021-12-29T20:38:38.000Z | """TEST MODULE TEMPLATE"""
from advent_of_code.y2018.d6 import solution_1
from advent_of_code.y2018.d6 import solution_2
def test_solution_1():
example_input = [(1, 1), (1, 6), (8, 3), (3, 4), (5, 5), (8, 9)]
example_result = 17
assert solution_1(example_input) == example_result
| 29.4 | 68 | 0.687075 |
78be9ee319f26a32cd845912988485b1b0d02f38 | 688 | py | Python | src/testcase/GN_APP/case/GN_APP_THEME_STYLE/GN_APP_THEME_STYLE_006.py | maiyajj/AutoTest_script-Appium_Connect | f9c2c42c281a9e2f984acb4a72dda0694b053f22 | [
"Apache-2.0"
] | 28 | 2017-11-10T00:19:16.000Z | 2022-02-19T16:42:05.000Z | src/testcase/GN_APP/case/GN_APP_THEME_STYLE/GN_APP_THEME_STYLE_006.py | maiyajj/AutoTest_script-Appium_Connect | f9c2c42c281a9e2f984acb4a72dda0694b053f22 | [
"Apache-2.0"
] | null | null | null | src/testcase/GN_APP/case/GN_APP_THEME_STYLE/GN_APP_THEME_STYLE_006.py | maiyajj/AutoTest_script-Appium_Connect | f9c2c42c281a9e2f984acb4a72dda0694b053f22 | [
"Apache-2.0"
] | 23 | 2017-08-22T06:12:19.000Z | 2021-09-18T05:45:41.000Z | # coding=utf-8
from src.testcase.GN_APP.WidgetOperation import *
class GNAPPThemeStyle6(WidgetOperation):
@case_run(False)
def run(self):
self.case_module = u"主题风格" # 用例所属模块
self.case_title = u'页面检查' # 用例名称
self.zentao_id = "1985" # 禅道ID
# 用例动作
def case(self):
self.... | 31.272727 | 79 | 0.62064 |
350b41769957c4c151ffd5af7223847d87d9637c | 4,474 | py | Python | vertex/test/test_conncache.py | glyph/vertex | fb98a5e4caf92da2f472c7caca14abd17445623b | [
"MIT"
] | 1 | 2019-03-29T19:53:39.000Z | 2019-03-29T19:53:39.000Z | vertex/test/test_conncache.py | glyph/vertex | fb98a5e4caf92da2f472c7caca14abd17445623b | [
"MIT"
] | null | null | null | vertex/test/test_conncache.py | glyph/vertex | fb98a5e4caf92da2f472c7caca14abd17445623b | [
"MIT"
] | null | null | null | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{vertex.conncache}.
"""
from twisted.internet.protocol import ClientFactory, Protocol
from twisted.internet.defer import Deferred
from twisted.trial.unittest import TestCase
from twisted.test.proto_helpers import StringTransport
f... | 29.826667 | 77 | 0.677693 |
b6d222bb35d35bc513b1e1dc5631d848aced636b | 2,513 | py | Python | src/cadati/conv_doy.py | wpreimes/cadati | 59beb7c7fbcd32aaaee8b334a81d3e56b8a98123 | [
"MIT"
] | null | null | null | src/cadati/conv_doy.py | wpreimes/cadati | 59beb7c7fbcd32aaaee8b334a81d3e56b8a98123 | [
"MIT"
] | null | null | null | src/cadati/conv_doy.py | wpreimes/cadati | 59beb7c7fbcd32aaaee8b334a81d3e56b8a98123 | [
"MIT"
] | null | null | null | # Copyright (c) 2020, TU Wien, Department of Geodesy and Geoinformation
# Distributed under the MIT License (see LICENSE.txt)
"""
Module provides functions related to day of year conversions.
"""
import numpy as np
from cadati.jd_date import jd2cal
from cadati.np_date import dt2cal
from cadati.check_date import is_... | 25.907216 | 74 | 0.622364 |
599128feaaf182dc884cabe551babfcc8ed92f63 | 35,549 | py | Python | launchdarkly_api/model/post_approval_request_apply_request.py | launchdarkly/api-client-python | b72bd94fb65ac57bd95df5767aebcdaff50e5cb6 | [
"Apache-2.0"
] | 6 | 2020-02-06T20:17:25.000Z | 2021-12-28T20:13:34.000Z | launchdarkly_api/model/post_approval_request_apply_request.py | launchdarkly/api-client-python | b72bd94fb65ac57bd95df5767aebcdaff50e5cb6 | [
"Apache-2.0"
] | 7 | 2019-02-18T21:51:47.000Z | 2021-09-03T17:49:33.000Z | launchdarkly_api/model/post_approval_request_apply_request.py | launchdarkly/api-client-python | b72bd94fb65ac57bd95df5767aebcdaff50e5cb6 | [
"Apache-2.0"
] | 6 | 2019-08-02T16:10:31.000Z | 2021-05-23T17:47:03.000Z | # -*- coding: utf-8 -*-
"""
LaunchDarkly REST API
# Overview ## Authentication All REST API resources are authenticated with either [personal or service access tokens](https://docs.launchdarkly.com/home/account-security/api-access-tokens), or session cookies. Other authentication mechanisms are not supporte... | 137.254826 | 24,467 | 0.637936 |
6899e3e3722286506e75b263db95a1640fddeaaf | 8,495 | py | Python | hlsclt/build_commands/build_commands.py | qarlosalberto/hlsclt | cc657b780aac3a617f48c1a80e263a6945f8b7c9 | [
"MIT"
] | 34 | 2017-07-03T09:56:11.000Z | 2022-03-22T02:03:27.000Z | hlsclt/build_commands/build_commands.py | qarlosalberto/hlsclt | cc657b780aac3a617f48c1a80e263a6945f8b7c9 | [
"MIT"
] | 22 | 2017-06-18T03:49:02.000Z | 2021-10-06T12:41:09.000Z | hlsclt/build_commands/build_commands.py | qarlosalberto/hlsclt | cc657b780aac3a617f48c1a80e263a6945f8b7c9 | [
"MIT"
] | 11 | 2018-06-02T04:38:26.000Z | 2021-06-10T11:57:27.000Z | # -*- coding: utf-8 -*-
""" Build related subcommands for HLSCLT.
Copyright (c) 2017 Ben Marshall
"""
### Imports ###
import click
import os
import subprocess
from hlsclt.helper_funcs import find_solution_num
from hlsclt.report_commands.report_commands import open_report
import shutil
### Supporting Functions ###
# ... | 41.847291 | 196 | 0.673102 |
666ffb3c67ae32d7fa533279cc278c407541ad92 | 40,931 | py | Python | App01_Env/lib/python3.9/site-packages/pylint/checkers/strings.py | Vuyani-Magibisela/App001 | 1a8fb63892bd622d9f016b66619e346bf90be186 | [
"MIT"
] | null | null | null | App01_Env/lib/python3.9/site-packages/pylint/checkers/strings.py | Vuyani-Magibisela/App001 | 1a8fb63892bd622d9f016b66619e346bf90be186 | [
"MIT"
] | null | null | null | App01_Env/lib/python3.9/site-packages/pylint/checkers/strings.py | Vuyani-Magibisela/App001 | 1a8fb63892bd622d9f016b66619e346bf90be186 | [
"MIT"
] | null | null | null | # Copyright (c) 2009-2014 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
# Copyright (c) 2010 Daniel Harding <dharding@gmail.com>
# Copyright (c) 2012-2014 Google, Inc.
# Copyright (c) 2013-2020 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2014 Brett Cannon <brett@python.org>
# Copyright (c) 2014 Arun Persau... | 40.326108 | 98 | 0.565684 |
245ec7e63d9b764586560b139a421611a908f480 | 23,434 | py | Python | pyscf/nao/test/test_0015_ls_contributing.py | KMCzajkowski/pyscf | e8af41d910cc0d3963655120c0b689590ad978e7 | [
"BSD-2-Clause"
] | null | null | null | pyscf/nao/test/test_0015_ls_contributing.py | KMCzajkowski/pyscf | e8af41d910cc0d3963655120c0b689590ad978e7 | [
"BSD-2-Clause"
] | null | null | null | pyscf/nao/test/test_0015_ls_contributing.py | KMCzajkowski/pyscf | e8af41d910cc0d3963655120c0b689590ad978e7 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import print_function, division
import unittest
from pyscf import gto
import os
ag_s7l7_wonatoms = """
H 2.346340 -0.000093 -1.449987
H 2.346702 -0.000095 1.450132
H -2.345370 -0.000086 -1.449228
H -2.345734 -0.000089 1.449376
H -1.449887 2.346112 -0.000046... | 38.798013 | 64 | 0.561364 |
f6af4d85431c413956502a4a793ed0636ab5d121 | 45,166 | py | Python | tests/core/test_processor.py | praneethgb/rasa | 5bf227f165d0b041a367d2c0bbf712ebb6a54792 | [
"Apache-2.0"
] | 8 | 2020-09-16T17:22:13.000Z | 2022-02-01T00:11:30.000Z | tests/core/test_processor.py | praneethgb/rasa | 5bf227f165d0b041a367d2c0bbf712ebb6a54792 | [
"Apache-2.0"
] | 216 | 2020-09-20T13:05:58.000Z | 2022-03-28T12:10:24.000Z | tests/core/test_processor.py | praneethgb/rasa | 5bf227f165d0b041a367d2c0bbf712ebb6a54792 | [
"Apache-2.0"
] | 1 | 2021-08-25T03:16:20.000Z | 2021-08-25T03:16:20.000Z | import asyncio
import datetime
import freezegun
import pytest
import time
import uuid
import json
from _pytest.monkeypatch import MonkeyPatch
from _pytest.logging import LogCaptureFixture
from aioresponses import aioresponses
from typing import Optional, Text, List, Callable, Type, Any
from unittest.mock import patch, ... | 33.283714 | 88 | 0.703914 |
91cd90ff38ae1b80d82d02cd208305cf6a834608 | 9,015 | py | Python | app/main/views.py | omarmhamza/pi-vault | 140f8c225daca78ce3ad0aefc3a4f5e94f6a9262 | [
"Unlicense"
] | 3 | 2021-01-23T07:49:24.000Z | 2021-01-29T13:13:25.000Z | app/main/views.py | omarmhamza/pi-vault | 140f8c225daca78ce3ad0aefc3a4f5e94f6a9262 | [
"Unlicense"
] | null | null | null | app/main/views.py | omarmhamza/pi-vault | 140f8c225daca78ce3ad0aefc3a4f5e94f6a9262 | [
"Unlicense"
] | null | null | null | from datetime import datetime
import pymongo
from flask import render_template, session, redirect, url_for, request, flash, abort, current_app
from flask_login import login_user, login_required, logout_user, fresh_login_required, current_user
from is_safe_url import is_safe_url
from .forms import AddPasswordField, Logi... | 37.878151 | 119 | 0.591681 |
f50462da9c4d212da44cf770652c64dd623afbba | 1,629 | py | Python | examples/pesum_kediyaram/sorkal.py | subramani95/open-tamil | eadb7192b685a5cdd6b1c86e7157b92a94a52e4d | [
"MIT"
] | null | null | null | examples/pesum_kediyaram/sorkal.py | subramani95/open-tamil | eadb7192b685a5cdd6b1c86e7157b92a94a52e4d | [
"MIT"
] | null | null | null | examples/pesum_kediyaram/sorkal.py | subramani95/open-tamil | eadb7192b685a5cdd6b1c86e7157b92a94a52e4d | [
"MIT"
] | null | null | null | # -*- coding: utf8 -*-
# This file is distributed under MIT License
# 2015 Muthiah Annamalai <ezhillang@gmail.com>
#
units = (u'பூஜ்ஜியம்', u'ஒன்று', u'இரண்டு', u'மூன்று', u'நான்கு', u'ஐந்து', u'ஆறு', u'ஏழு', u'எட்டு', u'ஒன்பது', u'பத்து') # 0-10
teens = (u'பதினொன்று', u' பனிரண்டு', u'பதிமூன்று', u'பதினான்கு', u'பதினைந... | 58.178571 | 155 | 0.569675 |
eadc921eeb1a418182a8c697114e9bf08206e7f3 | 942 | py | Python | src/clean_crime.py | wmaciel/van-crime | e70d0310f41de3a1b54572f6c6bf01083e56e0ab | [
"MIT"
] | 2 | 2016-03-03T00:14:59.000Z | 2016-08-21T14:28:02.000Z | src/clean_crime.py | wmaciel/van-crime | e70d0310f41de3a1b54572f6c6bf01083e56e0ab | [
"MIT"
] | null | null | null | src/clean_crime.py | wmaciel/van-crime | e70d0310f41de3a1b54572f6c6bf01083e56e0ab | [
"MIT"
] | null | null | null | __author__ = 'walthermaciel'
from utilities import utm_to_latlong
def main():
crime_fp = open('../data/crime_03_15/crime_csv_all_years.csv', 'r')
clean_fp = open('../data/crime_03_15/crime_latlong.csv', 'w')
for line in crime_fp:
cols = line.strip().split(',')
crime_type, year, month, hund... | 29.4375 | 130 | 0.537155 |
8beacf7fc7fb17732c4f86597d5bf1c5e56242f6 | 2,052 | py | Python | menuinst/freedesktop.py | ericpre/menuinst | dae53065e9e82a3352b817cca5895a9b271ddfdb | [
"BSD-3-Clause"
] | 24 | 2015-06-08T17:52:26.000Z | 2021-03-05T09:23:26.000Z | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/menuinst/freedesktop.py | anstkosh/PTVS | 1854ab3d6397e66765697bb63d898aec16d0406e | [
"Apache-2.0"
] | 72 | 2021-07-11T18:52:03.000Z | 2022-03-15T06:50:29.000Z | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/menuinst/freedesktop.py | anstkosh/PTVS | 1854ab3d6397e66765697bb63d898aec16d0406e | [
"Apache-2.0"
] | 28 | 2015-09-21T17:27:12.000Z | 2021-05-31T10:37:30.000Z | # Copyright (c) 2008-2011 by Enthought, Inc.
# All rights reserved.
def make_desktop_entry(d):
"""
Create a desktop entry that conforms to the format of the Desktop Entry
Specification by freedesktop.org. See:
http://freedesktop.org/Standards/desktop-entry-spec
These should work for both ... | 26.307692 | 79 | 0.646199 |
312c35a426a73d79b832cf901acd5a477edacd99 | 9,008 | py | Python | onmt/decoders/transformer.py | ymoslem/OpenNMT-py | 70fb14621aa573e84a498c64fc615cddedf22c87 | [
"MIT"
] | 1 | 2019-04-12T08:37:28.000Z | 2019-04-12T08:37:28.000Z | onmt/decoders/transformer.py | joker298/OpenNMT-py | fae4d620ff94113e9c0cb2cd4e71e46635b79aa9 | [
"MIT"
] | null | null | null | onmt/decoders/transformer.py | joker298/OpenNMT-py | fae4d620ff94113e9c0cb2cd4e71e46635b79aa9 | [
"MIT"
] | null | null | null | """
Implementation of "Attention is All You Need"
"""
import torch
import torch.nn as nn
from onmt.decoders.decoder import DecoderBase
from onmt.modules import MultiHeadedAttention, AverageAttention
from onmt.modules.position_ffn import PositionwiseFeedForward
class TransformerDecoderLayer(nn.Module):
"""
A... | 36.617886 | 79 | 0.589143 |
a99754b06dd87f89fa043334744c7a25d05922cc | 4,624 | py | Python | src/track.py | EddyDavies/Twitter_Representative_Sample | e63386f174ea9b34108ed0051dcd5531901a1a32 | [
"MIT"
] | 1 | 2021-09-11T15:23:26.000Z | 2021-09-11T15:23:26.000Z | src/track.py | EddyDavies/Twitter_Representative_Sample | e63386f174ea9b34108ed0051dcd5531901a1a32 | [
"MIT"
] | null | null | null | src/track.py | EddyDavies/Twitter_Representative_Sample | e63386f174ea9b34108ed0051dcd5531901a1a32 | [
"MIT"
] | null | null | null | from datetime import datetime
from random import randrange
from mongo import db, months, query
from utils import get_date_range, twitter_date_format_to_day, get_month_array, twitter_date_format_to_time
from decorators import accept_duplicates
from count_or_search import count, form_count_query_params
def check_count... | 30.421053 | 122 | 0.648789 |
4a4499d08303b45cbe9aab054aa51e2589bb5555 | 384 | py | Python | KeyPressModule.py | ChijunShen/TelloPythonControl | d78c98c053c264d669021b02f635884c68f1ac4c | [
"Apache-2.0"
] | 1 | 2022-03-01T05:21:43.000Z | 2022-03-01T05:21:43.000Z | KeyPressModule.py | ChijunShen/TelloPythonControl | d78c98c053c264d669021b02f635884c68f1ac4c | [
"Apache-2.0"
] | null | null | null | KeyPressModule.py | ChijunShen/TelloPythonControl | d78c98c053c264d669021b02f635884c68f1ac4c | [
"Apache-2.0"
] | null | null | null | import pygame
def init():
pygame.init()
win = pygame.display.set_mode((400, 400))
def getKey(keyName):
ans = False
for eve in pygame.event.get(): pass
keyInput = pygame.key.get_pressed()
myKey = getattr(pygame,'K_{}'.format(keyName))
if keyInput[myKey]:
ans = True
pygame.displa... | 21.333333 | 50 | 0.630208 |
3fd42c674fe3bf48bd6f48d3dc41d901881b3588 | 195 | py | Python | config.py | dddzg/MoCo | 94125b06235032cf74768709bac36e3ffbeb3f7c | [
"MIT"
] | 41 | 2019-12-04T09:56:22.000Z | 2022-02-10T13:07:37.000Z | config.py | dddzg/MoCo | 94125b06235032cf74768709bac36e3ffbeb3f7c | [
"MIT"
] | 5 | 2020-03-17T06:53:33.000Z | 2021-01-16T20:15:14.000Z | config.py | dddzg/MoCo | 94125b06235032cf74768709bac36e3ffbeb3f7c | [
"MIT"
] | 6 | 2019-12-21T06:50:58.000Z | 2021-12-04T20:48:16.000Z | BATCH_SIZE = 256
import torch
GPU_ID = 0
DEVICE = torch.device(f'cuda:{GPU_ID}')
QUEUE_LENGTH = 4096
FILE_PATH = './models/cifar_wideresnet'
MODEL = 'wideresnet'
RESUME = None
ALL_EPOCHS = 180
| 16.25 | 39 | 0.738462 |
dbfbb1a46100272a4432716ed2e143ff84cdf743 | 751 | py | Python | test.py | leonasci02/devopslab | bb7b12e3db382b91b1be7b5bb2a0ad6b1ec90d3a | [
"MIT"
] | null | null | null | test.py | leonasci02/devopslab | bb7b12e3db382b91b1be7b5bb2a0ad6b1ec90d3a | [
"MIT"
] | null | null | null | test.py | leonasci02/devopslab | bb7b12e3db382b91b1be7b5bb2a0ad6b1ec90d3a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from app import app
import unittest
class Test(unittest.TestCase):
def setUp(self):
# cria uma instância do unittest, precisa do nome "setUp"
self.app = app.test_client()
# envia uma requisicao GET para a URL
self.result = self.app.get('/')
... | 37.55 | 147 | 0.521971 |
391d4ddc8212d8cb19d5aad1eadd50c474e8280f | 6,300 | py | Python | recipes/mozjpeg/all/conanfile.py | flexferrum/conan-center-index | 5d0fb36e1e0b757e6deebc330c34d07dc1a5a7a5 | [
"MIT"
] | 3 | 2020-04-16T15:01:33.000Z | 2022-01-13T08:05:47.000Z | recipes/mozjpeg/all/conanfile.py | flexferrum/conan-center-index | 5d0fb36e1e0b757e6deebc330c34d07dc1a5a7a5 | [
"MIT"
] | 33 | 2020-02-18T15:54:50.000Z | 2022-03-28T08:54:10.000Z | recipes/mozjpeg/all/conanfile.py | GavinNL/conan-center-index | 0ae829a362c1cc6a20d97e023ca0aafc805797c3 | [
"MIT"
] | 8 | 2020-03-06T14:38:18.000Z | 2022-03-28T08:41:15.000Z | from conans import ConanFile, AutoToolsBuildEnvironment, CMake, tools
import os
import glob
class MozjpegConan(ConanFile):
name = "mozjpeg"
description = "MozJPEG is an improved JPEG encoder"
url = "https://github.com/conan-io/conan-center-index"
topics = ("conan", "image", "format", "mozjpeg", "jpg",... | 42.857143 | 105 | 0.616825 |
5373198bdb538afee89a27b5c90172416b4683ba | 13,022 | py | Python | manila_tempest_tests/tests/scenario/test_share_basic_ops.py | scality/manila | b4a67d033cdcbc1389ae52f35ad281be7a18c9ae | [
"Apache-2.0"
] | 1 | 2015-05-28T22:28:08.000Z | 2015-05-28T22:28:08.000Z | manila_tempest_tests/tests/scenario/test_share_basic_ops.py | scality/manila | b4a67d033cdcbc1389ae52f35ad281be7a18c9ae | [
"Apache-2.0"
] | 5 | 2015-08-13T15:17:28.000Z | 2016-08-02T02:55:01.000Z | manila_tempest_tests/tests/scenario/test_share_basic_ops.py | scality/manila | b4a67d033cdcbc1389ae52f35ad281be7a18c9ae | [
"Apache-2.0"
] | 2 | 2015-08-29T08:19:58.000Z | 2016-08-02T02:46:10.000Z | # Copyright 2015 Deutsche Telekom AG
# 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 requi... | 39.70122 | 79 | 0.616649 |
1f6978a0f5b0417b39568f734ea6fef28df1861e | 9,513 | py | Python | django/cantusdb_project/main_app/tests/make_fakes.py | DDMAL/CantusDB | 63c7b8df3c703008bd331097c7fb5e72c8890bb0 | [
"MIT"
] | 2 | 2020-10-16T09:50:54.000Z | 2021-07-29T08:38:34.000Z | django/cantusdb_project/main_app/tests/make_fakes.py | DDMAL/CantusDB | 63c7b8df3c703008bd331097c7fb5e72c8890bb0 | [
"MIT"
] | 65 | 2020-05-11T19:22:30.000Z | 2022-03-30T22:30:02.000Z | django/cantusdb_project/main_app/tests/make_fakes.py | DDMAL/CantusDB | 63c7b8df3c703008bd331097c7fb5e72c8890bb0 | [
"MIT"
] | null | null | null | """Functions to make fake objects to be used for testing"""
import random
from faker import Faker
from main_app.models import Century
from main_app.models import Chant
from main_app.models import Feast
from main_app.models import Genre
from main_app.models import Indexer
from main_app.models import Notation
from main_... | 35.898113 | 85 | 0.715232 |
bb2e340dd4831e35a7f16e0cac3ac6efb611789b | 969 | py | Python | Aulas_2/Aula45/Aula51a.py | Sofista23/Aula2_Python | 134d51bd7a33d753489ad2970a4f289273c93832 | [
"MIT"
] | null | null | null | Aulas_2/Aula45/Aula51a.py | Sofista23/Aula2_Python | 134d51bd7a33d753489ad2970a4f289273c93832 | [
"MIT"
] | null | null | null | Aulas_2/Aula45/Aula51a.py | Sofista23/Aula2_Python | 134d51bd7a33d753489ad2970a4f289273c93832 | [
"MIT"
] | null | null | null | import sqlite3
from sqlite3 import Error
#Criar Conexão
def conexaoBanco():
path="C:\\Users\\João Pedro Martins\\Documents\\PROGRAMAÇÃO\\Python\\Aulas_2\\Aula45\\Agenda.db"
con=None
try:
con=sqlite3.connect(path)
except Error as ex:
print(ex)
return con
vcon=conexaoBanco()
id=i... | 20.617021 | 100 | 0.622291 |
520a1689e33c0f9c4894ea92d34c2cc71317de19 | 283 | py | Python | main.py | Telchar22/AI-Chexpert | 8e60b06a204752f87b4800c5e43834e390ea9768 | [
"Apache-2.0"
] | null | null | null | main.py | Telchar22/AI-Chexpert | 8e60b06a204752f87b4800c5e43834e390ea9768 | [
"Apache-2.0"
] | null | null | null | main.py | Telchar22/AI-Chexpert | 8e60b06a204752f87b4800c5e43834e390ea9768 | [
"Apache-2.0"
] | null | null | null | #import tensorflow as tf
from Settings import settings as s
from Data_Handler import Load_Data_Frames as l
import os
import glob
from pathlib import Path
from Template_Matching import TemplateMatching as T
import cv2
import pandas as pd
if __name__ == '__main__':
print('Hello')
| 23.583333 | 51 | 0.805654 |
80dc4f0e85775888dc763bd63f358080deb249c4 | 12,105 | py | Python | src/container/kube-manager/kube_manager/vnc/vnc_endpoints.py | kaweue/contrail-controller | 66a8f1d13e2c28ddae6b5a5be6f068a03bea94e3 | [
"Apache-2.0"
] | null | null | null | src/container/kube-manager/kube_manager/vnc/vnc_endpoints.py | kaweue/contrail-controller | 66a8f1d13e2c28ddae6b5a5be6f068a03bea94e3 | [
"Apache-2.0"
] | null | null | null | src/container/kube-manager/kube_manager/vnc/vnc_endpoints.py | kaweue/contrail-controller | 66a8f1d13e2c28ddae6b5a5be6f068a03bea94e3 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
#
"""
VNC endpoints management for kubernetes
"""
from cfgm_common import importutils
from kube_manager.vnc.config_db import (
DBBaseKM, InstanceIpKM, LoadbalancerKM, LoadbalancerListenerKM,
LoadbalancerMemberKM, LoadbalancerPoolKM, VirtualMa... | 37.593168 | 80 | 0.583147 |
a728da82361a75be3f64c71ade0ec4c1b0654ebb | 1,192 | py | Python | Python/totient.py | IshankAgarwal/simple-maths | 90ea4eaed7a49da7f321fbd6fa89f265a49cfeb2 | [
"MIT"
] | 1 | 2020-03-07T09:37:26.000Z | 2020-03-07T09:37:26.000Z | Python/totient.py | IshankAgarwal/simple-maths | 90ea4eaed7a49da7f321fbd6fa89f265a49cfeb2 | [
"MIT"
] | null | null | null | Python/totient.py | IshankAgarwal/simple-maths | 90ea4eaed7a49da7f321fbd6fa89f265a49cfeb2 | [
"MIT"
] | null | null | null | from prime_factor import prime_factors
from product import product
def totient(num):
"""
Counts the numbers that are relative prime to the number.
This means that if a number 'x' has common divisors with another number 'a' lower than itself,
it is, 'a' is not relative prime to 'x'.
This means that... | 44.148148 | 98 | 0.66443 |
83af9ead91b23e573f6924e45d3a29c5597ff016 | 809 | py | Python | setup.py | sibowler/airtouch4pyapi | 0fa3d9b9a16da8675ebbdbdcd468277e7762ef06 | [
"MIT"
] | null | null | null | setup.py | sibowler/airtouch4pyapi | 0fa3d9b9a16da8675ebbdbdcd468277e7762ef06 | [
"MIT"
] | null | null | null | setup.py | sibowler/airtouch4pyapi | 0fa3d9b9a16da8675ebbdbdcd468277e7762ef06 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="airtouch4pyapi", # Replace with your own username
version="1.0.1",
author="Sam Sinnamon",
author_email="samsinnamon@hotmail.com",
description="An api allowing control of AC state (temperat... | 35.173913 | 127 | 0.688504 |
58d4450027f8b5d321780fd390b6985188763634 | 907 | py | Python | python/day05/craps.py | houbin/recipes | 2ca4008ae2409bfbc79fd6b664d492a616e745a8 | [
"MIT"
] | null | null | null | python/day05/craps.py | houbin/recipes | 2ca4008ae2409bfbc79fd6b664d492a616e745a8 | [
"MIT"
] | null | null | null | python/day05/craps.py | houbin/recipes | 2ca4008ae2409bfbc79fd6b664d492a616e745a8 | [
"MIT"
] | null | null | null | import random
player_win=0
banker_win=0
for i in range(1, 1000000):
x = random.randint(1, 6)
y = random.randint(1, 6)
#print(x)
if x + y == 7 or x + y == 11:
#print('玩家win: %d %d' %(x, y))
player_win += 1
elif x + y == 2 or x + y == 3 or x + y == 12:
#print('庄家win: %d %d' %... | 25.914286 | 64 | 0.414553 |
77879eee41e3b716229e95e2e65c2641ace4af97 | 2,072 | py | Python | td.py | yjnanan/Model_Free_Prediction | 135762a330ce6879973f005f370c886e53491922 | [
"Apache-2.0"
] | null | null | null | td.py | yjnanan/Model_Free_Prediction | 135762a330ce6879973f005f370c886e53491922 | [
"Apache-2.0"
] | null | null | null | td.py | yjnanan/Model_Free_Prediction | 135762a330ce6879973f005f370c886e53491922 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import random
import matplotlib.pyplot as plt
# define the transmission matrix
# States : T1,A,B,C,D,E,T2
def random_pick(some_list, probabilities):
x = random.uniform(0,1)
cumulative_probability = 0.0
for item, item_probability in zip(some_list, probabilities):
cumulative_probab... | 28.383562 | 102 | 0.545849 |
6183ec449e1c890b57979947866225df1e58ae14 | 547 | py | Python | config/urls.py | devmiguelangel/cride | 8593eb76291ff8af46a93b5625304766f95b2347 | [
"MIT"
] | null | null | null | config/urls.py | devmiguelangel/cride | 8593eb76291ff8af46a93b5625304766f95b2347 | [
"MIT"
] | null | null | null | config/urls.py | devmiguelangel/cride | 8593eb76291ff8af46a93b5625304766f95b2347 | [
"MIT"
] | null | null | null | """Main URLs module."""
from django.conf import settings
from django.urls import path, include
from django.conf.urls.static import static
from django.contrib import admin
urlpatterns = [
# Django Admin
path(settings.ADMIN_URL, admin.site.urls),
path('', include(('cride.users.urls', 'users'), namespace='us... | 34.1875 | 78 | 0.703839 |
e55e7f12f0b95e4295c07b7009063189bae11cb0 | 36,439 | py | Python | chemprop/args.py | googleak28282/chemprop | 651fa43bb21f96526eeeb575a9b544a739c9fd27 | [
"MIT"
] | 1 | 2022-02-19T14:04:20.000Z | 2022-02-19T14:04:20.000Z | chemprop/args.py | googleak28282/chemprop | 651fa43bb21f96526eeeb575a9b544a739c9fd27 | [
"MIT"
] | null | null | null | chemprop/args.py | googleak28282/chemprop | 651fa43bb21f96526eeeb575a9b544a739c9fd27 | [
"MIT"
] | null | null | null | import json
import os
from tempfile import TemporaryDirectory
import pickle
from typing import List, Optional, Tuple
from typing_extensions import Literal
import torch
from tap import Tap # pip install typed-argument-parser (https://github.com/swansonk14/typed-argument-parser)
import chemprop.data.utils
from chempro... | 45.662907 | 185 | 0.679739 |
8849096d243904454675111491a04d899d247e48 | 9,806 | py | Python | extras/elmerspline.py | TUTElectromechanics/mm-codegen | 02d97557e08cbeb3d53470934f471a6ede723570 | [
"BSD-2-Clause"
] | 2 | 2019-06-24T17:36:25.000Z | 2021-01-02T15:19:23.000Z | extras/elmerspline.py | TUTElectromechanics/mm-codegen | 02d97557e08cbeb3d53470934f471a6ede723570 | [
"BSD-2-Clause"
] | null | null | null | extras/elmerspline.py | TUTElectromechanics/mm-codegen | 02d97557e08cbeb3d53470934f471a6ede723570 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Python implementation of the spline routines in Elmer's GeneralUtils.F90.
This module provides compatibility with the finite element software Elmer.
You can provide your own (x,y) data points, and get cubic spline coefficients
in the format Elmer uses.
Mapping of rout... | 32.795987 | 98 | 0.547624 |
b950e3c1027f94d568df3ea6630c9beae1e0c2a0 | 1,002 | py | Python | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/api_lib/cloudbuild/cloudbuild_util.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/api_lib/cloudbuild/cloudbuild_util.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/.install/.backup/lib/googlecloudsdk/api_lib/cloudbuild/cloudbuild_util.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:09:01.000Z | 2020-07-25T12:09:01.000Z | # Copyright 2016 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... | 31.3125 | 80 | 0.774451 |
2a7cb8f6a2d213cb8fc19285195d424cb2e4ec9e | 12,003 | py | Python | bincrafters/generate_ci_jobs.py | Yetimove/bincrafters-package-tools | a7c16752d1c4ad5f1cd2a2bd503ca006c5da960e | [
"MIT"
] | null | null | null | bincrafters/generate_ci_jobs.py | Yetimove/bincrafters-package-tools | a7c16752d1c4ad5f1cd2a2bd503ca006c5da960e | [
"MIT"
] | 1 | 2021-05-26T08:46:14.000Z | 2021-05-26T08:46:14.000Z | bincrafters/generate_ci_jobs.py | Yetimove/bincrafters-package-tools | a7c16752d1c4ad5f1cd2a2bd503ca006c5da960e | [
"MIT"
] | null | null | null | import json
import os
import bincrafters
import yaml
import copy
from sys import version
from bincrafters.build_shared import get_bool_from_env, get_conan_vars, get_recipe_path, get_version_from_ci, get_archs
from bincrafters.autodetect import *
from bincrafters.utils import *
from bincrafters.check_compatibility impo... | 48.399194 | 135 | 0.608681 |
ac4c6aa9da6d53fe3f4693210afcb1d7f5964056 | 1,784 | py | Python | unet.py | schafo/Prediction-based-Video-Anomaly-Detection- | 5ad1f8cf169ee37c0b43cf664b30b029dd273e69 | [
"MIT"
] | 11 | 2020-10-21T10:37:01.000Z | 2022-02-22T01:59:42.000Z | unet.py | mausLe/Prediction-based-Video-Anomaly-Detection- | 699296e4f93c8bf029dd6da9e8b5aa71b2fb51b6 | [
"MIT"
] | 8 | 2020-12-17T13:26:04.000Z | 2021-11-18T10:11:39.000Z | unet.py | mausLe/Prediction-based-Video-Anomaly-Detection- | 699296e4f93c8bf029dd6da9e8b5aa71b2fb51b6 | [
"MIT"
] | 8 | 2020-11-10T05:16:09.000Z | 2021-08-31T20:20:50.000Z | import tensorflow as tf
from tensorflow.contrib.layers import conv2d, max_pool2d, conv2d_transpose
def unet(inputs, layers, features_root=64, filter_size=3, pool_size=2, output_channel=1):
"""
:param inputs: input tensor, shape[None, height, width, channel]
:param layers: number of layers
:param featu... | 41.488372 | 117 | 0.70796 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.