hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9639b6291e613c38380c6ef12ff591e7e7f06f5d | 2,419 | py | Python | challengerTest/api_init/api_user.py | andrequeiroz2/challengerAPI | df906cdd900874bb243e5d33cf745332f1fe556e | [
"MIT"
] | null | null | null | challengerTest/api_init/api_user.py | andrequeiroz2/challengerAPI | df906cdd900874bb243e5d33cf745332f1fe556e | [
"MIT"
] | null | null | null | challengerTest/api_init/api_user.py | andrequeiroz2/challengerAPI | df906cdd900874bb243e5d33cf745332f1fe556e | [
"MIT"
] | 1 | 2021-03-04T18:25:51.000Z | 2021-03-04T18:25:51.000Z | from flask import request, Response
from flask_restful import Resource
from model.model_user import User
from controller.controller_user import (
one_user,
all_user,
create_user,
update_user,
delete_user,
)
from message.msg import ADD_USER_SUCCESS, UPDATE_USER_SUCCESS, DELETE_USER_SUCCESS
from mongo... | 28.127907 | 82 | 0.639934 |
5cb1620854f6ca05f56a9f509d9df205a2b1f674 | 16,597 | py | Python | google/cloud/aiplatform_v1/services/model_service/pagers.py | dizcology/python-aiplatform | 1a135775966c8a2303ded529eba514dcf9db7205 | [
"Apache-2.0"
] | 2 | 2021-10-02T02:25:44.000Z | 2021-11-17T10:35:01.000Z | google/cloud/aiplatform_v1/services/model_service/pagers.py | pompipo/python-aiplatform | 3612b05c62dfb46822cd2c1798fd47349dba33bc | [
"Apache-2.0"
] | 1 | 2021-03-02T18:25:00.000Z | 2021-03-02T18:25:00.000Z | google/cloud/aiplatform_v1/services/model_service/pagers.py | pompipo/python-aiplatform | 3612b05c62dfb46822cd2c1798fd47349dba33bc | [
"Apache-2.0"
] | null | null | null | # -*- 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... | 39.610979 | 93 | 0.682412 |
3a6f8e589ff6cc6d7f402421acc3296fa52f91bc | 14,842 | py | Python | fibonacci21decomp.py | gavin4d/Fibonacci-Magic | 3e5c57e6ac6a190e5e9e6d62e34d2d8621ef47cc | [
"CC0-1.0"
] | 1 | 2021-12-28T19:10:58.000Z | 2021-12-28T19:10:58.000Z | fibonacci21decomp.py | gavin4d/Fibonacci-Magic | 3e5c57e6ac6a190e5e9e6d62e34d2d8621ef47cc | [
"CC0-1.0"
] | null | null | null | fibonacci21decomp.py | gavin4d/Fibonacci-Magic | 3e5c57e6ac6a190e5e9e6d62e34d2d8621ef47cc | [
"CC0-1.0"
] | null | null | null | from PIL.Image import FASTOCTREE
from manim import *
from functions import *
import color
def moveEquation(equations,loop,baseText,t1,t2,t3,t4,self):
equations[loop].add(baseText.copy(), t1[loop].copy(), t2[7-loop].copy(), t3[loop].copy(), t4[7-loop].copy())
self.play(equations[loop].animate.shift(LEFT * 6 + U... | 50.482993 | 258 | 0.607667 |
00c9b8d879ebeab599baadb47a20cadf2a76340b | 2,174 | py | Python | tests/test_checker.py | migzpogi/PokerCalculator | 3005e24552e465729f2aab7efea8bbbe831e736b | [
"MIT"
] | 4 | 2020-07-27T02:37:56.000Z | 2021-05-27T08:33:01.000Z | tests/test_checker.py | migzpogi/PokerCalculator | 3005e24552e465729f2aab7efea8bbbe831e736b | [
"MIT"
] | 1 | 2018-09-26T03:04:25.000Z | 2018-09-26T03:30:43.000Z | tests/test_checker.py | migzpogi/PokerCalculator | 3005e24552e465729f2aab7efea8bbbe831e736b | [
"MIT"
] | 2 | 2020-10-03T07:28:52.000Z | 2021-11-16T14:36:16.000Z | import unittest
from lib.checkers import input_type_checker, card_checker, convert_case, is_list_unique
class TestCheckers(unittest.TestCase):
"""
Unit tests for checker methods
"""
def test_valid_input_true(self):
"""
Checks if the input is a list of len > 2 for board and len == 2 for... | 23.376344 | 87 | 0.551518 |
319af097a45bd7932ffa38c9ab9991ba6a757dda | 4,025 | py | Python | tests/test_generic.py | vsaase/dicom2nifti | 6722420a7673d36437e4358ce3cb2a7c77c91820 | [
"MIT"
] | null | null | null | tests/test_generic.py | vsaase/dicom2nifti | 6722420a7673d36437e4358ce3cb2a7c77c91820 | [
"MIT"
] | null | null | null | tests/test_generic.py | vsaase/dicom2nifti | 6722420a7673d36437e4358ce3cb2a7c77c91820 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
dicom2nifti
@author: abrys
"""
import os
import random
import shutil
import string
import tempfile
import unittest
import nibabel
import tests.test_data as test_data
import dicom2nifti.convert_generic as convert_generic
from dicom2nifti.common import read_dicom_directory
from dicom2nift... | 40.25 | 110 | 0.649938 |
1a68eccb312a1ae8df487ecfc214c379035f4a91 | 5,618 | py | Python | homeassistant/components/iperf3/__init__.py | alemuro/home-assistant | 9b1315d8e55f0ca906c4c8a1b2ae8c2ea511dc90 | [
"Apache-2.0"
] | 2 | 2019-10-19T15:07:32.000Z | 2022-01-29T10:33:20.000Z | homeassistant/components/iperf3/__init__.py | alemuro/home-assistant | 9b1315d8e55f0ca906c4c8a1b2ae8c2ea511dc90 | [
"Apache-2.0"
] | 4 | 2021-02-08T21:05:14.000Z | 2021-09-08T02:57:03.000Z | homeassistant/components/iperf3/__init__.py | alemuro/home-assistant | 9b1315d8e55f0ca906c4c8a1b2ae8c2ea511dc90 | [
"Apache-2.0"
] | 2 | 2019-01-21T05:49:23.000Z | 2019-02-19T16:30:48.000Z | """Support for Iperf3 network measurement tool."""
import logging
from datetime import timedelta
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.const import (
CONF_MONITORED_CONDITIONS,
CONF_P... | 31.038674 | 88 | 0.649875 |
914e91e19ed4c4f7e5a9ccdf8b02b4d46aca28c7 | 1,089 | py | Python | certificates/certificates/urls.py | iamsajjad/certificates | 4c639e8da3a6f193ab6705b522d4d89b48b7c7d5 | [
"MIT"
] | null | null | null | certificates/certificates/urls.py | iamsajjad/certificates | 4c639e8da3a6f193ab6705b522d4d89b48b7c7d5 | [
"MIT"
] | null | null | null | certificates/certificates/urls.py | iamsajjad/certificates | 4c639e8da3a6f193ab6705b522d4d89b48b7c7d5 | [
"MIT"
] | null | null | null | """certificates URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.1/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-... | 35.129032 | 77 | 0.69697 |
22b405f3191ad6552fe07d5953c01d6408342dd7 | 8,361 | py | Python | tests/integration/callbacks/test_layout_paths_with_callbacks.py | jackwiy/dash | 5e406868be2ac17f129e61eb951a52b0bf290aca | [
"MIT"
] | 1 | 2020-03-20T21:44:44.000Z | 2020-03-20T21:44:44.000Z | tests/integration/callbacks/test_layout_paths_with_callbacks.py | gwu1/dash | 6d27808698b4be4d8c778291431f085ad4a19482 | [
"MIT"
] | 1 | 2022-02-28T03:20:59.000Z | 2022-02-28T03:20:59.000Z | tests/integration/callbacks/test_layout_paths_with_callbacks.py | gwu1/dash | 6d27808698b4be4d8c778291431f085ad4a19482 | [
"MIT"
] | null | null | null | import os
import json
from multiprocessing import Value
import dash_core_components as dcc
import dash_html_components as html
from dash import Dash
from dash.dependencies import Input, Output
import dash.testing.wait as wait
def test_cblp001_radio_buttons_callbacks_generating_children(dash_duo):
TIMEOUT = 2
... | 35.578723 | 99 | 0.537256 |
b23007b7d9dcd57d447fd479ffb2e409e227d168 | 5,926 | py | Python | yara/yarascan/yarascan.py | malvidin/stoq-plugins-public | 8aaf3b97dc3972ca852d2a73a7899afa7394f9bb | [
"Apache-2.0"
] | null | null | null | yara/yarascan/yarascan.py | malvidin/stoq-plugins-public | 8aaf3b97dc3972ca852d2a73a7899afa7394f9bb | [
"Apache-2.0"
] | null | null | null | yara/yarascan/yarascan.py | malvidin/stoq-plugins-public | 8aaf3b97dc3972ca852d2a73a7899afa7394f9bb | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2014-present PUNCH Cyber Analytics Group
#
# 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
#
# ... | 40.312925 | 121 | 0.616774 |
9f0a19d4a94e151885b91026b57fc94e6f53b499 | 893 | py | Python | jelly_display_2/display_collected_values_search.py | chalbersma/manowar | 023a696f7ea0458e1c2ae9a18e40a9d09e824cc4 | [
"BSD-2-Clause"
] | 3 | 2019-02-16T03:14:11.000Z | 2020-05-28T23:14:23.000Z | jelly_display_2/display_collected_values_search.py | chalbersma/manowar | 023a696f7ea0458e1c2ae9a18e40a9d09e824cc4 | [
"BSD-2-Clause"
] | 4 | 2018-08-09T22:39:59.000Z | 2020-02-12T00:36:47.000Z | jelly_display_2/display_collected_values_search.py | chalbersma/manowar | 023a696f7ea0458e1c2ae9a18e40a9d09e824cc4 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
'''
Copyright 2018, VDMS
Licensed under the terms of the BSD 2-clause license. See LICENSE file for terms.
'''
import json
import ast
import requests
from flask import current_app, Blueprint, g, request, jsonify, render_template
display_collected_values_search = Blueprint(
'display2_colle... | 27.060606 | 101 | 0.75252 |
b81c1ea16d8da7c1f1f1d99a5520a9b382d1708c | 5,664 | py | Python | evidently/widgets/prob_class_prod_quality_metrics_widget.py | jayeshmalu/evidently | 789f9a04827d166369d965eacbd11306eac6b961 | [
"Apache-2.0"
] | 1 | 2021-05-08T01:58:08.000Z | 2021-05-08T01:58:08.000Z | evidently/widgets/prob_class_prod_quality_metrics_widget.py | felipeescallon/evidently | f6243973998a74e3bdbfe891b02bccc35888e349 | [
"Apache-2.0"
] | null | null | null | evidently/widgets/prob_class_prod_quality_metrics_widget.py | felipeescallon/evidently | f6243973998a74e3bdbfe891b02bccc35888e349 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
import json
import pandas as pd
from pandas.api.types import is_numeric_dtype
import numpy as np
import math
from scipy.stats import ks_2samp
from sklearn import metrics, preprocessing
from evidently.model.widget import BaseWidgetInfo, AlertStats, AdditionalGraphInfo
from eviden... | 42.586466 | 121 | 0.543256 |
9a4a8be3da312ad182fc81ca0a9002ca69a75d31 | 189 | py | Python | 03/03_P7.py | endowp/Python101 | 9c29387f4ed53d10579613ecf5153b71abf7ccd7 | [
"MIT"
] | null | null | null | 03/03_P7.py | endowp/Python101 | 9c29387f4ed53d10579613ecf5153b71abf7ccd7 | [
"MIT"
] | null | null | null | 03/03_P7.py | endowp/Python101 | 9c29387f4ed53d10579613ecf5153b71abf7ccd7 | [
"MIT"
] | null | null | null | import math
x=float(input())
cosxn,cosx=1,0.0
k=0
while (cosxn>=10**-8)or(-1*cosxn>=10**-8):
cosxn=(((-1)**k)*(x**(2*k)))/(math.factorial(2*k))
cosx+=cosxn
k+=1
print(cosx,k-2)
| 18.9 | 54 | 0.560847 |
cf4c0e900802a3576843f29c51ce61c009a8e4c9 | 589 | py | Python | examples/python.py | charles-l/pyinfra | 1992d98ff31d41404427dbb3cc6095a7bebd4052 | [
"MIT"
] | 1 | 2020-12-24T08:24:13.000Z | 2020-12-24T08:24:13.000Z | examples/python.py | charles-l/pyinfra | 1992d98ff31d41404427dbb3cc6095a7bebd4052 | [
"MIT"
] | null | null | null | examples/python.py | charles-l/pyinfra | 1992d98ff31d41404427dbb3cc6095a7bebd4052 | [
"MIT"
] | 1 | 2021-11-12T18:36:01.000Z | 2021-11-12T18:36:01.000Z | from pyinfra.operations import python
# Tip: Can run try it out using: 'pyinfra @docker/python python.py'
SUDO = True
def my_callback(state, host, hello=None):
command = 'echo hello'
if hello:
command = command + ' ' + hello
status, stdout, stderr = host.run_shell_command(state, command=command,... | 29.45 | 86 | 0.672326 |
6ad70a7abb52c32e5347837aa91d1cbc208f4692 | 310 | py | Python | Problem5_10/summation_of_primes.py | Vaibhavi1707/Project-Euler | 3f625c69e4289fb9f09a4d4ef3b2618ebf4c2777 | [
"MIT"
] | 2 | 2021-05-29T16:59:30.000Z | 2021-11-26T17:30:33.000Z | Problem5_10/summation_of_primes.py | Vaibhavi1707/Project-Euler | 3f625c69e4289fb9f09a4d4ef3b2618ebf4c2777 | [
"MIT"
] | null | null | null | Problem5_10/summation_of_primes.py | Vaibhavi1707/Project-Euler | 3f625c69e4289fb9f09a4d4ef3b2618ebf4c2777 | [
"MIT"
] | 5 | 2021-05-19T13:16:21.000Z | 2021-05-21T11:48:20.000Z | #Project euler problem 10
#Problem link https://projecteuler.net/problem=10
def sumPrimes(n):
sum, sieve = 0, [True] * n
for p in range(2, n):
if sieve[p]:
sum += p
for i in range(p * p, n, p):
sieve[i] = False
return sum
print(sumPrimes(2000000)) | 22.142857 | 49 | 0.545161 |
f0bfe91d4d5cb8eecf5059e0a7620678d8f21d9c | 1,767 | py | Python | tests/unit/test_client.py | zakiharis/sam-simple-chat | 729f1d3935d480efcad52b60e3b4ff4bed3f8c12 | [
"Unlicense"
] | 1 | 2021-07-28T06:53:12.000Z | 2021-07-28T06:53:12.000Z | tests/unit/test_client.py | zakiharis/sam-simple-chat | 729f1d3935d480efcad52b60e3b4ff4bed3f8c12 | [
"Unlicense"
] | null | null | null | tests/unit/test_client.py | zakiharis/sam-simple-chat | 729f1d3935d480efcad52b60e3b4ff4bed3f8c12 | [
"Unlicense"
] | null | null | null | import client
import termcolor
import websocket
from click.testing import CliRunner
def test_on_message(mocker, monkeypatch):
def mock_colored(msg, color):
assert msg == 'hello world...'
assert color == 'green'
return None
monkeypatch.setattr(termcolor, 'colored', mock_colored)
m... | 24.887324 | 106 | 0.657612 |
9cf2371d09d9f07a15abd2f8c2b022752242bf7f | 21,660 | py | Python | vnpy/gateway/binance/binance_gateway.py | whypro/vnpy | 2403975311a0f0665e82c5f0ecb9fb1c455877a9 | [
"MIT"
] | 4 | 2020-04-01T18:46:56.000Z | 2021-08-29T09:45:47.000Z | vnpy/gateway/binance/binance_gateway.py | whypro/vnpy | 2403975311a0f0665e82c5f0ecb9fb1c455877a9 | [
"MIT"
] | 2 | 2019-08-04T01:45:37.000Z | 2019-08-04T01:48:18.000Z | vnpy/gateway/binance/binance_gateway.py | whypro/vnpy | 2403975311a0f0665e82c5f0ecb9fb1c455877a9 | [
"MIT"
] | 1 | 2020-04-12T08:56:56.000Z | 2020-04-12T08:56:56.000Z | """
Gateway for Binance Crypto Exchange.
"""
import urllib
import hashlib
import hmac
import time
from copy import copy
from datetime import datetime, timedelta
from enum import Enum
from threading import Lock
from vnpy.api.rest import RestClient, Request
from vnpy.api.websocket import WebsocketClient
from vnpy.trade... | 27.804878 | 85 | 0.536611 |
eee5f7549e7f3a5a6f39df7b815aca93bc536f48 | 1,328 | py | Python | hackerrank/artificial-intelligence/stack-exchange-question-classifier/stack-exchange-question-classifier.py | yasserglez/programming-problems | 08cef1186b182430b231ed9772d8f92ec1d2365b | [
"MIT"
] | 2 | 2017-02-17T01:40:27.000Z | 2018-04-22T12:47:28.000Z | hackerrank/artificial-intelligence/stack-exchange-question-classifier/stack-exchange-question-classifier.py | yasserglez/programming-problems | 08cef1186b182430b231ed9772d8f92ec1d2365b | [
"MIT"
] | null | null | null | hackerrank/artificial-intelligence/stack-exchange-question-classifier/stack-exchange-question-classifier.py | yasserglez/programming-problems | 08cef1186b182430b231ed9772d8f92ec1d2365b | [
"MIT"
] | 1 | 2016-10-14T06:00:42.000Z | 2016-10-14T06:00:42.000Z | # https://www.hackerrank.com/challenges/stack-exchange-question-classifier
import sys
import json
import numpy as np
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import SGDClassifier
from sklearn.model_selection import cross_val_score
de... | 30.883721 | 80 | 0.670934 |
5882ad569166c2bba4227e91833ff722bc1115c9 | 307 | py | Python | dandy/config/docs.py | erpcloudsystems/dandy | 6721c297644627b85e58419a36570095681df72c | [
"MIT"
] | null | null | null | dandy/config/docs.py | erpcloudsystems/dandy | 6721c297644627b85e58419a36570095681df72c | [
"MIT"
] | null | null | null | dandy/config/docs.py | erpcloudsystems/dandy | 6721c297644627b85e58419a36570095681df72c | [
"MIT"
] | null | null | null | """
Configuration for docs
"""
# source_link = "https://github.com/[org_name]/dandy"
# docs_base_url = "https://[org_name].github.io/dandy"
# headline = "App that does everything"
# sub_heading = "Yes, you got that right the first time, everything"
def get_context(context):
context.brand_html = "Dandy"
| 25.583333 | 68 | 0.716612 |
c818f53ae191012f825cf475328e092ed7c78dfc | 7,665 | py | Python | preprocessing/ned.py | flathers/soilCarbonFramework | 5d1d4fcd45eb1699b13d683cbaced75d3a341f60 | [
"MIT"
] | 1 | 2019-08-18T06:04:09.000Z | 2019-08-18T06:04:09.000Z | preprocessing/ned.py | flathers/soilCarbonFramework | 5d1d4fcd45eb1699b13d683cbaced75d3a341f60 | [
"MIT"
] | null | null | null | preprocessing/ned.py | flathers/soilCarbonFramework | 5d1d4fcd45eb1699b13d683cbaced75d3a341f60 | [
"MIT"
] | 1 | 2021-02-23T00:18:36.000Z | 2021-02-23T00:18:36.000Z | """
Get an extracted mosaic of the elevation data
"""
import arcpy
from arcpy import env
from arcpy.sa import *
import glob
class LicenseError(Exception):
pass
def mosaic(workspace, out_location, out_raster):
# after http://desktop.arcgis.com/en/arcmap/10.4/tools/data-management-toolbox/mosaic-to-new-ras... | 32.896996 | 107 | 0.705545 |
a2461b6b37d5145bcee8c41758569bde75cc554c | 719 | py | Python | 01_Introductions/06_Multiple_Linear_Regression.py | ivanbgd/Udacity-Deep-Learning-ND101 | 05f8fe15654f51e4d770af39ee0195f22a84e65c | [
"MIT"
] | 1 | 2017-12-06T23:23:26.000Z | 2017-12-06T23:23:26.000Z | 01_Introductions/06_Multiple_Linear_Regression.py | ivanbgd/Udacity-Deep-Learning-ND101 | 05f8fe15654f51e4d770af39ee0195f22a84e65c | [
"MIT"
] | null | null | null | 01_Introductions/06_Multiple_Linear_Regression.py | ivanbgd/Udacity-Deep-Learning-ND101 | 05f8fe15654f51e4d770af39ee0195f22a84e65c | [
"MIT"
] | 2 | 2019-09-02T05:27:35.000Z | 2020-03-28T18:27:07.000Z | from sklearn.linear_model import LinearRegression
from sklearn.datasets import load_boston
# Load the data from the the boston house-prices dataset
boston_data = load_boston()
X = boston_data['data']
y = boston_data['target']
# Make and fit the linear regression model
model = LinearRegression()
model.fit(X, y)
# Ma... | 37.842105 | 96 | 0.737135 |
7a593c3e7e9cb9af148a2a6a39698511ab078d20 | 646 | py | Python | print_all_links.py | jjtoledo/Treinamento-Data-Science | 5117975109695b1de06ae43b416972e66a4b7773 | [
"MIT"
] | null | null | null | print_all_links.py | jjtoledo/Treinamento-Data-Science | 5117975109695b1de06ae43b416972e66a4b7773 | [
"MIT"
] | null | null | null | print_all_links.py | jjtoledo/Treinamento-Data-Science | 5117975109695b1de06ae43b416972e66a4b7773 | [
"MIT"
] | null | null | null | def get_next_target(page):
start_link = page.find('<a href=')
# Insert your code below here
if (start_link == -1):
return None, 0
else:
start_quote = page.find('"', start_link)
end_quote = page.find('"', start_quote + 1)
url = page[start_quote + 1:end_quote]
retu... | 23.925926 | 90 | 0.589783 |
9e8d68ab952bafe73e60bce00e854daa9d594505 | 136,135 | py | Python | src/sage/categories/pushout.py | bopopescu/Sage-8 | 71be00ad5f25ca95381fae7cce96421ffdd43425 | [
"BSL-1.0"
] | null | null | null | src/sage/categories/pushout.py | bopopescu/Sage-8 | 71be00ad5f25ca95381fae7cce96421ffdd43425 | [
"BSL-1.0"
] | null | null | null | src/sage/categories/pushout.py | bopopescu/Sage-8 | 71be00ad5f25ca95381fae7cce96421ffdd43425 | [
"BSL-1.0"
] | null | null | null | """
Coercion via Construction Functors
"""
import six
from functor import Functor
from basic import *
from sage.structure.parent import CoercionException
# TODO, think through the rankings, and override pushout where necessary.
class ConstructionFunctor(Functor):
"""
Base class for construction functors.
... | 37.205521 | 470 | 0.561259 |
078e262b66c9254b895a611d85a57b9ee60b4632 | 1,614 | py | Python | waf-api/python/LetsEncrypt/manual_dns_create_challenges.py | scott-treacy/waf-automation | 5445c3cd62411e367463de95d5456f241f2042b8 | [
"MIT"
] | 16 | 2017-11-16T22:07:57.000Z | 2021-12-23T09:47:01.000Z | waf-api/python/LetsEncrypt/manual_dns_create_challenges.py | scott-treacy/waf-automation | 5445c3cd62411e367463de95d5456f241f2042b8 | [
"MIT"
] | 5 | 2018-02-02T17:58:39.000Z | 2021-05-24T23:45:11.000Z | waf-api/python/LetsEncrypt/manual_dns_create_challenges.py | scott-treacy/waf-automation | 5445c3cd62411e367463de95d5456f241f2042b8 | [
"MIT"
] | 16 | 2018-01-22T22:02:48.000Z | 2021-08-12T11:57:55.000Z | #!/usr/bin/env python
import csv
import sys
import argparse
from utils.acme_client import *
def main(argv):
parser = argparse.ArgumentParser()
parser.add_argument("-k", "--account-key", required=True, help="Path to your Let's Encrypt account private key")
parser.add_argument("-D", "--domain-file", required... | 38.428571 | 122 | 0.654275 |
fcc9652e947e9b75e55cd14de364300fa397418c | 15,113 | py | Python | src/procedure/image.py | figai/figocr | c358cceff80502647379bcfc94247ab19e626946 | [
"Apache-2.0"
] | 2 | 2020-04-19T09:34:19.000Z | 2020-04-19T14:40:02.000Z | src/procedure/image.py | figai/figocr | c358cceff80502647379bcfc94247ab19e626946 | [
"Apache-2.0"
] | null | null | null | src/procedure/image.py | figai/figocr | c358cceff80502647379bcfc94247ab19e626946 | [
"Apache-2.0"
] | 3 | 2020-04-19T06:45:08.000Z | 2020-04-22T13:16:51.000Z | # -*- coding: utf8 -*-
import cv2
import numpy as np
from skimage.morphology import opening, closing, square
from skimage.filters import threshold_otsu
import logging
def image_resize(image, width=None, height=None, inter=cv2.INTER_AREA):
dim = None
(h, w) = image.shape[:2]
if width is None and height is... | 30.531313 | 100 | 0.562562 |
7b78dce74e365cf91845bac8a5e8e20720f78e13 | 1,105 | py | Python | photo/views.py | firdausa7/MY-GALLERY | 5d2fe2727d760929800c14c11b0ff4c6d081584b | [
"MIT"
] | null | null | null | photo/views.py | firdausa7/MY-GALLERY | 5d2fe2727d760929800c14c11b0ff4c6d081584b | [
"MIT"
] | 3 | 2020-06-05T23:24:25.000Z | 2021-06-10T22:02:41.000Z | photo/views.py | firdausa7/MY-GALLERY | 5d2fe2727d760929800c14c11b0ff4c6d081584b | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
from django.conf.urls import url,include
from .models import Location, tags, Category, Image
# Create your views here.
#HOME PAGE VIEW FUNCTION
#########################
def index(request):
photos = Image.objects.all()
context = {'photo... | 26.309524 | 96 | 0.695023 |
c671edd2dc03a715d5202e39317ff42d86e4aa98 | 1,126 | py | Python | server/src/test/unit/weblab/data/test_experiments.py | romainrossi/weblabdeusto | 494f1cd291d03dcf1d2e8f3e36d3dbe2348b167f | [
"BSD-2-Clause"
] | 15 | 2015-03-12T12:15:41.000Z | 2021-12-20T17:53:24.000Z | server/src/test/unit/weblab/data/test_experiments.py | romainrossi/weblabdeusto | 494f1cd291d03dcf1d2e8f3e36d3dbe2348b167f | [
"BSD-2-Clause"
] | 44 | 2015-01-07T09:22:05.000Z | 2017-01-31T22:44:21.000Z | server/src/test/unit/weblab/data/test_experiments.py | romainrossi/weblabdeusto | 494f1cd291d03dcf1d2e8f3e36d3dbe2348b167f | [
"BSD-2-Clause"
] | 22 | 2015-01-13T13:55:48.000Z | 2021-12-16T17:07:00.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals,
# list... | 26.809524 | 80 | 0.72913 |
1dfe3ab6a4375dc484bf5f3b5449c63b9a1d4c35 | 7,169 | py | Python | gwlfe/Output/Loading/StreamBankEros_1.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | null | null | null | gwlfe/Output/Loading/StreamBankEros_1.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 6 | 2018-07-24T22:46:28.000Z | 2018-07-29T19:13:09.000Z | gwlfe/Output/Loading/StreamBankEros_1.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 1 | 2018-07-24T18:22:01.000Z | 2018-07-24T18:22:01.000Z | from numpy import maximum
from numpy import zeros
from gwlfe.BMPs.Stream.SEDFEN import SEDFEN
from gwlfe.BMPs.Stream.SEDFEN import SEDFEN_f
from gwlfe.BMPs.Stream.SEDSTAB import SEDSTAB
from gwlfe.BMPs.Stream.SEDSTAB import SEDSTAB_f
from gwlfe.BMPs.Stream.SURBBANK import SURBBANK
from gwlfe.BMPs.Stream.SURBBANK impor... | 70.284314 | 120 | 0.590877 |
28de8082213a5504e69994ceeef982856bb732cd | 4,104 | py | Python | ALREC_Method/trajectory_viewer.py | proy3/Abnormal_Trajectory_Classifier | a6b27c6847262e9703a0f3404c85c135415c1d4c | [
"MIT"
] | 6 | 2019-10-29T03:05:14.000Z | 2022-03-18T05:14:25.000Z | ALREC_Method/trajectory_viewer.py | proy3/Abnormal_Trajectory_Classifier | a6b27c6847262e9703a0f3404c85c135415c1d4c | [
"MIT"
] | 1 | 2022-03-11T03:49:34.000Z | 2022-03-11T03:49:34.000Z | ALREC_Method/trajectory_viewer.py | proy3/Abnormal_Trajectory_Classifier | a6b27c6847262e9703a0f3404c85c135415c1d4c | [
"MIT"
] | 1 | 2021-12-15T09:21:26.000Z | 2021-12-15T09:21:26.000Z | """
This script is used to view all the trajectories, including augmented and abnormal ones.
"""
import matplotlib.pyplot as plt
from scipy import ndimage
from PIL import Image
import os.path
number_of_images = 100
start_frame_number = 400
background_image_path = 'background_image_2.png'
overwrite_background_image =... | 34.2 | 116 | 0.665205 |
28b3b666936fc41c4051c7821a66cb8922aa6144 | 45 | py | Python | droput_authentication/droput_auth/config/__init__.py | hosein-yousefii/DROPUT | 99a714f03a92b14228a3691ca6568ece0f0ea48c | [
"Apache-2.0"
] | 2 | 2022-03-17T08:08:07.000Z | 2022-03-17T21:38:54.000Z | droput_authentication/droput_auth/config/__init__.py | hosein-yousefii/DROPUT | 99a714f03a92b14228a3691ca6568ece0f0ea48c | [
"Apache-2.0"
] | null | null | null | droput_authentication/droput_auth/config/__init__.py | hosein-yousefii/DROPUT | 99a714f03a92b14228a3691ca6568ece0f0ea48c | [
"Apache-2.0"
] | null | null | null | from droput_auth.config.config import Config
| 22.5 | 44 | 0.866667 |
bc0a1ebc7c0ca2c3120bc175c609fc6cb113540a | 757 | py | Python | examples/peripherals/pcnt/rotary_encoder/pytest_rotary_encoder.py | BU-EC444/esp-idf | 5963de1caf284b14ddfed11e52730a55e3783a3d | [
"Apache-2.0"
] | 4 | 2022-03-15T22:43:28.000Z | 2022-03-28T01:25:08.000Z | examples/peripherals/pcnt/rotary_encoder/pytest_rotary_encoder.py | BU-EC444/esp-idf | 5963de1caf284b14ddfed11e52730a55e3783a3d | [
"Apache-2.0"
] | null | null | null | examples/peripherals/pcnt/rotary_encoder/pytest_rotary_encoder.py | BU-EC444/esp-idf | 5963de1caf284b14ddfed11e52730a55e3783a3d | [
"Apache-2.0"
] | 2 | 2022-02-04T21:36:58.000Z | 2022-02-09T12:22:48.000Z | # SPDX-FileCopyrightText: 2021-2022 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: CC0-1.0
import pytest
from pytest_embedded.dut import Dut
@pytest.mark.esp32
@pytest.mark.esp32s2
@pytest.mark.esp32s3
@pytest.mark.generic
def test_rotary_encoder(dut: Dut) -> None:
dut.expect_exact('install pcnt ... | 32.913043 | 71 | 0.729194 |
8551ebdbf92ecd69657fb5e361e9eb22d83bfb51 | 2,406 | py | Python | tools/cxx_wrapper.py | URUSCG-LLC/fletch | 35967b56cecce8fd5ae96a0d85ca318272ee69a0 | [
"BSD-3-Clause"
] | null | null | null | tools/cxx_wrapper.py | URUSCG-LLC/fletch | 35967b56cecce8fd5ae96a0d85ca318272ee69a0 | [
"BSD-3-Clause"
] | null | null | null | tools/cxx_wrapper.py | URUSCG-LLC/fletch | 35967b56cecce8fd5ae96a0d85ca318272ee69a0 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
import os
import sys
import utils
import subprocess
def invoke_clang(args):
fletc... | 28.305882 | 78 | 0.672901 |
24970b286220a3536e312b5ea4869acc1d512ffa | 4,909 | py | Python | qcodes/tests/test_interactive_widget.py | RosenblumLabUser/Qcodes | 01fe56a0751a744d978a893f78ee9d6c8230478f | [
"MIT"
] | 223 | 2016-10-29T15:00:24.000Z | 2022-03-20T06:53:34.000Z | qcodes/tests/test_interactive_widget.py | M1racleShih/Qcodes | c03029a6968e16379155aadc8b083a02e01876a6 | [
"MIT"
] | 3,406 | 2016-10-25T10:44:50.000Z | 2022-03-31T09:47:35.000Z | qcodes/tests/test_interactive_widget.py | nikhartman/Qcodes | 042c5e25ab9e40b20c316b4055c4842844834d1e | [
"MIT"
] | 263 | 2016-10-25T11:35:36.000Z | 2022-03-31T08:53:20.000Z | import time
from unittest.mock import patch
import matplotlib
import pytest
from ipywidgets import HTML, Button, GridspecLayout, Tab, Textarea
# set matplotlib backend before importing pyplot
matplotlib.use("Agg")
from qcodes import interactive_widget
# we only need `experiment` here, but pytest does not discover th... | 30.490683 | 79 | 0.744755 |
171a12e661d8b0a26e6093543e96edeac9ab7a50 | 18,951 | py | Python | pyzoo/zoo/orca/learn/tf2/tf_runner.py | shane-huang/analytics-zoo | 9c29bc7d678b526cd8ff256d731ed9ac2c18cc81 | [
"Apache-2.0"
] | null | null | null | pyzoo/zoo/orca/learn/tf2/tf_runner.py | shane-huang/analytics-zoo | 9c29bc7d678b526cd8ff256d731ed9ac2c18cc81 | [
"Apache-2.0"
] | 1 | 2020-04-17T02:41:28.000Z | 2020-04-20T02:37:41.000Z | pyzoo/zoo/orca/learn/tf2/tf_runner.py | shane-huang/analytics-zoo | 9c29bc7d678b526cd8ff256d731ed9ac2c18cc81 | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 39.563674 | 100 | 0.598649 |
f7a6522272ca25f0b11966dffdd9996ab5aae982 | 29,283 | py | Python | ml-agents-envs/mlagents/envs/environment.py | trainmachines/unity-ml-agents-cl | 71ab07a0caf49ea73082f4f80b71951f2b10ff15 | [
"Apache-2.0"
] | 58 | 2019-06-13T16:35:40.000Z | 2021-12-30T03:16:45.000Z | ml-agents-envs/mlagents/envs/environment.py | trainmachines/unity-ml-agents-cl | 71ab07a0caf49ea73082f4f80b71951f2b10ff15 | [
"Apache-2.0"
] | 7 | 2020-09-26T00:43:02.000Z | 2022-02-10T01:26:53.000Z | ml-agents-envs/mlagents/envs/environment.py | trainmachines/unity-ml-agents-cl | 71ab07a0caf49ea73082f4f80b71951f2b10ff15 | [
"Apache-2.0"
] | 23 | 2019-06-25T17:09:32.000Z | 2021-03-18T06:44:17.000Z | import atexit
import glob
import logging
import numpy as np
import os
import subprocess
from typing import Dict, List, Optional, Any
from mlagents.envs.base_unity_environment import BaseUnityEnvironment
from mlagents.envs.timers import timed, hierarchical_timer
from .brain import AllBrainInfo, BrainInfo, BrainParamete... | 43.190265 | 120 | 0.563262 |
68a6faee5354dc73505617fbb80d35ae1721bcaa | 916 | py | Python | backblast/model.py | kickstandproject/backblast | a3b251afeba5798cccfcd3766f1ea3e55f78034c | [
"Apache-2.0"
] | 1 | 2016-03-26T21:30:19.000Z | 2016-03-26T21:30:19.000Z | backblast/model.py | kickstandproject/backblast | a3b251afeba5798cccfcd3766f1ea3e55f78034c | [
"Apache-2.0"
] | null | null | null | backblast/model.py | kickstandproject/backblast | a3b251afeba5798cccfcd3766f1ea3e55f78034c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# 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, softw... | 33.925926 | 75 | 0.628821 |
e2092fb01863f91227a7a77f4cf5d7e031c0822a | 1,365 | py | Python | files/utils.py | SIBSIND/PHPMYADMINWEBSITE | e2112f0fb43f042be551ecaadb05b1cc79ba5360 | [
"MIT"
] | 31 | 2015-05-26T23:13:06.000Z | 2022-03-10T12:03:33.000Z | files/utils.py | SIBSIND/PHPMYADMINWEBSITE | e2112f0fb43f042be551ecaadb05b1cc79ba5360 | [
"MIT"
] | 136 | 2015-01-15T23:30:23.000Z | 2022-03-31T00:59:01.000Z | files/utils.py | SIBSIND/PHPMYADMINWEBSITE | e2112f0fb43f042be551ecaadb05b1cc79ba5360 | [
"MIT"
] | 158 | 2015-01-15T23:25:26.000Z | 2022-02-09T01:47:20.000Z | # -*- coding: UTF-8 -*-
# vim: set expandtab sw=4 ts=4 sts=4:
#
# phpMyAdmin web site
#
# Copyright (C) 2008 - 2016 Michal Cihar <michal@cihar.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundati... | 35 | 73 | 0.671795 |
be64e074af6729b6171d5eed328bc46d2d983abb | 19,608 | py | Python | tensorflow_probability/python/distributions/masked.py | mederrata/probability | bc6c411b0fbd83141f303f91a27343fe3c43a797 | [
"Apache-2.0"
] | 1 | 2022-03-22T11:56:31.000Z | 2022-03-22T11:56:31.000Z | tensorflow_probability/python/distributions/masked.py | robot0102/probability | 89d248c420b8ecabfd9d6de4a1aa8d3886920049 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/distributions/masked.py | robot0102/probability | 89d248c420b8ecabfd9d6de4a1aa8d3886920049 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 41.719149 | 88 | 0.708588 |
0ba40d41d92725b5dfdbb5f9f2d17cf5f19f4b7f | 2,797 | py | Python | tests/bel.py | dahlia/hangulize | 903e07cb587670f80020818f5c384ceca29ed67b | [
"BSD-3-Clause"
] | 1 | 2020-10-18T20:28:54.000Z | 2020-10-18T20:28:54.000Z | tests/bel.py | dahlia/hangulize | 903e07cb587670f80020818f5c384ceca29ed67b | [
"BSD-3-Clause"
] | null | null | null | tests/bel.py | dahlia/hangulize | 903e07cb587670f80020818f5c384ceca29ed67b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from tests import HangulizeTestCase
from hangulize.langs.bel import Belarusian
class BelarusianTestCase(HangulizeTestCase):
lang = Belarusian()
def test_people(self):
self.assert_examples({
u'Аляксей Абалмасаў': u'알략세이 아발마사우',
u'Вікторыя Азарэнка': u'빅... | 37.293333 | 58 | 0.508759 |
d41e0912749c613a036317fd354ba93582c1bd0a | 738 | py | Python | value_investing/filter_results.py | bfan1256/fundamental-analysis-algorithms | 96b41d46eb40124d0b2d74bd3f51b3b431e50be3 | [
"Apache-2.0"
] | null | null | null | value_investing/filter_results.py | bfan1256/fundamental-analysis-algorithms | 96b41d46eb40124d0b2d74bd3f51b3b431e50be3 | [
"Apache-2.0"
] | null | null | null | value_investing/filter_results.py | bfan1256/fundamental-analysis-algorithms | 96b41d46eb40124d0b2d74bd3f51b3b431e50be3 | [
"Apache-2.0"
] | null | null | null | import csv
with open('undervalued_good_buys.csv') as f:
reader = csv.reader(f)
data = []
for row in reader:
data.append(row)
data = data[1:]
filtered_data = []
for row in data:
if float(row[1]) <= 6 and float(row[-3]) < 1:
filtered_data.append(row)
final_data = []
for row in filter... | 28.384615 | 126 | 0.636856 |
52c92dd011d770faa0b895db9b1fe44cd7a83c30 | 58 | py | Python | api.py | ioggstream/rest-samples | 03c9e524ea2dca7d56fcfdc134f285c118151d32 | [
"MIT"
] | null | null | null | api.py | ioggstream/rest-samples | 03c9e524ea2dca7d56fcfdc134f285c118151d32 | [
"MIT"
] | null | null | null | api.py | ioggstream/rest-samples | 03c9e524ea2dca7d56fcfdc134f285c118151d32 | [
"MIT"
] | null | null | null |
def ping(*args, **kwargs):
return {"ciao": "belli"}
| 11.6 | 28 | 0.551724 |
fec50492c14d8a387b445f6ae03e433ec3d3116d | 11,002 | py | Python | hmtl/dataset_readers/coref_conll.py | rahular/joint-coref-srl | cd85fb4e11af1a1ea400ed657d0a4511c1d6c6be | [
"MIT"
] | null | null | null | hmtl/dataset_readers/coref_conll.py | rahular/joint-coref-srl | cd85fb4e11af1a1ea400ed657d0a4511c1d6c6be | [
"MIT"
] | null | null | null | hmtl/dataset_readers/coref_conll.py | rahular/joint-coref-srl | cd85fb4e11af1a1ea400ed657d0a4511c1d6c6be | [
"MIT"
] | null | null | null | import sys
import logging
import collections
from typing import Any, Dict, List, Optional, Tuple, DefaultDict, Set
from overrides import overrides
from allennlp.common.file_utils import cached_path
from allennlp.data.dataset_readers.dataset_reader import DatasetReader
from allennlp.data.fields import (
Field,
... | 43.65873 | 99 | 0.62225 |
3a313c3f567495cb262c97605f26e3a1118f04a8 | 7,275 | py | Python | server.py | alexvbogdan/Assistant-for-People-with-Low-Vision | 2c8d60a857a63ce516f33263e61313a3bad0695f | [
"MIT"
] | 1 | 2020-08-21T07:35:54.000Z | 2020-08-21T07:35:54.000Z | server.py | alexvbogdan/Assistant-for-People-with-Low-Vision | 2c8d60a857a63ce516f33263e61313a3bad0695f | [
"MIT"
] | null | null | null | server.py | alexvbogdan/Assistant-for-People-with-Low-Vision | 2c8d60a857a63ce516f33263e61313a3bad0695f | [
"MIT"
] | null | null | null | from __future__ import print_function
from flask import Flask, request, redirect, url_for, jsonify, send_from_directory
from time import time
import time
import numpy as np
import hashlib
import os
import sys
sys.path.append("./questionAnswering") # path to question answering module
from QuestionAnswering import Quest... | 29.815574 | 157 | 0.581306 |
7f4b387e48575d16d887b7d9f601f06f4ea2b7b9 | 2,600 | py | Python | clip_retrieval/clip_filter.py | techthiyanes/clip-retrieval | aa00e05704cc65e5fd91504216c6b6f3e991a0cc | [
"MIT"
] | 201 | 2021-06-08T10:58:25.000Z | 2022-03-29T21:23:44.000Z | clip_retrieval/clip_filter.py | techthiyanes/clip-retrieval | aa00e05704cc65e5fd91504216c6b6f3e991a0cc | [
"MIT"
] | 88 | 2021-06-21T14:58:10.000Z | 2022-03-24T10:20:32.000Z | clip_retrieval/clip_filter.py | techthiyanes/clip-retrieval | aa00e05704cc65e5fd91504216c6b6f3e991a0cc | [
"MIT"
] | 25 | 2021-07-31T21:49:56.000Z | 2022-03-23T17:54:02.000Z | """clip filter is a tool to use a knn index and a image/text collection to extract interesting subsets"""
import fire
def clip_filter(query, output_folder, indice_folder, num_results=100, threshold=None):
"""Entry point of clip filter"""
import faiss # pylint: disable=import-outside-toplevel
import to... | 34.210526 | 119 | 0.666154 |
8aac816e61445226ff66ccdfbe8f17dd2e061801 | 8,404 | py | Python | tests/syntax/test_specifiers.py | HaoranBai17/Scenic | 65372e488ec9323e550ccc1f157369aad88ad94d | [
"BSD-3-Clause"
] | 1 | 2019-06-14T21:04:37.000Z | 2019-06-14T21:04:37.000Z | tests/syntax/test_specifiers.py | yuul/Scenic | 66fbf7aa67e649cf2379ee6e4d4273ff4980c04c | [
"BSD-3-Clause"
] | null | null | null | tests/syntax/test_specifiers.py | yuul/Scenic | 66fbf7aa67e649cf2379ee6e4d4273ff4980c04c | [
"BSD-3-Clause"
] | 2 | 2020-01-02T12:37:46.000Z | 2020-07-30T02:02:01.000Z |
import math
import pytest
from scenic.syntax.translator import InterpreterParseError, InvalidScenarioError
from scenic.core.vectors import Vector
from tests.utils import compileScenic, sampleEgoFrom
## Dependencies and lazy evaluation
def test_double_specification():
with pytest.raises(InterpreterParseError):
... | 36.06867 | 80 | 0.639457 |
9706a8a0cfe6e79d68086c481e13af8756c61d91 | 47,453 | py | Python | Lib/distutils/ccompiler.py | gerph/cpython | 98813cb03c2371789669c3d8debf8fca2a344de9 | [
"CNRI-Python-GPL-Compatible"
] | 5 | 2020-01-25T19:30:31.000Z | 2021-03-05T20:34:57.000Z | Lib/distutils/ccompiler.py | gerph/cpython | 98813cb03c2371789669c3d8debf8fca2a344de9 | [
"CNRI-Python-GPL-Compatible"
] | 18 | 2019-12-09T17:05:24.000Z | 2021-06-09T15:19:49.000Z | Lib/distutils/ccompiler.py | gerph/cpython | 98813cb03c2371789669c3d8debf8fca2a344de9 | [
"CNRI-Python-GPL-Compatible"
] | 3 | 2020-05-15T22:25:58.000Z | 2021-03-05T20:35:00.000Z | """distutils.ccompiler
Contains CCompiler, an abstract base class that defines the interface
for the Distutils compiler abstraction model."""
import sys, os, re
from distutils.errors import *
from distutils.spawn import spawn
from distutils.file_util import move_file
from distutils.dir_util import mkpath
from distuti... | 42.406613 | 92 | 0.615578 |
50975694cfa84bd032eaef252e7a3a1686329d87 | 124 | py | Python | shop/apps.py | marcopuccio/mpbb | 18e303308865493886af7667c79720eee766641c | [
"MIT"
] | null | null | null | shop/apps.py | marcopuccio/mpbb | 18e303308865493886af7667c79720eee766641c | [
"MIT"
] | 12 | 2019-10-02T17:18:09.000Z | 2022-03-11T23:54:53.000Z | shop/apps.py | marcopuccio/mpbb | 18e303308865493886af7667c79720eee766641c | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from django.apps import AppConfig
class ShopConfig(AppConfig):
name = 'shop'
| 15.5 | 39 | 0.782258 |
c096097a57fecd741f4c67dc473f40962f4d8f74 | 7,785 | py | Python | python_modules/libraries/dagster-databricks/dagster_databricks_tests/test_pyspark.py | makotonium/dagster | f5d56514b7e7c5bca28ea14060316d242f51b71b | [
"Apache-2.0"
] | 4,606 | 2018-06-21T17:45:20.000Z | 2022-03-31T23:39:42.000Z | python_modules/libraries/dagster-databricks/dagster_databricks_tests/test_pyspark.py | makotonium/dagster | f5d56514b7e7c5bca28ea14060316d242f51b71b | [
"Apache-2.0"
] | 6,221 | 2018-06-12T04:36:01.000Z | 2022-03-31T21:43:05.000Z | python_modules/libraries/dagster-databricks/dagster_databricks_tests/test_pyspark.py | makotonium/dagster | f5d56514b7e7c5bca28ea14060316d242f51b71b | [
"Apache-2.0"
] | 619 | 2018-08-22T22:43:09.000Z | 2022-03-31T22:48:06.000Z | import os
from unittest import mock
import pytest
from dagster import (
InputDefinition,
ModeDefinition,
OutputDefinition,
execute_pipeline,
fs_io_manager,
pipeline,
reconstructable,
solid,
)
from dagster.core.definitions.no_step_launcher import no_step_launcher
from dagster.utils.merge... | 31.905738 | 98 | 0.618882 |
6e2269ca705745e9caeb3c22251ca2bf252d3fc9 | 6,728 | py | Python | grl/rl_apps/psro/general_psro_eval.py | indylab/xdo | 1ddd92aa56ba10fa468396de8f8824c83ba9d0ba | [
"MIT"
] | 12 | 2021-03-12T07:18:52.000Z | 2022-03-15T22:30:44.000Z | grl/rl_apps/psro/general_psro_eval.py | indylab/xdo | 1ddd92aa56ba10fa468396de8f8824c83ba9d0ba | [
"MIT"
] | 1 | 2021-11-22T16:39:46.000Z | 2022-02-02T22:13:03.000Z | grl/rl_apps/psro/general_psro_eval.py | indylab/xdo | 1ddd92aa56ba10fa468396de8f8824c83ba9d0ba | [
"MIT"
] | 4 | 2021-06-21T03:54:45.000Z | 2022-01-13T10:28:26.000Z | import argparse
import logging
import time
import numpy as np
import ray
from ray.rllib.agents.trainer import with_common_config
from grl.algos.p2sro.eval_dispatcher.remote import RemoteEvalDispatcherClient
from grl.rl_apps import GRL_SEED
from grl.rl_apps.scenarios.catalog import scenario_catalog
from grl.rl_apps.sc... | 43.128205 | 117 | 0.676724 |
95b57e53cb69e7a0365a16294e049be2082f6de2 | 3,574 | py | Python | samples/kubeflow-tf/kubeflow-training-classification.py | pamarquez/pipelineHW | 5a5e39dc51add22c02e91222daa88fae0d82da9d | [
"Apache-2.0"
] | 1 | 2019-07-02T01:58:17.000Z | 2019-07-02T01:58:17.000Z | samples/kubeflow-tf/kubeflow-training-classification.py | kweinmeister/pipelines | a819506dbfdd188077b160f2cc77b17807e5cc8a | [
"Apache-2.0"
] | 21 | 2020-01-28T22:48:55.000Z | 2022-03-08T22:48:12.000Z | samples/kubeflow-tf/kubeflow-training-classification.py | pamarquez/pipelineHW | 5a5e39dc51add22c02e91222daa88fae0d82da9d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2019 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... | 38.847826 | 207 | 0.745663 |
c75d0756d81bcd50299c361bf16765d1de87c2bb | 1,706 | py | Python | vagrant/vagrant-brozzler-new-job.py | wolfgang42/brozzler | 0f27c9995ad0251a22f238bd7a01653e0ef3b7b9 | [
"Apache-2.0"
] | 519 | 2016-04-25T20:11:23.000Z | 2022-03-30T10:25:38.000Z | vagrant/vagrant-brozzler-new-job.py | wolfgang42/brozzler | 0f27c9995ad0251a22f238bd7a01653e0ef3b7b9 | [
"Apache-2.0"
] | 102 | 2016-05-17T17:17:30.000Z | 2022-02-25T23:26:17.000Z | vagrant/vagrant-brozzler-new-job.py | wolfgang42/brozzler | 0f27c9995ad0251a22f238bd7a01653e0ef3b7b9 | [
"Apache-2.0"
] | 94 | 2016-05-06T01:03:06.000Z | 2021-12-30T20:57:30.000Z | #!/usr/bin/env python
'''
vagrant-brozzler-new-job.py - runs brozzler-new-job inside the vagrant vm to
queue a job for your vagrant brozzler deployment.
This is a standalone script with no dependencies other than python, and should
work with python 2.7 or python 3.2+. The only reason it's not a bash script is
so we ca... | 34.12 | 78 | 0.705158 |
db8c782e0ee725eda53f3f770587326c4e826e54 | 532 | py | Python | Algo and DSA/LeetCode-Solutions-master/Python/reverse-words-in-a-string-ii.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 3,269 | 2018-10-12T01:29:40.000Z | 2022-03-31T17:58:41.000Z | Algo and DSA/LeetCode-Solutions-master/Python/reverse-words-in-a-string-ii.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 53 | 2018-12-16T22:54:20.000Z | 2022-02-25T08:31:20.000Z | Algo and DSA/LeetCode-Solutions-master/Python/reverse-words-in-a-string-ii.py | Sourav692/FAANG-Interview-Preparation | f523e5c94d582328b3edc449ea16ac6ab28cdc81 | [
"Unlicense"
] | 1,236 | 2018-10-12T02:51:40.000Z | 2022-03-30T13:30:37.000Z | # Time: O(n)
# Space:O(1)
class Solution(object):
def reverseWords(self, s):
"""
:type s: a list of 1 length strings (List[str])
:rtype: nothing
"""
def reverse(s, begin, end):
for i in xrange((end - begin) / 2):
s[begin + i], s[end - 1 - i] = s[e... | 24.181818 | 75 | 0.411654 |
b3c5fe35b37fa38a081633042560f1a1d9c857aa | 309 | py | Python | sabueso/protein/is_protein.py | dprada/sabueso | 14843cf3522b5b89db5b61c1541a7015f114dd53 | [
"MIT"
] | null | null | null | sabueso/protein/is_protein.py | dprada/sabueso | 14843cf3522b5b89db5b61c1541a7015f114dd53 | [
"MIT"
] | 2 | 2022-01-31T21:22:17.000Z | 2022-02-04T20:20:12.000Z | sabueso/protein/is_protein.py | dprada/sabueso | 14843cf3522b5b89db5b61c1541a7015f114dd53 | [
"MIT"
] | 1 | 2021-07-20T15:01:14.000Z | 2021-07-20T15:01:14.000Z |
def is_protein(molecular_system, indices='all'):
from sabueso import get_form
from sabueso.forms import dict_is_protein
form = get_form(molecular_system)
output = dict_is_protein[form](molecular_system, indices='all')
if len(output)==1:
output = output[0]
return output
| 19.3125 | 67 | 0.702265 |
206896c8381e63fbd15895ce9e336363cd8b7627 | 32,367 | py | Python | sdk/python/pulumi_azure_nextgen/importexport/v20161101/outputs.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/importexport/v20161101/outputs.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/importexport/v20161101/outputs.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 40.611041 | 319 | 0.651157 |
78ec3c249f67bc2058141e704634f42967c3cc0d | 653 | py | Python | python/sorting/quicksort_test.py | giubueno/algorithms | 950730befc4db7e85838e93d2bd4068abaa176a7 | [
"MIT"
] | 2 | 2021-02-26T11:51:29.000Z | 2021-02-26T11:51:43.000Z | python/sorting/quicksort_test.py | giubueno/algorithms | 950730befc4db7e85838e93d2bd4068abaa176a7 | [
"MIT"
] | null | null | null | python/sorting/quicksort_test.py | giubueno/algorithms | 950730befc4db7e85838e93d2bd4068abaa176a7 | [
"MIT"
] | null | null | null | import unittest
from Quicksort import sortArray
class TestStringMethods(unittest.TestCase):
def test_quicksort_simple(self):
self.assertListEqual(sortArray([1,3,5,0]), [0,1,3,5])
def test_quicksort_repeation(self):
self.assertListEqual(sortArray([0,3,5,0]), [0,0,3,5])
def test_quicksort_s... | 29.681818 | 65 | 0.669219 |
ceee26367273e233da6b1a8de4405aa732359f5a | 1,409 | py | Python | datastore/shared/util/__init__.py | jsangmeister/openslides-datastore-service | 7170f008ccac0b31c37ffeee083b972bc314660d | [
"MIT"
] | 2 | 2020-01-20T13:56:28.000Z | 2020-02-17T10:56:26.000Z | datastore/shared/util/__init__.py | jsangmeister/openslides-datastore-service | 7170f008ccac0b31c37ffeee083b972bc314660d | [
"MIT"
] | 122 | 2020-01-16T15:13:37.000Z | 2022-03-17T10:32:47.000Z | datastore/shared/util/__init__.py | jsangmeister/openslides-datastore-service | 7170f008ccac0b31c37ffeee083b972bc314660d | [
"MIT"
] | 7 | 2020-02-20T12:04:17.000Z | 2021-11-23T17:54:33.000Z | from ..typing import JSON, Collection, Field, Fqid, Id, Model, Position # noqa
from .deleted_models_behaviour import ( # noqa
DeletedModelsBehaviour,
get_exception_for_deleted_models_behaviour,
)
from .exceptions import ( # noqa
BadCodingError,
DatastoreException,
DatastoreNotEmpty,
InvalidDa... | 24.293103 | 79 | 0.741661 |
7e9a70a8f79e27679402473b54012b84c6e87357 | 1,725 | py | Python | backend-tests/tests/api/deviceauth.py | spockfish/mender-integration | 09441e4ec88c837605aa12d70db4faa8f1a16b59 | [
"Apache-2.0"
] | null | null | null | backend-tests/tests/api/deviceauth.py | spockfish/mender-integration | 09441e4ec88c837605aa12d70db4faa8f1a16b59 | [
"Apache-2.0"
] | null | null | null | backend-tests/tests/api/deviceauth.py | spockfish/mender-integration | 09441e4ec88c837605aa12d70db4faa8f1a16b59 | [
"Apache-2.0"
] | 1 | 2019-05-10T14:25:13.000Z | 2019-05-10T14:25:13.000Z | # Copyright 2018 Northern.tech AS
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 33.173077 | 77 | 0.717101 |
e94ef6a926e4f152f4b62d0b6c4e3cb379ebd6bc | 3,065 | py | Python | graphviz/lang.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2022-01-25T22:52:58.000Z | 2022-01-25T22:52:58.000Z | graphviz/lang.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | graphviz/lang.py | EnjoyLifeFund/Debian_py36_packages | 1985d4c73fabd5f08f54b922e73a9306e09c77a5 | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | # lang.py - dot language creation helpers
"""Quote strings to be valid DOT identifiers, assemble attribute lists."""
import re
from . import tools
__all__ = ['quote', 'quote_edge', 'a_list', 'attr_list']
# http://www.graphviz.org/doc/info/lang.html
ID = re.compile(r'([a-zA-Z_][a-zA-Z0-9_]*|-?(\.\d+|\d... | 27.366071 | 95 | 0.555628 |
901c98564713e19b7ad2c3415461ff46eae08ecc | 8,664 | py | Python | python/cusignal/convolution/correlate.py | sean-frye/cusignal | 5e12771ca47e7ee653ebe79b236f86ce428ace84 | [
"Apache-2.0"
] | null | null | null | python/cusignal/convolution/correlate.py | sean-frye/cusignal | 5e12771ca47e7ee653ebe79b236f86ce428ace84 | [
"Apache-2.0"
] | null | null | null | python/cusignal/convolution/correlate.py | sean-frye/cusignal | 5e12771ca47e7ee653ebe79b236f86ce428ace84 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019-2020, NVIDIA CORPORATION.
# 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... | 34.245059 | 79 | 0.610688 |
e756467804095e36c04994392f239e08007f49cf | 331 | py | Python | own_practice/one_eleven.py | Ellis0817/Introduction-to-Programming-Using-Python | 1882a2a846162d5ff56d4d56c3940b638ef408bd | [
"MIT"
] | null | null | null | own_practice/one_eleven.py | Ellis0817/Introduction-to-Programming-Using-Python | 1882a2a846162d5ff56d4d56c3940b638ef408bd | [
"MIT"
] | 4 | 2019-11-07T12:32:19.000Z | 2020-07-19T14:04:44.000Z | own_practice/one_eleven.py | Ellis0817/Introduction-to-Programming-Using-Python | 1882a2a846162d5ff56d4d56c3940b638ef408bd | [
"MIT"
] | 5 | 2019-12-04T15:56:55.000Z | 2022-01-14T06:19:18.000Z | u"""
程式設計練習題 1-6 1-11 人口推算.
美國人口普查局根據以下假設來推算人口:
- 每7秒中有一個小孩出生
- 每13秒鐘有一個人死亡
- 每45秒鐘有一個新移民入境
請撰寫一程式,顯示接下來五年的人口數。假設目前人口為312,032,486,每年有365天。
提示:在Python中,如果兩個整數做除法運算,結果還是整數。小數點會被去掉。比方說,5//4結果會是1
(而不是1.25),而10//4結果會是2(而不是2.5)。
"""
print((312032486 + (365 * 24 * 3600) // 7 - (365 * 24 * 3600) // 13 + (
365 * 24 * 360... | 20.6875 | 71 | 0.664653 |
4363d545194d4331bed7de71c0b6e6f8c4d9718e | 1,805 | py | Python | FeiZhai/OK/ZiXun/dongmanzixun/dongmanzixun/spiders/dongzi.py | FSen0/FeiZhai | 5fa635551066a1ba2866b345b39ecf13ef070103 | [
"Apache-2.0"
] | null | null | null | FeiZhai/OK/ZiXun/dongmanzixun/dongmanzixun/spiders/dongzi.py | FSen0/FeiZhai | 5fa635551066a1ba2866b345b39ecf13ef070103 | [
"Apache-2.0"
] | null | null | null | FeiZhai/OK/ZiXun/dongmanzixun/dongmanzixun/spiders/dongzi.py | FSen0/FeiZhai | 5fa635551066a1ba2866b345b39ecf13ef070103 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import scrapy
from dongmanzixun.items import DongmanzixunItem
class DongziSpider(scrapy.Spider):
name = 'dongzi'
allowed_domains = ['news.comicst.com']
start_urls = ['http://news.comicst.com/']
page = 1
url = 'http://news.comicst.com/index.php?page={}'
def parse(self,... | 35.392157 | 107 | 0.573407 |
cd5af835269313f16b34f389955041a7ae7e45d5 | 41,423 | py | Python | tensorflow/python/framework/tensor_util.py | TOT0RoKR/tensorflow | 12c2babf7dccc00c13d6e297c0f792f89f7408aa | [
"Apache-2.0"
] | 10 | 2021-05-25T17:43:04.000Z | 2022-03-08T10:46:09.000Z | tensorflow/python/framework/tensor_util.py | CaptainGizzy21/tensorflow | 3457a2b122e50b4d44ceaaed5a663d635e5c22df | [
"Apache-2.0"
] | 1,056 | 2019-12-15T01:20:31.000Z | 2022-02-10T02:06:28.000Z | tensorflow/python/framework/tensor_util.py | CaptainGizzy21/tensorflow | 3457a2b122e50b4d44ceaaed5a663d635e5c22df | [
"Apache-2.0"
] | 6 | 2016-09-07T04:00:15.000Z | 2022-01-12T01:47:38.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.984821 | 115 | 0.702508 |
10ec64423763f715851c20ce5c6252de470dc841 | 4,361 | py | Python | Chapter04/Chapter_4_ARIMA.py | stciaischoolrnn/Practical-Time-Series-Analysis | 72eeabbcf2a3af742b2a114026cfd841b0ea9184 | [
"MIT"
] | 267 | 2017-10-04T10:10:39.000Z | 2022-03-26T03:54:44.000Z | Chapter04/Chapter_4_ARIMA.py | stciaischoolrnn/Practical-Time-Series-Analysis | 72eeabbcf2a3af742b2a114026cfd841b0ea9184 | [
"MIT"
] | 5 | 2018-03-08T10:11:26.000Z | 2022-01-22T07:48:48.000Z | Chapter04/Chapter_4_ARIMA.py | stciaischoolrnn/Practical-Time-Series-Analysis | 72eeabbcf2a3af742b2a114026cfd841b0ea9184 | [
"MIT"
] | 215 | 2017-09-28T13:52:06.000Z | 2022-03-27T14:14:37.000Z | # Load Modules
from __future__ import print_function
import os
import pandas as pd
import numpy as np
from matplotlib import pyplot as plt
from statsmodels.graphics.tsaplots import plot_acf, plot_pacf
from statsmodels.tsa.arima_model import ARIMA
import statsmodels.api as sm
import statsmodels.tsa.api as smtsa
# Func... | 30.929078 | 103 | 0.690667 |
1d67756efa059874c1c33a0e2b4a7a42273ee83e | 180 | py | Python | fudgeit/recommendation/admin.py | fahimtran/hackgt-8 | 2746cd334b73268ea1f5872c796873125056e61d | [
"MIT"
] | null | null | null | fudgeit/recommendation/admin.py | fahimtran/hackgt-8 | 2746cd334b73268ea1f5872c796873125056e61d | [
"MIT"
] | null | null | null | fudgeit/recommendation/admin.py | fahimtran/hackgt-8 | 2746cd334b73268ea1f5872c796873125056e61d | [
"MIT"
] | null | null | null | from django.contrib import admin
from recommendation.models import Restaurant, FoodItem
# Register your models here.
admin.site.register(Restaurant)
admin.site.register(FoodItem)
| 25.714286 | 54 | 0.833333 |
bf578b99fd912ddc1437dbe9a6b1bcbdc031b3e5 | 833 | py | Python | V8_SensorDistancia_Recepcion.py | Cellista33/Trabajo_9 | c00abfaf909df3aeb168fc7468dc54edb50bad8b | [
"MIT"
] | null | null | null | V8_SensorDistancia_Recepcion.py | Cellista33/Trabajo_9 | c00abfaf909df3aeb168fc7468dc54edb50bad8b | [
"MIT"
] | null | null | null | V8_SensorDistancia_Recepcion.py | Cellista33/Trabajo_9 | c00abfaf909df3aeb168fc7468dc54edb50bad8b | [
"MIT"
] | null | null | null | import serial
import time
from turtle import *
def grafico(dis):
x1 = 217-233-dis
x4 = 217-dis
x3 = x4
x2 = x1
y1 = -69
y2 = 69
y4 = y1
y3 = y2
setup (434, 200, 0, 0)
screensize(433, 200 )
title("EL TWIZY QUE APARCA")
hideturtle()
pencolor("red")
... | 12.815385 | 67 | 0.519808 |
347472d387f62c0f0e1c4919f0e49d214eac0d4d | 1,025 | py | Python | cli_app/engine/notifier.py | namuan/news-rider | 2f8f5204eda717e39ab7d4c048692d5ec2eb5449 | [
"MIT"
] | 5 | 2021-04-26T20:46:30.000Z | 2021-05-03T07:29:31.000Z | cli_app/engine/notifier.py | namuan/news-rider | 2f8f5204eda717e39ab7d4c048692d5ec2eb5449 | [
"MIT"
] | null | null | null | cli_app/engine/notifier.py | namuan/news-rider | 2f8f5204eda717e39ab7d4c048692d5ec2eb5449 | [
"MIT"
] | null | null | null | import json
import os
import sys
import requests
from dotenv import load_dotenv
from .log_helper import logger
sys.path.append(os.getcwd())
load_dotenv(verbose=True)
PUSHOVER_TOKEN = os.getenv("PUSHOVER_TOKEN")
PUSHOVER_USER_KEY = os.getenv("PUSHOVER_USER_KEY")
def notify_user(title, msg):
try:
respon... | 27.702703 | 70 | 0.612683 |
5b0febff823bed0ec74bed39945cfbfa6f4e237f | 3,442 | py | Python | tests/gallery/test_summarystatsagg.py | krisHans3n/geoalchemy2-mysql | 38a44d51c242d867f40d4c5503c91f52a8269ff4 | [
"MIT"
] | null | null | null | tests/gallery/test_summarystatsagg.py | krisHans3n/geoalchemy2-mysql | 38a44d51c242d867f40d4c5503c91f52a8269ff4 | [
"MIT"
] | null | null | null | tests/gallery/test_summarystatsagg.py | krisHans3n/geoalchemy2-mysql | 38a44d51c242d867f40d4c5503c91f52a8269ff4 | [
"MIT"
] | null | null | null | """
Use CompositeType
=================
Some functions return composite types. This example shows how to deal with this
kind of functions.
"""
import pytest
from pkg_resources import parse_version
from sqlalchemy import Column
from sqlalchemy import Float
from sqlalchemy import Integer
from sqlalchemy import MetaData
... | 29.169492 | 90 | 0.639454 |
5c944b92c4fa28a2cc2f05731987a9d9239eb590 | 6,583 | py | Python | lib/gui/gridview.py | frontinc-ayau/dsce | 39051752f8f2e75f912903b0b07f7ad0aba680d8 | [
"Apache-2.0"
] | null | null | null | lib/gui/gridview.py | frontinc-ayau/dsce | 39051752f8f2e75f912903b0b07f7ad0aba680d8 | [
"Apache-2.0"
] | null | null | null | lib/gui/gridview.py | frontinc-ayau/dsce | 39051752f8f2e75f912903b0b07f7ad0aba680d8 | [
"Apache-2.0"
] | null | null | null | # This file is part of the DomainSharedContactsEditor (DSCE) application.
#
# DSCE is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... | 35.972678 | 100 | 0.634969 |
1072433d27472659e823d353b8c2d85c0d1ecbd9 | 17,273 | py | Python | nova/virt/libvirt/utils.py | vasart/nova | bca5004d367e0418e35f8a72fe0f2e106e977ab0 | [
"Apache-2.0"
] | 1 | 2021-09-10T15:29:02.000Z | 2021-09-10T15:29:02.000Z | nova/virt/libvirt/utils.py | PFZheng/nova | 84be8abbccb5ddc2d7c5a7db59019ed1edb19e7f | [
"Apache-2.0"
] | null | null | null | nova/virt/libvirt/utils.py | PFZheng/nova | 84be8abbccb5ddc2d7c5a7db59019ed1edb19e7f | [
"Apache-2.0"
] | null | null | null | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyright (c) 2011 OpenStack Foundation
# (c) Cop... | 32.468045 | 78 | 0.634111 |
2b47a6dee3d34acd702ffeff9b13940608c41b21 | 3,699 | py | Python | Desktop/cs61a/lab/lab10/reader.py | cpvb13/cal-hack-5-proj | 13e31fff3f56b57030c34147b04cef1d6309c62b | [
"MIT"
] | 6 | 2018-09-01T15:11:11.000Z | 2022-03-23T00:34:31.000Z | Desktop/cs61a/lab/lab10/reader.py | cpvb13/cal-hack-5-proj | 13e31fff3f56b57030c34147b04cef1d6309c62b | [
"MIT"
] | null | null | null | Desktop/cs61a/lab/lab10/reader.py | cpvb13/cal-hack-5-proj | 13e31fff3f56b57030c34147b04cef1d6309c62b | [
"MIT"
] | 3 | 2020-07-25T22:03:58.000Z | 2022-01-05T18:54:52.000Z | import string
from buffer import Buffer
from expr import *
SYMBOL_STARTS = set(string.ascii_lowercase + string.ascii_uppercase + '_')
SYMBOL_INNERS = SYMBOL_STARTS | set(string.digits)
NUMERAL = set(string.digits + '-.')
WHITESPACE = set(' \t\n\r')
DELIMITERS = set('(),:')
def read(s):
"""Parse an expression fro... | 28.453846 | 81 | 0.583401 |
d0877eb244ce75015a69bff9c7ebf32d79f3262d | 1,008 | py | Python | 2018/codemotion/cnd/demo/vote/app.py | pchico83/talks | 8335e8740e764a4e45c443597b70bca684ba0238 | [
"Apache-2.0"
] | null | null | null | 2018/codemotion/cnd/demo/vote/app.py | pchico83/talks | 8335e8740e764a4e45c443597b70bca684ba0238 | [
"Apache-2.0"
] | null | null | null | 2018/codemotion/cnd/demo/vote/app.py | pchico83/talks | 8335e8740e764a4e45c443597b70bca684ba0238 | [
"Apache-2.0"
] | null | null | null | from flask import Flask, render_template, request, make_response, g
from redis import Redis
import os
import socket
import random
import json
option_a = os.getenv('OPTION_A', "AAA")
option_b = os.getenv('OPTION_B', "Dogs")
hostname = socket.gethostname()
app = Flask(__name__)
def get_redis():
if not hasattr(g, ... | 24 | 67 | 0.632937 |
5c4dfd3d25d55e3ed71a388ba4c9a33ce854e381 | 684 | py | Python | 8ball.py | cccepc/dpr228 | 175613d086d2c544d6bee1e3482294326979f9ae | [
"Apache-2.0"
] | null | null | null | 8ball.py | cccepc/dpr228 | 175613d086d2c544d6bee1e3482294326979f9ae | [
"Apache-2.0"
] | null | null | null | 8ball.py | cccepc/dpr228 | 175613d086d2c544d6bee1e3482294326979f9ae | [
"Apache-2.0"
] | null | null | null | import random
def getAnswer(answerNumber):
if answerNumber == 1:
return 'It is certain'
elif answerNumber == 2:
return 'It is decidedly so'
elif answerNumber == 3:
return 'Yes'
elif answerNumber == 4:
return 'Reply hazy try again'
elif answerNumber == 5:
... | 26.307692 | 43 | 0.593567 |
8ca93981a5ebe08e6349e061d96013b8fae414f8 | 961 | py | Python | isi_sdk_9_0_0/test/test_dedupe_settings_settings.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_9_0_0/test/test_dedupe_settings_settings.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_9_0_0/test/test_dedupe_settings_settings.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 10
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_9_0_0
from ... | 23.439024 | 102 | 0.723205 |
2aec9d11c3117c74123550aab275ffd0a5c9dac5 | 1,879 | py | Python | examples/gallery/embellishments/colorbars_multiple.py | arleaman/pygmt | 7f53b9dae66fae3f0cd91c7feb92ef53bf7d9f42 | [
"BSD-3-Clause"
] | 1 | 2021-11-16T01:29:59.000Z | 2021-11-16T01:29:59.000Z | examples/gallery/embellishments/colorbars_multiple.py | PeiyanXi/pygmt | 1b74259a0346f45ff4e42244185450d0e70cc2ff | [
"BSD-3-Clause"
] | 18 | 2021-11-02T21:16:06.000Z | 2022-03-22T21:15:40.000Z | examples/gallery/embellishments/colorbars_multiple.py | geodeepak/Pygmt | 77949bba289102d3077cfa9b7fda26f74ef6aed0 | [
"BSD-3-Clause"
] | null | null | null | """
Multiple colormaps
------------------
This gallery example shows how to create multiple colormaps for different
subplots. To better understand how GMT modern mode maintains several levels of
colormaps, please refer to
:gmt-docs:`cookbook/features.html#gmt-modern-mode-hierarchical-levels` for
details.
"""
import pyg... | 41.755556 | 86 | 0.700905 |
e98774dc3bf7d3d1a4dbd13092bd5cc1d058e576 | 296 | py | Python | Players/AIPlayer.py | Lunalulululu/Cardgame | 97756464d8ea5ed252ae6817e6c121590c6b4130 | [
"Apache-2.0"
] | null | null | null | Players/AIPlayer.py | Lunalulululu/Cardgame | 97756464d8ea5ed252ae6817e6c121590c6b4130 | [
"Apache-2.0"
] | null | null | null | Players/AIPlayer.py | Lunalulululu/Cardgame | 97756464d8ea5ed252ae6817e6c121590c6b4130 | [
"Apache-2.0"
] | null | null | null | from OptimalDiscard import OptimalDiscard
from OptimalGrouping import OptimalGrouping
from Players.Player import Player
class AIPlayer(Player):
def do_discard(self):
OptimalDiscard(self)
def do_grouping(self):
if len(self.hand) == 10:
OptimalGrouping(self)
| 22.769231 | 43 | 0.719595 |
7daa81a0ac0e13b744a6b44d3531c130a2a4092f | 2,598 | py | Python | src/poetry/console/commands/publish.py | robin92/poetry | 7cc684981983963dc202e1a249a4b66667b468bd | [
"MIT"
] | null | null | null | src/poetry/console/commands/publish.py | robin92/poetry | 7cc684981983963dc202e1a249a4b66667b468bd | [
"MIT"
] | null | null | null | src/poetry/console/commands/publish.py | robin92/poetry | 7cc684981983963dc202e1a249a4b66667b468bd | [
"MIT"
] | null | null | null | from pathlib import Path
from typing import Optional
from cleo.helpers import option
from poetry.console.commands.command import Command
class PublishCommand(Command):
name = "publish"
description = "Publishes a package to a remote repository."
options = [
option(
"repository", "r"... | 29.862069 | 88 | 0.585835 |
9cdab62b48749bea48ad417b986b14e915053aae | 12,168 | py | Python | google/cloud/firestore_v1/async_client.py | tswast/python-firestore | 1f44a45419a85d8646ded5f22d6cbab697761651 | [
"Apache-2.0"
] | null | null | null | google/cloud/firestore_v1/async_client.py | tswast/python-firestore | 1f44a45419a85d8646ded5f22d6cbab697761651 | [
"Apache-2.0"
] | null | null | null | google/cloud/firestore_v1/async_client.py | tswast/python-firestore | 1f44a45419a85d8646ded5f22d6cbab697761651 | [
"Apache-2.0"
] | 1 | 2020-10-04T12:11:36.000Z | 2020-10-04T12:11:36.000Z | # Copyright 2020 Google LLC 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... | 37.555556 | 107 | 0.644313 |
7e65a59da65ea9219aba1b59c7958de1b4b9109c | 2,818 | py | Python | quorum/quorum_algorithm.py | Blackjack92/distributed-decision-trees-corrution-analysis | fb12a29eb8b767996e1cdcbb0a73bb7f0ad8de75 | [
"MIT"
] | null | null | null | quorum/quorum_algorithm.py | Blackjack92/distributed-decision-trees-corrution-analysis | fb12a29eb8b767996e1cdcbb0a73bb7f0ad8de75 | [
"MIT"
] | null | null | null | quorum/quorum_algorithm.py | Blackjack92/distributed-decision-trees-corrution-analysis | fb12a29eb8b767996e1cdcbb0a73bb7f0ad8de75 | [
"MIT"
] | null | null | null | import os
import sys
import functools
import itertools
import random
scriptpath = "../"
# Add the directory containing your module to the Python path (wants absolute paths)
sys.path.append(os.path.abspath(scriptpath))
import dt_algorithm
def calculate_quorum_tree_len(quorum_tree):
return functools.reduce(lambda ... | 40.257143 | 126 | 0.75763 |
a5f8a33d1408ca06ddf63d241f325859f87bc8e4 | 291 | py | Python | 1066.py | heltonricardo/URI | 160cca22d94aa667177c9ebf2a1c9864c5e55b41 | [
"MIT"
] | 6 | 2021-04-13T00:33:43.000Z | 2022-02-10T10:23:59.000Z | 1066.py | heltonricardo/URI | 160cca22d94aa667177c9ebf2a1c9864c5e55b41 | [
"MIT"
] | null | null | null | 1066.py | heltonricardo/URI | 160cca22d94aa667177c9ebf2a1c9864c5e55b41 | [
"MIT"
] | 3 | 2021-03-23T18:42:24.000Z | 2022-02-10T10:24:07.000Z | pa = im = po = ne = 0
for i in range(5):
n = int(input())
if n % 2 == 0: pa += 1
else: im += 1
if n > 0: po += 1
elif n < 0: ne += 1
print(pa , 'valor(es) par(es)')
print(im , 'valor(es) impar(es)')
print(po , 'valor(es) positivo(s)')
print(ne , 'valor(es) negativo(s)')
| 24.25 | 35 | 0.505155 |
45e46b8e066aa7f46a3d3a93ad1781a92a5ad9d6 | 5,615 | py | Python | zvt/recorders/eastmoney/meta/china_stock_category_recorder.py | doncat99/zvt | 831183bdf7a6d0fc3acd3ea51984df590078eec6 | [
"MIT"
] | 10 | 2020-08-08T04:43:00.000Z | 2021-07-23T05:38:11.000Z | zvt/recorders/eastmoney/meta/china_stock_category_recorder.py | doncat99/zvt | 831183bdf7a6d0fc3acd3ea51984df590078eec6 | [
"MIT"
] | 1 | 2021-08-14T12:19:18.000Z | 2021-09-30T06:44:04.000Z | zvt/recorders/eastmoney/meta/china_stock_category_recorder.py | doncat99/zvt | 831183bdf7a6d0fc3acd3ea51984df590078eec6 | [
"MIT"
] | 1 | 2021-12-16T01:57:37.000Z | 2021-12-16T01:57:37.000Z | # -*- coding: utf-8 -*-
import pandas as pd
from numba import njit
from zvt import zvt_config
from zvt.api.data_type import Region, Provider, EntityType
from zvt.api.quote import china_stock_code_to_id
from zvt.domain import BlockStock, BlockCategory, Block
from zvt.contract.api import df_to_db
from zvt.contract.recor... | 40.395683 | 263 | 0.654675 |
58feb55017462e7efa4d72ed4df75abfd5f318ad | 16,784 | py | Python | backend/modules/watson_developer_cloud/watson_service.py | RaitzeR/FinnBros | a2d7e3e755af7bb22bb2ce779ea1f36c6bed961b | [
"MIT"
] | null | null | null | backend/modules/watson_developer_cloud/watson_service.py | RaitzeR/FinnBros | a2d7e3e755af7bb22bb2ce779ea1f36c6bed961b | [
"MIT"
] | 10 | 2020-06-05T18:08:03.000Z | 2022-03-11T23:19:52.000Z | backend/modules/watson_developer_cloud/watson_service.py | RaitzeR/FinnBros | a2d7e3e755af7bb22bb2ce779ea1f36c6bed961b | [
"MIT"
] | null | null | null | # coding: utf-8
# Copyright 2017 IBM 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... | 37.380846 | 134 | 0.633878 |
e12825b9a5af5d59a3a50a92c8c06b6e0e080535 | 575 | py | Python | deepbgc/output/pfam_tsv.py | gkapatai/deepbgc | 977fa56972a38b9405725315f566a939d5d21759 | [
"MIT"
] | 60 | 2019-02-01T14:40:32.000Z | 2022-03-10T14:15:01.000Z | deepbgc/output/pfam_tsv.py | gkapatai/deepbgc | 977fa56972a38b9405725315f566a939d5d21759 | [
"MIT"
] | 43 | 2019-01-31T17:17:47.000Z | 2022-03-22T21:14:43.000Z | deepbgc/output/pfam_tsv.py | gkapatai/deepbgc | 977fa56972a38b9405725315f566a939d5d21759 | [
"MIT"
] | 24 | 2019-01-14T19:12:16.000Z | 2021-11-02T08:32:02.000Z | import logging
from deepbgc import util
from deepbgc.output.writer import TSVWriter
class PfamTSVWriter(TSVWriter):
@classmethod
def get_description(cls):
return 'Table of Pfam domains (pfam_id) from given sequence (sequence_id) in genomic order, with BGC detection scores'
@classmethod
def ... | 27.380952 | 126 | 0.707826 |
5dd1ccf8332fc9a9227f9a245c243895e11fd837 | 39 | py | Python | QUANTAXIS_Trade/QA_status_center/__init__.py | xiongyixiaoyang/QUANTAXIS | 08441ce711e55385e2b01f80df17d34e7e89f564 | [
"MIT"
] | 92 | 2017-03-22T07:27:21.000Z | 2021-04-04T06:59:26.000Z | QUANTAXIS_Trade/QA_status_center/__init__.py | xiongyixiaoyang/QUANTAXIS | 08441ce711e55385e2b01f80df17d34e7e89f564 | [
"MIT"
] | 2 | 2017-12-27T02:34:32.000Z | 2018-04-18T02:50:13.000Z | QUANTAXIS_Trade/QA_status_center/__init__.py | xiongyixiaoyang/QUANTAXIS | 08441ce711e55385e2b01f80df17d34e7e89f564 | [
"MIT"
] | 7 | 2017-03-22T07:27:25.000Z | 2020-04-28T08:44:03.000Z | #coding:utf-8
"""
状态维护中心,确定订单状态等等
""" | 6.5 | 15 | 0.615385 |
0990e38f2a1cf6f0d6f25d16cd680e2208a55f3e | 11,696 | py | Python | external/vcm/vcm/cubedsphere/regridz.py | jacnugent/fv3net | 84958651bdd17784fdab98f87ad0d65414c03368 | [
"MIT"
] | null | null | null | external/vcm/vcm/cubedsphere/regridz.py | jacnugent/fv3net | 84958651bdd17784fdab98f87ad0d65414c03368 | [
"MIT"
] | null | null | null | external/vcm/vcm/cubedsphere/regridz.py | jacnugent/fv3net | 84958651bdd17784fdab98f87ad0d65414c03368 | [
"MIT"
] | null | null | null | import dask
import numpy as np
import xarray as xr
from typing import Tuple, Union
import vcm.mappm
from ..calc.thermo import pressure_at_interface
from ..cubedsphere import edge_weighted_block_average, weighted_block_average
from ..cubedsphere.coarsen import block_upsample_like
from ..cubedsphere.constants import (
... | 34.501475 | 88 | 0.671939 |
3409dfa4972d6dae58406ce1cd4526ddc8d2a72b | 29,771 | py | Python | tensorflow/python/keras/testing_utils.py | ouakif/tensorflow | 63c45aacf30e819b00e74b85bd1c9f11b0760cd3 | [
"Apache-2.0"
] | 27 | 2020-02-29T04:13:22.000Z | 2022-02-07T21:54:50.000Z | tensorflow/python/keras/testing_utils.py | top-on/tensorflow | 6efce9a74d4ba2ba2182d92ac1e4f144b5d755d2 | [
"Apache-2.0"
] | 5 | 2020-06-01T18:50:38.000Z | 2021-07-16T07:13:52.000Z | tensorflow/python/keras/testing_utils.py | top-on/tensorflow | 6efce9a74d4ba2ba2182d92ac1e4f144b5d755d2 | [
"Apache-2.0"
] | 10 | 2020-12-15T03:55:24.000Z | 2021-12-17T23:14:11.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.273697 | 88 | 0.700548 |
6e32491e85557dfaca3d49711288198d50f511ab | 312 | py | Python | blog/urls.py | admtomas/cybersecurity_blog | bad19ad189b1fdb770a935ecaac85187e6f62271 | [
"MIT"
] | null | null | null | blog/urls.py | admtomas/cybersecurity_blog | bad19ad189b1fdb770a935ecaac85187e6f62271 | [
"MIT"
] | null | null | null | blog/urls.py | admtomas/cybersecurity_blog | bad19ad189b1fdb770a935ecaac85187e6f62271 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
app_name = 'blog'
urlpatterns = [
path('', views.post_list, name='post_list'),
path('<slug:post>/', views.post_detail, name='post_detail'),
path('comment/reply/', views.reply_page, name='reply'),
path('about', views.about_page, name='about'),
]
| 26 | 64 | 0.669872 |
45a430ee9e5e39a41348e7fbc6f0e24240168953 | 17,478 | py | Python | uhd_restpy/testplatform/sessions/ixnetwork/topology/rsvpp2mpingresssublsps_c610bddfdb08c054e463708b863af4f0.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 20 | 2019-05-07T01:59:14.000Z | 2022-02-11T05:24:47.000Z | uhd_restpy/testplatform/sessions/ixnetwork/topology/rsvpp2mpingresssublsps_c610bddfdb08c054e463708b863af4f0.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 60 | 2019-04-03T18:59:35.000Z | 2022-02-22T12:05:05.000Z | uhd_restpy/testplatform/sessions/ixnetwork/topology/rsvpp2mpingresssublsps_c610bddfdb08c054e463708b863af4f0.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 13 | 2019-05-20T10:48:31.000Z | 2021-10-06T07:45:44.000Z | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify,... | 42.943489 | 1,774 | 0.653736 |
f23a91cc540fb271100666f8db10a5352608fcdb | 13,547 | py | Python | bindings/java/java_generator.py | nirbheek/openwebrtc | 838d6eedf2b4e53224a60f3da8529e6cc621359f | [
"BSD-2-Clause"
] | null | null | null | bindings/java/java_generator.py | nirbheek/openwebrtc | 838d6eedf2b4e53224a60f3da8529e6cc621359f | [
"BSD-2-Clause"
] | null | null | null | bindings/java/java_generator.py | nirbheek/openwebrtc | 838d6eedf2b4e53224a60f3da8529e6cc621359f | [
"BSD-2-Clause"
] | null | null | null | # Copyright (c) 2014, Ericsson AB. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the fol... | 32.486811 | 124 | 0.571639 |
839b8c118726c68da2e8a06e4975472c985234ad | 142 | py | Python | sandbox/lib/jumpscale/JumpscaleLibsExtra/clients/racktivity/energyswitch/modelfactory/models/RTF0032/Master_0_0_4_4.py | threefoldtech/threebot_prebuilt | 1f0e1c65c14cef079cd80f73927d7c8318755c48 | [
"Apache-2.0"
] | 2 | 2019-05-09T07:21:25.000Z | 2019-08-05T06:37:53.000Z | sandbox/lib/jumpscale/JumpscaleLibsExtra/clients/racktivity/energyswitch/modelfactory/models/RTF0032/Master_0_0_4_4.py | threefoldtech/threebot_prebuilt | 1f0e1c65c14cef079cd80f73927d7c8318755c48 | [
"Apache-2.0"
] | 664 | 2018-12-19T12:43:44.000Z | 2019-08-23T04:24:42.000Z | Jumpscale/clients/racktivity/energyswitch/modelfactory/models/RTF0032/Master_0_0_4_4.py | threefoldtech/jumpscale10 | 5fb073a82aeb0e66fc7d9660c45a1e31bc094bfa | [
"Apache-2.0"
] | 7 | 2019-05-03T07:14:37.000Z | 2019-08-05T12:36:52.000Z | from clients.racktivity.energyswitch.modelfactory.models.common.Master_0_0_4_4 import Model as ModelClass
class Model(ModelClass):
pass
| 23.666667 | 105 | 0.830986 |
e9ced04bd0d3656821864a27ed83bbb6558dc5a8 | 1,072 | py | Python | day20/day20.py | Strandtasche/go-experiments | 650b3e49439792a3e4e491436676197b720726b4 | [
"MIT"
] | null | null | null | day20/day20.py | Strandtasche/go-experiments | 650b3e49439792a3e4e491436676197b720726b4 | [
"MIT"
] | null | null | null | day20/day20.py | Strandtasche/go-experiments | 650b3e49439792a3e4e491436676197b720726b4 | [
"MIT"
] | null | null | null | import numpy as np
from collections import Counter
with open('./data/input20.txt') as f:
tiles = [l.rstrip('\n') for l in f.read().split('\n\n')]
matched = {}
sides = {}
allsides = []
for tile in tiles:
tmp = tile.split('\n')
number = int(tmp[0].split()[1][:-1])
rep = np.array([list(line) for line ... | 22.333333 | 60 | 0.602612 |
d8e07aaf4064f9ab9e182485ac68ce8df9d92cd3 | 3,061 | py | Python | model.py | kylemin/A2CL-PT | 53a56d1b11f800741a41e784e8bcb2114199a1c6 | [
"MIT"
] | 48 | 2020-07-16T03:34:22.000Z | 2022-03-24T07:23:43.000Z | model.py | kylemin/A2CL-PT | 53a56d1b11f800741a41e784e8bcb2114199a1c6 | [
"MIT"
] | 9 | 2020-08-17T03:05:10.000Z | 2022-02-23T10:16:30.000Z | model.py | kylemin/A2CL-PT | 53a56d1b11f800741a41e784e8bcb2114199a1c6 | [
"MIT"
] | 9 | 2020-09-02T01:57:08.000Z | 2022-02-27T14:06:46.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.init as torch_init
from math import ceil, floor
def weights_init(m):
classname = m.__class__.__name__
if classname.find('Conv') != -1 or classname.find('Linear') != -1:
torch_init.xavier_uniform_(m.weight)
if m.b... | 39.753247 | 158 | 0.619079 |
7ddde92a995a9b74dc88eac38a7ef31ff2e15f55 | 4,072 | py | Python | project/GUI/GUICore.py | RemuTeam/Remu | a7d100ff9002b1b1d27249f8adf510b5a89c09e3 | [
"MIT"
] | 2 | 2017-09-18T11:04:38.000Z | 2017-09-25T17:23:21.000Z | project/GUI/GUICore.py | RemuTeam/Remu | a7d100ff9002b1b1d27249f8adf510b5a89c09e3 | [
"MIT"
] | 26 | 2017-09-20T09:11:10.000Z | 2017-12-11T12:21:56.000Z | project/GUI/GUICore.py | RemuTeam/Remu | a7d100ff9002b1b1d27249f8adf510b5a89c09e3 | [
"MIT"
] | null | null | null | from kivy.app import App
from kivy.properties import StringProperty
from kivy.uix.screenmanager import ScreenManager, Screen
from GUI.MasterGUI.MasterGUILayout import MasterGUILayout
from GUI.MasterGUI.ProjectOverview import ProjectOverview # Do not remove, needed by RemuSM!
from GUI.SlaveGUI.PresentationLayout import... | 31.8125 | 93 | 0.670432 |
6d0110085c9b6c82a74d002debd653a2a9419c65 | 405 | py | Python | astrazenecadev/wsgi.py | Nicolasvegam/astrazeneca | 9f549c170553d6ad13bc2949e147f4a2a53cb67d | [
"MIT"
] | null | null | null | astrazenecadev/wsgi.py | Nicolasvegam/astrazeneca | 9f549c170553d6ad13bc2949e147f4a2a53cb67d | [
"MIT"
] | null | null | null | astrazenecadev/wsgi.py | Nicolasvegam/astrazeneca | 9f549c170553d6ad13bc2949e147f4a2a53cb67d | [
"MIT"
] | null | null | null | """
WSGI config for astrazenecadev project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANG... | 23.823529 | 78 | 0.792593 |
3702fa725c47e6f4f77283709392367e2864cd48 | 4,701 | py | Python | homeassistant/components/konnected/switch.py | andersop91/core | 0e0ef0aa17073609eae7c974cf4c73306b7c414b | [
"Apache-2.0"
] | 4 | 2021-07-11T09:11:00.000Z | 2022-02-27T14:43:50.000Z | homeassistant/components/konnected/switch.py | andersop91/core | 0e0ef0aa17073609eae7c974cf4c73306b7c414b | [
"Apache-2.0"
] | 277 | 2021-10-04T06:39:33.000Z | 2021-12-28T22:04:17.000Z | homeassistant/components/konnected/switch.py | andersop91/core | 0e0ef0aa17073609eae7c974cf4c73306b7c414b | [
"Apache-2.0"
] | 1 | 2022-02-09T00:30:51.000Z | 2022-02-09T00:30:51.000Z | """Support for wired switches attached to a Konnected device."""
import logging
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
ATTR_STATE,
CONF_DEVICES,
CONF_NAME,
CONF_REPEAT,
CONF_SWITCHES,
CONF_ZONE,
)
from homeassistant.core import HomeAssistant, call... | 30.927632 | 85 | 0.640715 |
b147cfde7baafc7dc3e6b01fd4c9fb6d4de994cc | 9,174 | py | Python | tests/logic/meta_attribute_mappers_test.py | Yelp/schematizer | 035845d27945a05db475f00eb76f59e8825dbaa4 | [
"Apache-2.0"
] | 86 | 2016-11-17T17:39:13.000Z | 2021-06-01T15:19:05.000Z | tests/logic/meta_attribute_mappers_test.py | tomzhang/schematizer | 035845d27945a05db475f00eb76f59e8825dbaa4 | [
"Apache-2.0"
] | 2 | 2016-12-01T20:57:43.000Z | 2021-09-28T09:26:25.000Z | tests/logic/meta_attribute_mappers_test.py | tomzhang/schematizer | 035845d27945a05db475f00eb76f59e8825dbaa4 | [
"Apache-2.0"
] | 26 | 2016-11-29T22:38:11.000Z | 2021-03-02T19:44:17.000Z | # -*- coding: utf-8 -*-
# Copyright 2016 Yelp 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 ag... | 33.604396 | 78 | 0.664923 |
8cdd49a00a0482d3b7552334f7886066ea555d9a | 2,300 | py | Python | .leetcode/784.letter-case-permutation.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | .leetcode/784.letter-case-permutation.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | .leetcode/784.letter-case-permutation.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | # @lc app=leetcode id=784 lang=python3
#
# [784] Letter Case Permutation
#
# https://leetcode.com/problems/letter-case-permutation/description/
#
# algorithms
# Medium (69.67%)
# Likes: 2697
# Dislikes: 130
# Total Accepted: 174K
# Total Submissions: 246K
# Testcase Example: '"a1b2"'
#
# Given a string s, we can... | 17.424242 | 81 | 0.568261 |
82e180da8ee6788c1c1757c5f16616889e681dd6 | 2,714 | py | Python | research/object_detection/utils/dataset_util.py | leejang/tensorflow_models | 20ed9860902c59cc81f161e6027daafc9a936bed | [
"Apache-2.0"
] | null | null | null | research/object_detection/utils/dataset_util.py | leejang/tensorflow_models | 20ed9860902c59cc81f161e6027daafc9a936bed | [
"Apache-2.0"
] | null | null | null | research/object_detection/utils/dataset_util.py | leejang/tensorflow_models | 20ed9860902c59cc81f161e6027daafc9a936bed | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 30.840909 | 80 | 0.713338 |
827a372ecd72f3ec58eecd63e1480ad5ed3be47c | 3,200 | py | Python | app/utils/notification_utils.py | ORANZINO/bouquet_server | 2ce1bb59df15297878c555dd97e0f27b5202ed02 | [
"MIT"
] | 7 | 2022-01-20T11:50:39.000Z | 2022-01-27T09:39:27.000Z | app/utils/notification_utils.py | ORANZINO/bouquet_server | 2ce1bb59df15297878c555dd97e0f27b5202ed02 | [
"MIT"
] | null | null | null | app/utils/notification_utils.py | ORANZINO/bouquet_server | 2ce1bb59df15297878c555dd97e0f27b5202ed02 | [
"MIT"
] | 1 | 2022-01-20T11:51:50.000Z | 2022-01-20T11:51:50.000Z | from exponent_server_sdk import (
DeviceNotRegisteredError,
PushClient,
PushMessage,
PushServerError,
PushTicketError,
)
from requests.exceptions import ConnectionError, HTTPError
from fastapi import APIRouter, Body, Depends
from sqlalchemy.orm import Session
from typing import Optional
from app.dat... | 44.444444 | 144 | 0.59625 |
d4243183a351a28d0a110a618ac6a5ae7fcf9b08 | 2,341 | py | Python | drafts/twitterology/examples/examine_tweets.py | tekhnus/misc | cf4c6e29434c546e3c29f24f7bb16a0ac65005f5 | [
"Unlicense"
] | null | null | null | drafts/twitterology/examples/examine_tweets.py | tekhnus/misc | cf4c6e29434c546e3c29f24f7bb16a0ac65005f5 | [
"Unlicense"
] | null | null | null | drafts/twitterology/examples/examine_tweets.py | tekhnus/misc | cf4c6e29434c546e3c29f24f7bb16a0ac65005f5 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# Usage: examples/logistic_regression examples.db:track_hello
from sys import argv
from itertools import groupby, islice
from operator import itemgetter
from random import Random
import matplotlib
matplotlib.use("pdf")
import matplotlib.pyplot as plt
import tabulate
import twitterology as tw
im... | 27.541176 | 115 | 0.620248 |
0515849adb8dc07aea1994b95a672d50b9b55285 | 8,926 | py | Python | src/config/device-manager/test/test_dm_bgp.py | jnpr-pranav/contrail-controller | 428eee37c28c31830fd764315794e1a6e52720c1 | [
"Apache-2.0"
] | 37 | 2020-09-21T10:42:26.000Z | 2022-01-09T10:16:40.000Z | src/config/device-manager/test/test_dm_bgp.py | jnpr-pranav/contrail-controller | 428eee37c28c31830fd764315794e1a6e52720c1 | [
"Apache-2.0"
] | null | null | null | src/config/device-manager/test/test_dm_bgp.py | jnpr-pranav/contrail-controller | 428eee37c28c31830fd764315794e1a6e52720c1 | [
"Apache-2.0"
] | 21 | 2020-08-25T12:48:42.000Z | 2022-03-22T04:32:18.000Z | #
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
from __future__ import absolute_import
import sys
import gevent
import itertools
from cfgm_common.tests.test_common import retries
from cfgm_common.tests.test_common import retry_exc_handler
from vnc_api.vnc_api import *
from device_api.juniper_common... | 42.504762 | 121 | 0.660542 |
91a3c9af34722ba8fcf54b20735260f296b0d2aa | 96 | py | Python | venv/lib/python3.8/site-packages/requests_toolbelt/sessions.py | Retraces/UkraineBot | 3d5d7f8aaa58fa0cb8b98733b8808e5dfbdb8b71 | [
"MIT"
] | 2 | 2022-03-13T01:58:52.000Z | 2022-03-31T06:07:54.000Z | venv/lib/python3.8/site-packages/requests_toolbelt/sessions.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | 19 | 2021-11-20T04:09:18.000Z | 2022-03-23T15:05:55.000Z | venv/lib/python3.8/site-packages/requests_toolbelt/sessions.py | DesmoSearch/Desmobot | b70b45df3485351f471080deb5c785c4bc5c4beb | [
"MIT"
] | null | null | null | /home/runner/.cache/pip/pool/75/18/ba/b72d03a68b06bd91c53e9e13a1d9e1813afdf08053e51f62e701317533 | 96 | 96 | 0.895833 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.