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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3e98d0a4f84ec8319d693e7fac3f10ddf8f9e5d3 | 2,491 | py | Python | helpers.py | maariagarrcia/Introduccion-a-la-algoritmica | a2e1a49e22f77057485b23825d0aee9376b6aced | [
"Apache-2.0"
] | null | null | null | helpers.py | maariagarrcia/Introduccion-a-la-algoritmica | a2e1a49e22f77057485b23825d0aee9376b6aced | [
"Apache-2.0"
] | null | null | null | helpers.py | maariagarrcia/Introduccion-a-la-algoritmica | a2e1a49e22f77057485b23825d0aee9376b6aced | [
"Apache-2.0"
] | null | null | null | ## I M P O R T S
import os
from colorama import Fore
#
# Funciones auxiliares
#
from colorama import Fore
import os
# Limpiar la terminal.
# No funciona al ejecutar en ventana interactiva
def clear():
if os.name == "nt":
os.system("cls")
else:
os.system("clear")
def esperarIntro():
inp... | 25.161616 | 73 | 0.572461 |
a39967d937181adcf4b70dd0356ea2dcbb1b1c38 | 3,337 | py | Python | src/bin/prepare_image.py | dashwood8691/f5-bigip-image-generator | 5a5b39a266a0762be5b908e6b47323efdf7d32c1 | [
"Apache-2.0"
] | 34 | 2019-08-21T01:28:27.000Z | 2021-10-05T07:21:58.000Z | src/bin/prepare_image.py | dashwood8691/f5-bigip-image-generator | 5a5b39a266a0762be5b908e6b47323efdf7d32c1 | [
"Apache-2.0"
] | 34 | 2019-09-13T10:17:31.000Z | 2022-03-09T00:01:00.000Z | src/bin/prepare_image.py | dashwood8691/f5-bigip-image-generator | 5a5b39a266a0762be5b908e6b47323efdf7d32c1 | [
"Apache-2.0"
] | 16 | 2019-08-21T20:06:17.000Z | 2022-03-25T11:59:00.000Z | #!/usr/bin/env python3
"""Image preparation command handler"""
# Copyright (C) 2019 F5 Networks, 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... | 42.240506 | 93 | 0.642493 |
0d47a581e508fe2a8cae6162406a1bb39ee4ec59 | 10,881 | py | Python | plotly/graph_objs/table/header/_font.py | gnestor/plotly.py | a8ae062795ddbf9867b8578fe6d9e244948c15ff | [
"MIT"
] | 12 | 2020-04-18T18:10:22.000Z | 2021-12-06T10:11:15.000Z | plotly/graph_objs/table/header/_font.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 27 | 2020-04-28T21:23:12.000Z | 2021-06-25T15:36:38.000Z | plotly/graph_objs/table/header/_font.py | Vesauza/plotly.py | e53e626d59495d440341751f60aeff73ff365c28 | [
"MIT"
] | 6 | 2020-04-18T23:07:08.000Z | 2021-11-18T07:53:06.000Z | from plotly.basedatatypes import BaseTraceHierarchyType
import copy
class Font(BaseTraceHierarchyType):
# color
# -----
@property
def color(self):
"""
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g... | 34.216981 | 71 | 0.56107 |
0171f2e13bb0793bbd8955b3b90ad2b46efc7be2 | 553 | py | Python | fund_app/alembic/versions/384798d610db_.py | vioquedu/Spanish-funds | cdd261a4aef61674807f76809891b5309e28174a | [
"MIT"
] | 1 | 2017-08-01T09:17:45.000Z | 2017-08-01T09:17:45.000Z | fund_app/alembic/versions/384798d610db_.py | vioquedu/Spanish-funds | cdd261a4aef61674807f76809891b5309e28174a | [
"MIT"
] | null | null | null | fund_app/alembic/versions/384798d610db_.py | vioquedu/Spanish-funds | cdd261a4aef61674807f76809891b5309e28174a | [
"MIT"
] | null | null | null | """empty message
Revision ID: 384798d610db
Revises: 1bd8f12ce572
Create Date: 2017-08-19 00:07:43.854158
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '384798d610db'
down_revision = '1bd8f12ce572'
branch_labels = None
depends_on = None
def upgrade():
# ... | 19.068966 | 65 | 0.687161 |
6776a39d8a6423de5a0033a3e84a83b6cd241257 | 929 | py | Python | dataset.py | moh3n9595/class.vision | cbcc65fd1f226273d26e44576ca7c3950faea75c | [
"MIT"
] | 103 | 2018-02-23T15:58:26.000Z | 2022-03-09T05:49:14.000Z | dataset.py | Deep-learning999/class.vision | c3cc8118d8c00aff56956fba69e8c99d666251d5 | [
"MIT"
] | null | null | null | dataset.py | Deep-learning999/class.vision | c3cc8118d8c00aff56956fba69e8c99d666251d5 | [
"MIT"
] | 53 | 2018-02-16T20:38:29.000Z | 2022-03-07T10:12:10.000Z | # for more information read "19-Intro2ML-HodaDataset.ipynb"
import cv2
import numpy as np
from scipy import io
def load_hoda(training_sample_size=1000, test_sample_size=200, size=5):
#load dataset
trs = training_sample_size
tes = test_sample_size
dataset = io.loadmat('./dataset/Data_hoda_full.mat')
... | 37.16 | 83 | 0.707212 |
f30385b2add5770003a26df1e06ae5963c6fe0cb | 190 | py | Python | Codeforces/B_Levko_and_Permutation.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | Codeforces/B_Levko_and_Permutation.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | Codeforces/B_Levko_and_Permutation.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | n,k = map(int,input().split())
l=[]
if n==k:
print(-1)
else:
for i in range(2,n-k+1):
l.append(i)
l.append(1)
for j in range(n-k+1,n+1):
l.append(j)
print(*l) | 17.272727 | 30 | 0.494737 |
20bd3deb7cd25f4f501dd3a2f6f65489905b589d | 6,666 | py | Python | handcam/tensorflow/handcam/wrn_visualization2.py | luketaverne/handcam | e294ebf2be8b5512c8607d3c8ba3f6946f3b8e30 | [
"MIT"
] | 1 | 2022-02-10T13:19:20.000Z | 2022-02-10T13:19:20.000Z | handcam/tensorflow/handcam/wrn_visualization2.py | luketaverne/handcam | e294ebf2be8b5512c8607d3c8ba3f6946f3b8e30 | [
"MIT"
] | null | null | null | handcam/tensorflow/handcam/wrn_visualization2.py | luketaverne/handcam | e294ebf2be8b5512c8607d3c8ba3f6946f3b8e30 | [
"MIT"
] | null | null | null | from handcam.ltt.util.TFTools import (
_DatasetInitializerHook,
shuffle_dataset,
per_sequence_standardization,
per_sequence_standardization_rgbd,
)
import tensorflow as tf
import glob
import sys
import numpy as np
import six
import os
import pickle
import datetime
from handcam.ltt.network.model.Wide_Res... | 29.495575 | 99 | 0.685719 |
071968ce2b1fa4fd3020bd516724858533f979ad | 5,147 | py | Python | tutorials/language/extern_op.py | baowenlei/tvm | 6b2e18ed96fad26b4a5e5f8a6dcbedf9206c9a65 | [
"Apache-2.0"
] | 1 | 2019-04-26T18:35:40.000Z | 2019-04-26T18:35:40.000Z | tutorials/language/extern_op.py | baowenlei/tvm | 6b2e18ed96fad26b4a5e5f8a6dcbedf9206c9a65 | [
"Apache-2.0"
] | null | null | null | tutorials/language/extern_op.py | baowenlei/tvm | 6b2e18ed96fad26b4a5e5f8a6dcbedf9206c9a65 | [
"Apache-2.0"
] | 2 | 2019-05-24T17:22:38.000Z | 2019-06-14T23:30:24.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 40.849206 | 87 | 0.653196 |
0998d871e36ff04c405c041e99eb3f02060b200d | 230 | py | Python | jango_learning/jango_learning/views.py | hosseinmh/jango_learning | e0aac3eb7d7742df5d79fd0686cec2e53f32abed | [
"MIT"
] | 1 | 2017-03-05T17:12:42.000Z | 2017-03-05T17:12:42.000Z | jango_learning/jango_learning/views.py | hosseinmh/jango_learning | e0aac3eb7d7742df5d79fd0686cec2e53f32abed | [
"MIT"
] | null | null | null | jango_learning/jango_learning/views.py | hosseinmh/jango_learning | e0aac3eb7d7742df5d79fd0686cec2e53f32abed | [
"MIT"
] | null | null | null | from django.http import HttpResponse, HttpResponseRedirect
def home(request):
return HttpResponse("<h1> welcome to Django</h1>")
def redirect(request):
redirect = HttpResponseRedirect("/google/sad")
return redirect
| 23 | 58 | 0.747826 |
a510275ba5d629c8b2994af22852bc75b7af6df5 | 32,362 | py | Python | raspberrymint/mcpipy/polyhedron.py | alienhunter3010/raspberryjammod-minetest | 98ac119b77bb8ae5769c90c543bede66b1cf5422 | [
"MIT"
] | 2 | 2021-12-20T09:40:11.000Z | 2022-01-07T11:43:51.000Z | raspberrymint/mcpipy/polyhedron.py | alienhunter3010/raspberryjammod-minetest | 98ac119b77bb8ae5769c90c543bede66b1cf5422 | [
"MIT"
] | null | null | null | raspberrymint/mcpipy/polyhedron.py | alienhunter3010/raspberryjammod-minetest | 98ac119b77bb8ae5769c90c543bede66b1cf5422 | [
"MIT"
] | null | null | null | #The software in this file is copyright 2003,2004 Simon Tatham and copyright 2015 Alexander Pruss
#Based on code from http://www.chiark.greenend.org.uk/~sgtatham/polyhedra/
#
#Permission is hereby granted, free of charge, to any person
#obtaining a copy of this software and associated documentation files
#(the "Softwar... | 42.693931 | 97 | 0.518849 |
705c1cc8f25f19f309e26e48488eb05fad122b47 | 50,997 | py | Python | pythonocc/lib/OCC/HatchGen.py | mbattistello/lambda_converters | 0dfef8927d3ddbc74e5c8ce1c38701ea182a27b3 | [
"MIT"
] | 2 | 2017-10-30T15:51:48.000Z | 2020-11-04T02:23:36.000Z | pythonocc/lib/OCC/HatchGen.py | mbattistello/lambda_converters | 0dfef8927d3ddbc74e5c8ce1c38701ea182a27b3 | [
"MIT"
] | null | null | null | pythonocc/lib/OCC/HatchGen.py | mbattistello/lambda_converters | 0dfef8927d3ddbc74e5c8ce1c38701ea182a27b3 | [
"MIT"
] | 4 | 2017-11-29T05:24:34.000Z | 2020-03-05T23:23:23.000Z | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 2.0.10
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (3,0,0):
new_instancemethod = lambda func, inst, cls: _HatchGe... | 37.061773 | 294 | 0.721219 |
fcce6eab37a8a4f90d8999314df299df7aa5d94d | 1,740 | py | Python | AutomatedTesting/Gem/PythonTests/EditorPythonBindings/EditorCommandLine_test.py | whywhywhyw/o3de | 8e09f66799d4c8f188d45861d821e8656a554cb1 | [
"Apache-2.0",
"MIT"
] | 11 | 2021-07-08T09:58:26.000Z | 2022-03-17T17:59:26.000Z | AutomatedTesting/Gem/PythonTests/EditorPythonBindings/EditorCommandLine_test.py | RoddieKieley/o3de | e804fd2a4241b039a42d9fa54eaae17dc94a7a92 | [
"Apache-2.0",
"MIT"
] | 29 | 2021-07-06T19:33:52.000Z | 2022-03-22T10:27:49.000Z | AutomatedTesting/Gem/PythonTests/EditorPythonBindings/EditorCommandLine_test.py | RoddieKieley/o3de | e804fd2a4241b039a42d9fa54eaae17dc94a7a92 | [
"Apache-2.0",
"MIT"
] | 4 | 2021-07-06T19:24:43.000Z | 2022-03-31T12:42:27.000Z | """
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
#
# This is a pytest module to test the in-Editor Python API from PythonEditorFuncs
#
import pytest
pytest.impo... | 34.117647 | 104 | 0.696552 |
8528be602dc4a6b1dd1ee890bfc6857ba567c948 | 1,380 | py | Python | content/Example Based Unit Testing/code-snippets-4/test_impl_with_pytest.py | rvprasad/software-testing-course | 3803851dcf9f7bbd0f0b89fca6c9c5e3a48f22e0 | [
"CC-BY-4.0"
] | 11 | 2018-02-08T05:23:28.000Z | 2021-05-24T13:23:56.000Z | content/Example Based Unit Testing/code-snippets-4/test_impl_with_pytest.py | rvprasad/software-testing-course | 3803851dcf9f7bbd0f0b89fca6c9c5e3a48f22e0 | [
"CC-BY-4.0"
] | null | null | null | content/Example Based Unit Testing/code-snippets-4/test_impl_with_pytest.py | rvprasad/software-testing-course | 3803851dcf9f7bbd0f0b89fca6c9c5e3a48f22e0 | [
"CC-BY-4.0"
] | 2 | 2020-09-15T08:51:22.000Z | 2021-01-26T12:07:18.000Z | # execute with
# pytest -s --html=report.html test_impl_with_pytest.py
import pytest
import impl2 as impl
class TestPhysicalInfo:
def setup_method(self):
self.pi = impl.PhysicalInfo()
def test_set_height_valid_values1(self):
try:
self.pi.set_height(45)
ass... | 27.058824 | 59 | 0.557971 |
7cf5efe6fc58c4bef89bf8ed97fdb34c68222b1b | 782 | py | Python | lesson5/homework/Task_5_10.py | shkutaa/teache_me_skills | e4ac5292ca391b01c09f427f65cd7251d218cf7d | [
"MIT"
] | null | null | null | lesson5/homework/Task_5_10.py | shkutaa/teache_me_skills | e4ac5292ca391b01c09f427f65cd7251d218cf7d | [
"MIT"
] | null | null | null | lesson5/homework/Task_5_10.py | shkutaa/teache_me_skills | e4ac5292ca391b01c09f427f65cd7251d218cf7d | [
"MIT"
] | null | null | null | '''Создать список поездов. Структура словаря: номер поезда,
пункт и время прибытия, пункт и время отбытия. Вывести все сведения о поездах,
время пребывания в пути которых превышает 7 часов 20 минут'''
from datetime import datetime, timedelta
delta_time = timedelta(hours = 7, minutes = 20)
trains = [
{
'nu... | 27.928571 | 78 | 0.576726 |
8b859310d5501a1328208638c21de76ff4cf2210 | 17,843 | py | Python | diskimage_builder/block_device/blockdevice.py | fooxlj07/diskimage-builder | eb5c38da22d0eb2594d79b05849d8fe9d53d28c0 | [
"Apache-2.0"
] | 262 | 2015-01-16T03:26:25.000Z | 2022-03-31T06:46:02.000Z | diskimage_builder/block_device/blockdevice.py | fooxlj07/diskimage-builder | eb5c38da22d0eb2594d79b05849d8fe9d53d28c0 | [
"Apache-2.0"
] | 21 | 2015-07-23T12:37:50.000Z | 2022-03-25T03:05:43.000Z | diskimage_builder/block_device/blockdevice.py | fooxlj07/diskimage-builder | eb5c38da22d0eb2594d79b05849d8fe9d53d28c0 | [
"Apache-2.0"
] | 183 | 2015-01-16T05:18:59.000Z | 2022-03-20T01:48:46.000Z | # Copyright 2016-2017 Andreas Florath (andreas@florath.net)
#
# 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 applicabl... | 37.018672 | 79 | 0.59648 |
de337090126e3ffef8390fd0f357b7befcff8d46 | 17,212 | py | Python | autotf/ensemble/stack.py | DAIM-ML/autotf | 3f82d858f49c27d5ecb624cee555fb8fd47bf067 | [
"BSD-3-Clause"
] | 8 | 2018-03-07T06:58:16.000Z | 2019-01-30T07:49:44.000Z | autotf/ensemble/stack.py | DAIM-ML/autotf | 3f82d858f49c27d5ecb624cee555fb8fd47bf067 | [
"BSD-3-Clause"
] | null | null | null | autotf/ensemble/stack.py | DAIM-ML/autotf | 3f82d858f49c27d5ecb624cee555fb8fd47bf067 | [
"BSD-3-Clause"
] | 1 | 2018-03-31T09:06:12.000Z | 2018-03-31T09:06:12.000Z | import os
import sys
import warnings
from datetime import datetime
import numpy as np
import scipy.stats as st
from sklearn.model_selection import KFold
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import mean_absolute_error
from sklearn.metrics import accuracy_score
from sklearn.m... | 48.348315 | 146 | 0.546073 |
3cf6591656d2d28eb90b342f9dc4bd389bc726fb | 46,714 | py | Python | lndgrpc/rpc_pb2_grpc.py | citizenanalog/lnd-grpc-client | 8609e058d36e6c91cce47f9eb6b1b4a113f113dd | [
"MIT"
] | 39 | 2018-03-21T06:28:13.000Z | 2022-01-28T09:31:07.000Z | lndgrpc/rpc_pb2_grpc.py | citizenanalog/lnd-grpc-client | 8609e058d36e6c91cce47f9eb6b1b4a113f113dd | [
"MIT"
] | 25 | 2018-04-12T02:03:04.000Z | 2022-01-26T17:28:07.000Z | lndgrpc/rpc_pb2_grpc.py | citizenanalog/lnd-grpc-client | 8609e058d36e6c91cce47f9eb6b1b4a113f113dd | [
"MIT"
] | 15 | 2018-11-09T08:09:10.000Z | 2022-01-28T09:31:28.000Z | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from lndgrpc import rpc_pb2 as rpc__pb2
class WalletUnlockerStub(object):
"""The WalletUnlocker service is used to set up a wallet password for
lnd at first startup, and unlock a previously set up wallet.
"""
def __init__(self... | 45.888016 | 83 | 0.742047 |
50a184d527843e8db56b2a2d854a4694f5066bad | 371 | py | Python | gcp/mysql-database.py | gtoonstra/airflow-deployments | 98e9ec79db6ce81a031e6d2015dd5906ee2556cd | [
"Apache-2.0"
] | 4 | 2017-08-08T04:51:57.000Z | 2018-06-07T14:29:51.000Z | gcp/mysql-database.py | gtoonstra/airflow-deployments | 98e9ec79db6ce81a031e6d2015dd5906ee2556cd | [
"Apache-2.0"
] | null | null | null | gcp/mysql-database.py | gtoonstra/airflow-deployments | 98e9ec79db6ce81a031e6d2015dd5906ee2556cd | [
"Apache-2.0"
] | null | null | null | """Creates the airflow database."""
def GenerateConfig(context):
resources = [{
'name': context.env['name'],
'type': 'sqladmin.v1beta4.database',
'properties': {
# 'instance': '$(ref.' + context.properties['instance-name'] + '.selfLink)'
'instance': context.properties['instance-nam... | 26.5 | 83 | 0.598383 |
47546a3fd30f15fc3b70fe9d50640bffce30de69 | 46,657 | py | Python | src/app_neo4j_queries.py | hubmapconsortium/entity-api | 09caa5006a1de17a56d3fba21ef76a7480c374be | [
"MIT"
] | 2 | 2021-11-02T20:35:44.000Z | 2021-12-16T14:58:41.000Z | src/app_neo4j_queries.py | hubmapconsortium/entity-api | 09caa5006a1de17a56d3fba21ef76a7480c374be | [
"MIT"
] | 161 | 2019-11-13T16:47:02.000Z | 2022-03-30T04:05:28.000Z | src/app_neo4j_queries.py | hubmapconsortium/entity-api | 09caa5006a1de17a56d3fba21ef76a7480c374be | [
"MIT"
] | 1 | 2021-12-03T17:24:45.000Z | 2021-12-03T17:24:45.000Z | from neo4j.exceptions import TransactionError
import logging
import json
logger = logging.getLogger(__name__)
# The filed name of the single result record
record_field_name = 'result'
####################################################################################################
## Directly called by app.py
##... | 36.140201 | 240 | 0.635446 |
c4be264c87d0ff1092f10c1b5fd2086974c857f9 | 2,752 | py | Python | getstats.py | ijt/wagon_challenge_1 | 71e17df827c88da7f7157d0ca9fd64cdbd737243 | [
"MIT"
] | null | null | null | getstats.py | ijt/wagon_challenge_1 | 71e17df827c88da7f7157d0ca9fd64cdbd737243 | [
"MIT"
] | null | null | null | getstats.py | ijt/wagon_challenge_1 | 71e17df827c88da7f7157d0ca9fd64cdbd737243 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import re
import sys
class TextStat(object):
def __init__(self):
self.string_to_count = {}
def update(self, c):
self.string_to_count[c] = self.string_to_count.get(c, 0) + 1
def summary(self):
count = sum(self.string_to_count.values())
null_count = se... | 30.921348 | 97 | 0.567587 |
79c862a2e2c34687304fa3a6cefa221e871e27e6 | 3,344 | py | Python | src/AoC_2020/d13_bus_schedule_primes_and_lcm/bus_schedule_part2.py | derailed-dash/Advent-of-Code | 12378baf33ef4a59958e84eb60e795b6530c22ba | [
"MIT"
] | 9 | 2021-12-31T20:13:03.000Z | 2022-03-05T07:05:06.000Z | src/AoC_2020/d13_bus_schedule_primes_and_lcm/bus_schedule_part2.py | derailed-dash/Advent-of-Code | 12378baf33ef4a59958e84eb60e795b6530c22ba | [
"MIT"
] | 1 | 2022-01-25T08:35:04.000Z | 2022-01-29T00:07:00.000Z | src/AoC_2020/d13_bus_schedule_primes_and_lcm/bus_schedule_part2.py | derailed-dash/Advent-of-Code | 12378baf33ef4a59958e84eb60e795b6530c22ba | [
"MIT"
] | null | null | null | """
Author: Darren
Date: 13/12/2020
Solving: https://adventofcode.com/2020/day/13
Solution 1 of 2: doing it the hard way
Part 2
------
Input like: 7,13,x,x,59,x,31,19
Find first time where 7 departs at t=0, 13 departs at t=1, x departs at t=2, etc.
Bus ID also represents the duration of each bus loop.
E.g. bus 7 de... | 30.4 | 91 | 0.667763 |
c39ab1507c4f38d6a0f73f45fcd411dc12761867 | 1,803 | py | Python | 2021/day14.py | blin00/advent-of-code | 0a8cafb1eb6c2ec0b35af2af1fdbf6498ca0a83f | [
"Unlicense"
] | 7 | 2021-12-11T00:04:11.000Z | 2021-12-30T11:13:36.000Z | 2021/day14.py | blin00/advent-of-code | 0a8cafb1eb6c2ec0b35af2af1fdbf6498ca0a83f | [
"Unlicense"
] | null | null | null | 2021/day14.py | blin00/advent-of-code | 0a8cafb1eb6c2ec0b35af2af1fdbf6498ca0a83f | [
"Unlicense"
] | 2 | 2021-12-18T10:15:43.000Z | 2021-12-22T05:11:32.000Z | from sortedcontainers import *
from bisect import *
from collections import *
from functools import *
from heapq import *
import itertools
from string import whitespace, ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits, octdigits, punctuation, printable
from util import *
"""
echo "=== sample ===" ... | 20.965116 | 132 | 0.494731 |
7b876fc81f915a18a99d0987814775457b041b23 | 4,852 | py | Python | conanfile.py | jargonzombies/conan-mongo-cxx-driver | a47589b1b4250f5df24c4a87acce3b0d3e3ad8c0 | [
"MIT"
] | 1 | 2020-03-08T08:49:24.000Z | 2020-03-08T08:49:24.000Z | conanfile.py | jargonzombies/conan-mongo-cxx-driver | a47589b1b4250f5df24c4a87acce3b0d3e3ad8c0 | [
"MIT"
] | 2 | 2019-02-04T17:04:29.000Z | 2020-12-07T23:08:59.000Z | conanfile.py | jargonzombies/conan-mongo-cxx-driver | a47589b1b4250f5df24c4a87acce3b0d3e3ad8c0 | [
"MIT"
] | 9 | 2018-11-13T10:03:33.000Z | 2020-11-04T11:03:38.000Z | from conans import ConanFile, CMake, tools
import os
import shutil
import re
class MongoCxxConan(ConanFile):
name = "mongo-cxx-driver"
version = "3.3.0"
url = "http://github.com/bincrafters/conan-mongo-cxx-driver"
description = "C++ Driver for MongoDB"
license = "https://github.com/mongodb/mongo-cx... | 42.938053 | 186 | 0.616035 |
33d50fee79d41f478c5847c53ea4d124f617e73d | 4,590 | py | Python | base_shallow_classifier.py | duongntbk/FashionMNIST | 982f31ac7d857b5deadfde37f979bc6a047fa007 | [
"MIT"
] | null | null | null | base_shallow_classifier.py | duongntbk/FashionMNIST | 982f31ac7d857b5deadfde37f979bc6a047fa007 | [
"MIT"
] | 10 | 2020-01-28T22:19:43.000Z | 2022-02-10T00:30:45.000Z | base_shallow_classifier.py | duongntbk/FashionMNIST | 982f31ac7d857b5deadfde37f979bc6a047fa007 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import pickle
from abc import abstractmethod
from sklearn.metrics import accuracy_score
from sklearn.model_selection import GridSearchCV
from sklearn.preprocessing import LabelEncoder
from base_classifier import BaseClassifier
class BaseShallowClassifier(BaseClassifier):
'''
Base cl... | 33.75 | 91 | 0.647277 |
49e43c502861e21e5d46f674c65bab4c889482e7 | 120,454 | py | Python | torch/_tensor_docs.py | jaketae/pytorch | 5654e6339879e438efb7cf50e88e356472eb0545 | [
"Intel"
] | null | null | null | torch/_tensor_docs.py | jaketae/pytorch | 5654e6339879e438efb7cf50e88e356472eb0545 | [
"Intel"
] | null | null | null | torch/_tensor_docs.py | jaketae/pytorch | 5654e6339879e438efb7cf50e88e356472eb0545 | [
"Intel"
] | null | null | null | """Adds docstrings to Tensor functions"""
import torch._C
from torch._C import _add_docstr as add_docstr
from ._torch_docs import parse_kwargs
from ._torch_docs import reproducibility_notes
def add_docstr_all(method, docstr):
add_docstr(getattr(torch._C._TensorBase, method), docstr)
common_args = parse_kwargs("... | 23.480312 | 118 | 0.621308 |
b536e686fe92a83b35247d09d4794ff332063473 | 991 | py | Python | shfl/data_base/fashion_mnist.py | joarreg/Sherpa.ai-Federated-Learning-Framework | 9da392bf71c9acf13761dde0f119622c62780c87 | [
"Apache-2.0"
] | 2 | 2021-11-14T12:04:39.000Z | 2022-01-03T16:03:36.000Z | shfl/data_base/fashion_mnist.py | SSSuperTIan/Sherpa.ai-Federated-Learning-Framework | a30d73a018526f1033ee0ec57489c4c6e2f15b0a | [
"Apache-2.0"
] | null | null | null | shfl/data_base/fashion_mnist.py | SSSuperTIan/Sherpa.ai-Federated-Learning-Framework | a30d73a018526f1033ee0ec57489c4c6e2f15b0a | [
"Apache-2.0"
] | 1 | 2022-01-19T16:29:46.000Z | 2022-01-19T16:29:46.000Z | from tensorflow.keras.datasets import fashion_mnist
from shfl.data_base.data_base import DataBase
import tensorflow as tf
class FashionMnist(DataBase):
"""
Implementation for load FASHION-MNIST data
# References
[FASHION-MNIST dataset](https://keras.io/datasets/#fashion-mnist-database-of-fashion... | 30.96875 | 114 | 0.688194 |
37aca8beaa6b5d1f2da5ee7597ca091f2189cf84 | 3,707 | py | Python | contrib/macdeploy/custom_dsstore.py | ReloadCoin/RLD | 8d76077973a0c975271be4306bc06bb976e058fe | [
"MIT"
] | 1 | 2020-09-10T11:50:50.000Z | 2020-09-10T11:50:50.000Z | contrib/macdeploy/custom_dsstore.py | ReloadCoin/RLD | 8d76077973a0c975271be4306bc06bb976e058fe | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | ReloadCoin/RLD | 8d76077973a0c975271be4306bc06bb976e058fe | [
"MIT"
] | 1 | 2019-11-25T19:18:11.000Z | 2019-11-25T19:18:11.000Z | #!/usr/bin/env python3
# Copyright (c) 2013-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import biplist
from ds_store import DSStore
from mac_alias import Alias
import sys
output_file = sys.argv... | 61.783333 | 1,817 | 0.724036 |
f5a4b0fc9e9c157202a88e103fccb108eb3eba69 | 3,184 | py | Python | py/topcoder/SRM649/div1_XorSequence.py | shhuan/algorithms | 2830c7e2ada8dfd3dcdda7c06846116d4f944a27 | [
"MIT"
] | null | null | null | py/topcoder/SRM649/div1_XorSequence.py | shhuan/algorithms | 2830c7e2ada8dfd3dcdda7c06846116d4f944a27 | [
"MIT"
] | null | null | null | py/topcoder/SRM649/div1_XorSequence.py | shhuan/algorithms | 2830c7e2ada8dfd3dcdda7c06846116d4f944a27 | [
"MIT"
] | 1 | 2022-03-09T04:52:55.000Z | 2022-03-09T04:52:55.000Z | # -*- coding: utf-8 -*-
"""
created by huash06 at 2015-06-19 16:08
Problem Statement
You are given an integer sequence A and an N that is a power of 2.
All elements of A are between 0 and N-1, inclusive.
You can now choose an integer B which is between 0 and N-1, inclusive.
This integer determines a new sequence C... | 27.213675 | 99 | 0.546482 |
e199ac486fa2d5c4ac172a582e45e1c48e390b76 | 4,427 | py | Python | src/run/nihlatak.py | EthanJian/botty | 2afb05363e9b0cd2439faaebb4b9b6f76b809bb8 | [
"MIT"
] | null | null | null | src/run/nihlatak.py | EthanJian/botty | 2afb05363e9b0cd2439faaebb4b9b6f76b809bb8 | [
"MIT"
] | null | null | null | src/run/nihlatak.py | EthanJian/botty | 2afb05363e9b0cd2439faaebb4b9b6f76b809bb8 | [
"MIT"
] | null | null | null | from char.i_char import IChar
from config import Config
from logger import Logger
from pather import Location, Pather
from typing import Union
from item.pickit import PickIt
from template_finder import TemplateFinder
from town.town_manager import TownManager
from ui import UiManager
from utils.misc import wait
from dat... | 45.173469 | 164 | 0.660041 |
3d358430da1dc7286d62dbae79220eef70047942 | 722 | py | Python | Libraries/zobrist_hash.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | 2 | 2022-01-22T07:56:58.000Z | 2022-01-24T00:29:37.000Z | Libraries/zobrist_hash.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | Libraries/zobrist_hash.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | import sys
import math
from collections import defaultdict, deque
from random import randint
sys.setrecursionlimit(10 ** 6)
stdin = sys.stdin
INF = float('inf')
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().strip()
r_map = {}
def gen_rand(A, B):
for ... | 17.190476 | 53 | 0.548476 |
d3c039b5fd9b1eccf209400b17eebab6b877fde3 | 38,279 | py | Python | qiling/qiling/os/windows/dlls/ntoskrnl.py | mrTavas/owasp-fstm-auto | 6e9ff36e46d885701c7419db3eca15f12063a7f3 | [
"CC0-1.0"
] | 2 | 2021-05-05T12:03:01.000Z | 2021-06-04T14:27:15.000Z | qiling/qiling/os/windows/dlls/ntoskrnl.py | mrTavas/owasp-fstm-auto | 6e9ff36e46d885701c7419db3eca15f12063a7f3 | [
"CC0-1.0"
] | null | null | null | qiling/qiling/os/windows/dlls/ntoskrnl.py | mrTavas/owasp-fstm-auto | 6e9ff36e46d885701c7419db3eca15f12063a7f3 | [
"CC0-1.0"
] | 2 | 2021-05-05T12:03:09.000Z | 2021-06-04T14:27:21.000Z | #!/usr/bin/env python3
#
# Cross Platform and Multi Architecture Advanced Binary Emulation Framework
#
from qiling.os.windows.const import *
from qiling.os.windows.fncc import *
from qiling.os.const import *
from qiling.os.windows.utils import *
from qiling.os.windows.thread import *
from qiling.os.windows.handle imp... | 29.882123 | 120 | 0.656966 |
b98433240c69ebf2d962684330064099dffcaff9 | 110 | py | Python | version.py | dimapu/pint | e2db6e2735dc8e4958cd54145c8c21e66febebad | [
"BSD-3-Clause"
] | null | null | null | version.py | dimapu/pint | e2db6e2735dc8e4958cd54145c8c21e66febebad | [
"BSD-3-Clause"
] | 1 | 2020-08-06T00:48:34.000Z | 2020-08-11T19:36:38.000Z | version.py | dimapu/pint | e2db6e2735dc8e4958cd54145c8c21e66febebad | [
"BSD-3-Clause"
] | 1 | 2020-04-29T15:36:28.000Z | 2020-04-29T15:36:28.000Z | # This is just for zest.releaser. Do not touch
# flake8: noqa
# fmt: off
__version__ = '0.16.dev0'
# fmt: on
| 15.714286 | 46 | 0.672727 |
07ccd9fb6659be2441bf17b864908b1578558a10 | 1,924 | py | Python | tests/common/fixtures/services.py | tgiardina/rpp-h | fece590f901b052a59c19a24acfeba52cee33c84 | [
"BSD-2-Clause"
] | null | null | null | tests/common/fixtures/services.py | tgiardina/rpp-h | fece590f901b052a59c19a24acfeba52cee33c84 | [
"BSD-2-Clause"
] | null | null | null | tests/common/fixtures/services.py | tgiardina/rpp-h | fece590f901b052a59c19a24acfeba52cee33c84 | [
"BSD-2-Clause"
] | null | null | null | from unittest.mock import create_autospec
import pytest
from h.services.annotation_moderation import AnnotationModerationService
from h.services.groupfinder import GroupfinderService
from h.services.links import LinksService
from h.services.nipsa import NipsaService
from h.services.search_index import SearchIndexServ... | 24.987013 | 82 | 0.761954 |
81aa970a32f76e80ea78441498849b6e1e34cc74 | 2,820 | py | Python | python/pyspark/shell.py | MiguelPeralvo/spark | 979a73f86f77e7ae294979b7962b8ae30d38f1ff | [
"Apache-2.0"
] | 73 | 2018-07-06T07:41:46.000Z | 2022-01-06T02:32:22.000Z | python/pyspark/shell.py | MiguelPeralvo/spark | 979a73f86f77e7ae294979b7962b8ae30d38f1ff | [
"Apache-2.0"
] | 6 | 2019-11-13T07:48:07.000Z | 2022-01-21T23:24:20.000Z | python/pyspark/shell.py | MiguelPeralvo/spark | 979a73f86f77e7ae294979b7962b8ae30d38f1ff | [
"Apache-2.0"
] | 44 | 2018-07-09T12:42:44.000Z | 2021-10-17T06:46:01.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 34.390244 | 99 | 0.733333 |
3441b44b766383eb6225133b19e62c2eedeeb61f | 396 | py | Python | chlorobot/chlorobot/wsgi.py | chlorobot/chlorobot-app | 7496938a6cadc96209bd42250e6bbe7727657067 | [
"MIT"
] | 5 | 2017-11-06T14:59:09.000Z | 2018-01-22T09:14:21.000Z | chlorobot/chlorobot/wsgi.py | chlorobot/chlorobot-app | 7496938a6cadc96209bd42250e6bbe7727657067 | [
"MIT"
] | 2 | 2020-02-11T23:40:07.000Z | 2020-06-05T17:36:08.000Z | chlorobot/chlorobot/wsgi.py | chlorobot/chlorobot-app | 7496938a6cadc96209bd42250e6bbe7727657067 | [
"MIT"
] | null | null | null | """
WSGI config for chlorobot project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SE... | 23.294118 | 78 | 0.787879 |
7fe8bd58f30cd9e17a918e67afb6b820cf8e6de3 | 9,810 | py | Python | tests/unit/modules/localemod_test.py | herlo/salt | 10ffb8315559c0cfbc10b4adc26cd62ebc462851 | [
"Apache-2.0"
] | null | null | null | tests/unit/modules/localemod_test.py | herlo/salt | 10ffb8315559c0cfbc10b4adc26cd62ebc462851 | [
"Apache-2.0"
] | 1 | 2018-08-23T18:25:42.000Z | 2018-08-23T18:25:42.000Z | tests/unit/modules/localemod_test.py | herlo/salt | 10ffb8315559c0cfbc10b4adc26cd62ebc462851 | [
"Apache-2.0"
] | 1 | 2018-04-19T16:57:27.000Z | 2018-04-19T16:57:27.000Z | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Rupesh Tare <rupesht@saltstack.com>`
'''
# Import Python libs
from __future__ import absolute_import
# Import Salt Testing Libs
from salttesting import TestCase, skipIf
from salttesting.mock import (
MagicMock,
patch,
NO_MOCK,
NO_MOCK_REASON
)
# Im... | 43.6 | 104 | 0.5737 |
f78a7c36fd2b942f470175637d2254f3edfef327 | 1,204 | py | Python | Training/file_handling.py | RobVor/Python | 5cfcd9a72c3899a453c0ec8f4fadea71fe453c49 | [
"FSFAP"
] | null | null | null | Training/file_handling.py | RobVor/Python | 5cfcd9a72c3899a453c0ec8f4fadea71fe453c49 | [
"FSFAP"
] | 4 | 2021-06-02T03:44:24.000Z | 2022-03-12T00:52:58.000Z | Training/file_handling.py | RobVor/Python | 5cfcd9a72c3899a453c0ec8f4fadea71fe453c49 | [
"FSFAP"
] | null | null | null | file = open("example.txt", 'r')
print(type(file))
content = file.read()
print(content)
content = file.readlines()
print(content)
file.seek(0)
content = file.readlines()
print(content)
contentNew = [i.rstrip("\n") for i in content]
print(contentNew)
file.close()
with open("Writer.txt", 'a+') as file:
file.write("A... | 37.625 | 190 | 0.723422 |
ad77e2f26a19b791d9757824f166cb0622c8eb50 | 3,720 | py | Python | supervisor/api/host.py | tidalf/supervisor | 73821821324fc34552180b39505440a03369e389 | [
"Apache-2.0"
] | 1 | 2022-02-08T21:32:33.000Z | 2022-02-08T21:32:33.000Z | supervisor/api/host.py | OpenPeerPower/supervisor | 39a3226041caa34b2dabb54f76d8e88c06d50155 | [
"Apache-2.0"
] | 140 | 2021-01-05T07:07:20.000Z | 2022-03-31T06:05:09.000Z | supervisor/api/host.py | OpenPeerPower/supervisor | 39a3226041caa34b2dabb54f76d8e88c06d50155 | [
"Apache-2.0"
] | null | null | null | """Init file for Supervisor host RESTful API."""
import asyncio
from typing import Awaitable
from aiohttp import web
import voluptuous as vol
from ..const import (
ATTR_CHASSIS,
ATTR_CPE,
ATTR_DEPLOYMENT,
ATTR_DESCRIPTON,
ATTR_DISK_FREE,
ATTR_DISK_TOTAL,
ATTR_DISK_USED,
ATTR_FEATURES,
... | 29.76 | 88 | 0.633871 |
85deb1a8f97106f3c06d4600cdf197fbab67ab6d | 39,562 | py | Python | IQA_BIECON_release/data_load/data_loader_IQA.py | ma3252788/IQA_BIECON_release | 9b9452681460cbd3b670aff62f18c6661a724997 | [
"MIT"
] | 96 | 2017-07-25T07:54:59.000Z | 2022-01-09T03:33:07.000Z | IQA_BIECON_release/data_load/data_loader_IQA.py | ma3252788/IQA_BIECON_release | 9b9452681460cbd3b670aff62f18c6661a724997 | [
"MIT"
] | 4 | 2018-04-25T09:46:05.000Z | 2019-11-08T12:44:39.000Z | IQA_BIECON_release/data_load/data_loader_IQA.py | jongyookim/IQA_BIECON_release | 9b9452681460cbd3b670aff62f18c6661a724997 | [
"MIT"
] | 35 | 2017-07-25T02:51:22.000Z | 2022-02-05T03:05:40.000Z | from __future__ import absolute_import, division, print_function
import os
import sys
import timeit
import numpy as np
from scipy import misc
from scipy.ndimage.filters import convolve
from .dataset import Dataset
from ..ssim import ssim
FR_MET_BASEPATH = 'FR_met/'
FR_MET_SUBPATH_LIVE = 'LIVE/LIVE IQA DB/'
FR_MET_S... | 36.904851 | 81 | 0.536045 |
a580b6608727af53c0beac789a537230d8c722c7 | 3,779 | py | Python | release/stubs/Tekla/Structures/Filtering/Categories.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs/Tekla/Structures/Filtering/Categories.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | release/stubs/Tekla/Structures/Filtering/Categories.py | YKato521/ironpython-stubs | b1f7c580de48528490b3ee5791b04898be95a9ae | [
"MIT"
] | null | null | null | # encoding: utf-8
# module Tekla.Structures.Filtering.Categories calls itself Categories
# from Tekla.Structures, Version=2017.0.0.0, Culture=neutral, PublicKeyToken=2f04dbe497b71114
# by generator 1.145
# no doc
# no imports
# no functions
# classes
class AssemblyFilterExpressions(object):
# no doc
CustomBo... | 19.994709 | 93 | 0.664991 |
8c14f9519e17251dad6656b2f31d302f266612ef | 6,701 | py | Python | quick_sort2.py | RitRa/Algorithms-project- | d9de6437be9fa3424aeec08cb8cf42bc377c5813 | [
"MIT"
] | null | null | null | quick_sort2.py | RitRa/Algorithms-project- | d9de6437be9fa3424aeec08cb8cf42bc377c5813 | [
"MIT"
] | null | null | null | quick_sort2.py | RitRa/Algorithms-project- | d9de6437be9fa3424aeec08cb8cf42bc377c5813 | [
"MIT"
] | null | null | null | # importing the random numbers
from randomnumber import *
# Quick Sort
def printalistay(alist):
return (' '.join(str(i) for i in alist))
def quicksort(alist, i, j):
if i < j:
pos = partition(alist, i, j)
quicksort(alist, i, pos - 1)
quicksort(alist, pos + 1, j)
def partition(alist, i, j):
#pivot ... | 27.463115 | 79 | 0.584241 |
f0ef41fe0ddc80f26eed8f8b18c91f922b4c09ca | 1,077 | py | Python | projecteuler/034_digit_factorials.py | vikasmunshi/euler | da4a7916b24e2d2b902ffdd1094991416eb74034 | [
"MIT"
] | null | null | null | projecteuler/034_digit_factorials.py | vikasmunshi/euler | da4a7916b24e2d2b902ffdd1094991416eb74034 | [
"MIT"
] | null | null | null | projecteuler/034_digit_factorials.py | vikasmunshi/euler | da4a7916b24e2d2b902ffdd1094991416eb74034 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3.8
# -*- coding: utf-8 -*-
"""
https://projecteuler.net/problem=34
145 is a curious number, as 1! + 4! + 5! = 1 + 24 + 120 = 145.
Find the sum of all numbers which are equal to the sum of the factorial of their digits.
Note: as 1! = 1 and 2! = 2 are not sums they are not included.
Answer: 40730
... | 31.676471 | 113 | 0.629526 |
34e87420510c2916e488920880e613d9a303a5d9 | 5,469 | py | Python | tests/test_image_preprocessor.py | awesome-archive/gnes | 21311f05747303d0acdc303f2ade830ef971f47d | [
"Apache-2.0"
] | null | null | null | tests/test_image_preprocessor.py | awesome-archive/gnes | 21311f05747303d0acdc303f2ade830ef971f47d | [
"Apache-2.0"
] | null | null | null | tests/test_image_preprocessor.py | awesome-archive/gnes | 21311f05747303d0acdc303f2ade830ef971f47d | [
"Apache-2.0"
] | null | null | null | import os
import unittest
import zipfile
from gnes.cli.parser import set_preprocessor_service_parser, _set_client_parser
from gnes.proto import gnes_pb2, RequestGenerator, blob2array
from gnes.service.grpc import ZmqClient
from gnes.service.preprocessor import PreprocessorService
class TestProto(unittest.TestCase):
... | 45.198347 | 113 | 0.62132 |
2c046546bee718ec6078086bf73df14ef3e78012 | 2,695 | py | Python | salt/modules/openstack_mng.py | l2ol33rt/salt | ff68bbd9f4bda992a3e039822fb32f141e94347c | [
"Apache-2.0"
] | 1 | 2022-02-09T06:40:14.000Z | 2022-02-09T06:40:14.000Z | salt/modules/openstack_mng.py | l2ol33rt/salt | ff68bbd9f4bda992a3e039822fb32f141e94347c | [
"Apache-2.0"
] | null | null | null | salt/modules/openstack_mng.py | l2ol33rt/salt | ff68bbd9f4bda992a3e039822fb32f141e94347c | [
"Apache-2.0"
] | 4 | 2020-11-04T06:28:05.000Z | 2022-02-09T10:54:49.000Z | # -*- coding: utf-8 -*-
'''
Module for OpenStack Management
:codeauthor: Konrad Mosoń <mosonkonrad@gmail.com>
:maturity: new
:depends: openstack-utils
:platform: linux
'''
# Import python libs
from __future__ import absolute_import
import logging
import os.path
# Import salt libs
import salt.utils
... | 26.95 | 128 | 0.647124 |
043509f5897d044981f35394212bd8e1694672fa | 1,637 | py | Python | spinup/gym_reachability/envs/__init__.py | MrRubyRed/spinningup | 345a7e32e4fe1c700c591286d31c453f5116d5d2 | [
"MIT"
] | null | null | null | spinup/gym_reachability/envs/__init__.py | MrRubyRed/spinningup | 345a7e32e4fe1c700c591286d31c453f5116d5d2 | [
"MIT"
] | null | null | null | spinup/gym_reachability/envs/__init__.py | MrRubyRed/spinningup | 345a7e32e4fe1c700c591286d31c453f5116d5d2 | [
"MIT"
] | null | null | null | # Copyright (c) 2019–2020, The Regents of the University of California.
# All rights reserved.
#
# This file is subject to the terms and conditions defined in the LICENSE file
# included in this repository.
#
# Please contact the author(s) of this library if you have any questions.
# Authors: Neil Lugovoy ( nflugovoy... | 41.974359 | 115 | 0.873549 |
a5e2da04514f796cb99d63c9c287b11a8b044439 | 32,207 | py | Python | tests/default_xml_mapping/jats_test.py | elifesciences/sciencebeam-judge | 357f1b4266674611b24371224468db268ed4574e | [
"MIT"
] | null | null | null | tests/default_xml_mapping/jats_test.py | elifesciences/sciencebeam-judge | 357f1b4266674611b24371224468db268ed4574e | [
"MIT"
] | 189 | 2018-01-11T17:14:18.000Z | 2022-03-28T17:30:11.000Z | tests/default_xml_mapping/jats_test.py | elifesciences/sciencebeam-judge | 357f1b4266674611b24371224468db268ed4574e | [
"MIT"
] | null | null | null | import logging
from lxml.builder import E
from sciencebeam_judge.parsing.xpath.jats_xpath_functions import (
XLINK_HREF
)
from .utils import parse_xml_node
# false positive not-callable for lxml.builder.E
# pylint: disable=not-callable
LOGGER = logging.getLogger(__name__)
DOI_1 = '10.12345/abc/1'
HTTPS_DOI... | 40.614124 | 100 | 0.486633 |
f780814392dde30c5ff58e5dcd17f0d4b5a6d4ac | 1,273 | py | Python | experiments/normal/normal_clsf.py | Glaciohound/VCML | 5a0f01a0baba238cef2f63131fccd412e3d7822b | [
"MIT"
] | 52 | 2019-12-04T22:26:56.000Z | 2022-03-31T17:04:15.000Z | experiments/normal/normal_clsf.py | guxiwuruo/VCML | 5a0f01a0baba238cef2f63131fccd412e3d7822b | [
"MIT"
] | 6 | 2020-08-25T07:35:14.000Z | 2021-09-09T04:57:09.000Z | experiments/normal/normal_clsf.py | guxiwuruo/VCML | 5a0f01a0baba238cef2f63131fccd412e3d7822b | [
"MIT"
] | 5 | 2020-02-10T07:39:24.000Z | 2021-06-23T02:53:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# File : normal_clsf.py
# Author : Chi Han, Jiayuan Mao
# Email : haanchi@gmail.com, maojiayuan@gmail.com
# Date : 13.08.2019
# Last Modified Date: 18.08.2019
# Last Modified By : Chi Han, Jiayuan Mao
#
# This file is part ... | 28.288889 | 71 | 0.655145 |
6788f6bdb667f5a89a7dcb1ff274469d5582b8d4 | 5,476 | py | Python | simulations/full_send.py | emmetthough/gravity_sim | bda22113462bebd1e8e6c03ea775237ee755d255 | [
"MIT"
] | null | null | null | simulations/full_send.py | emmetthough/gravity_sim | bda22113462bebd1e8e6c03ea775237ee755d255 | [
"MIT"
] | null | null | null | simulations/full_send.py | emmetthough/gravity_sim | bda22113462bebd1e8e6c03ea775237ee755d255 | [
"MIT"
] | null | null | null | import numpy as np
import os, sys
import dill as pickle
import time
from tqdm import tqdm
from joblib import Parallel, delayed
import itertools
from symmetric_attractor_profile import attractor_profile
ncores = 24
parent = os.getcwd()
data_root = parent+'/sim_data/'
save_img = False
verbose = True
# define bead pro... | 28.973545 | 148 | 0.641709 |
8f4d4148038c1ee633d0fe7e73c9c20556472160 | 5,652 | py | Python | venv/Lib/site-packages/PySide6/examples/widgets/layouts/flowlayout/flowlayout.py | gabrielcervante/live-sharer | 6fb33d5663849734caddcba8d439244c03693e63 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/PySide6/examples/widgets/layouts/flowlayout/flowlayout.py | gabrielcervante/live-sharer | 6fb33d5663849734caddcba8d439244c03693e63 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/PySide6/examples/widgets/layouts/flowlayout/flowlayout.py | gabrielcervante/live-sharer | 6fb33d5663849734caddcba8d439244c03693e63 | [
"MIT"
] | null | null | null |
############################################################################
##
## Copyright (C) 2013 Riverbank Computing Limited.
## Copyright (C) 2020 The Qt Company Ltd.
## Contact: http://www.qt.io/licensing/
##
## This file is part of the Qt for Python examples of the Qt Toolkit.
##
## $QT_BEGIN_LICENSE:BSD$
## Y... | 35.10559 | 77 | 0.614119 |
12ce5c5c11fb95be9bbec0b057cf3174911b1d6e | 695 | py | Python | tests/test_VarPermutation.py | nariaki3551/flopt | fdf18deb63827463d90658c107c520aec4f0f707 | [
"MIT"
] | 4 | 2020-06-14T10:10:33.000Z | 2022-03-11T18:34:02.000Z | tests/test_VarPermutation.py | flab-coder/flopt | 681d2f98824a52bb95de73676823d7ae59c6a013 | [
"MIT"
] | 36 | 2020-04-30T12:07:15.000Z | 2021-11-02T05:30:04.000Z | tests/test_VarPermutation.py | flab-coder/flopt | 681d2f98824a52bb95de73676823d7ae59c6a013 | [
"MIT"
] | 4 | 2020-04-30T11:32:15.000Z | 2021-07-15T09:09:42.000Z | import pytest
from flopt import Variable
from flopt.constants import VariableType
@pytest.fixture(scope='function')
def a():
return Variable('a', lowBound=0, upBound=4, cat='Permutation')
def test_VarPermutation_hash(a):
hash(a)
# base function
def test_VarPermutation_type(a):
assert a.type() == Variabl... | 23.965517 | 66 | 0.703597 |
c08e22b9a6b34b0002343cbff04d372e0ad09a56 | 4,920 | py | Python | registers.py | arkorobotics/rfm69-micropython | c85668dc708248b640a1f63db2a851c5049c8b2d | [
"MIT"
] | 1 | 2019-10-18T01:41:07.000Z | 2019-10-18T01:41:07.000Z | registers.py | arkorobotics/rfm69-micropython | c85668dc708248b640a1f63db2a851c5049c8b2d | [
"MIT"
] | null | null | null | registers.py | arkorobotics/rfm69-micropython | c85668dc708248b640a1f63db2a851c5049c8b2d | [
"MIT"
] | null | null | null | # RFM69 Register Dictionary
#
# Ported to Micropython 2016 Ara Kourchians
#
# C code Author: Phil Crump (phildcrump@gmail.com)
# Copyright (C) 2014 Phil Crump
# Based on RF22.h
# Author: Mike McCauley (mikem@open.com.au)
# Copyright (C) 2011 Mike McCauley
# Minimal register dictionary, see RFM69Dict_complete.py for mo... | 42.782609 | 82 | 0.591667 |
04c6ad37056630faa719fe57ff34f32766eff247 | 1,881 | py | Python | web_feed.py | Jarde01/invisy | f9060eaa5beec6463e0055c8f7744218c1b4c310 | [
"MIT"
] | 1 | 2018-12-01T17:37:17.000Z | 2018-12-01T17:37:17.000Z | web_feed.py | LeviIsAwesome/Invisy | 59a25f06a2c98dbd828ae2d82aff2b8c5a91228a | [
"MIT"
] | null | null | null | web_feed.py | LeviIsAwesome/Invisy | 59a25f06a2c98dbd828ae2d82aff2b8c5a91228a | [
"MIT"
] | 2 | 2018-12-01T15:50:38.000Z | 2018-12-02T03:30:43.000Z | import time
from tkinter import Label
import cv2
import requests
import numpy as np
import urllib3
from PIL import ImageGrab, Image, ImageTk
from urllib3.packages.six import StringIO
import PIL
username = "jarde"
password = "invisy"
url_with_auth = f"http://{username}:{password}@140.193.201.45:8080/shot.jpg"
url = f"... | 27.661765 | 81 | 0.603402 |
4c48d4e4f5c17721343aae4a40c148a1b0337b3a | 438 | py | Python | PYTHON/Operators/logical.py | YakazaSTG/Python-Basics | 35cbc9a7b30dd985922bb288d67a1cf10d4da40c | [
"MIT"
] | null | null | null | PYTHON/Operators/logical.py | YakazaSTG/Python-Basics | 35cbc9a7b30dd985922bb288d67a1cf10d4da40c | [
"MIT"
] | null | null | null | PYTHON/Operators/logical.py | YakazaSTG/Python-Basics | 35cbc9a7b30dd985922bb288d67a1cf10d4da40c | [
"MIT"
] | null | null | null | x = 5
hak = 0
devam ='e'
result = 5 < x <10
# and
# True, True => True
# # True, False => False
result = (x > 5) and (x < 10)
result = (hak > 0) and (devam == 'e')
# or
result = (x > 0) or (x % 2 == 0)
# True,False => True
# True, True => True
# False, False => False
# not
result =... | 13.272727 | 43 | 0.486301 |
630638c53311c09c8ccbbbc7ffea1cd32c963f98 | 1,866 | py | Python | guests/tests/test_importer.py | MarinaMcGrath/django-wedding-website | 1e7f981e9e3cd7d0fb6361f26753f3077969463a | [
"Apache-2.0"
] | null | null | null | guests/tests/test_importer.py | MarinaMcGrath/django-wedding-website | 1e7f981e9e3cd7d0fb6361f26753f3077969463a | [
"Apache-2.0"
] | null | null | null | guests/tests/test_importer.py | MarinaMcGrath/django-wedding-website | 1e7f981e9e3cd7d0fb6361f26753f3077969463a | [
"Apache-2.0"
] | null | null | null | import os
from django.test import TestCase
from guests.csv_import import import_guests
from guests.models import Party, Guest
class GuestImporterTest(TestCase):
@classmethod
def setUpClass(cls):
super(GuestImporterTest, cls).setUpClass()
cls.path = os.path.join(os.path.dirname(__file__), 'dat... | 35.207547 | 89 | 0.64523 |
4fe0a231eea6ee1d002d98a06912db70019aa7cf | 1,334 | py | Python | alipay/aop/api/domain/AnttechBlockchainTwcUserMatchModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AnttechBlockchainTwcUserMatchModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AnttechBlockchainTwcUserMatchModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AnttechBlockchainTwcUserMatchModel(object):
def __init__(self):
self._cert_no = None
self._user_id = None
@property
def cert_no(self):
return self._cert_no
@... | 23.821429 | 65 | 0.572714 |
4e643a47be709f567eb297309a19a26d84922d9c | 317 | py | Python | flask_app/application.py | lucidfrontier45/flasktest | 7700f35c732f9a9877d7bd34179d0a604b77a892 | [
"MIT"
] | null | null | null | flask_app/application.py | lucidfrontier45/flasktest | 7700f35c732f9a9877d7bd34179d0a604b77a892 | [
"MIT"
] | null | null | null | flask_app/application.py | lucidfrontier45/flasktest | 7700f35c732f9a9877d7bd34179d0a604b77a892 | [
"MIT"
] | null | null | null | from flask_restful import Api
import logging
from . import app, model, api
app.logger.setLevel(logging.DEBUG)
db_session = model.db.session
@app.route('/')
def hello_world():
app.logger.debug("hello")
return 'Hello World!'
rest_api = Api(app)
rest_api.add_resource(api.User, "/user/", "/user/<name>/")
| 16.684211 | 58 | 0.70347 |
c3c00fb614e4916896ee492eea082db5fac625c1 | 7,496 | py | Python | tools/train_mean_teacher.py | SIAAAAAA/MMT-PSM | 0835c01c5010d3337778f452e9d96416e0f8a11a | [
"MIT"
] | 41 | 2020-07-22T03:55:08.000Z | 2022-02-27T12:04:41.000Z | tools/train_mean_teacher.py | SIAAAAAA/MMT-PSM | 0835c01c5010d3337778f452e9d96416e0f8a11a | [
"MIT"
] | 5 | 2020-11-08T08:47:34.000Z | 2021-07-09T03:53:42.000Z | tools/train_mean_teacher.py | SIAAAAAA/MMT-PSM | 0835c01c5010d3337778f452e9d96416e0f8a11a | [
"MIT"
] | 5 | 2020-10-13T11:09:53.000Z | 2021-07-28T12:41:53.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
r"""
Basic training script for PyTorch
"""
import argparse
import os
import shutil
import torch
from maskrcnn_benchmark.config import cfg
from maskrcnn_benchmark.data import make_data_loader,\
make_mt_data_loader
from maskrcnn_benchmark.solver... | 36.565854 | 140 | 0.622332 |
b616028c417e8222c24ac3d30268ffa9b492db40 | 3,442 | py | Python | mitmproxy/contrib/wbxml/ASWBXMLByteQueue.py | ravitejavalluri/mproxy | ccd8e1e617cdbf3b34ec01ac130093396197101f | [
"MIT"
] | 9 | 2016-11-20T02:18:18.000Z | 2021-07-27T00:25:13.000Z | mitmproxy/contrib/wbxml/ASWBXMLByteQueue.py | ravitejavalluri/mproxy | ccd8e1e617cdbf3b34ec01ac130093396197101f | [
"MIT"
] | 1 | 2021-05-09T11:18:14.000Z | 2021-05-09T11:18:14.000Z | mitmproxy/contrib/wbxml/ASWBXMLByteQueue.py | ravitejavalluri/mproxy | ccd8e1e617cdbf3b34ec01ac130093396197101f | [
"MIT"
] | 15 | 2016-12-22T15:15:47.000Z | 2021-09-19T06:47:02.000Z | #!/usr/bin/env python
'''
@author: David Shaw, david.shaw.aw@gmail.com
Inspired by EAS Inspector for Fiddler
https://easinspectorforfiddler.codeplex.com
----- The MIT License (MIT) -----
Filename: ASWBXMLByteQueue.py
Copyright (c) 2014, David P. Shaw
Permission is hereby granted, free of charge, to any person obtain... | 33.417476 | 97 | 0.633643 |
18f5197dc900938614ab367243f18133a970e324 | 259 | py | Python | EZclim/Months.py | msc-acse/acse-9-independent-research-project-AdannaAkwats | 3a46de2e95b35ef095d2376e7237fad14e058b3e | [
"MIT"
] | null | null | null | EZclim/Months.py | msc-acse/acse-9-independent-research-project-AdannaAkwats | 3a46de2e95b35ef095d2376e7237fad14e058b3e | [
"MIT"
] | null | null | null | EZclim/Months.py | msc-acse/acse-9-independent-research-project-AdannaAkwats | 3a46de2e95b35ef095d2376e7237fad14e058b3e | [
"MIT"
] | 5 | 2019-06-21T16:14:28.000Z | 2021-01-22T07:53:54.000Z | """
Created by Adanna Akwataghibe (Github: AdannaAkwats)
"""
class Month:
January = 1
February = 2
March = 3
April = 4
May = 5
June = 6
July = 7
August = 8
September = 9
October = 10
November = 11
December = 12 | 15.235294 | 52 | 0.552124 |
a3a3af5bc519662c2acb5db115d5c60811266a08 | 1,154 | py | Python | padatious/intent_manager.py | DodoHan/mycroft-core-zh | d07e374d29bbc9182a71cdcb72a1828272858b45 | [
"Apache-2.0"
] | 144 | 2017-08-03T11:33:47.000Z | 2022-03-07T20:25:42.000Z | padatious/intent_manager.py | DodoHan/mycroft-core-zh | d07e374d29bbc9182a71cdcb72a1828272858b45 | [
"Apache-2.0"
] | 31 | 2017-09-06T16:39:35.000Z | 2021-11-10T00:46:49.000Z | padatious/intent_manager.py | DodoHan/mycroft-core-zh | d07e374d29bbc9182a71cdcb72a1828272858b45 | [
"Apache-2.0"
] | 44 | 2017-09-05T16:44:56.000Z | 2022-03-20T03:26:20.000Z | # Copyright 2017 Mycroft AI, 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 writ... | 34.969697 | 74 | 0.727036 |
6e0f42b087409ebd69197995b282b85f36b47374 | 3,823 | py | Python | c-deps/krb5/src/tests/t_kadm5_auth.py | Yangjxxxxx/ZNBase | dcf993b73250dd5cb63041f4d9cf098941f67b2b | [
"MIT",
"BSD-3-Clause"
] | 1 | 2021-12-03T05:07:39.000Z | 2021-12-03T05:07:39.000Z | c-deps/krb5/src/tests/t_kadm5_auth.py | Yangjxxxxx/ZNBase | dcf993b73250dd5cb63041f4d9cf098941f67b2b | [
"MIT",
"BSD-3-Clause"
] | 9 | 2020-05-13T16:28:13.000Z | 2021-12-30T04:07:49.000Z | src/tests/t_kadm5_auth.py | frozencemetery/krb5 | bb8fa495d00ccd931eec87a01b8920636cf7903e | [
"MIT"
] | 4 | 2020-07-01T12:41:46.000Z | 2022-01-26T03:05:30.000Z | from k5test import *
# Create a realm with the welcomer and bouncer kadm5_auth test modules
# in place of the builtin modules.
modpath = os.path.join(buildtop, 'plugins', 'kadm5_auth', 'test',
'kadm5_auth_test.so')
conf = {'plugins': {'kadm5_auth': {'module': ['welcomer:' + modpath,
... | 47.197531 | 78 | 0.684018 |
1107af50cfac1ffee585fc57db868b9608c942d5 | 1,014 | py | Python | scanner/plugins/system/weblogic/weblogic_interface_disclosure.py | UgOrange/onlinetools | 06205282965395e37fb3a7fed806682196ad9ccc | [
"MIT"
] | 1,207 | 2018-01-31T06:36:34.000Z | 2022-03-31T07:35:35.000Z | scanner/plugins/system/weblogic/weblogic_interface_disclosure.py | UgOrange/onlinetools | 06205282965395e37fb3a7fed806682196ad9ccc | [
"MIT"
] | 21 | 2018-07-30T03:01:49.000Z | 2022-03-28T08:20:39.000Z | scanner/plugins/system/weblogic/weblogic_interface_disclosure.py | UgOrange/onlinetools | 06205282965395e37fb3a7fed806682196ad9ccc | [
"MIT"
] | 310 | 2018-02-22T01:23:20.000Z | 2022-03-28T08:51:37.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
name: weblogic 接口泄露
referer: unknown
author: Lucifer
description: weblogic 接口泄露
'''
import sys
import requests
class weblogic_interface_disclosure_BaseVerify:
def __init__(self, url):
self.url = url
def run(self):
headers = {
"User-Agen... | 28.166667 | 144 | 0.619329 |
7151cc04e6105f335357d0aa7ca6c51b788e29ba | 111 | py | Python | airbrake/__init__.py | Perkville/django-airbrake | e0b6a9384b18a1b30a54cb19ec5d93a5aafba595 | [
"MIT"
] | null | null | null | airbrake/__init__.py | Perkville/django-airbrake | e0b6a9384b18a1b30a54cb19ec5d93a5aafba595 | [
"MIT"
] | null | null | null | airbrake/__init__.py | Perkville/django-airbrake | e0b6a9384b18a1b30a54cb19ec5d93a5aafba595 | [
"MIT"
] | null | null | null | __version__ = '1.0.8'
__app_name__ = 'django-airbrake'
__app_url__ = 'http://github.com/Bouke/django-airbrake'
| 27.75 | 55 | 0.747748 |
c01fe7a4d06651b3954bb7700889bfa513670ed3 | 385 | py | Python | app/email.py | goldangera/pitch-perfect | 30fe8876e0069646721e73f173b8b098d5a3de68 | [
"MIT"
] | null | null | null | app/email.py | goldangera/pitch-perfect | 30fe8876e0069646721e73f173b8b098d5a3de68 | [
"MIT"
] | 4 | 2021-02-08T20:31:31.000Z | 2022-03-11T23:51:59.000Z | app/email.py | goldangera/pitch-perfect | 30fe8876e0069646721e73f173b8b098d5a3de68 | [
"MIT"
] | null | null | null | from flask_mail import Message
from flask import render_template
from . import mail
def mail_message(subject,template,to,**kwargs):
sender_email = 'markagimba@gmail.com'
email = Message(subject, sender=sender_email, recipients=[to])
email.body= render_template(template + ".txt",**kwargs)
email.html = ... | 35 | 66 | 0.737662 |
bb1237908db0ccffa389ae8312650c591abb28d1 | 15,426 | py | Python | nnmnkwii/io/hts.py | moseshi-dev/nnmnkwii | def4eefafaab7f6da8d4b2a06111549637f17a35 | [
"MIT"
] | null | null | null | nnmnkwii/io/hts.py | moseshi-dev/nnmnkwii | def4eefafaab7f6da8d4b2a06111549637f17a35 | [
"MIT"
] | null | null | null | nnmnkwii/io/hts.py | moseshi-dev/nnmnkwii | def4eefafaab7f6da8d4b2a06111549637f17a35 | [
"MIT"
] | null | null | null | # Part of code here is adapted from Merlin. Their license follows:
##########################################################################
# The Neural Network (NN) based Speech Synthesis System
# https://github.com/CSTR-Edinburgh/merlin
#
# Centre for Speech Technology Resear... | 35.791183 | 98 | 0.595618 |
13a906a0828f036d75d0107aa55d0ec71e14ef0c | 5,664 | py | Python | trade.py | dvirg/acending_price_recipetree_auction | 23b8209b7dde0350053636321475eb74f4115ab5 | [
"MIT"
] | null | null | null | trade.py | dvirg/acending_price_recipetree_auction | 23b8209b7dde0350053636321475eb74f4115ab5 | [
"MIT"
] | null | null | null | trade.py | dvirg/acending_price_recipetree_auction | 23b8209b7dde0350053636321475eb74f4115ab5 | [
"MIT"
] | null | null | null | #!python3
"""
class TradeWithSinglePrice
Represents a set of deals done in a multi-lateral market.
See also: Market
Author: AnonymousE
Since: 2019-08
"""
import math
from agents import AgentCategory
from typing import *
class Trade:
"""
An abstract base class.
Represents a set of deals done in a mar... | 35.848101 | 120 | 0.624117 |
3bf5e73a60cad05117ae354b6340406661d8bab3 | 4,113 | py | Python | pettingzoo/sisl/multiwalker/multiwalker.py | dsctt/PettingZoo | b839259e961798cfc23b6f82c6ba0898b55cda60 | [
"Apache-2.0"
] | null | null | null | pettingzoo/sisl/multiwalker/multiwalker.py | dsctt/PettingZoo | b839259e961798cfc23b6f82c6ba0898b55cda60 | [
"Apache-2.0"
] | null | null | null | pettingzoo/sisl/multiwalker/multiwalker.py | dsctt/PettingZoo | b839259e961798cfc23b6f82c6ba0898b55cda60 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from gym.utils import EzPickle
from pettingzoo import AECEnv
from pettingzoo.utils import agent_selector, wrappers
from pettingzoo.utils.conversions import parallel_wrapper_fn
from .multiwalker_base import FPS
from .multiwalker_base import MultiWalkerEnv as _env
def env(**kwargs):
env = raw_e... | 35.456897 | 136 | 0.639679 |
96c6b3d332eedc46c0326fec5a357883f4abd936 | 311 | py | Python | src/catkin_projects/robot_server/setup.py | mehrdad-shokri/spartan | 854b26e3af75910ef57b874db7853abd4249543e | [
"BSD-3-Clause-Clear"
] | 32 | 2017-09-09T12:02:02.000Z | 2022-01-26T10:46:31.000Z | src/catkin_projects/robot_server/setup.py | mehrdad-shokri/spartan | 854b26e3af75910ef57b874db7853abd4249543e | [
"BSD-3-Clause-Clear"
] | 235 | 2017-06-06T18:14:17.000Z | 2020-10-01T15:09:21.000Z | src/catkin_projects/robot_server/setup.py | mehrdad-shokri/spartan | 854b26e3af75910ef57b874db7853abd4249543e | [
"BSD-3-Clause-Clear"
] | 32 | 2017-06-09T15:27:59.000Z | 2021-07-13T02:58:58.000Z | ## ! DO NOT MANUALLY INVOKE THIS setup.py, USE CATKIN INSTEAD
from distutils.core import setup
from catkin_pkg.python_setup import generate_distutils_setup
# fetch values from package.xml
setup_args = generate_distutils_setup(
packages=['robot_server'],
package_dir={'': 'src'})
setup(**setup_args)
| 23.923077 | 61 | 0.765273 |
9c6f99b4988acb8a41b6dd0f8285c45767bad61c | 44,160 | py | Python | nova/api/openstack/wsgi.py | venusource/nova | 0c6e6f180eebe71a3431abf726a0fd0c66578162 | [
"Apache-2.0"
] | 7 | 2015-09-22T11:27:16.000Z | 2015-11-02T12:33:46.000Z | nova/api/openstack/wsgi.py | venusource/nova | 0c6e6f180eebe71a3431abf726a0fd0c66578162 | [
"Apache-2.0"
] | 2 | 2015-09-07T22:14:46.000Z | 2020-08-12T08:51:56.000Z | nova/api/openstack/wsgi.py | venusource/nova | 0c6e6f180eebe71a3431abf726a0fd0c66578162 | [
"Apache-2.0"
] | 4 | 2015-09-09T16:48:56.000Z | 2022-03-15T20:52:57.000Z | # Copyright 2013 IBM Corp.
# Copyright 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LIC... | 35.728155 | 79 | 0.612092 |
e380a441f1fff538fe69bf9e224202f9693b8453 | 6,891 | py | Python | env/lib/python3.6/site-packages/cryptography/hazmat/primitives/asymmetric/dsa.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 9,953 | 2019-04-03T23:41:04.000Z | 2022-03-31T11:54:44.000Z | env/lib/python3.6/site-packages/cryptography/hazmat/primitives/asymmetric/dsa.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 427 | 2017-09-29T22:54:36.000Z | 2022-02-15T19:26:50.000Z | env/lib/python3.6/site-packages/cryptography/hazmat/primitives/asymmetric/dsa.py | anthowen/duplify | 846d01c1b21230937fdf0281b0cf8c0b08a8c24e | [
"MIT"
] | 2,803 | 2019-04-06T13:15:33.000Z | 2022-03-31T07:42:01.000Z | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import six
from cryptography import utils
@six.add_metacla... | 27.023529 | 79 | 0.636192 |
e5657c40ca330c75d7f2b2ed81c86d49e9a0abe8 | 1,276 | py | Python | example.py | samson6460/tf_keras_gradcamplusplus | c539a09a5fd38fecf045a927c25cbc87de3a1d93 | [
"Apache-2.0"
] | 12 | 2021-03-15T17:53:38.000Z | 2022-03-31T03:11:04.000Z | example.py | samson6460/tf.keras-gradcamplusplus | c539a09a5fd38fecf045a927c25cbc87de3a1d93 | [
"Apache-2.0"
] | 1 | 2021-06-09T15:55:01.000Z | 2022-02-18T01:15:39.000Z | example.py | samson6460/tf.keras-gradcamplusplus | c539a09a5fd38fecf045a927c25cbc87de3a1d93 | [
"Apache-2.0"
] | 2 | 2021-05-02T07:32:15.000Z | 2021-09-15T13:42:03.000Z | # Copyright 2020 Samson Woof
# 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, sof... | 34.486486 | 80 | 0.681818 |
590d378d1cabe510400fdd9dc8b73c1bbc08ecf5 | 583 | py | Python | users/models/notifications.py | bycristhian/psp | 019825e010386b6acc8c5466e7a6765218cb10d9 | [
"MIT"
] | 2 | 2020-09-04T17:06:41.000Z | 2020-10-05T01:46:20.000Z | users/models/notifications.py | bycristhian/psp | 019825e010386b6acc8c5466e7a6765218cb10d9 | [
"MIT"
] | null | null | null | users/models/notifications.py | bycristhian/psp | 019825e010386b6acc8c5466e7a6765218cb10d9 | [
"MIT"
] | null | null | null |
# Django
from django.db import models
# Models
from django.contrib.auth.models import User
# TODO Implementar un sistema de notificaciones en el futuro
# This model save the notifications of the user
'''class Notification(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='user... | 29.15 | 95 | 0.759863 |
1f4e043dd5ebfcc8c6c75c342ad0d5c56b15b476 | 2,833 | py | Python | networkapi/util/appcache.py | vinicius-marinho/GloboNetworkAPI | 94651d3b4dd180769bc40ec966814f3427ccfb5b | [
"Apache-2.0"
] | 73 | 2015-04-13T17:56:11.000Z | 2022-03-24T06:13:07.000Z | networkapi/util/appcache.py | vinicius-marinho/GloboNetworkAPI | 94651d3b4dd180769bc40ec966814f3427ccfb5b | [
"Apache-2.0"
] | 99 | 2015-04-03T01:04:46.000Z | 2021-10-03T23:24:48.000Z | networkapi/util/appcache.py | vinicius-marinho/GloboNetworkAPI | 94651d3b4dd180769bc40ec966814f3427ccfb5b | [
"Apache-2.0"
] | 64 | 2015-08-05T21:26:29.000Z | 2022-03-22T01:06:28.000Z | import hashlib
import logging
from django.core.cache import cache as djangocache
from networkapi.distributedlock import distributedlock
from networkapi.system.facade import get_value
log = logging.getLogger(__name__)
DEFAULT_CACHE_TIMEOUT = 86400
ENVIRONMENT_CACHE_ENTRY = "CACHE_ENV_LIST"
def cache_enabled():
... | 28.33 | 84 | 0.578539 |
21f04b067eac79b48825d7a6d370c1526d4a64ca | 428 | py | Python | common/Message.py | justinchuby/cmu-courseapi-restful-elasticsearch | 054201337da3d81010046be456b680c037385928 | [
"MIT"
] | null | null | null | common/Message.py | justinchuby/cmu-courseapi-restful-elasticsearch | 054201337da3d81010046be456b680c037385928 | [
"MIT"
] | null | null | null | common/Message.py | justinchuby/cmu-courseapi-restful-elasticsearch | 054201337da3d81010046be456b680c037385928 | [
"MIT"
] | null | null | null | import config.course
HOME_MESSAGE = 'Hoooray! You are connected.'
API_ROOT_MESSAGE = 'Course API by ScottyLabs!'
DATETIME_PARSE_FAIL = 'Failed to parse datetime. Please check format agrees with ISO-8601.'
SPAN_PARSE_FAIL = 'Failed to parse span. Span should be an integer between {} and {}.'.format(config.course.SPAN_L... | 61.142857 | 157 | 0.792056 |
f42dd36f9d268532781ba7f490837e2af6551d37 | 366 | py | Python | pycharm/module/changefile/__init__.py | jinbao-x/python | 728db91e7f702f26a4cb601a41fac5b5eb45cb5f | [
"Apache-2.0"
] | null | null | null | pycharm/module/changefile/__init__.py | jinbao-x/python | 728db91e7f702f26a4cb601a41fac5b5eb45cb5f | [
"Apache-2.0"
] | null | null | null | pycharm/module/changefile/__init__.py | jinbao-x/python | 728db91e7f702f26a4cb601a41fac5b5eb45cb5f | [
"Apache-2.0"
] | null | null | null | # from . import readfile # 先在init里导入一下模块,先初始化一下,然后,包之外的另外一个文件就可以使用from 包 imoprt *来调用了
# from . import writefile
# __init__
# 1、声明文件夹是个包
# 2、可以做初始化操作
# 3、可以声明__all__影响 from 包 import *导入,在__all__里写的才会导入
# 当然这个init文件也可以想其他普通模块文件内一样,可以使用__all__ = ['readfile']这样的方式来确认模块里的哪些方法可以使用
# 这种是为了解决其他模块文件里用from changefile import ... | 30.5 | 86 | 0.814208 |
e242887d30f65a8827eefb1f14659f2dc175f2e3 | 1,038 | py | Python | media.py | robertkohl125/Movies_Website | 859dd1b6bd52e916dc8053dd03a230885f599e72 | [
"MIT",
"Unlicense"
] | null | null | null | media.py | robertkohl125/Movies_Website | 859dd1b6bd52e916dc8053dd03a230885f599e72 | [
"MIT",
"Unlicense"
] | null | null | null | media.py | robertkohl125/Movies_Website | 859dd1b6bd52e916dc8053dd03a230885f599e72 | [
"MIT",
"Unlicense"
] | null | null | null | import webbrowser
class Video():
"""This Parent class constructs a list of media variables for the
child classes Video and TvShow for our web site."""
# This is the Parent class for the media classes (Movie and TvShow).
def __init__(self, title, storyline, poster_image_url,
trailer_y... | 43.25 | 78 | 0.689788 |
c26f66c0382307a41460de4691257d74d61f53ee | 435 | py | Python | exercicios-python/curso-python/ex036.py | PabloLanza/curso-python3 | 34cf44a2467fa239ba4019e085833002ad9b76a1 | [
"MIT"
] | null | null | null | exercicios-python/curso-python/ex036.py | PabloLanza/curso-python3 | 34cf44a2467fa239ba4019e085833002ad9b76a1 | [
"MIT"
] | null | null | null | exercicios-python/curso-python/ex036.py | PabloLanza/curso-python3 | 34cf44a2467fa239ba4019e085833002ad9b76a1 | [
"MIT"
] | null | null | null | from datetime import date
nasc = int(input('Digite o ano em que o atleta nasceu: '))
ano = date.today().year
ida = ano - nasc
if ida <= 9:
print('O atleta está na categoria Mirim.')
elif ida <= 14:
print('O atleta está na cetegoria Infaltil.')
elif ida <= 19:
print('O atleta está na categoria Júnior.')
eli... | 29 | 58 | 0.668966 |
75c00ef27fefba4de5a9f06e5364c3e6e2bdcaf1 | 945 | py | Python | AlgorithmChanllengeProject/evaluation_Agora_0903/torchprofile/utils/ir/variable.py | AgoraIO-Community/RTC-Innovation-Challenge-2020 | 13a1b7f917a90beb758727eeb908622045420455 | [
"MIT"
] | 216 | 2019-09-09T19:45:07.000Z | 2020-06-15T20:17:55.000Z | AlgorithmChanllengeProject/evaluation_Agora_0903/torchprofile/utils/ir/variable.py | AgoraIO-Community/RTC-Innovation-Challenge-2020 | 13a1b7f917a90beb758727eeb908622045420455 | [
"MIT"
] | 10 | 2020-08-27T05:00:31.000Z | 2022-03-18T11:10:09.000Z | torchf1/apputils/graph/variable.py | longw010/PyTorch-F1 | 13be169bddc41316e498c4e4cd20575bc8b51f9a | [
"MIT"
] | 79 | 2020-07-31T03:02:30.000Z | 2021-07-13T06:45:37.000Z | __all__ = ['Variable']
class Variable:
def __init__(self, name, dtype, shape=None):
self.name = name
self.dtype = dtype
self.shape = shape
@property
def name(self):
return self._name
@name.setter
def name(self, name):
self._name = name
@property
d... | 19.285714 | 71 | 0.546032 |
050294138ac10aa28a33b59445f55cee1289b5fa | 1,264 | py | Python | expense_track/urls.py | bhavish14/Expense-Track | cf71472420187efa89b84d24e7302206cf819680 | [
"MIT"
] | null | null | null | expense_track/urls.py | bhavish14/Expense-Track | cf71472420187efa89b84d24e7302206cf819680 | [
"MIT"
] | null | null | null | expense_track/urls.py | bhavish14/Expense-Track | cf71472420187efa89b84d24e7302206cf819680 | [
"MIT"
] | null | null | null | """expense_track URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.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... | 32.410256 | 80 | 0.696203 |
01eaa94161e8ea46d92eb31a5b82e8446b157453 | 551 | py | Python | lint/queue.py | ericwb/SublimeLinter | cdb8bd35a835c7d473bad98650447cdcbca2d727 | [
"MIT"
] | null | null | null | lint/queue.py | ericwb/SublimeLinter | cdb8bd35a835c7d473bad98650447cdcbca2d727 | [
"MIT"
] | null | null | null | lint/queue.py | ericwb/SublimeLinter | cdb8bd35a835c7d473bad98650447cdcbca2d727 | [
"MIT"
] | null | null | null | import threading
# Map from view_id to threading.Timer objects
timers = {}
def debounce(callback, delay, key):
try:
timers[key].cancel()
except KeyError:
pass
timers[key] = timer = threading.Timer(delay, callback)
timer.start()
return timer
def cleanup(vid):
try:
t... | 16.205882 | 58 | 0.568058 |
b301bb6aa36107c3e762841423b82864f100e35f | 15 | py | Python | test/general/caching/cachingtest.py | Cyclip/SoSoBot | 271a9c56ee8b83616d21acb1920435f53c97ebc2 | [
"MIT"
] | null | null | null | test/general/caching/cachingtest.py | Cyclip/SoSoBot | 271a9c56ee8b83616d21acb1920435f53c97ebc2 | [
"MIT"
] | null | null | null | test/general/caching/cachingtest.py | Cyclip/SoSoBot | 271a9c56ee8b83616d21acb1920435f53c97ebc2 | [
"MIT"
] | 1 | 2021-03-26T18:28:04.000Z | 2021-03-26T18:28:04.000Z | import caching
| 7.5 | 14 | 0.866667 |
15f461d0004d7b8686d1a757d3a794f8f9198394 | 193 | py | Python | openapi_core/schema/specs.py | correl/openapi-core | 5dcb0dba7642f9959bb7af5e40f3fdeb1b2cc85f | [
"BSD-3-Clause"
] | 1 | 2021-07-14T14:43:22.000Z | 2021-07-14T14:43:22.000Z | openapi_core/schema/specs.py | ashb/openapi-core | c4fab4c4b3830bff5b90c3a0ac8dc62e67ee78a3 | [
"BSD-3-Clause"
] | 9 | 2021-07-13T22:19:17.000Z | 2022-01-05T22:12:31.000Z | openapi_core/schema/specs.py | ashb/openapi-core | c4fab4c4b3830bff5b90c3a0ac8dc62e67ee78a3 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import division
from openapi_core.schema.servers import get_server_url
def get_spec_url(spec, index=0):
servers = spec / 'servers'
return get_server_url(servers / 0)
| 21.444444 | 54 | 0.766839 |
d30202ed7eaeed530eec17e91d1d46f8e58b0b10 | 13,753 | py | Python | salt/renderers/pyobjects.py | mgwilliams/salt | c5f814bfdbc46765f4baa8355082a3528a7c9d8e | [
"Apache-2.0"
] | null | null | null | salt/renderers/pyobjects.py | mgwilliams/salt | c5f814bfdbc46765f4baa8355082a3528a7c9d8e | [
"Apache-2.0"
] | null | null | null | salt/renderers/pyobjects.py | mgwilliams/salt | c5f814bfdbc46765f4baa8355082a3528a7c9d8e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Python renderer that includes a Pythonic Object based interface
:maintainer: Evan Borgstrom <evan@borgstrom.ca>
Let's take a look at how you use pyobjects in a state file. Here's a quick
example that ensures the ``/tmp`` directory is in the correct state.
.. code-block:: python
:lineno... | 30.836323 | 86 | 0.648877 |
c84428ed7cbb15175a7d5882ac26093742ee2170 | 784 | py | Python | scripts/exp-application/fwt_oTree/trust_simple/models.py | ffzg-erudito/inter-testing-feedback-2018 | 368f3fb8960535dd0d99213a360491b1edde8b39 | [
"CC0-1.0",
"CC-BY-4.0"
] | null | null | null | scripts/exp-application/fwt_oTree/trust_simple/models.py | ffzg-erudito/inter-testing-feedback-2018 | 368f3fb8960535dd0d99213a360491b1edde8b39 | [
"CC0-1.0",
"CC-BY-4.0"
] | null | null | null | scripts/exp-application/fwt_oTree/trust_simple/models.py | ffzg-erudito/inter-testing-feedback-2018 | 368f3fb8960535dd0d99213a360491b1edde8b39 | [
"CC0-1.0",
"CC-BY-4.0"
] | null | null | null | from otree.api import (
models, widgets, BaseConstants, BaseSubsession, BaseGroup, BasePlayer,
Currency as c, currency_range
)
import random
doc = """
Simple trust game
"""
class Constants(BaseConstants):
name_in_url = 'trust_simple'
players_per_group = 2
num_rounds = 1
end... | 19.6 | 75 | 0.644133 |
42c04b793cc84d8fd214d2e119102b5460f64068 | 624 | py | Python | var/spack/repos/builtin/packages/r-stabledist/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/r-stabledist/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 8 | 2021-11-09T20:28:40.000Z | 2022-03-15T03:26:33.000Z | var/spack/repos/builtin/packages/r-stabledist/package.py | jeanbez/spack | f4e51ce8f366c85bf5aa0eafe078677b42dae1ba | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class RStabledist(RPackage):
"""Stable Distribution Functions.
Density, Probability... | 31.2 | 95 | 0.748397 |
3c23c06093c73fd77023e504e1560773347c2e2b | 1,395 | py | Python | alipay/aop/api/domain/AliosOpenAutoInfoQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AliosOpenAutoInfoQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AliosOpenAutoInfoQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AliosOpenAutoInfoQueryModel(object):
def __init__(self):
self._device_token = None
self._user_id = None
@property
def device_token(self):
return self._device_toke... | 24.910714 | 75 | 0.591398 |
b2f2c1ca50c0e0cb0432910b59474eefc6caad29 | 2,362 | py | Python | Updated_Peak_Finder.py | AustinShih/radwatch-analysis | 748f23bb09a5aae87e848a3b212244b15bdda600 | [
"MIT"
] | 6 | 2016-08-03T02:21:09.000Z | 2020-01-30T18:47:51.000Z | Updated_Peak_Finder.py | AustinShih/radwatch-analysis | 748f23bb09a5aae87e848a3b212244b15bdda600 | [
"MIT"
] | 47 | 2016-07-29T23:42:51.000Z | 2017-08-04T16:41:01.000Z | Updated_Peak_Finder.py | AustinShih/radwatch-analysis | 748f23bb09a5aae87e848a3b212244b15bdda600 | [
"MIT"
] | 10 | 2016-08-03T04:48:25.000Z | 2021-11-16T08:24:39.000Z | from __future__ import print_function
import numpy as np
import peakutils as p
import matplotlib.pyplot as plt
import SPEFile
def peak_finder_pro(measurement):
E0 = measurement.energy_cal[0]
Eslope = measurement.energy_cal[1]
energy_axis = E0 + Eslope*measurement.channel
increment = 25
counts = me... | 34.735294 | 74 | 0.564352 |
17c8162db0c0f3388d5446dc0e124d4ebdddc29d | 1,892 | py | Python | Lib/site-packages/troposphere/servicediscovery.py | ZGrinacoff/ufc_fightclub | ee0a0a5ff2756db05198522a376c6c38d09976e5 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | Lib/site-packages/troposphere/servicediscovery.py | ZGrinacoff/ufc_fightclub | ee0a0a5ff2756db05198522a376c6c38d09976e5 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | Lib/site-packages/troposphere/servicediscovery.py | ZGrinacoff/ufc_fightclub | ee0a0a5ff2756db05198522a376c6c38d09976e5 | [
"bzip2-1.0.6",
"MIT"
] | null | null | null | # Copyright (c) 2012-2017, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty
class Instance(AWSObject):
resource_type = "AWS::ServiceDiscovery::Instance"
props = {
'InstanceAttributes': (dict, True),
'InstanceId': (st... | 21.747126 | 68 | 0.595666 |
edba3f179dbe3bab2e0f047dd35b649639b16200 | 774 | py | Python | Dictionaries.py | Nikuchan/Python | 3312175d4bc1299b70a74a64011f3f7c402eaabc | [
"MIT"
] | null | null | null | Dictionaries.py | Nikuchan/Python | 3312175d4bc1299b70a74a64011f3f7c402eaabc | [
"MIT"
] | null | null | null | Dictionaries.py | Nikuchan/Python | 3312175d4bc1299b70a74a64011f3f7c402eaabc | [
"MIT"
] | null | null | null | student={'name':'john','age':25,'courses':['Math','CompSci']}
print(student)
print(student['name'])
print(student['courses'])
# print(student['phone'])
print(student.get('name'))
print(student.get('phone',"Not Found"))
# Adding
#student['phone']='555-5555'
#print(student['phone'])
# Updating
#stude... | 13.578947 | 62 | 0.612403 |
8fae87b7ec9a8c9e603b88824d1db7b6fcf979ae | 839 | py | Python | 02.pyaudio/record.py | s3ishr/python-websocket-sample | 89854e45925af8aee0b797541958e11a92da63a6 | [
"MIT"
] | null | null | null | 02.pyaudio/record.py | s3ishr/python-websocket-sample | 89854e45925af8aee0b797541958e11a92da63a6 | [
"MIT"
] | null | null | null | 02.pyaudio/record.py | s3ishr/python-websocket-sample | 89854e45925af8aee0b797541958e11a92da63a6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pyaudio
import wave
import audioop
import sys
import websocket
#ws = websocket.create_connection("ws://localhost:8080/ws")
CHUNK = 8192
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 44100
RECORD_SEC = input('REC TIME >')
p = pyaudio.PyAudio()
stream = p.open(for... | 19.068182 | 65 | 0.604291 |
00bed0c32e4dd339314242f4f56c3da644e4a177 | 923 | py | Python | 4 - manipulating dataframes with pandas/Grouping data/grouping on a function of the index.py | Baidaly/datacamp-samples | 09b3e253ec2c503df936298fedc3902413c987b0 | [
"MIT"
] | null | null | null | 4 - manipulating dataframes with pandas/Grouping data/grouping on a function of the index.py | Baidaly/datacamp-samples | 09b3e253ec2c503df936298fedc3902413c987b0 | [
"MIT"
] | null | null | null | 4 - manipulating dataframes with pandas/Grouping data/grouping on a function of the index.py | Baidaly/datacamp-samples | 09b3e253ec2c503df936298fedc3902413c987b0 | [
"MIT"
] | null | null | null | '''
Groupby operations can also be performed on transformations of the index values. In the case of a DateTimeIndex, we can extract portions of the datetime over which to group.
In this exercise you'll read in a set of sample sales data from February 2015 and assign the 'Date' column as the index. Your job is to group... | 43.952381 | 224 | 0.755146 |
b6f3eac53f45189d82f47bc624943ce346eb17c6 | 258,948 | py | Python | src/controller/python/chip/clusters/CHIPClusters.py | sungho1shin/connectedhomeip | 050eb6d24487598a97743b6a23d41232e45bef88 | [
"Apache-2.0"
] | null | null | null | src/controller/python/chip/clusters/CHIPClusters.py | sungho1shin/connectedhomeip | 050eb6d24487598a97743b6a23d41232e45bef88 | [
"Apache-2.0"
] | null | null | null | src/controller/python/chip/clusters/CHIPClusters.py | sungho1shin/connectedhomeip | 050eb6d24487598a97743b6a23d41232e45bef88 | [
"Apache-2.0"
] | null | null | null | '''
/*
*
* Copyright (c) 2022 Project CHIP 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 re... | 36.876673 | 102 | 0.358817 |
601f48cee85b6bc8767b1d0a6b06749f24f63155 | 1,146 | py | Python | Optical Flow Basics/main.py | Asadullah-Dal17/Qr-code-detection-distance-estimation | 962e48c9524e5fa9be8948fdeb16eedafb7adf30 | [
"MIT"
] | null | null | null | Optical Flow Basics/main.py | Asadullah-Dal17/Qr-code-detection-distance-estimation | 962e48c9524e5fa9be8948fdeb16eedafb7adf30 | [
"MIT"
] | null | null | null | Optical Flow Basics/main.py | Asadullah-Dal17/Qr-code-detection-distance-estimation | 962e48c9524e5fa9be8948fdeb16eedafb7adf30 | [
"MIT"
] | null | null | null | # importing modules
import cv2 as cv
import numpy as np
import AiPhile
import time
# point seletctor function, which let's select the point, through mouse
def selectPoint(event, x, y, flags, params):
global point, condition, old_points
if event == cv.EVENT_LBUTTONDOWN:
point = (int(x), int(y))
... | 23.875 | 72 | 0.650087 |
4c92612373d33536aeefa41189ae96701010ef6a | 467 | py | Python | projects/migrations/0108_deadline_error_date_type_mismatch.py | SuviVappula/kaavapino | 0e3687c94afff10527c9bee9627fc30bd2dfab4f | [
"MIT"
] | null | null | null | projects/migrations/0108_deadline_error_date_type_mismatch.py | SuviVappula/kaavapino | 0e3687c94afff10527c9bee9627fc30bd2dfab4f | [
"MIT"
] | null | null | null | projects/migrations/0108_deadline_error_date_type_mismatch.py | SuviVappula/kaavapino | 0e3687c94afff10527c9bee9627fc30bd2dfab4f | [
"MIT"
] | null | null | null | # Generated by Django 2.2.13 on 2021-04-27 07:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('projects', '0107_auto_20210426_0932'),
]
operations = [
migrations.AddField(
model_name='deadline',
name='error_dat... | 24.578947 | 111 | 0.640257 |
8f3764a69e9fdf3838ca74b1710da1e2a2e8a2cd | 17,236 | py | Python | tests/test_experiments.py | cassidylaidlaw/boltzmann-policy-distribution | 573476dd3e86934dc8884340c42512caa896e9a7 | [
"MIT"
] | null | null | null | tests/test_experiments.py | cassidylaidlaw/boltzmann-policy-distribution | 573476dd3e86934dc8884340c42512caa896e9a7 | [
"MIT"
] | null | null | null | tests/test_experiments.py | cassidylaidlaw/boltzmann-policy-distribution | 573476dd3e86934dc8884340c42512caa896e9a7 | [
"MIT"
] | null | null | null | import csv
import glob
import json
import os
import random
import time
from typing import Optional
import pytest
from bpd.experiments.train_overcooked import (
ex as train_overcooked_ex,
)
from bpd.experiments.train_overcooked_bc import (
ex as train_overcooked_bc_ex,
)
from bpd.experiments.evaluate_overcooke... | 31.977737 | 114 | 0.604607 |
1a695cdb0c08ff965d084b2726dec379d5404672 | 6,165 | py | Python | admin/heart_disease/configure_training.py | aimakerspace/synergos_ttp | f9bff258cf27e77e0a9af10427e7dcc1f05f337a | [
"Apache-2.0"
] | 1 | 2021-09-11T03:53:04.000Z | 2021-09-11T03:53:04.000Z | admin/heart_disease/configure_training.py | aimakerspace/synergos_ttp | f9bff258cf27e77e0a9af10427e7dcc1f05f337a | [
"Apache-2.0"
] | null | null | null | admin/heart_disease/configure_training.py | aimakerspace/synergos_ttp | f9bff258cf27e77e0a9af10427e7dcc1f05f337a | [
"Apache-2.0"
] | 2 | 2022-01-21T00:58:39.000Z | 2022-01-26T01:09:45.000Z | #!/usr/bin/env python
"""
This script is for generating a 2-party end-to-end run of the PySyft REST-RPC
service. Detailed here are all the necessary payload submissions that are
required to be submitted to `http://<ttp_host>:<ttp_port>/ttp/connect/...` in
order to initialise and register for a PySyft REST-RPC project.... | 30.369458 | 91 | 0.687429 |
0c3893343dbdf9a93f7b258a0f5aff5d827a6453 | 77,002 | py | Python | tests/unit/gapic/shell_v1/test_cloud_shell_service.py | LaudateCorpus1/python-shell | 1276804edb8cbc409aaa392287926f17111e8b4c | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/shell_v1/test_cloud_shell_service.py | LaudateCorpus1/python-shell | 1276804edb8cbc409aaa392287926f17111e8b4c | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/shell_v1/test_cloud_shell_service.py | LaudateCorpus1/python-shell | 1276804edb8cbc409aaa392287926f17111e8b4c | [
"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... | 38.138683 | 121 | 0.694008 |
d17d048284dffbf8b3c2618b3ce606a792bec979 | 10,998 | py | Python | Q-learning-control/sumo_speed_limit _test.py | KaguraTart/SUMO-RL-ramp-control | 45a6015aee120e86fdcc28a519a7aeb4da5e3f5c | [
"MIT"
] | 6 | 2021-06-03T14:57:49.000Z | 2022-03-29T08:05:58.000Z | Q-learning-control/sumo_speed_limit _test.py | KaguraTart/SUMO-RL-ramp-control | 45a6015aee120e86fdcc28a519a7aeb4da5e3f5c | [
"MIT"
] | null | null | null | Q-learning-control/sumo_speed_limit _test.py | KaguraTart/SUMO-RL-ramp-control | 45a6015aee120e86fdcc28a519a7aeb4da5e3f5c | [
"MIT"
] | 2 | 2022-01-05T20:50:11.000Z | 2022-03-15T08:31:30.000Z | from tqdm import tqdm
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib
import numpy as np
import math
from dateutil.relativedelta import relativedelta
from datetime import datetime, date
import os, sys
import time#绘图图式
plt.rcParams['figure.figsize']=(30,10)
# plt.style.use('ggplot')
from sumolib i... | 34.694006 | 159 | 0.657574 |
0b055ed9555364d32e853a1f181016622ae8b7c6 | 3,580 | py | Python | eval.py | Romero027/Object-Detection-Metrics | ca5d8d0ab0926ad45c6656053fe3ae5fbbcdc71f | [
"MIT"
] | null | null | null | eval.py | Romero027/Object-Detection-Metrics | ca5d8d0ab0926ad45c6656053fe3ae5fbbcdc71f | [
"MIT"
] | null | null | null | eval.py | Romero027/Object-Detection-Metrics | ca5d8d0ab0926ad45c6656053fe3ae5fbbcdc71f | [
"MIT"
] | null | null | null | import _init_paths
from utils import *
import json
from BoundingBox import BoundingBox
from BoundingBoxes import BoundingBoxes
dict = [{'box': [1614, 184, 1694, 366], 'label': 'person', 'score': 0.67870224}, {'box': [243, 191, 309, 292], 'label': 'person', 'score': 0.6672403}, {'box': [1246, 138, 1301, 288], 'label': ... | 61.724138 | 1,715 | 0.603631 |
d6bca3439deceda8ed0062a636f62f28ca1db7cf | 364 | py | Python | coinaddress/coinaddress.py | umair-akb/coinaddress | a36427dbb86da9268f9cdb95d90ad2a90f4ffc11 | [
"MIT"
] | 11 | 2020-06-20T18:20:57.000Z | 2021-11-27T13:13:13.000Z | coinaddress/coinaddress.py | umair-akb/coinaddress | a36427dbb86da9268f9cdb95d90ad2a90f4ffc11 | [
"MIT"
] | 1 | 2021-04-19T17:47:43.000Z | 2021-09-27T18:01:12.000Z | coinaddress/coinaddress.py | umair-akb/coinaddress | a36427dbb86da9268f9cdb95d90ad2a90f4ffc11 | [
"MIT"
] | 8 | 2020-05-11T14:13:51.000Z | 2022-03-04T20:44:27.000Z | """Main module."""
from .networks import registry
from .networks.base import BaseNetwork
def get_network(name: str) -> BaseNetwork:
return registry.get(name)
def address_from_xpub(network: str, xpub: str, path: str = '0') -> str:
"""Get address derived from xpub.
"""
net = get_network(network)
r... | 24.266667 | 71 | 0.692308 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.