hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d285baafc260e6bc15a3cb91a69a445ffa93d910 | 12,816 | py | Python | blocks/monitoring/evaluators.py | bartvm/blocks-fork | a5376e196e3c2df080a009e8ae8d6bf0efb57f36 | [
"BSD-3-Clause"
] | 1 | 2015-10-19T07:54:34.000Z | 2015-10-19T07:54:34.000Z | blocks/monitoring/evaluators.py | bartvm/blocks-fork | a5376e196e3c2df080a009e8ae8d6bf0efb57f36 | [
"BSD-3-Clause"
] | null | null | null | blocks/monitoring/evaluators.py | bartvm/blocks-fork | a5376e196e3c2df080a009e8ae8d6bf0efb57f36 | [
"BSD-3-Clause"
] | null | null | null | from collections import OrderedDict
import logging
from picklable_itertools.extras import equizip
import theano
from theano import tensor
from blocks.utils import dict_subset
from blocks.monitoring.aggregation import (_DataIndependent, Mean,
TakeLast, MonitoredQuantity)
from... | 39.192661 | 78 | 0.638811 |
25fbd53e267bed3bd34c846fa57ed5644299a95a | 17,380 | py | Python | tests/cylinder_tests.py | kauevestena/sanit3Dsdi | 6f12add218a9c64b86e3eb85d865117ac07e7299 | [
"MIT"
] | null | null | null | tests/cylinder_tests.py | kauevestena/sanit3Dsdi | 6f12add218a9c64b86e3eb85d865117ac07e7299 | [
"MIT"
] | null | null | null | tests/cylinder_tests.py | kauevestena/sanit3Dsdi | 6f12add218a9c64b86e3eb85d865117ac07e7299 | [
"MIT"
] | null | null | null | # import subprocess
# import numpy as np
# import json
# import geopandas as gpd
# from shapely.geometry import LineString
# import numpy as np
# import os
# import pymesh
# from copy import deepcopy
# # normalized_v = v/np.linalg.norm(v)
# def normalize_vec(input_vec):
# try:
# return input_vec/np.linalg... | 27.5 | 142 | 0.528884 |
89ad019847bfc14c71a5683913afeaa3123cc30c | 761 | py | Python | sonarr_exporter/__init__.py | dr1s/sonarr_exporter.py | 46361ec6ad93489b6ba2bd2815e1dad8c1b39c43 | [
"Apache-2.0"
] | 3 | 2019-09-15T17:02:50.000Z | 2020-04-09T09:13:42.000Z | sonarr_exporter/__init__.py | dr1s/sonarr_exporter.py | 46361ec6ad93489b6ba2bd2815e1dad8c1b39c43 | [
"Apache-2.0"
] | 1 | 2018-12-22T00:16:30.000Z | 2019-06-17T17:11:06.000Z | sonarr_exporter/__init__.py | dr1s/sonarr_exporter.py | 46361ec6ad93489b6ba2bd2815e1dad8c1b39c43 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright 2018 Daniel Schmitz
#
# 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 l... | 30.44 | 74 | 0.751643 |
50cfe4cbd4e8014a860556dee6ed883de0e11858 | 13,464 | py | Python | invenio_rdm_records/services/schemas/metadata.py | mb-wali/invenio-rdm-records | df2f2ae047ad262d189b2cb72049263a272039bc | [
"MIT"
] | null | null | null | invenio_rdm_records/services/schemas/metadata.py | mb-wali/invenio-rdm-records | df2f2ae047ad262d189b2cb72049263a272039bc | [
"MIT"
] | null | null | null | invenio_rdm_records/services/schemas/metadata.py | mb-wali/invenio-rdm-records | df2f2ae047ad262d189b2cb72049263a272039bc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
# Copyright (C) 2020 Northwestern University.
# Copyright (C) 2021 Graz University of Technology.
#
# Invenio-RDM-Records is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
"""RDM recor... | 30.392777 | 79 | 0.645276 |
b32497499203c0a3e3539bd25903a1ab41581c9d | 3,529 | py | Python | silk/views/requests.py | JoshData/silk | f025dff691d8ce11a17e4a9499084e1c05598450 | [
"MIT"
] | 1 | 2016-02-16T09:24:26.000Z | 2016-02-16T09:24:26.000Z | silk/views/requests.py | JoshData/silk | f025dff691d8ce11a17e4a9499084e1c05598450 | [
"MIT"
] | null | null | null | silk/views/requests.py | JoshData/silk | f025dff691d8ce11a17e4a9499084e1c05598450 | [
"MIT"
] | null | null | null | from django.core.context_processors import csrf
from django.db.models import Sum
from django.shortcuts import render_to_response
from django.utils.decorators import method_decorator
from django.views.generic import View
from silk.profiling.dynamic import _get_module
from silk.auth import login_possibly_required, perm... | 39.211111 | 135 | 0.65571 |
8253e880e6ea28c0a08387bb10cf6c1cce4879f2 | 105 | py | Python | ulmo/usace/rivergages/__init__.py | cameronbracken/ulmo | 4f38995843a760e0fca4e9f07c21ffeb4552f29c | [
"BSD-3-Clause"
] | null | null | null | ulmo/usace/rivergages/__init__.py | cameronbracken/ulmo | 4f38995843a760e0fca4e9f07c21ffeb4552f29c | [
"BSD-3-Clause"
] | null | null | null | ulmo/usace/rivergages/__init__.py | cameronbracken/ulmo | 4f38995843a760e0fca4e9f07c21ffeb4552f29c | [
"BSD-3-Clause"
] | null | null | null | from core import (
get_stations,
get_station_data,
get_station_parameters,
)
| 17.5 | 31 | 0.609524 |
c31b2e66bfcc9e5feb39a0e8e1f9c18b5bdeb64d | 11,245 | py | Python | board.py | cs10/Pytris-FA20-Skeleton | 9b70ae644b6fc0c39297bc08b4bb1a6b883f7502 | [
"BSD-2-Clause"
] | null | null | null | board.py | cs10/Pytris-FA20-Skeleton | 9b70ae644b6fc0c39297bc08b4bb1a6b883f7502 | [
"BSD-2-Clause"
] | null | null | null | board.py | cs10/Pytris-FA20-Skeleton | 9b70ae644b6fc0c39297bc08b4bb1a6b883f7502 | [
"BSD-2-Clause"
] | null | null | null | class Board:
""" An object to represent a 2-Dimensional rectangular board
"""
def __init__(self, num_cols=10, num_rows=20, cell_item=None, grid=None):
""" Create a Board instance that has num cols and num rows.
The 2D board is represented with a single list, if the board looks like:
... | 26.710214 | 90 | 0.434682 |
0294473b7d8733b5932d3b64c1582a1804c3bd58 | 671 | py | Python | app/core/management/commands/wait_for_db.py | AlfaSakan/recipe-app-api | 61c34252271f669d15d3e83980d33afd46469157 | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | AlfaSakan/recipe-app-api | 61c34252271f669d15d3e83980d33afd46469157 | [
"MIT"
] | null | null | null | app/core/management/commands/wait_for_db.py | AlfaSakan/recipe-app-api | 61c34252271f669d15d3e83980d33afd46469157 | [
"MIT"
] | null | null | null | import time
from django.db import connections
from django.db.utils import OperationalError
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""Django command to pause execution until database is available"""
def handle(self, *args, **kwargs):
self.stdout.write('Waiting ... | 30.5 | 78 | 0.651267 |
4903d2c10789bacbdab8e849a562725dcff7aa68 | 1,671 | py | Python | doc/tools/healthcheck.py | d4wner/axefuzzer | 2c5c5abc9cea3b24c14735ba9cb159911e9f1ded | [
"BSD-2-Clause"
] | 2 | 2019-03-13T12:30:48.000Z | 2021-01-29T23:40:46.000Z | doc/tools/healthcheck.py | d4wner/axefuzzer | 2c5c5abc9cea3b24c14735ba9cb159911e9f1ded | [
"BSD-2-Clause"
] | null | null | null | doc/tools/healthcheck.py | d4wner/axefuzzer | 2c5c5abc9cea3b24c14735ba9cb159911e9f1ded | [
"BSD-2-Clause"
] | 1 | 2019-03-13T12:30:52.000Z | 2019-03-13T12:30:52.000Z | #!/usr/bin/env python
# encoding: utf-8
'''代理服务器健康监控工具
health check tool,
if wyproxy is error, then restart the proxy server.
$ python wyproxy.py -restart
: wyporyx.py need add -conf options
'''
from __future__ import (absolute_import, print_function, division)
import os
import json
import subprocess
"""health che... | 27.393443 | 86 | 0.629563 |
616427a25ab4a9af2055dcfa2757f9a003ac7293 | 5,143 | py | Python | pipelines/processor.py | theboxahaan/pipelines | 19c7ab18db2db6fe4d4316f8f843cf3e0e9681e2 | [
"MIT"
] | 3 | 2021-05-24T02:15:05.000Z | 2022-03-03T07:45:16.000Z | pipelines/processor.py | theboxahaan/pipelines | 19c7ab18db2db6fe4d4316f8f843cf3e0e9681e2 | [
"MIT"
] | 2 | 2021-05-24T15:33:57.000Z | 2021-05-25T04:28:59.000Z | pipelines/processor.py | theboxahaan/pipelines | 19c7ab18db2db6fe4d4316f8f843cf3e0e9681e2 | [
"MIT"
] | 2 | 2021-07-06T02:54:14.000Z | 2022-02-27T10:32:25.000Z | import uuid
import asyncio
import logging
import traceback
class Processor:
"""
Class Processor represents a node in the processing pipeline where
node := (input Q, processor, output Q, accumulator)
pipeline := node1 -> node2 -> node3
"""
def __init__(self,
name:str = None,
input_queue:asyncio.Queu... | 29.728324 | 104 | 0.698425 |
f28499f97e68f8fdd8df26964566c07bc84bfd0c | 720 | py | Python | wsgi.py | ioannova/cache_app | dec4985b6ca7d718eaebe99cf0c2687f03e5e3ab | [
"MIT"
] | null | null | null | wsgi.py | ioannova/cache_app | dec4985b6ca7d718eaebe99cf0c2687f03e5e3ab | [
"MIT"
] | null | null | null | wsgi.py | ioannova/cache_app | dec4985b6ca7d718eaebe99cf0c2687f03e5e3ab | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
from flask_migrate import Migrate
from app import app, db
from app.settings import Development, Production
import sqlite3
# Alembic
migrate = Migrate(app, db)
if __name__ == "__main__":
app.run()
def reset():
from os import system, getcwd, path
import sqlite3
system('rm %s... | 30 | 82 | 0.648611 |
4778624634bc70df7a21222991c018121d4925c6 | 5,103 | py | Python | salt/returners/memcache_return.py | styro/salt | d087d94dca02ca8bf53a6c21b94944bc7957522c | [
"Apache-2.0"
] | 1 | 2016-04-26T03:42:32.000Z | 2016-04-26T03:42:32.000Z | salt/returners/memcache_return.py | styro/salt | d087d94dca02ca8bf53a6c21b94944bc7957522c | [
"Apache-2.0"
] | null | null | null | salt/returners/memcache_return.py | styro/salt | d087d94dca02ca8bf53a6c21b94944bc7957522c | [
"Apache-2.0"
] | 1 | 2021-12-02T15:30:00.000Z | 2021-12-02T15:30:00.000Z | # -*- coding: utf-8 -*-
'''
Return data to a memcache server
To enable this returner the minion will need the python client for memcache
installed and the following values configured in the minion or master
config, these are the defaults:
memcache.host: 'localhost'
memcache.port: '11211'
Alternative configur... | 26.304124 | 101 | 0.610033 |
dc145e835fe14e9b1e67c4b334a638609d285e96 | 435 | py | Python | api/serializers.py | phemmylintry/flight-book | dcd187e81d36fae7424c2e19142cd4f31045f129 | [
"MIT"
] | null | null | null | api/serializers.py | phemmylintry/flight-book | dcd187e81d36fae7424c2e19142cd4f31045f129 | [
"MIT"
] | null | null | null | api/serializers.py | phemmylintry/flight-book | dcd187e81d36fae7424c2e19142cd4f31045f129 | [
"MIT"
] | null | null | null | """Define serializers for API."""
from rest_framework.serializers import ModelSerializer
from .models import Flight
class FlightSerializer(ModelSerializer):
"""flight object serializer."""
class Meta:
"""Meta data for flight object."""
model = Flight
fields = ("id", "origin", "dest... | 21.75 | 66 | 0.602299 |
459784e7d83034f035339b3054713dae105c3375 | 5,615 | py | Python | example/app/api/client_routes.py | monoper/BlockchainDB | cda8bb65e2351553d4d09e6396796eb0715641b7 | [
"MIT"
] | 1 | 2021-05-15T19:45:41.000Z | 2021-05-15T19:45:41.000Z | example/app/api/client_routes.py | monoper/BlockchainDB | cda8bb65e2351553d4d09e6396796eb0715641b7 | [
"MIT"
] | null | null | null | example/app/api/client_routes.py | monoper/BlockchainDB | cda8bb65e2351553d4d09e6396796eb0715641b7 | [
"MIT"
] | null | null | null | import uuid
from typing import List
from fastapi import Depends, APIRouter, status, HTTPException
from .client_models import Client, LinkedProvider
from .provider_models import Provider
from .common_models import Appointment, AppointmentStatus
from .blockchain import BlockchainDb
from .util import verify_auth_header
... | 43.527132 | 100 | 0.68602 |
086ee9c878ca501f61915e87e401f87d189cd793 | 2,164 | py | Python | CSCI-104/hw7/hw7-test/tests/checker.py | liyang990803/CSCI-103 | 6f84fbc242be90f7a9c3a58bdcc6f54352e4ae5a | [
"MIT"
] | null | null | null | CSCI-104/hw7/hw7-test/tests/checker.py | liyang990803/CSCI-103 | 6f84fbc242be90f7a9c3a58bdcc6f54352e4ae5a | [
"MIT"
] | null | null | null | CSCI-104/hw7/hw7-test/tests/checker.py | liyang990803/CSCI-103 | 6f84fbc242be90f7a9c3a58bdcc6f54352e4ae5a | [
"MIT"
] | 1 | 2018-03-23T04:19:24.000Z | 2018-03-23T04:19:24.000Z | import sys
from checker_bst import bst
from checker_rotate import rotate
from checker_hypercube import hypercube
from cs_grading import Grader, Homework, Problem
from cs_grading import generate_grade_report
sys.path.insert(0, '..')
import setting
RESULT_DIR = '../results/' # where test results are stored
GRADER_CONF... | 30.055556 | 58 | 0.737061 |
6f72209ca045276a65cf7f00b94112305dafb5d4 | 1,480 | py | Python | src/openprocurement/tender/limited/tests/document.py | pontostroy/api | 5afdd3a62a8e562cf77e2d963d88f1a26613d16a | [
"Apache-2.0"
] | 10 | 2020-02-18T01:56:21.000Z | 2022-03-28T00:32:57.000Z | src/openprocurement/tender/limited/tests/document.py | pontostroy/api | 5afdd3a62a8e562cf77e2d963d88f1a26613d16a | [
"Apache-2.0"
] | 26 | 2018-07-16T09:30:44.000Z | 2021-02-02T17:51:30.000Z | src/openprocurement/tender/limited/tests/document.py | scrubele/prozorro-testing | 42b93ea2f25d8cc40e66c596f582c7c05e2a9d76 | [
"Apache-2.0"
] | 15 | 2019-08-08T10:50:47.000Z | 2022-02-05T14:13:36.000Z | # -*- coding: utf-8 -*-
import unittest
from openprocurement.tender.belowthreshold.tests.document import (
TenderDocumentResourceTestMixin,
TenderDocumentWithDSResourceTestMixin,
)
from openprocurement.tender.limited.tests.base import (
BaseTenderContentWebTest,
test_tender_data,
test_tender_negot... | 29.019608 | 106 | 0.833784 |
0c8b4fcabaaf735c3ebf6c034042f53501e9ed79 | 2,629 | py | Python | helpers/WIndowsUSB.py | shloak17107/WhatsApp-Key-Database-Extractor | 24fb112a81fe54d0b0f42a6d3253b3420b92976e | [
"MIT"
] | null | null | null | helpers/WIndowsUSB.py | shloak17107/WhatsApp-Key-Database-Extractor | 24fb112a81fe54d0b0f42a6d3253b3420b92976e | [
"MIT"
] | null | null | null | helpers/WIndowsUSB.py | shloak17107/WhatsApp-Key-Database-Extractor | 24fb112a81fe54d0b0f42a6d3253b3420b92976e | [
"MIT"
] | null | null | null | import os
import re
from subprocess import check_output, getoutput
try:
import wget
from packaging import version
except ImportError:
try:
os.system('pip3 install wget packaging')
except:
os.system('python3 -m pip install wget packaging')
from CustomCI import CustomPrint
# Global Vari... | 36.013699 | 92 | 0.633321 |
72312b1b26acf19c60784c6ebba4d0af31e6fe8e | 10,775 | py | Python | models/modelszoo/ResNet3D_VAE.py | qgking/FRGAN | b6a250c46981707c43c3889f80d8cc3ec31edaaf | [
"MIT"
] | 2 | 2021-08-10T02:38:23.000Z | 2021-08-10T03:04:22.000Z | models/modelszoo/ResNet3D_VAE.py | qgking/FRGAN | b6a250c46981707c43c3889f80d8cc3ec31edaaf | [
"MIT"
] | 1 | 2022-02-21T15:57:03.000Z | 2022-02-21T15:57:03.000Z | models/modelszoo/ResNet3D_VAE.py | qgking/FRGAN | b6a250c46981707c43c3889f80d8cc3ec31edaaf | [
"MIT"
] | 2 | 2021-11-07T13:25:51.000Z | 2022-01-18T07:09:30.000Z | import torch
import torch.nn as nn
from models.modelszoo.BaseModelClass import BaseModel
"""
Implementation based on the original paper https://arxiv.org/pdf/1810.11654.pdf
"""
class GreenBlock(nn.Module):
def __init__(self, in_channels, out_channels=32, norm="group"):
super(GreenBlock, self).__init__(... | 35.444079 | 122 | 0.632854 |
1e34f2805c40edd53ed7ee9f96063dd3e144c81b | 1,052 | py | Python | kubernetes/test/test_v1beta1_rolling_update_daemon_set.py | itholic/python | dffe577a062e17057270ae80fa677ffd83e9d183 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1beta1_rolling_update_daemon_set.py | itholic/python | dffe577a062e17057270ae80fa677ffd83e9d183 | [
"Apache-2.0"
] | null | null | null | kubernetes/test/test_v1beta1_rolling_update_daemon_set.py | itholic/python | dffe577a062e17057270ae80fa677ffd83e9d183 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: v1.15.7
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import kube... | 26.3 | 124 | 0.748099 |
7051a88e18e77b2c4292e3a10feabd5b395df914 | 19,623 | py | Python | MIES/Spaces.py | caueguidotti/auto_dqn | 0f20464fe9d67dbbddf156d97788d7fc816435bc | [
"MIT"
] | null | null | null | MIES/Spaces.py | caueguidotti/auto_dqn | 0f20464fe9d67dbbddf156d97788d7fc816435bc | [
"MIT"
] | null | null | null | MIES/Spaces.py | caueguidotti/auto_dqn | 0f20464fe9d67dbbddf156d97788d7fc816435bc | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# =============================================================================
# File : Spaces.py
# Project : Project
# Created By : Caue Guidotti
# Created Date: 7/6/2021
# =============================================================================
"""
This... | 39.642424 | 170 | 0.636804 |
660d6923bf082998a3ccf923f8cdd45f54e2aea0 | 701 | py | Python | setup.py | skolwa/astro-realm | 008e6e97a256cbc2fd15ca6612f7a99c818b7d34 | [
"MIT"
] | null | null | null | setup.py | skolwa/astro-realm | 008e6e97a256cbc2fd15ca6612f7a99c818b7d34 | [
"MIT"
] | null | null | null | setup.py | skolwa/astro-realm | 008e6e97a256cbc2fd15ca6612f7a99c818b7d34 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="astrorealm",
version="0.0.1",
author="Sthabile Kolwa",
author_email="sthabile.kolwa@gmail.com",
description='''This package provides modules for
analysing the kinematics of gas in dist... | 30.478261 | 61 | 0.686163 |
6e5dfe88cc18ff54c530c286b03047db75316d77 | 10,163 | py | Python | spare/cmds/farm_funcs.py | Spare-Network/spare-blockchain | 9ea2677c73570131cfd02447b9cdc64cf01e0909 | [
"Apache-2.0"
] | 122 | 2021-06-18T23:51:22.000Z | 2022-01-15T17:51:49.000Z | spare/cmds/farm_funcs.py | zcomputerwiz/spare-blockchain | c48fe41ac3b2aae2e76fce0e44ab0647530147ee | [
"Apache-2.0"
] | 165 | 2021-06-18T23:12:20.000Z | 2021-11-14T06:02:04.000Z | spare/cmds/farm_funcs.py | zcomputerwiz/spare-blockchain | c48fe41ac3b2aae2e76fce0e44ab0647530147ee | [
"Apache-2.0"
] | 58 | 2021-06-18T23:10:50.000Z | 2022-03-15T08:44:02.000Z | from typing import Any, Dict, List, Optional
import aiohttp
from spare.cmds.units import units
from spare.consensus.block_record import BlockRecord
from spare.rpc.farmer_rpc_client import FarmerRpcClient
from spare.rpc.full_node_rpc_client import FullNodeRpcClient
from spare.rpc.wallet_rpc_client import WalletRpcClie... | 39.391473 | 119 | 0.672734 |
35862e91c71fda3ec0bd73b587b7f563435ee535 | 3,887 | py | Python | tests/entities_update_tests.py | aswathm78/moncli | 745672a335e61910181c4abbf28115ded4eb6f0e | [
"BSD-3-Clause"
] | 40 | 2019-11-22T19:52:18.000Z | 2022-03-26T09:03:10.000Z | tests/entities_update_tests.py | aswathm78/moncli | 745672a335e61910181c4abbf28115ded4eb6f0e | [
"BSD-3-Clause"
] | 35 | 2019-09-24T22:27:43.000Z | 2022-03-31T19:54:03.000Z | tests/entities_update_tests.py | aswathm78/moncli | 745672a335e61910181c4abbf28115ded4eb6f0e | [
"BSD-3-Clause"
] | 17 | 2020-04-10T18:55:10.000Z | 2022-03-14T14:45:24.000Z | from unittest.mock import patch
from nose.tools import ok_, eq_
from moncli import client, entities as en
TEST_USER = en.User(**{'creds': None, 'id': '1', 'email': 'foo.bar@test.com'})
@patch('moncli.api_v2.get_updates')
def test_update_should_return_list_of_replies(get_updates):
# Arrange
get_updates.retu... | 28.166667 | 130 | 0.646771 |
14cdb270096ebf0717e20664b85c6322d0620f75 | 1,155 | py | Python | aggcat/utils.py | djedi/python-aggcat | a922ee4a7eabf3714e62cbeda73c8fece511f5ca | [
"Unlicense"
] | 1 | 2021-01-14T21:44:09.000Z | 2021-01-14T21:44:09.000Z | aggcat/utils.py | djedi/python-aggcat | a922ee4a7eabf3714e62cbeda73c8fece511f5ca | [
"Unlicense"
] | null | null | null | aggcat/utils.py | djedi/python-aggcat | a922ee4a7eabf3714e62cbeda73c8fece511f5ca | [
"Unlicense"
] | null | null | null | from StringIO import StringIO
from lxml import etree
def remove_namespaces(tree):
io = StringIO()
"""Remove the namspaces from XML for easier parsing"""
xslt = """
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" i... | 32.083333 | 91 | 0.502165 |
2708f38bdc1150aa45b31ba3dc352ee0cbd5a996 | 5,720 | py | Python | dashboard/dashboard/doctype/dashboard_items/dashboard_items.py | TridotsTech/FrappeDashboardBuilder | 2f8ff177694d13bd5941c3bcba4056f2bb5d19ac | [
"MIT"
] | 1 | 2019-08-18T08:16:00.000Z | 2019-08-18T08:16:00.000Z | dashboard/dashboard/doctype/dashboard_items/dashboard_items.py | TridotsTech/FrappeDashboardBuilder | 2f8ff177694d13bd5941c3bcba4056f2bb5d19ac | [
"MIT"
] | null | null | null | dashboard/dashboard/doctype/dashboard_items/dashboard_items.py | TridotsTech/FrappeDashboardBuilder | 2f8ff177694d13bd5941c3bcba4056f2bb5d19ac | [
"MIT"
] | 1 | 2020-10-11T13:22:51.000Z | 2020-10-11T13:22:51.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2018, info@valiantsystems.com and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe.model.document import Document
class DashboardItems(Document):
# def autoname(self):
# self.name=self.display_te... | 35.974843 | 129 | 0.715909 |
8870165d006985a6aa9e568fff9254b5d4578c1d | 5,913 | py | Python | dataprep/clean/clean_iban.py | devinllu/dataprep | d56861e5bed3c608cace74983f797dc729072d0a | [
"MIT"
] | 1 | 2022-02-14T07:18:00.000Z | 2022-02-14T07:18:00.000Z | dataprep/clean/clean_iban.py | devinllu/dataprep | d56861e5bed3c608cace74983f797dc729072d0a | [
"MIT"
] | null | null | null | dataprep/clean/clean_iban.py | devinllu/dataprep | d56861e5bed3c608cace74983f797dc729072d0a | [
"MIT"
] | null | null | null | """
Clean and validate a DataFrame column containing IBAN numbers.
"""
# pylint: disable=too-many-lines, too-many-arguments, too-many-branches, unused-argument
from typing import Any, Union
from operator import itemgetter
import dask.dataframe as dd
import numpy as np
import pandas as pd
from stdnum import iban
from ... | 31.121053 | 97 | 0.603754 |
47d23289200133407a8a8de01a79ac3693b8e84d | 2,319 | py | Python | plugins/libravatar/libravatar.py | mohnjahoney/website_source | edc86a869b90ae604f32e736d9d5ecd918088e6a | [
"MIT"
] | 13 | 2020-01-27T09:02:25.000Z | 2022-01-20T07:45:26.000Z | plugins/libravatar/libravatar.py | mohnjahoney/website_source | edc86a869b90ae604f32e736d9d5ecd918088e6a | [
"MIT"
] | 29 | 2020-03-22T06:57:57.000Z | 2022-01-24T22:46:42.000Z | plugins/libravatar/libravatar.py | mohnjahoney/website_source | edc86a869b90ae604f32e736d9d5ecd918088e6a | [
"MIT"
] | 6 | 2020-07-10T00:13:30.000Z | 2022-01-26T08:22:33.000Z | """Libravatar plugin for Pelican"""
## Copyright (C) 2015 Rafael Laboissiere <rafael@laboissiere.net>
##
## This program is free software: you can redistribute it and/or modify it
## under the terms of the GNU General Affero Public License as published by
## the Free Software Foundation, either version 3 of the Licen... | 34.102941 | 75 | 0.661492 |
dd7309a51f5a56c0054b8786a504826624e60ee0 | 8,601 | py | Python | summarytable.py | dalekreitler-bnl/summarytable | d6a82a54b73482d0fe6e607fb37f8bd88b9fe302 | [
"MIT"
] | null | null | null | summarytable.py | dalekreitler-bnl/summarytable | d6a82a54b73482d0fe6e607fb37f8bd88b9fe302 | [
"MIT"
] | null | null | null | summarytable.py | dalekreitler-bnl/summarytable | d6a82a54b73482d0fe6e607fb37f8bd88b9fe302 | [
"MIT"
] | null | null | null | #!/bin/python
import xmltodict
from pathlib import PurePath
import os
from time import sleep
import fcntl
def scan_directory(dirpath,
dirs_to_avoid=["dozor"],
sort_dirs=True,
filepatterns=["fast_dp.xml","autoPROC.xml"]):
path_dict = {}
for (dirpath,d... | 38.397321 | 99 | 0.488897 |
83413188b8941713b5a3de52a46c23b1290228d8 | 9,540 | py | Python | backend/pyrogram/utils.py | appheap/social-media-analyzer | 0f9da098bfb0b4f9eb38e0244aa3a168cf97d51c | [
"Apache-2.0"
] | 5 | 2021-09-11T22:01:15.000Z | 2022-03-16T21:33:42.000Z | backend/pyrogram/utils.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | null | null | null | backend/pyrogram/utils.py | iamatlasss/social-media-analyzer | 429d1d2bbd8bfce80c50c5f8edda58f87ace668d | [
"Apache-2.0"
] | 3 | 2022-01-18T11:06:22.000Z | 2022-02-26T13:39:28.000Z | import asyncio
import base64
import functools
import hashlib
import os
import struct
from concurrent.futures.thread import ThreadPoolExecutor
from getpass import getpass
from typing import Union, List, Optional, Dict
import pyrogram
from pyrogram import raw
from pyrogram import types
from pyrogram.file_id import FileI... | 27.492795 | 111 | 0.634696 |
806154c4643ec23d664f319d2d54100c301db412 | 1,487 | py | Python | python_examples/example_box.py | adam-urbanczyk/cpp-solnp | 97ac9296e39bf3dedcf3eacc1abc659e7eb7c6fa | [
"BSL-1.0"
] | null | null | null | python_examples/example_box.py | adam-urbanczyk/cpp-solnp | 97ac9296e39bf3dedcf3eacc1abc659e7eb7c6fa | [
"BSL-1.0"
] | null | null | null | python_examples/example_box.py | adam-urbanczyk/cpp-solnp | 97ac9296e39bf3dedcf3eacc1abc659e7eb7c6fa | [
"BSL-1.0"
] | null | null | null | """
To test this algorithm, then:
1) Install this package, for example through pip or by running "pip install ." from the cpp_solnp folder.
2) Run this file with Python
"""
import pysolnp
def box_objective_function(x):
result = -1 * x[0] * x[1] * x[2]
return result
def box_equality_function(x):
result ... | 25.20339 | 105 | 0.643578 |
efb2a17bd35c02b1526c4307d92920f90e491922 | 487 | py | Python | interview/project/tests/base.py | Nkarnaud/interview_mgt | 21c0cb987135b09b37fa1f5250a2eb96d9bb61b8 | [
"Apache-2.0"
] | 1 | 2019-08-08T10:25:48.000Z | 2019-08-08T10:25:48.000Z | interview/project/tests/base.py | Nkarnaud/interview_mgt | 21c0cb987135b09b37fa1f5250a2eb96d9bb61b8 | [
"Apache-2.0"
] | null | null | null | interview/project/tests/base.py | Nkarnaud/interview_mgt | 21c0cb987135b09b37fa1f5250a2eb96d9bb61b8 | [
"Apache-2.0"
] | null | null | null | from flask_testing import TestCase
from project import create_app, db
# App initialisation
app = create_app()
# Defining the base test configuration
class BaseTestCase(TestCase):
def create_app(self):
app.config.from_object('project.config.TestingConfig')
return app
# Database setup
de... | 19.48 | 62 | 0.671458 |
9dbebbb28a51f9d7841d3172e62feed098293d12 | 49,605 | py | Python | scripts/slave/recipes/findit/chromium/test.py | mithro/chromium-build | 98d83e124dc08510756906171922a22ba27b87fa | [
"BSD-3-Clause"
] | null | null | null | scripts/slave/recipes/findit/chromium/test.py | mithro/chromium-build | 98d83e124dc08510756906171922a22ba27b87fa | [
"BSD-3-Clause"
] | null | null | null | scripts/slave/recipes/findit/chromium/test.py | mithro/chromium-build | 98d83e124dc08510756906171922a22ba27b87fa | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from collections import defaultdict
import json
from recipe_engine.config import Dict
from recipe_engine.config import List
from recipe_engine.config import... | 36.023965 | 80 | 0.5139 |
fa8b3d62ddea2c79f0d1664ed17a6bfeca1658f7 | 4,370 | py | Python | benchmark/startQiskit1907.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit1907.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit1907.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=5
# total number=53
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as np
import networkx as ... | 32.132353 | 82 | 0.61373 |
da7b5f814fa5840ffa90a2c92ca78a68ddd4f053 | 5,927 | py | Python | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/dumbo/phys/Phys_IEEE802154_GB868.py | SiliconLabs/gecko_sdk | 310814a9016b60a8012d50c62cc168a783ac102b | [
"Zlib"
] | 69 | 2021-12-16T01:34:09.000Z | 2022-03-31T08:27:39.000Z | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/dumbo/phys/Phys_IEEE802154_GB868.py | SiliconLabs/gecko_sdk | 310814a9016b60a8012d50c62cc168a783ac102b | [
"Zlib"
] | 6 | 2022-01-12T18:22:08.000Z | 2022-03-25T10:19:27.000Z | platform/radio/efr32_multiphy_configurator/pyradioconfig/parts/dumbo/phys/Phys_IEEE802154_GB868.py | SiliconLabs/gecko_sdk | 310814a9016b60a8012d50c62cc168a783ac102b | [
"Zlib"
] | 21 | 2021-12-20T09:05:45.000Z | 2022-03-28T02:52:28.000Z | from pyradioconfig.calculator_model_framework.interfaces.iphy import IPhy
from pyradioconfig.parts.common.phys.phy_common import PHY_COMMON_FRAME_154
from py_2_and_3_compatibility import *
class PHYS_IEEE802154_GB868(IPhy):
def IEEE802154_GB868_154G_PHR(self, phy, model):
# Great Britain smart metering P... | 56.990385 | 155 | 0.729037 |
bf656fe2fac3cc141792dca0c26695c579314dfa | 3,574 | py | Python | google-cloud-sdk/lib/surface/compute/os_login/remove_profile.py | bopopescu/Social-Lite | ee05d6a7431c36ff582c8d6b58bb20a8c5f550bf | [
"Apache-2.0"
] | 2 | 2019-11-10T09:17:07.000Z | 2019-12-18T13:44:08.000Z | google-cloud-sdk/lib/surface/compute/os_login/remove_profile.py | bopopescu/Social-Lite | ee05d6a7431c36ff582c8d6b58bb20a8c5f550bf | [
"Apache-2.0"
] | 4 | 2020-07-21T12:51:46.000Z | 2022-01-22T10:29:25.000Z | google-cloud-sdk/lib/surface/compute/os_login/remove_profile.py | bopopescu/Social-Lite | ee05d6a7431c36ff582c8d6b58bb20a8c5f550bf | [
"Apache-2.0"
] | 1 | 2020-07-25T18:17:57.000Z | 2020-07-25T18:17:57.000Z | # -*- coding: utf-8 -*- #
# Copyright 2017 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 requir... | 37.621053 | 79 | 0.715165 |
a20fd5fb67f71511bdc5f34aec6e9bede92a42a4 | 1,091 | py | Python | src/genie/libs/parser/ironware/tests/ShowIPInterface/cli/equal/golden_output1_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 204 | 2018-06-27T00:55:27.000Z | 2022-03-06T21:12:18.000Z | src/genie/libs/parser/ironware/tests/ShowIPInterface/cli/equal/golden_output1_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 468 | 2018-06-19T00:33:18.000Z | 2022-03-31T23:23:35.000Z | src/genie/libs/parser/ironware/tests/ShowIPInterface/cli/equal/golden_output1_expected.py | balmasea/genieparser | d1e71a96dfb081e0a8591707b9d4872decd5d9d3 | [
"Apache-2.0"
] | 309 | 2019-01-16T20:21:07.000Z | 2022-03-30T12:56:41.000Z | expected_output = {
'interfaces': {
'ethernet1/1': {
'ip': '10.254.32.221',
'ok': 'YES',
'method': 'NVRAM',
'status': 'admin/down',
'protocol': 'down',
'vrf': 'default-vrf'
},
'ethernet5/1': {
'ip': '10.254.32.3',
'ok': 'YES',
'method': 'NVRAM',
... | 20.203704 | 29 | 0.395967 |
53a924086ad5a98167ba7b8f99bd735ce8a1c130 | 2,252 | py | Python | social_blog/blog_posts/views.py | higorspinto/Social-Blog | bec89351bf76778059f112c0e2a66de9348dda54 | [
"MIT"
] | null | null | null | social_blog/blog_posts/views.py | higorspinto/Social-Blog | bec89351bf76778059f112c0e2a66de9348dda54 | [
"MIT"
] | 4 | 2021-03-19T03:43:40.000Z | 2022-01-13T01:39:30.000Z | social_blog/blog_posts/views.py | higorspinto/Social-Blog | bec89351bf76778059f112c0e2a66de9348dda54 | [
"MIT"
] | null | null | null | # blog_posts/views.py
from flask import render_template, redirect, url_for, flash, request, Blueprint
from flask_login import current_user, login_required
from social_blog import db
from social_blog.models import BlogPost
from social_blog.blog_posts.forms import BlogPostForm
blog_posts = Blueprint('blog_posts', __nam... | 26.186047 | 83 | 0.683393 |
68ecea8f5958f9cac6b97c57a9ab69b733bf1a14 | 7,902 | py | Python | src/datasets/off_road_testsets.py | Brazilian-Institute-of-Robotics/autonomous_perception | 5645a2bc6811b33e9e6bf0f6873f496dff45ad94 | [
"MIT"
] | null | null | null | src/datasets/off_road_testsets.py | Brazilian-Institute-of-Robotics/autonomous_perception | 5645a2bc6811b33e9e6bf0f6873f496dff45ad94 | [
"MIT"
] | null | null | null | src/datasets/off_road_testsets.py | Brazilian-Institute-of-Robotics/autonomous_perception | 5645a2bc6811b33e9e6bf0f6873f496dff45ad94 | [
"MIT"
] | 1 | 2020-12-23T23:27:30.000Z | 2020-12-23T23:27:30.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Aug 6 15:26:10 2019
@author: nelson
"""
import tensorflow_datasets.public_api as tfds
import os
import tensorflow as tf
import random
classes = [
{'name': 'ignore' , 'color': [ 0, 0, 0]},
{'name': 'road' ,... | 39.118812 | 122 | 0.506328 |
e9b4ecf55f6abdc4c1c21a6deab17773fa6cfac2 | 24,352 | py | Python | ssd_liverdet/pixel_link/model.py | L0SG/Liver_segmentation | 178b2367cf606ba7d704e96f855389be4c1abd14 | [
"MIT"
] | null | null | null | ssd_liverdet/pixel_link/model.py | L0SG/Liver_segmentation | 178b2367cf606ba7d704e96f855389be4c1abd14 | [
"MIT"
] | null | null | null | ssd_liverdet/pixel_link/model.py | L0SG/Liver_segmentation | 178b2367cf606ba7d704e96f855389be4c1abd14 | [
"MIT"
] | null | null | null | import torch.nn as nn
import pixel_link.pixel_link_config as config
import numpy as np
from pixel_link.pixel_link_decode import *
from layers.dcn_v2_custom import DCN
from layers import self_attn
import os
import torch
from torch.utils.checkpoint import checkpoint
def xavier(param):
nn.init.xavier_uniform_(param)
... | 57.56974 | 160 | 0.589192 |
0ff9a9bae36874fc3a41a605b6109b76794154d0 | 991 | py | Python | headerstest.py | mzeinstra/openAnalyser | 859156117948eb15283c348e6f6025cae9352279 | [
"MIT"
] | 1 | 2021-06-28T09:39:43.000Z | 2021-06-28T09:39:43.000Z | headerstest.py | mzeinstra/openAnalyser | 859156117948eb15283c348e6f6025cae9352279 | [
"MIT"
] | null | null | null | headerstest.py | mzeinstra/openAnalyser | 859156117948eb15283c348e6f6025cae9352279 | [
"MIT"
] | null | null | null | from urllib.parse import urlparse
from bs4 import BeautifulSoup
import urllib3
from socket import timeout
import tldextract
import re
import traceback
import sys
import logging
import socket
import threading
from time import sleep
from collector import Collector
from checker import Checker
http = urllib3.PoolManager(... | 30.030303 | 64 | 0.491423 |
13db41a3aa7fcbe8ff30af5fa8fc986a9d0efbaf | 7,162 | py | Python | python/kfserving/kfserving/models/v1alpha2_kf_service_list.py | ariefrahmansyah/kfserving | 733e415a3715e5bf662ef9fd791fc2708d145a37 | [
"Apache-2.0"
] | null | null | null | python/kfserving/kfserving/models/v1alpha2_kf_service_list.py | ariefrahmansyah/kfserving | 733e415a3715e5bf662ef9fd791fc2708d145a37 | [
"Apache-2.0"
] | null | null | null | python/kfserving/kfserving/models/v1alpha2_kf_service_list.py | ariefrahmansyah/kfserving | 733e415a3715e5bf662ef9fd791fc2708d145a37 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 kubeflow.org.
#
# 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,... | 33.157407 | 295 | 0.63069 |
671932eb2f238490056d3f42565ba61024eb49e3 | 7,250 | py | Python | src/NewDouban.py | fugary/calibre-web-douban-api | 8a8b7c969095a7be7a4df4c26fd82fdc8fcd85e3 | [
"Apache-2.0"
] | 69 | 2021-11-05T05:14:10.000Z | 2022-03-30T17:55:57.000Z | src/NewDouban.py | zhoucheng8023/calibre-web-douban-api | 8a8b7c969095a7be7a4df4c26fd82fdc8fcd85e3 | [
"Apache-2.0"
] | 7 | 2021-11-09T08:25:40.000Z | 2022-03-29T05:54:39.000Z | src/NewDouban.py | zhoucheng8023/calibre-web-douban-api | 8a8b7c969095a7be7a4df4c26fd82fdc8fcd85e3 | [
"Apache-2.0"
] | 23 | 2021-11-05T05:14:17.000Z | 2022-03-20T03:35:05.000Z | import re
import time
import requests
from concurrent.futures import ThreadPoolExecutor, as_completed
from urllib.parse import urlparse, unquote
from lxml import etree
from functools import lru_cache
from cps.services.Metadata import Metadata, MetaSourceInfo, MetaRecord
DOUBAN_SEARCH_JSON_URL = "https://www.douban.c... | 37.958115 | 132 | 0.6 |
2e93b372d355932294deded9335115ab9e166d81 | 980 | py | Python | main1.py | HieuNguyenPhi/ChatBot | 7ae98fef40527ced15a58a4f35d3114257d32fbd | [
"MIT"
] | null | null | null | main1.py | HieuNguyenPhi/ChatBot | 7ae98fef40527ced15a58a4f35d3114257d32fbd | [
"MIT"
] | null | null | null | main1.py | HieuNguyenPhi/ChatBot | 7ae98fef40527ced15a58a4f35d3114257d32fbd | [
"MIT"
] | null | null | null | import nltk
nltk.download('punkt')
nltk.download('wordnet')
from nltk.stem import WordNetLemmatizer
lemmatizer = WordNetLemmatizer()
import json
import pickle
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Activation, Dropout
from keras.optimizers import SGD
import random
import... | 24.5 | 51 | 0.7 |
9770979f9a5a1e2afc56b9342f33d82ccc97a78f | 1,676 | py | Python | ticketsystem/mainapp/urls.py | malfin/ISMticket | a29260b008b4d1721b1986c85c9d92d703839f1f | [
"Apache-2.0"
] | null | null | null | ticketsystem/mainapp/urls.py | malfin/ISMticket | a29260b008b4d1721b1986c85c9d92d703839f1f | [
"Apache-2.0"
] | null | null | null | ticketsystem/mainapp/urls.py | malfin/ISMticket | a29260b008b4d1721b1986c85c9d92d703839f1f | [
"Apache-2.0"
] | null | null | null | from django.urls import path
import mainapp.views as mainapp
app_name = 'mainapp'
urlpatterns = [
path('', mainapp.index, name='index'),
path('tickets/', mainapp.my_ticket, name='my_ticket'),
path('tickets/create/', mainapp.create_ticket, name='create_ticket'),
path('tickets/open/<int:pk>/', mainapp.o... | 50.787879 | 105 | 0.708831 |
a9970ca270d93f59cdf6fb1d78f9bcaf06cf493f | 3,951 | py | Python | 2019/05/day5.py | jscpeterson/advent-of-code-2020 | 69dce1b8ac752a63c4b064e46f0f7218a96bceb8 | [
"Apache-2.0"
] | null | null | null | 2019/05/day5.py | jscpeterson/advent-of-code-2020 | 69dce1b8ac752a63c4b064e46f0f7218a96bceb8 | [
"Apache-2.0"
] | null | null | null | 2019/05/day5.py | jscpeterson/advent-of-code-2020 | 69dce1b8ac752a63c4b064e46f0f7218a96bceb8 | [
"Apache-2.0"
] | null | null | null | ADD = 1
MULTIPLY = 2
SAVE = 3
OUTPUT = 4
JUMP_IF_TRUE = 5
JUMP_IF_FALSE = 6
LESS_THAN = 7
EQUALS = 8
HALT = 99
OP_PARAMS = {
ADD: 3,
MULTIPLY: 3,
SAVE: 1,
OUTPUT: 1,
JUMP_IF_TRUE: 2,
JUMP_IF_FALSE: 2,
LESS_THAN: 3,
EQUALS: 3,
HALT: 0,
}
POSITION = 0
IMMEDIATE = 1
class IntcodeComp... | 37.628571 | 102 | 0.564667 |
f5ba8a33eacd571f1e35c5725e6ce1c3ca3eaab3 | 471 | py | Python | scrooge/datasource/migrations/0004_auto_20160627_2239.py | SpisTresci/scrooge | 787b7d5f8ece8f3f24feb4273505e6c0ea60b5d7 | [
"MIT"
] | 1 | 2021-01-04T04:30:24.000Z | 2021-01-04T04:30:24.000Z | scrooge/datasource/migrations/0004_auto_20160627_2239.py | SpisTresci/scrooge | 787b7d5f8ece8f3f24feb4273505e6c0ea60b5d7 | [
"MIT"
] | 6 | 2019-12-21T03:19:17.000Z | 2020-01-07T07:28:04.000Z | scrooge/datasource/migrations/0004_auto_20160627_2239.py | SpisTresci/scrooge | 787b7d5f8ece8f3f24feb4273505e6c0ea60b5d7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-06-27 20:39
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('datasource', '0003_auto_20160627_1928'),
]
operations = [
migrations.AlterUniqueToge... | 23.55 | 94 | 0.63482 |
b59e05cf739be04bb254d42ffafbac9626305f41 | 379 | py | Python | parsec/commands/tools/get_citations.py | erasche/parsec | c2f1bda7ff776f9aa121c7b94d62e3da2fad93f6 | [
"Apache-2.0"
] | 8 | 2015-03-27T17:09:15.000Z | 2021-07-13T15:33:02.000Z | parsec/commands/tools/get_citations.py | erasche/parsec | c2f1bda7ff776f9aa121c7b94d62e3da2fad93f6 | [
"Apache-2.0"
] | 30 | 2015-02-27T21:21:47.000Z | 2021-08-31T14:19:55.000Z | parsec/commands/tools/get_citations.py | erasche/parsec | c2f1bda7ff776f9aa121c7b94d62e3da2fad93f6 | [
"Apache-2.0"
] | 12 | 2017-06-01T03:49:23.000Z | 2021-07-13T15:33:06.000Z | import click
from parsec.cli import pass_context, json_loads
from parsec.decorators import custom_exception, json_output
@click.command('get_citations')
@click.argument("tool_id", type=str)
@pass_context
@custom_exception
@json_output
def cli(ctx, tool_id):
"""Get BibTeX citations for a given tool ID.
Output:
... | 19.947368 | 59 | 0.757256 |
bbd63a07393c3ab514b58b03d170123f960e0fc4 | 14,002 | py | Python | common/xrd-opmon-tests/testcases/test_metaservices.py | ria-ee/XTM | 6103f3f5bbba387b8b59b050c0c4f1fb2180fc37 | [
"MIT"
] | 3 | 2018-03-15T14:22:50.000Z | 2021-11-08T10:30:35.000Z | common/xrd-opmon-tests/testcases/test_metaservices.py | ria-ee/XTM | 6103f3f5bbba387b8b59b050c0c4f1fb2180fc37 | [
"MIT"
] | 11 | 2017-04-06T09:25:41.000Z | 2018-06-04T09:08:48.000Z | common/xrd-opmon-tests/testcases/test_metaservices.py | ria-ee/XTM | 6103f3f5bbba387b8b59b050c0c4f1fb2180fc37 | [
"MIT"
] | 20 | 2017-03-14T07:21:58.000Z | 2019-05-21T09:26:30.000Z | #!/usr/bin/env python3
# The MIT License
# Copyright (c) 2016 Estonian Information System Authority (RIA), Population Register Centre (VRK)
#
# 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 ... | 46.059211 | 99 | 0.746893 |
3b4297a55ff48c9c736a7cc8d8ccb9ba0639010c | 2,459 | py | Python | leetcode_python/Array/spiral-matrix-iii.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 18 | 2019-08-01T07:45:02.000Z | 2022-03-31T18:05:44.000Z | leetcode_python/Array/spiral-matrix-iii.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Array/spiral-matrix-iii.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 15 | 2019-12-29T08:46:20.000Z | 2022-03-08T14:14:05.000Z | # V0
# V1
# https://www.jiuzhang.com/solution/spiral-matrix-iii/#tag-highlight-lang-python
def spiralMatrixIII(self, R, C, r0, c0):
"""
:type R: int
:type C: int
:type r0: int
:type c0: int
:rtype: List[List[int]]
"""
i = r0
j = c0
... | 28.593023 | 130 | 0.371289 |
7894d791f0bec280ba937357d1a5c6f5e63d0260 | 14,780 | py | Python | lang/py3/avro/datafile.py | mkram/avro | f6c044e56f9de7d3e34eeb1702c11fa4add04d84 | [
"Apache-2.0"
] | 2 | 2021-11-09T12:50:18.000Z | 2022-01-18T00:12:38.000Z | lang/py3/avro/datafile.py | mkram/avro | f6c044e56f9de7d3e34eeb1702c11fa4add04d84 | [
"Apache-2.0"
] | null | null | null | lang/py3/avro/datafile.py | mkram/avro | f6c044e56f9de7d3e34eeb1702c11fa4add04d84 | [
"Apache-2.0"
] | 1 | 2020-09-13T13:10:00.000Z | 2020-09-13T13:10:00.000Z | #!/usr/bin/env python3
# -*- mode: python -*-
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you... | 27.626168 | 80 | 0.660622 |
adefc8476e326941cd9caf8aa79032dbc68547a7 | 235 | py | Python | raissyon/raissyon/doctype/salary_register_confirmation/test_salary_register_confirmation.py | mhbu50/raissyon | 73d5d7498e3e7f74b07e4c0a1c979ad10f9c37ce | [
"MIT"
] | null | null | null | raissyon/raissyon/doctype/salary_register_confirmation/test_salary_register_confirmation.py | mhbu50/raissyon | 73d5d7498e3e7f74b07e4c0a1c979ad10f9c37ce | [
"MIT"
] | null | null | null | raissyon/raissyon/doctype/salary_register_confirmation/test_salary_register_confirmation.py | mhbu50/raissyon | 73d5d7498e3e7f74b07e4c0a1c979ad10f9c37ce | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Accurate Systems and Contributors
# See license.txt
from __future__ import unicode_literals
# import frappe
import unittest
class TestSalaryRegisterConfirmation(unittest.TestCase):
pass
| 21.363636 | 56 | 0.782979 |
ba419490fe692d6d238b3fc1ad1e05e1dddb5606 | 5,145 | py | Python | qiskit/aqua/algorithms/single_sample/amplitude_estimation/ae_algorithm.py | l45k/qiskit-aqua | 77589d5fa0da670c23a4f6730d8a5477c9b0d126 | [
"Apache-2.0"
] | 1 | 2020-02-12T16:52:34.000Z | 2020-02-12T16:52:34.000Z | qiskit/aqua/algorithms/single_sample/amplitude_estimation/ae_algorithm.py | l45k/qiskit-aqua | 77589d5fa0da670c23a4f6730d8a5477c9b0d126 | [
"Apache-2.0"
] | null | null | null | qiskit/aqua/algorithms/single_sample/amplitude_estimation/ae_algorithm.py | l45k/qiskit-aqua | 77589d5fa0da670c23a4f6730d8a5477c9b0d126 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 32.563291 | 98 | 0.640428 |
6d2dd8e6270c241c670a8862f2de7246c19acba2 | 13,010 | py | Python | salt/modules/freebsdservice.py | Jille/salt | 286eaf923782851c9b6602583050be804c181a9a | [
"Apache-2.0"
] | null | null | null | salt/modules/freebsdservice.py | Jille/salt | 286eaf923782851c9b6602583050be804c181a9a | [
"Apache-2.0"
] | null | null | null | salt/modules/freebsdservice.py | Jille/salt | 286eaf923782851c9b6602583050be804c181a9a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
The service module for FreeBSD
.. important::
If you feel that Salt should be using this module to manage services on a
minion, and it is using a different module (or gives an error similar to
*'service.start' is not available*), see :ref:`here
<module-provider-override>`.
'... | 25.11583 | 110 | 0.600307 |
c9505a17e3fdf556e23aeea332ca6968d6640bdf | 3,204 | py | Python | quotes/apis.py | iJohnMaged/stock-market-CMS | fc40470c49bf9e3328538b90510923801b13a8f4 | [
"MIT"
] | null | null | null | quotes/apis.py | iJohnMaged/stock-market-CMS | fc40470c49bf9e3328538b90510923801b13a8f4 | [
"MIT"
] | null | null | null | quotes/apis.py | iJohnMaged/stock-market-CMS | fc40470c49bf9e3328538b90510923801b13a8f4 | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from datetime import date
import requests
@dataclass
class APIHandler:
original_url: str
post_data: dict = None
data: dict = None
updated: date = None
def __post_init__(self):
self.url = self.original_url
def get(self):
res = requests.get(sel... | 31.106796 | 85 | 0.594881 |
fa0c72f8fa69c3ae79c4b9f3e80c0e2bae2adea0 | 9,202 | py | Python | convlab/spec/spec_util.py | seungjaeryanlee/ConvLab | a8c90f63a86b84d45384b507663c4c6fbe8a378a | [
"MIT"
] | 6 | 2021-09-07T14:30:22.000Z | 2021-12-29T05:54:18.000Z | convlab/spec/spec_util.py | seungjaeryanlee/ConvLab | a8c90f63a86b84d45384b507663c4c6fbe8a378a | [
"MIT"
] | null | null | null | convlab/spec/spec_util.py | seungjaeryanlee/ConvLab | a8c90f63a86b84d45384b507663c4c6fbe8a378a | [
"MIT"
] | 1 | 2021-09-02T15:12:18.000Z | 2021-09-02T15:12:18.000Z | # The spec module
# Manages specification to run things in lab
import itertools
import json
import os
from string import Template
import pydash as ps
from convlab.lib import logger, util
SPEC_DIR = 'convlab/spec'
'''
All spec values are already param, inferred automatically.
To change from a value into param range, ... | 34.988593 | 144 | 0.621169 |
1d26f4292c443334a2de5b10112eda5b20a117b1 | 1,142 | py | Python | knapsack_problem/file_handling.py | netotz/optimization | e688904759892bb2e2048c1778434c411f29ddb4 | [
"Unlicense"
] | 1 | 2020-02-07T04:44:26.000Z | 2020-02-07T04:44:26.000Z | knapsack_problem/file_handling.py | netotz/optimization | e688904759892bb2e2048c1778434c411f29ddb4 | [
"Unlicense"
] | 1 | 2021-08-31T15:19:53.000Z | 2021-08-31T15:19:53.000Z | knapsack_problem/file_handling.py | netotz/optimization | e688904759892bb2e2048c1778434c411f29ddb4 | [
"Unlicense"
] | null | null | null | """
Module for viewing subdirectories and constructing paths and file names.
"""
from os import listdir, makedirs
from os.path import dirname, join, isfile
FOLDER = 'instances'
def generateFileName(total_items, capacity, index = 0):
'''
Generates a name for the file which will store the n items and capacity ... | 29.282051 | 106 | 0.690893 |
c128eccd8bfccba16d7bebe299019485f27cb38e | 336 | py | Python | build-support/travis/generate_travis_yml_main.py | billybecker/pants | ee101f3e360b712aceb9dacf7723aaf9b5567f04 | [
"Apache-2.0"
] | 94 | 2015-01-15T21:24:20.000Z | 2022-02-16T16:55:43.000Z | build-support/travis/generate_travis_yml_main.py | billybecker/pants | ee101f3e360b712aceb9dacf7723aaf9b5567f04 | [
"Apache-2.0"
] | 5 | 2020-07-18T01:04:43.000Z | 2021-05-10T08:40:56.000Z | build-support/travis/generate_travis_yml_main.py | billybecker/pants | ee101f3e360b712aceb9dacf7723aaf9b5567f04 | [
"Apache-2.0"
] | 47 | 2015-02-25T02:20:07.000Z | 2022-03-21T00:59:16.000Z | # coding=utf-8
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
from generate_travis_yml import generate_travis_yml
if __name__ == '__main__':
genera... | 28 | 82 | 0.803571 |
87a080e15a30cf0a85da6b88b6cda82511adc662 | 9,765 | py | Python | cowrie/output/donthackme.py | McNinja/McCowrie | 41d1a8fdc1f0331414004f5e1139060317f5258e | [
"BSD-3-Clause"
] | null | null | null | cowrie/output/donthackme.py | McNinja/McCowrie | 41d1a8fdc1f0331414004f5e1139060317f5258e | [
"BSD-3-Clause"
] | null | null | null | cowrie/output/donthackme.py | McNinja/McCowrie | 41d1a8fdc1f0331414004f5e1139060317f5258e | [
"BSD-3-Clause"
] | null | null | null | """Cowrie API output plugin."""
# Copyright 2016 Russell Troxel
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 29.862385 | 79 | 0.498515 |
2572be34f9b825a21707b4d04f87cb18b1662ee6 | 5,794 | py | Python | py_src/mlpiot/proto/action_execution_pb2.py | machine2learn/mlpiot.base | da0b77fccbb0e42d1ddbb6dbc490313433dc7575 | [
"Apache-2.0"
] | 1 | 2021-03-30T20:49:54.000Z | 2021-03-30T20:49:54.000Z | py_src/mlpiot/proto/action_execution_pb2.py | machine2learn/mlpiot.base | da0b77fccbb0e42d1ddbb6dbc490313433dc7575 | [
"Apache-2.0"
] | null | null | null | py_src/mlpiot/proto/action_execution_pb2.py | machine2learn/mlpiot.base | da0b77fccbb0e42d1ddbb6dbc490313433dc7575 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: mlpiot/proto/action_execution.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol... | 40.802817 | 580 | 0.774422 |
eb65a0bd69937e2cc6cd6c9a09e95f916e8e69de | 26,145 | py | Python | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_version_set_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_version_set_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | 2 | 2021-11-03T06:10:36.000Z | 2021-12-01T06:29:39.000Z | sdk/apimanagement/azure-mgmt-apimanagement/azure/mgmt/apimanagement/operations/_api_version_set_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | 1 | 2021-05-19T02:55:10.000Z | 2021-05-19T02:55:10.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 51.772277 | 211 | 0.659361 |
2549cf4caf3f65971678ef730aa45f89c565d1f7 | 2,170 | py | Python | delta/data/frontend/plp_test.py | didichuxing/delta | 31dfebc8f20b7cb282b62f291ff25a87e403cc86 | [
"Apache-2.0"
] | 1,442 | 2019-07-09T07:34:28.000Z | 2020-11-15T09:52:09.000Z | delta/data/frontend/plp_test.py | didichuxing/delta | 31dfebc8f20b7cb282b62f291ff25a87e403cc86 | [
"Apache-2.0"
] | 93 | 2019-07-22T09:20:20.000Z | 2020-11-13T01:59:30.000Z | delta/data/frontend/plp_test.py | didichuxing/delta | 31dfebc8f20b7cb282b62f291ff25a87e403cc86 | [
"Apache-2.0"
] | 296 | 2019-07-09T07:35:28.000Z | 2020-11-16T02:27:51.000Z | # Copyright (C) 2017 Beijing Didi Infinity Technology and Development Co.,Ltd.
# 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/LI... | 35 | 83 | 0.652995 |
d1f2503da5f902a31e6622eab275488d9f499afd | 12,543 | py | Python | techminer/correlation_analysis.py | jdvelasq/techminer-new | a4b54c2783aee1a2d0d823ffd270131e42e5ff9a | [
"MIT"
] | 1 | 2020-04-29T20:35:13.000Z | 2020-04-29T20:35:13.000Z | techminer/correlation_analysis.py | jdvelasq/techminer-new | a4b54c2783aee1a2d0d823ffd270131e42e5ff9a | [
"MIT"
] | null | null | null | techminer/correlation_analysis.py | jdvelasq/techminer-new | a4b54c2783aee1a2d0d823ffd270131e42e5ff9a | [
"MIT"
] | null | null | null | import matplotlib.pyplot as pyplot
import numpy as np
import pandas as pd
import techminer.core.dashboard as dash
from techminer.core import (
DASH,
Network,
TF_matrix,
add_counters_to_axis,
corpus_filter,
limit_to_exclude,
sort_by_axis,
)
from techminer.core.dashboard import min_occurrence... | 27.997768 | 86 | 0.456111 |
823f29991129a83bb6f71f21c15154fc6481446f | 225 | py | Python | python/ccxtpro/test/exchange/test_ticker.py | kakacaca/ccxt | 4fdb7d450fb9c9e480b6f0a3e3866b784cf24ebf | [
"Unlicense"
] | 1 | 2021-09-15T11:42:59.000Z | 2021-09-15T11:42:59.000Z | python/ccxtpro/test/exchange/test_ticker.py | bikidenny/ccxt | 4fdb7d450fb9c9e480b6f0a3e3866b784cf24ebf | [
"Unlicense"
] | null | null | null | python/ccxtpro/test/exchange/test_ticker.py | bikidenny/ccxt | 4fdb7d450fb9c9e480b6f0a3e3866b784cf24ebf | [
"Unlicense"
] | 1 | 2022-03-12T03:02:15.000Z | 2022-03-12T03:02:15.000Z | # -*- coding: utf-8 -*-
__all__ = ['test_ticker']
def test_ticker(exchange, ticker, method, symbol):
print(
exchange.id,
symbol,
method,
ticker['datetime'],
ticker['last']
)
| 16.071429 | 50 | 0.528889 |
cc80cafacaa7562613b01094d3569e8dd8695c5e | 843 | py | Python | Project_PyCharm/maps/map3.py | DayongTong/ESE650LearningInRobotics | 08d73fe237db7eee87f1e56f01b39baf11b6aa38 | [
"MIT"
] | null | null | null | Project_PyCharm/maps/map3.py | DayongTong/ESE650LearningInRobotics | 08d73fe237db7eee87f1e56f01b39baf11b6aa38 | [
"MIT"
] | null | null | null | Project_PyCharm/maps/map3.py | DayongTong/ESE650LearningInRobotics | 08d73fe237db7eee87f1e56f01b39baf11b6aa38 | [
"MIT"
] | null | null | null | import random
import numpy as np
import matplotlib.pyplot as plt
###########################maze##################################
maze = np.full((30,40), 1)
random.seed(42)
numAgents = 20
agent_pos = []
posx = []
posy = []
for i in range(120):
while True:
row = random.randint(0,29)
... | 22.783784 | 66 | 0.500593 |
f6843a04c5fceaca943849d8669489f95b376e0e | 5,775 | py | Python | iogt/settings/base.py | sheralim012/iogt | 72a43626636568b7b4603a193fdc045b581f5cd3 | [
"BSD-2-Clause"
] | null | null | null | iogt/settings/base.py | sheralim012/iogt | 72a43626636568b7b4603a193fdc045b581f5cd3 | [
"BSD-2-Clause"
] | 3 | 2021-07-26T07:55:17.000Z | 2021-08-25T10:08:41.000Z | iogt/settings/base.py | sheralim012/iogt | 72a43626636568b7b4603a193fdc045b581f5cd3 | [
"BSD-2-Clause"
] | null | null | null | """
Django settings for iogt project.
Generated by 'django-admin startproject' using Django 3.1.7.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.1/ref/settings/
"""
# Build paths i... | 28.875 | 95 | 0.719481 |
c94a07de7095e95c88d9f4695ca909cb6f258793 | 268 | py | Python | backend/app/__init__.py | ecshreve/jeppy | d15be0e6457be7dfa30c7a91a7c1218baf58ef98 | [
"MIT"
] | 1 | 2021-02-14T01:18:21.000Z | 2021-02-14T01:18:21.000Z | backend/app/__init__.py | ecshreve/jeppy | d15be0e6457be7dfa30c7a91a7c1218baf58ef98 | [
"MIT"
] | 3 | 2021-02-28T04:55:59.000Z | 2021-02-28T08:51:18.000Z | backend/app/__init__.py | ecshreve/jeppy | d15be0e6457be7dfa30c7a91a7c1218baf58ef98 | [
"MIT"
] | 1 | 2021-02-28T01:10:07.000Z | 2021-02-28T01:10:07.000Z | from flask import Flask
from flask_sqlalchemy import SQLAlchemy
from flask_migrate import Migrate
from config import Config
app = Flask(__name__)
app.config.from_object(Config)
db = SQLAlchemy(app)
migrate = Migrate(app, db)
from app import routes, models, helpers
| 20.615385 | 39 | 0.80597 |
936585c4d58a259d5935c0023bd65988b81b76a7 | 7,987 | py | Python | es_distributed/dist.py | TrevorCMorton/deep-neuroevolution | d6e5c5b41202e9c2e50c986fc822809b507ede64 | [
"MIT"
] | null | null | null | es_distributed/dist.py | TrevorCMorton/deep-neuroevolution | d6e5c5b41202e9c2e50c986fc822809b507ede64 | [
"MIT"
] | null | null | null | es_distributed/dist.py | TrevorCMorton/deep-neuroevolution | d6e5c5b41202e9c2e50c986fc822809b507ede64 | [
"MIT"
] | null | null | null | import logging
import os
import pickle
import time
from collections import deque
from pprint import pformat
import redis
logger = logging.getLogger(__name__)
EXP_KEY = 'es:exp'
TASK_ID_KEY = 'es:task_id'
TASK_DATA_KEY = 'es:task_data'
TASK_CHANNEL = 'es:task_channel'
RESULTS_KEY = 'es:results'
ARCHIVE_KEY = 'es:arch... | 40.338384 | 143 | 0.632778 |
9f29b37ba554ae51911a54a45425d6ed00a0090b | 7,064 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/f5networks/f5_modules/tests/unit/modules/network/f5/test_bigip_gtm_datacenter.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/lib/python3.6/site-packages/ansible_collections/f5networks/f5_modules/tests/unit/modules/network/f5/test_bigip_gtm_datacenter.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/f5networks/f5_modules/tests/unit/modules/network/f5/test_bigip_gtm_datacenter.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import pytest
import sys
if sys.version_info < (2, ... | 30.713043 | 124 | 0.625425 |
0b898e852e920e2852835108928af595b10e7928 | 14,854 | py | Python | qcfractal/server.py | ChayaSt/QCFractal | 2d3c737b0e755d6e5bac743a0beb0714b5a92d0b | [
"BSD-3-Clause"
] | null | null | null | qcfractal/server.py | ChayaSt/QCFractal | 2d3c737b0e755d6e5bac743a0beb0714b5a92d0b | [
"BSD-3-Clause"
] | null | null | null | qcfractal/server.py | ChayaSt/QCFractal | 2d3c737b0e755d6e5bac743a0beb0714b5a92d0b | [
"BSD-3-Clause"
] | null | null | null | """
The FractalServer class
"""
import asyncio
import logging
import ssl
import threading
import traceback
import tornado.ioloop
import tornado.log
import tornado.options
import tornado.web
from . import interface
from . import queue
from . import services
from . import storage_sockets
from . import web_handlers
my... | 33.68254 | 118 | 0.61613 |
587ce641463e5b80404c88308ac402e3e7791462 | 3,603 | py | Python | dev/website_docs/parse_tutorials.py | blazejdolicki/vissl | 9c10748a19fb1c637f32687142c8cd685f2410ff | [
"MIT"
] | 2,512 | 2021-01-27T18:44:44.000Z | 2022-03-31T19:33:49.000Z | dev/website_docs/parse_tutorials.py | blazejdolicki/vissl | 9c10748a19fb1c637f32687142c8cd685f2410ff | [
"MIT"
] | 361 | 2021-01-27T20:12:09.000Z | 2022-03-31T12:39:34.000Z | dev/website_docs/parse_tutorials.py | blazejdolicki/vissl | 9c10748a19fb1c637f32687142c8cd685f2410ff | [
"MIT"
] | 277 | 2021-01-29T08:09:02.000Z | 2022-03-31T07:57:35.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import json
import os
import nbformat
from bs4 import BeautifulSoup
from nbconvert import HTMLExporter, ScriptExporter
TEMPL... | 32.754545 | 83 | 0.634749 |
7f10e1c0cb847ca10cbdef318a6bb410df71386c | 19,517 | py | Python | reg/tests/test_dispatch_method.py | sgaist/reg | c6d721da1d71a299063695966a8f73c4180de1a5 | [
"BSD-3-Clause"
] | null | null | null | reg/tests/test_dispatch_method.py | sgaist/reg | c6d721da1d71a299063695966a8f73c4180de1a5 | [
"BSD-3-Clause"
] | null | null | null | reg/tests/test_dispatch_method.py | sgaist/reg | c6d721da1d71a299063695966a8f73c4180de1a5 | [
"BSD-3-Clause"
] | null | null | null | from types import FunctionType
import pytest
from ..context import (
dispatch,
dispatch_method,
methodify,
clean_dispatch_methods,
)
from ..predicate import match_instance
from ..error import RegistrationError
def test_dispatch_method_explicit_fallback():
def obj_fallback(self, obj):
retur... | 24.305106 | 74 | 0.614234 |
8303f491d50b034e30739abf07d18cfed5bc216b | 36,820 | py | Python | second/utils/eval.py | CMU-Light-Curtains/ObjectDetection | d2002f6d1ebcf05a78f179bf0474703ed0211ac0 | [
"BSD-3-Clause"
] | null | null | null | second/utils/eval.py | CMU-Light-Curtains/ObjectDetection | d2002f6d1ebcf05a78f179bf0474703ed0211ac0 | [
"BSD-3-Clause"
] | null | null | null | second/utils/eval.py | CMU-Light-Curtains/ObjectDetection | d2002f6d1ebcf05a78f179bf0474703ed0211ac0 | [
"BSD-3-Clause"
] | null | null | null | import io as sysio
import time
import numba
import numpy as np
from scipy.interpolate import interp1d
from second.core.non_max_suppression.nms_gpu import rotate_iou_gpu_eval
from second.core import box_np_ops
@numba.jit
def get_thresholds(scores: np.ndarray, num_gt, num_sample_pts=41):
scores.sort()
scores =... | 39.170213 | 117 | 0.514177 |
4284a9266dfb2da4cddf9c92e33d95dbb7d84c86 | 2,031 | py | Python | amrevaluation/utils.py | yichao-l/amr-eager-multilingual | 6d96445a23ff493ceedea02712fbcceffe08b879 | [
"BSD-2-Clause"
] | null | null | null | amrevaluation/utils.py | yichao-l/amr-eager-multilingual | 6d96445a23ff493ceedea02712fbcceffe08b879 | [
"BSD-2-Clause"
] | null | null | null | amrevaluation/utils.py | yichao-l/amr-eager-multilingual | 6d96445a23ff493ceedea02712fbcceffe08b879 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
#coding=utf-8
'''
Various routines used by scores.py
'''
def disambig(lst):
lst2 = []
for v in lst:
idx = 1
v_idx = v + '_0'
while str(v_idx) in lst2:
v_idx = v + '_' + str(idx)
idx += 1
lst2.append(str(v_idx))
return lst2
def ... | 27.08 | 85 | 0.533235 |
e1767c03220a4b2ec1d1c6c2fd773d9b3838d43e | 9,082 | py | Python | test/backward_compatibility/check_backward_compatibility.py | suphoff/pytorch | 7cdfd86a727ce01e41f2af81931064fb664513dd | [
"Intel"
] | null | null | null | test/backward_compatibility/check_backward_compatibility.py | suphoff/pytorch | 7cdfd86a727ce01e41f2af81931064fb664513dd | [
"Intel"
] | null | null | null | test/backward_compatibility/check_backward_compatibility.py | suphoff/pytorch | 7cdfd86a727ce01e41f2af81931064fb664513dd | [
"Intel"
] | null | null | null | import argparse
import datetime
import re
import sys
from collections import defaultdict
import torch
from torch._C import parse_schema
# The date specifies how long the allowlist exclusion should apply to.
#
# - If we NEVER give BC guarantee for an operator, you can put the
# date arbitrarily far in the futur... | 43.247619 | 86 | 0.65261 |
55139a6204a49499741ae86fde290b2327325399 | 28,546 | py | Python | pyjsdl/vector.py | jggatc/pyjsdl-ts | 393658a58d4b9ed71efaa9adbbf1d85e368a8cca | [
"MIT"
] | null | null | null | pyjsdl/vector.py | jggatc/pyjsdl-ts | 393658a58d4b9ed71efaa9adbbf1d85e368a8cca | [
"MIT"
] | null | null | null | pyjsdl/vector.py | jggatc/pyjsdl-ts | 393658a58d4b9ed71efaa9adbbf1d85e368a8cca | [
"MIT"
] | null | null | null | #Pyjsdl - Copyright (C) 2021 James Garnon <https://gatc.ca/>
#Released under the MIT License <https://opensource.org/licenses/MIT>
from math import sqrt, sin, cos, atan2, pi, floor
class Vector2(object):
"""
Vector2 - 2-dimensional vector.
Operator and index functionality requires __pragma__ ('opov').
... | 32.365079 | 90 | 0.508933 |
c07414cafc565f90834e59efde6c25643fb556ed | 189 | py | Python | musicstore/musicapp/admin.py | hannahclee/recordreview | 73855cdc006db5170c9fca214bf5ce6d142040b3 | [
"Apache-2.0"
] | null | null | null | musicstore/musicapp/admin.py | hannahclee/recordreview | 73855cdc006db5170c9fca214bf5ce6d142040b3 | [
"Apache-2.0"
] | null | null | null | musicstore/musicapp/admin.py | hannahclee/recordreview | 73855cdc006db5170c9fca214bf5ce6d142040b3 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from .models import Artist, Record, Review
# Register your models here.
admin.site.register(Artist)
admin.site.register(Record)
admin.site.register(Review) | 27 | 42 | 0.809524 |
2861e4e01e81763f3230d96375eb16ecf7fa5c84 | 972 | py | Python | a2ml/api/a2ml_dataset.py | arita37/a2ml | 3e92bede2c2ef6e63be74560cc6b904d3ec9d931 | [
"Apache-2.0"
] | 2 | 2020-04-09T16:59:22.000Z | 2020-04-09T17:01:10.000Z | a2ml/api/a2ml_dataset.py | arita37/a2ml | 3e92bede2c2ef6e63be74560cc6b904d3ec9d931 | [
"Apache-2.0"
] | null | null | null | a2ml/api/a2ml_dataset.py | arita37/a2ml | 3e92bede2c2ef6e63be74560cc6b904d3ec9d931 | [
"Apache-2.0"
] | null | null | null | from a2ml.api.utils.crud_runner import CRUDRunner
from a2ml.api.utils.show_result import show_result
class A2MLDataset(object):
"""Contains the dataset CRUD operations that interact with provider."""
def __init__(self, ctx, provider):
"""Initializes a new a2ml.
Args:
provider (str)... | 28.588235 | 100 | 0.639918 |
994ed9ed21b6233033178db357596123c0fcc744 | 9,204 | py | Python | Pyrado/pyrado/algorithms/episodic/nes.py | theogruner/SimuRLacra | 4893514ccdeb10a736c55de9aa7753fd51c5afec | [
"DOC",
"Zlib",
"BSD-3-Clause"
] | null | null | null | Pyrado/pyrado/algorithms/episodic/nes.py | theogruner/SimuRLacra | 4893514ccdeb10a736c55de9aa7753fd51c5afec | [
"DOC",
"Zlib",
"BSD-3-Clause"
] | null | null | null | Pyrado/pyrado/algorithms/episodic/nes.py | theogruner/SimuRLacra | 4893514ccdeb10a736c55de9aa7753fd51c5afec | [
"DOC",
"Zlib",
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2020, Fabio Muratore, Honda Research Institute Europe GmbH, and
# Technical University of Darmstadt.
# 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 ... | 47.2 | 141 | 0.686875 |
113fdaaf14ead638f626a61a7766e9d2979329b9 | 1,244 | py | Python | superset/migrations/versions/55e910a74826_add_metadata_column_to_annotation_model_.py | Manikantan22/incubator-superset | ec325c871e60ae2a050aae595b430d6fc2888d1a | [
"Apache-2.0"
] | 6 | 2019-06-14T11:16:54.000Z | 2020-11-08T16:02:00.000Z | superset/migrations/versions/55e910a74826_add_metadata_column_to_annotation_model_.py | Manikantan22/incubator-superset | ec325c871e60ae2a050aae595b430d6fc2888d1a | [
"Apache-2.0"
] | 203 | 2019-05-31T11:13:10.000Z | 2020-03-31T02:50:54.000Z | superset/migrations/versions/55e910a74826_add_metadata_column_to_annotation_model_.py | Manikantan22/incubator-superset | ec325c871e60ae2a050aae595b430d6fc2888d1a | [
"Apache-2.0"
] | 14 | 2019-05-31T11:32:40.000Z | 2021-01-28T11:18:16.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... | 31.897436 | 85 | 0.766881 |
51872b7bf71a067a06ea7e2ec6458e4b7615c9a5 | 3,862 | py | Python | python/download-trade.py | Kento-Bento/binance-public-data | a4309127213f2f8af194626013598b278a541c73 | [
"MIT"
] | 637 | 2021-01-14T03:41:05.000Z | 2022-03-29T13:02:56.000Z | python/download-trade.py | Kento-Bento/binance-public-data | a4309127213f2f8af194626013598b278a541c73 | [
"MIT"
] | 115 | 2021-01-15T02:52:21.000Z | 2022-03-29T09:30:37.000Z | python/download-trade.py | Kento-Bento/binance-public-data | a4309127213f2f8af194626013598b278a541c73 | [
"MIT"
] | 267 | 2021-01-19T13:36:17.000Z | 2022-03-31T15:56:19.000Z | #!/usr/bin/env python
"""
script to download trades.
set the absoluate path destination folder for STORE_DIRECTORY, and run
e.g. STORE_DIRECTORY=/data/ ./download-trade.py
"""
import sys
from datetime import *
import pandas as pd
from enums import *
from utility import download_file, get_all_symbols, get_pars... | 34.792793 | 145 | 0.684878 |
5276ecf712911672f88b4005caab490f5941ef1b | 1,204 | py | Python | src/omnibus/app.py | hmajid2301/omnibus | 99de78329c28e99bcfefd523640f4fdd377bf8d4 | [
"Apache-2.0"
] | 1 | 2022-02-25T13:05:27.000Z | 2022-02-25T13:05:27.000Z | src/omnibus/app.py | hmajid2301/omnibus | 99de78329c28e99bcfefd523640f4fdd377bf8d4 | [
"Apache-2.0"
] | null | null | null | src/omnibus/app.py | hmajid2301/omnibus | 99de78329c28e99bcfefd523640f4fdd377bf8d4 | [
"Apache-2.0"
] | null | null | null | from typing import Any, Callable, Dict, List, Type, Union
from beanie import init_beanie
from beanie.odm.documents import DocType
from fastapi import FastAPI
from fastapi_health import health
from motor import motor_asyncio
from omnibus.config.settings import OmnibusSettings
from omnibus.healthcheck import default_he... | 37.625 | 112 | 0.775748 |
8fa7a58c8e55a8cf09335f185287c7bbde6d6829 | 18,454 | py | Python | PAPC/models/detect/pointpillars/core/__init__.py | AgentMaker/PAPC | f5f385c6fed53d2ca2599171a317efaac348dfb5 | [
"MIT"
] | 70 | 2021-02-20T03:44:38.000Z | 2022-01-17T12:55:45.000Z | PAPC/models/detect/pointpillars/core/__init__.py | AgentMaker/PAPC | f5f385c6fed53d2ca2599171a317efaac348dfb5 | [
"MIT"
] | 1 | 2021-02-20T05:26:14.000Z | 2021-02-20T13:22:13.000Z | PAPC/models/detect/pointpillars/core/__init__.py | AgentMaker/PAPC | f5f385c6fed53d2ca2599171a317efaac348dfb5 | [
"MIT"
] | 8 | 2021-02-20T03:35:25.000Z | 2022-02-08T03:22:55.000Z | import numpy as np
from functools import partial
import pickle
import paddle
from core.box_coders import (GroundBox3dCoderPaddle, BevBoxCoderPaddle)
from core.voxel_generator import VoxelGenerator
from core.target_assigner import TargetAssigner
from core.similarity_calculator import (RotateIouSimilarity,NearestIouSi... | 34.950758 | 104 | 0.700336 |
f1923e6a60d6703b867a3d141b6b252c7f6100ff | 216 | py | Python | catalog/bindings/gmd/bounded_feature_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/gmd/bounded_feature_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | catalog/bindings/gmd/bounded_feature_type.py | NIVANorge/s-enda-playground | 56ae0a8978f0ba8a5546330786c882c31e17757a | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from bindings.gmd.abstract_feature_type import AbstractFeatureType
__NAMESPACE__ = "http://www.opengis.net/gml"
@dataclass
class BoundedFeatureType(AbstractFeatureType):
pass
| 21.6 | 66 | 0.828704 |
3a6ee928b99933fe9275310a59ba9981df8294f1 | 64,738 | py | Python | distributed/dashboard/components/scheduler.py | MichaelSchreier/distributed | 7b9fccb1f5d6e5e262500c342650afbd5bfeccd7 | [
"BSD-3-Clause"
] | null | null | null | distributed/dashboard/components/scheduler.py | MichaelSchreier/distributed | 7b9fccb1f5d6e5e262500c342650afbd5bfeccd7 | [
"BSD-3-Clause"
] | null | null | null | distributed/dashboard/components/scheduler.py | MichaelSchreier/distributed | 7b9fccb1f5d6e5e262500c342650afbd5bfeccd7 | [
"BSD-3-Clause"
] | null | null | null | from collections import defaultdict
import logging
import math
from numbers import Number
import operator
import os
from bokeh.layouts import column, row
from bokeh.models import (
ColumnDataSource,
ColorBar,
DataRange1d,
HoverTool,
ResetTool,
PanTool,
WheelZoomTool,
TapTool,
OpenUR... | 32.417626 | 104 | 0.512651 |
07694b597b9191a7951ccd0b714e74ca0c95319c | 18,349 | py | Python | student_tools/tools.py | mahart-studio/UniCloud | ab137c82680f23f2fea6fc226867b32967019ede | [
"MIT"
] | 3 | 2019-12-06T15:31:14.000Z | 2021-01-09T05:45:52.000Z | student_tools/tools.py | avour/UniCloud | ab137c82680f23f2fea6fc226867b32967019ede | [
"MIT"
] | null | null | null | student_tools/tools.py | avour/UniCloud | ab137c82680f23f2fea6fc226867b32967019ede | [
"MIT"
] | null | null | null | # my kivy side import
import kivy
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.uix.button import Button
from kivy.uix.label import Label
from kivy.uix.spinner import Spinner, SpinnerOption
from kivy.uix.dropdown import DropDown
fr... | 32.361552 | 141 | 0.588915 |
ff1bc782d52f33bcf94fbdbc4a24c493b2b7240d | 69,456 | py | Python | packages/python/plotly/plotly/graph_objs/parcats/line/__init__.py | thatneat/plotly.py | 2e7c0ff2565f703394d872b0d8ea13f45aba3498 | [
"MIT"
] | 1 | 2020-02-29T09:46:51.000Z | 2020-02-29T09:46:51.000Z | packages/python/plotly/plotly/graph_objs/parcats/line/__init__.py | hermitspirit/plotly.py | 2e7c0ff2565f703394d872b0d8ea13f45aba3498 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/graph_objs/parcats/line/__init__.py | hermitspirit/plotly.py | 2e7c0ff2565f703394d872b0d8ea13f45aba3498 | [
"MIT"
] | null | null | null | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class ColorBar(_BaseTraceHierarchyType):
# bgcolor
# -------
@property
def bgcolor(self):
"""
Sets the color of padded area.
The 'bgcolor' property is a color and may b... | 37.341935 | 98 | 0.571427 |
aad9ebc919506cdb9632b02701488ee4ee2b0a42 | 907 | py | Python | tests/test_grid.py | roure/aima-drivers | 45ed0153b614ca28979f58591956b59bc4ffcedf | [
"MIT"
] | null | null | null | tests/test_grid.py | roure/aima-drivers | 45ed0153b614ca28979f58591956b59bc4ffcedf | [
"MIT"
] | 2 | 2019-03-12T12:59:50.000Z | 2019-03-12T13:09:06.000Z | tests/test_grid.py | roure/aima-drivers | 45ed0153b614ca28979f58591956b59bc4ffcedf | [
"MIT"
] | null | null | null | import pytest
from grid import * # noqa
def compare_list(x, y):
return all([elm_x == y[i] for i, elm_x in enumerate(x)])
def test_distance():
assert distance((1, 2), (5, 5)) == 5.0
def test_distance_squared():
assert distance_squared((1, 2), (5, 5)) == 25.0
def test_vector_clip():
assert vector... | 21.595238 | 60 | 0.577729 |
259ff7f5dee426d2c362f1800bb1be98a804421c | 5,184 | py | Python | extensionGadget.py | GarnetSunset/chromeExtensionsFetcher | dd2f620f9cfe8897235b8bf98a5b614d5669c6e2 | [
"MIT"
] | null | null | null | extensionGadget.py | GarnetSunset/chromeExtensionsFetcher | dd2f620f9cfe8897235b8bf98a5b614d5669c6e2 | [
"MIT"
] | null | null | null | extensionGadget.py | GarnetSunset/chromeExtensionsFetcher | dd2f620f9cfe8897235b8bf98a5b614d5669c6e2 | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
from selenium import webdriver
from six.moves.urllib.request import urlretrieve
import ctypes, os, re, json, socket, subprocess, sys, time, zipfile
localappdata = os.getenv('LocalAPPDATA')
dir = localappdata + r"\Google\Chrome\User Data\Default\Extensions"
dragNDrop = ''.join(sys.argv[1:]... | 34.105263 | 128 | 0.575424 |
c54a7f8aaa93fe7d262b1a26ae1192dcbf79e7f3 | 1,672 | py | Python | leetcode/tree/binary-tree-inorder-traversal.py | jaimeulloa61/data-structure-and-algorithms | 76140bb36b62ebc7c60914c48a323aae4956fb0a | [
"MIT"
] | 81 | 2020-05-22T14:22:04.000Z | 2021-12-18T10:11:23.000Z | leetcode/tree/binary-tree-inorder-traversal.py | jaimeulloa61/data-structure-and-algorithms | 76140bb36b62ebc7c60914c48a323aae4956fb0a | [
"MIT"
] | 4 | 2020-08-06T21:08:00.000Z | 2021-03-31T16:07:50.000Z | leetcode/tree/binary-tree-inorder-traversal.py | jaimeulloa61/data-structure-and-algorithms | 76140bb36b62ebc7c60914c48a323aae4956fb0a | [
"MIT"
] | 37 | 2020-05-22T14:25:21.000Z | 2021-12-30T03:13:13.000Z | """
Given a binary tree, return the inorder traversal of its nodes' values.
Example:
Input: [1,null,2,3]
1
\
2
/
3
Output: [1,3,2]
Follow up: Recursive solution is trivial, could you do it iteratively?
"""
# Solutions
# Recursive Solution
class TreeNode:
def __init__(self, x):
self... | 18.577778 | 72 | 0.560407 |
17523b234697d2b2d456c0d5207e7e64e93cef44 | 6,964 | py | Python | testing/conformance/conformance/applications/topology.py | vishalbelsare/wallaroo | 2b985a3e756786139316c72ebcca342346546ba7 | [
"Apache-2.0"
] | 1,459 | 2017-09-16T13:13:15.000Z | 2020-10-05T06:19:50.000Z | testing/conformance/conformance/applications/topology.py | vishalbelsare/wallaroo | 2b985a3e756786139316c72ebcca342346546ba7 | [
"Apache-2.0"
] | 1,413 | 2017-09-14T18:18:14.000Z | 2020-09-28T08:10:30.000Z | testing/conformance/conformance/applications/topology.py | vishalbelsare/wallaroo | 2b985a3e756786139316c72ebcca342346546ba7 | [
"Apache-2.0"
] | 80 | 2017-09-27T23:16:23.000Z | 2020-06-02T09:18:53.000Z | # Copyright 2019 The Wallaroo 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 ... | 37.240642 | 80 | 0.596927 |
0f8a0012b869a206f29d6c7aa045fc77e3095113 | 209 | py | Python | BoardGame/connectfour/ConnectFour.py | kitman0804/BoardGame | be8c08adf10f5d236d3904ca7673f2210f925979 | [
"MIT"
] | null | null | null | BoardGame/connectfour/ConnectFour.py | kitman0804/BoardGame | be8c08adf10f5d236d3904ca7673f2210f925979 | [
"MIT"
] | null | null | null | BoardGame/connectfour/ConnectFour.py | kitman0804/BoardGame | be8c08adf10f5d236d3904ca7673f2210f925979 | [
"MIT"
] | null | null | null | from ..prototype.mnkgame.Game import Game
from .GameBoard import GameBoard
class ConnectFour(Game):
def __init__(self):
super().__init__(m=6, n=7, k=4)
self._core.gameboard = GameBoard()
| 23.222222 | 42 | 0.684211 |
6c631fd16496abf26de9e86bf061d6fb44cd8b38 | 2,210 | py | Python | harnessed_jobs/BOT_EO_analysis/v0/producer_BOT_EO_analysis.py | duncanwood/EO-analysis-jobs | 26d22e49c0d2e32fbf2759f504048754f66ecc45 | [
"BSD-3-Clause-LBNL"
] | 2 | 2018-07-26T09:32:46.000Z | 2019-05-28T20:57:43.000Z | harnessed_jobs/BOT_EO_analysis/v0/producer_BOT_EO_analysis.py | duncanwood/EO-analysis-jobs | 26d22e49c0d2e32fbf2759f504048754f66ecc45 | [
"BSD-3-Clause-LBNL"
] | 3 | 2018-03-18T21:55:07.000Z | 2019-04-18T18:26:06.000Z | harnessed_jobs/BOT_EO_analysis/v0/producer_BOT_EO_analysis.py | duncanwood/EO-analysis-jobs | 26d22e49c0d2e32fbf2759f504048754f66ecc45 | [
"BSD-3-Clause-LBNL"
] | 2 | 2020-11-12T19:47:42.000Z | 2022-02-25T21:43:03.000Z | #!/usr/bin/env python
"""
Producer script for BOT analyses.
"""
from __future__ import print_function
from multiprocessor_execution import run_device_analysis_pool
from camera_components import camera_info
from bot_eo_analyses import fe55_jh_task, bias_frame_jh_task, \
read_noise_jh_task, \
dark_current_jh_task... | 38.77193 | 76 | 0.625792 |
0403b4cbfe7710d35f2e8dedf3d8f4cd81c9329d | 2,454 | py | Python | tests/games/test_uttt_monte_carlo.py | DoveDoof/QLUT | 8d48a5430a267b6b1018312d8267236d4df899d9 | [
"MIT"
] | null | null | null | tests/games/test_uttt_monte_carlo.py | DoveDoof/QLUT | 8d48a5430a267b6b1018312d8267236d4df899d9 | [
"MIT"
] | 13 | 2018-07-19T09:42:28.000Z | 2018-09-25T15:08:05.000Z | tests/games/test_uttt_monte_carlo.py | DoveDoof/QLUT | 8d48a5430a267b6b1018312d8267236d4df899d9 | [
"MIT"
] | null | null | null | import unittest as test
import time
import games.uttt as ut
import techniques.monte_carlo as mc
class TestUltimateTicTacToe(test.TestCase):
@test.skip
def test_move(self):
# Test single move of monte carlo tree search algorithm
game_spec = ut.UltimateTicTacToeGameSpec()
# generate board with 10 random move... | 29.926829 | 100 | 0.717604 |
c8eac20fdd8e250bad5331b3b5c52ede01e4b5e9 | 924 | py | Python | davidgram/users/migrations/0005_auto_20180418_1957.py | lopun/davidgram | 74abe2598d3bfd15b6ff88243696e71f451ba250 | [
"MIT"
] | 2 | 2018-12-24T23:00:59.000Z | 2019-05-18T23:52:02.000Z | davidgram/users/migrations/0005_auto_20180418_1957.py | ujin43255252/davidgram | 74abe2598d3bfd15b6ff88243696e71f451ba250 | [
"MIT"
] | 11 | 2020-06-05T18:23:02.000Z | 2022-03-08T22:01:34.000Z | davidgram/users/migrations/0005_auto_20180418_1957.py | ujin43255252/davidgram | 74abe2598d3bfd15b6ff88243696e71f451ba250 | [
"MIT"
] | 1 | 2018-10-17T12:43:40.000Z | 2018-10-17T12:43:40.000Z | # Generated by Django 2.0.4 on 2018-04-18 10:57
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0004_auto_20180418_1952'),
]
operations = [
migrations.AddField(
model_name='user',
... | 30.8 | 147 | 0.608225 |
2a12d69e35e3d4db9e0a5d907ab51a8f8d523306 | 2,062 | py | Python | profiles_api/models.py | eklonsousa/profiles-rest-api | fbe9d2c917a597657fcfa97c4d3d47373f3cdff0 | [
"MIT"
] | null | null | null | profiles_api/models.py | eklonsousa/profiles-rest-api | fbe9d2c917a597657fcfa97c4d3d47373f3cdff0 | [
"MIT"
] | null | null | null | profiles_api/models.py | eklonsousa/profiles-rest-api | fbe9d2c917a597657fcfa97c4d3d47373f3cdff0 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import BaseUserManager
from django.conf import settings
class UserProfileManager(BaseUserManager):
"""Manager for user profiles"""
def cr... | 26.779221 | 63 | 0.675558 |
e88d64287de85e2970296dd42d7e7ee7c5b686f2 | 23,173 | py | Python | src/practice_problem3.py | tnafiu/13-Exam2Practice | 2c9f91a79eb7358a8376b3554abcc1dc082f6f04 | [
"MIT"
] | null | null | null | src/practice_problem3.py | tnafiu/13-Exam2Practice | 2c9f91a79eb7358a8376b3554abcc1dc082f6f04 | [
"MIT"
] | null | null | null | src/practice_problem3.py | tnafiu/13-Exam2Practice | 2c9f91a79eb7358a8376b3554abcc1dc082f6f04 | [
"MIT"
] | null | null | null | """
PRACTICE Test 2, practice_problem 3.
Authors: David Mutchler, Dave Fisher, Valerie Galluzzi, Amanda Stouder,
their colleagues and Toluwa Nafiu.
""" # DONE: 1. PUT YOUR NAME IN THE ABOVE LINE.
########################################################################
# Students:
#
# These problems have DIF... | 43.072491 | 82 | 0.453933 |
9120d8b84eea6c8bcc4685d92ee2b7afdd5b86ea | 3,163 | py | Python | Utilitarios/adivinhador_cesar.py | GregorioFornetti/CriPython | 12b5bc64188de3a7c81d8f9d0a392f6edc7ac827 | [
"MIT"
] | 1 | 2020-05-17T03:00:18.000Z | 2020-05-17T03:00:18.000Z | Utilitarios/adivinhador_cesar.py | GregorioFornetti/Cripythongrafia | 12b5bc64188de3a7c81d8f9d0a392f6edc7ac827 | [
"MIT"
] | 1 | 2020-05-17T15:59:26.000Z | 2020-05-17T15:59:26.000Z | Utilitarios/adivinhador_cesar.py | GregorioFornetti/Cripythongrafia | 12b5bc64188de3a7c81d8f9d0a392f6edc7ac827 | [
"MIT"
] | null | null | null | import Cifras.cifra_de_cesar as cifra_de_cesar
import Cifras.utilidades_cifras as utilidades
import dicionarios
def imprimir_melhor_mensagem_adivinhada_apenas_letras(mensagem):
lista_melhor_msg_e_indice = adivinhar_cesar_apenas_letras(mensagem)
if lista_melhor_msg_e_indice:
print(dicionarios.retorna_me... | 52.716667 | 157 | 0.739488 |
0ad3de628147dff99fe766c197042c4cda7f923b | 943 | py | Python | tuyaha/devices/factory.py | xremix/tuyaha | 5ce4e352131bbf3b1e1a5fabf9bd6af8102c83a8 | [
"MIT"
] | 153 | 2019-07-19T14:32:44.000Z | 2022-02-11T20:44:22.000Z | tuyaha/devices/factory.py | xremix/tuyaha | 5ce4e352131bbf3b1e1a5fabf9bd6af8102c83a8 | [
"MIT"
] | 97 | 2019-07-11T03:13:04.000Z | 2021-10-04T02:02:11.000Z | tuyaha/devices/factory.py | xremix/tuyaha | 5ce4e352131bbf3b1e1a5fabf9bd6af8102c83a8 | [
"MIT"
] | 96 | 2019-08-12T16:04:13.000Z | 2021-12-30T16:16:21.000Z | from tuyaha.devices.climate import TuyaClimate
from tuyaha.devices.cover import TuyaCover
from tuyaha.devices.fan import TuyaFanDevice
from tuyaha.devices.light import TuyaLight
from tuyaha.devices.lock import TuyaLock
from tuyaha.devices.scene import TuyaScene
from tuyaha.devices.switch import TuyaSwitch
def get_tuy... | 32.517241 | 48 | 0.698834 |
e5edfa5325c6c2bd0c21090104d440e84f9838a1 | 499 | py | Python | alipay/aop/api/response/AlipayEcoMycarDialogonlineAnswererUpdateResponse.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayEcoMycarDialogonlineAnswererUpdateResponse.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayEcoMycarDialogonlineAnswererUpdateResponse.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayEcoMycarDialogonlineAnswererUpdateResponse(AlipayResponse):
def __init__(self):
super(AlipayEcoMycarDialogonlineAnswererUpdateResponse, self).__init__()
... | 31.1875 | 121 | 0.801603 |
25d82d38fb40d0d16451f5a9f183f995446d8552 | 7,003 | py | Python | app/dao/provider_details_dao.py | alphagov/notify-notifications-api | e604385e0cf4c2ab8c6451b7120ceb196cce21b5 | [
"MIT"
] | null | null | null | app/dao/provider_details_dao.py | alphagov/notify-notifications-api | e604385e0cf4c2ab8c6451b7120ceb196cce21b5 | [
"MIT"
] | null | null | null | app/dao/provider_details_dao.py | alphagov/notify-notifications-api | e604385e0cf4c2ab8c6451b7120ceb196cce21b5 | [
"MIT"
] | null | null | null | from datetime import datetime, timedelta
from flask import current_app
from notifications_utils.timezones import convert_utc_to_bst
from sqlalchemy import asc, desc, func
from app import db
from app.dao.dao_utils import autocommit
from app.models import (
SMS_TYPE,
FactBilling,
ProviderDetails,
Provid... | 36.097938 | 119 | 0.74668 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.