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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
a2657c4134de6c5a28580d756a1566afcc716786 | 898 | py | Python | saleor/api/category/views.py | glosoftgroup/restaurant | 5b10a8f5199103e5bee01b45952c9638e63f28af | [
"BSD-3-Clause"
] | 1 | 2018-05-03T06:17:02.000Z | 2018-05-03T06:17:02.000Z | saleor/api/category/views.py | glosoftgroup/restaurant | 5b10a8f5199103e5bee01b45952c9638e63f28af | [
"BSD-3-Clause"
] | 8 | 2018-05-07T16:42:35.000Z | 2022-02-26T03:31:56.000Z | saleor/api/category/views.py | glosoftgroup/tenants | a6b229ad1f6d567b7078f83425a532830b71e1bb | [
"BSD-3-Clause"
] | null | null | null | from rest_framework import generics
from rest_framework.response import Response
from rest_framework.request import Request
from django.contrib.auth import get_user_model
from .serializers import (
CategoryListSerializer,
)
from ...product.models import Category
User = get_user_model()
class CategoryListAP... | 28.967742 | 92 | 0.752784 |
0f53396dcafdbf2cabeb020b950c4a17fe66b21e | 2,923 | py | Python | parsl/tests/test_error_handling/test_retries.py | cylondata/parsl | 00ff9372bd841dafef8a0b3566c79ffe68f0e367 | [
"Apache-2.0"
] | null | null | null | parsl/tests/test_error_handling/test_retries.py | cylondata/parsl | 00ff9372bd841dafef8a0b3566c79ffe68f0e367 | [
"Apache-2.0"
] | null | null | null | parsl/tests/test_error_handling/test_retries.py | cylondata/parsl | 00ff9372bd841dafef8a0b3566c79ffe68f0e367 | [
"Apache-2.0"
] | null | null | null | import argparse
import os
import pytest
import parsl
from parsl import bash_app, python_app
from parsl.tests.configs.local_threads import fresh_config
local_config = fresh_config()
local_config.retries = 2
@python_app
def sleep_then_fail(inputs=[], sleep_dur=0.1):
import time
import math
time.sleep(slee... | 23.572581 | 67 | 0.62778 |
a7a2945f745b374bdf8507d31720a3f6f2ccc095 | 1,801 | py | Python | src/api/codecheck/views/common_views.py | Chromico/bk-base | be822d9bbee544a958bed4831348185a75604791 | [
"MIT"
] | 84 | 2021-06-30T06:20:23.000Z | 2022-03-22T03:05:49.000Z | src/api/codecheck/views/common_views.py | Chromico/bk-base | be822d9bbee544a958bed4831348185a75604791 | [
"MIT"
] | 7 | 2021-06-30T06:21:16.000Z | 2022-03-29T07:36:13.000Z | src/api/codecheck/views/common_views.py | Chromico/bk-base | be822d9bbee544a958bed4831348185a75604791 | [
"MIT"
] | 40 | 2021-06-30T06:21:26.000Z | 2022-03-29T12:42:26.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础计算平台 available.
Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
You may o... | 40.022222 | 115 | 0.626319 |
0ef3986a72a88476dd0b3605bccd5fb752d57139 | 5,375 | py | Python | gitsome/lib/github3/events.py | stackriot-labs/gitsome | d7c57abc7cb66e9c910a844f15d4536866da3310 | [
"Apache-2.0"
] | 7,986 | 2015-11-07T11:59:21.000Z | 2022-03-27T17:20:49.000Z | gitsome/lib/github3/events.py | themaximum88/gitsome | d7c57abc7cb66e9c910a844f15d4536866da3310 | [
"Apache-2.0"
] | 161 | 2016-05-09T09:53:48.000Z | 2022-02-22T04:18:59.000Z | gitsome/lib/github3/events.py | themaximum88/gitsome | d7c57abc7cb66e9c910a844f15d4536866da3310 | [
"Apache-2.0"
] | 539 | 2016-04-05T05:39:58.000Z | 2022-03-23T20:47:52.000Z | # -*- coding: utf-8 -*-
"""
github3.events
==============
This module contains the class(es) related to Events
"""
from __future__ import unicode_literals
from .models import GitHubCore
class Event(GitHubCore):
"""The :class:`Event <Event>` object. It structures and handles the data
returned by via the `E... | 28.743316 | 78 | 0.642605 |
4c909c014b26ba3b8c8f927b0fcc73ebcf142895 | 562 | py | Python | tests/base_sets_tests/test_repr.py | lycantropos/dendroid | 4315673ef52129909617225df6357416c56a84b3 | [
"MIT"
] | null | null | null | tests/base_sets_tests/test_repr.py | lycantropos/dendroid | 4315673ef52129909617225df6357416c56a84b3 | [
"MIT"
] | 16 | 2019-11-02T10:44:20.000Z | 2020-09-21T15:22:29.000Z | tests/base_sets_tests/test_repr.py | lycantropos/dendroid | 4315673ef52129909617225df6357416c56a84b3 | [
"MIT"
] | 1 | 2020-03-13T08:41:39.000Z | 2020-03-13T08:41:39.000Z | import math
import sys
from hypothesis import given
from tests.utils import BaseSet
from . import strategies
@given(strategies.sets)
def test_basic(set_: BaseSet) -> None:
result = repr(set_)
type_ = type(set_)
assert result.startswith(type_.__qualname__)
@given(strategies.sets_with_none_orders)
def... | 20.814815 | 66 | 0.697509 |
80d49483846cd2da05886ba651e3a48403797d98 | 4,240 | py | Python | data_load.py | Cyclcrclicly/dc_tts | d823bd6f53123809ccd1847ebef052292d0b633a | [
"Apache-2.0"
] | null | null | null | data_load.py | Cyclcrclicly/dc_tts | d823bd6f53123809ccd1847ebef052292d0b633a | [
"Apache-2.0"
] | null | null | null | data_load.py | Cyclcrclicly/dc_tts | d823bd6f53123809ccd1847ebef052292d0b633a | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#/usr/bin/python2
'''
By kyubyong park. kbpark.linguist@gmail.com.
https://www.github.com/kyubyong/dc_tts
'''
from __future__ import print_function
from hyperparams import Hyperparams as hp
import numpy as np
import tensorflow as tf
from utils import *
import codecs
import re
import os, sys
i... | 36.551724 | 123 | 0.545283 |
8ba8689ccbdd5a1d98b1bc7cdf41c266dc30a6c3 | 830 | py | Python | flask_Test.py | WilliLam/THEFE | 931c1fd759e36a4b9801b33299813d09223e84e7 | [
"Apache-2.0"
] | null | null | null | flask_Test.py | WilliLam/THEFE | 931c1fd759e36a4b9801b33299813d09223e84e7 | [
"Apache-2.0"
] | null | null | null | flask_Test.py | WilliLam/THEFE | 931c1fd759e36a4b9801b33299813d09223e84e7 | [
"Apache-2.0"
] | null | null | null | from flask import Flask
from flask import render_template, json, url_for, jsonify
import os
app = Flask(__name__)
with open('data.json') as f:
j = json.load(f)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/home')
def home():
return render_template('home.html')
@app.route(... | 22.432432 | 62 | 0.672289 |
d55ec43d2c0162f8ddc4040f915c27637c7ec6e8 | 1,689 | py | Python | host/linux/host_control/python_support/test.py | ys-oh/esp-hosted | a70eb16e52312d58fe0096a7ea6e48c1d8bc325a | [
"Apache-2.0"
] | null | null | null | host/linux/host_control/python_support/test.py | ys-oh/esp-hosted | a70eb16e52312d58fe0096a7ea6e48c1d8bc325a | [
"Apache-2.0"
] | 1 | 2021-02-24T05:01:31.000Z | 2021-02-24T05:01:31.000Z | host/linux/host_control/python_support/test.py | ys-oh/esp-hosted | a70eb16e52312d58fe0096a7ea6e48c1d8bc325a | [
"Apache-2.0"
] | null | null | null | # Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD
#
# 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... | 21.935065 | 74 | 0.706335 |
c5c0d1e073a5f30f1b9509b179976c28725f68f1 | 12,400 | py | Python | cdasim/sim.py | katmayo7/quiesce | 9d1a4c5386849302473e0d4ad75b3f7e2e7f049b | [
"Apache-2.0"
] | 4 | 2019-01-12T09:02:18.000Z | 2021-10-30T12:08:27.000Z | cdasim/sim.py | katmayo7/quiesce | 9d1a4c5386849302473e0d4ad75b3f7e2e7f049b | [
"Apache-2.0"
] | 1 | 2020-09-28T01:15:11.000Z | 2020-10-07T06:58:47.000Z | cdasim/sim.py | katmayo7/quiesce | 9d1a4c5386849302473e0d4ad75b3f7e2e7f049b | [
"Apache-2.0"
] | 7 | 2019-03-09T11:45:44.000Z | 2022-03-25T12:18:43.000Z | #!/usr/bin/env python3
import argparse
import heapq
import itertools
import json
import math
import multiprocessing
import random
import sys
# Smallest float above 0. Should only effect numbers really close to 0. Allows
# division by 0 to be 0 without a conditional.
TINY = 2.2250738585072014e-308
class SummStats(obj... | 31.713555 | 83 | 0.553468 |
088d7180c3204d90f3b1212a47b909539f2994cc | 3,008 | py | Python | include/ToolBOSCore/Packages/DebianPackage.py | manuelmuehlig/ToolBOSCore | 20a218f45f91506add885d5cd7b5e4f40a744105 | [
"BSD-3-Clause"
] | null | null | null | include/ToolBOSCore/Packages/DebianPackage.py | manuelmuehlig/ToolBOSCore | 20a218f45f91506add885d5cd7b5e4f40a744105 | [
"BSD-3-Clause"
] | null | null | null | include/ToolBOSCore/Packages/DebianPackage.py | manuelmuehlig/ToolBOSCore | 20a218f45f91506add885d5cd7b5e4f40a744105 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Model for Debian/Ubuntu packages
#
# Copyright (c) Honda Research Institute Europe GmbH
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# 1. Redistributions of source code must reta... | 36.682927 | 84 | 0.693816 |
db48cfb333f94ad1a8f2e7e15c12cd3584d87c7c | 872 | py | Python | controls/linux/button_control.py | yeyeto2788/mudpi-core | dc477eb3ccbe3317d11a8555d245dadbdb34c257 | [
"BSD-4-Clause"
] | null | null | null | controls/linux/button_control.py | yeyeto2788/mudpi-core | dc477eb3ccbe3317d11a8555d245dadbdb34c257 | [
"BSD-4-Clause"
] | 1 | 2021-03-15T14:32:34.000Z | 2021-03-15T14:32:34.000Z | controls/linux/button_control.py | yeyeto2788/mudpi-core | dc477eb3ccbe3317d11a8555d245dadbdb34c257 | [
"BSD-4-Clause"
] | null | null | null | import time
import datetime
import json
import redis
from .control import Control
r = redis.Redis(host='127.0.0.1', port=6379)
class ButtonControl(Control):
def __init__(self, pin, name=None, key=None, resistor=None, edge_detection=None, debounce=None, topic=None, redis_conn=None):
super().__init__(pin... | 28.129032 | 141 | 0.654817 |
6e85aff24ce39d67809e4858e2899501337785e3 | 843 | py | Python | samples/user_management/coreservices/get_user_information.py | shalltell/cybersource-rest-samples-python | 95b0557456d99538fca5d01c238d3600378930de | [
"MIT"
] | null | null | null | samples/user_management/coreservices/get_user_information.py | shalltell/cybersource-rest-samples-python | 95b0557456d99538fca5d01c238d3600378930de | [
"MIT"
] | null | null | null | samples/user_management/coreservices/get_user_information.py | shalltell/cybersource-rest-samples-python | 95b0557456d99538fca5d01c238d3600378930de | [
"MIT"
] | null | null | null | from CyberSource import *
import os
from importlib.machinery import SourceFileLoader
config_file = os.path.join(os.getcwd(), "data", "Configuration.py")
configuration = SourceFileLoader("module.name", config_file).load_module()
def get_user_information():
try:
# Reading Merchant details from Configuratio... | 33.72 | 93 | 0.721234 |
563169765c0845f7458fbb5591254ccbd5dbab7e | 129 | py | Python | ros_ws/src/moveit_robots/iri_wam_moveit_config/scripts/modules/common.py | mesneym/Baxter-Arm-PP | fdbf86309bc64c31af105daa026b2f8519710129 | [
"MIT"
] | null | null | null | ros_ws/src/moveit_robots/iri_wam_moveit_config/scripts/modules/common.py | mesneym/Baxter-Arm-PP | fdbf86309bc64c31af105daa026b2f8519710129 | [
"MIT"
] | null | null | null | ros_ws/src/moveit_robots/iri_wam_moveit_config/scripts/modules/common.py | mesneym/Baxter-Arm-PP | fdbf86309bc64c31af105daa026b2f8519710129 | [
"MIT"
] | null | null | null | version https://git-lfs.github.com/spec/v1
oid sha256:8c71c631d896b078cdf1db3c9b7bc52158208078312b7d618f3e7315088e7c9a
size 1452
| 32.25 | 75 | 0.883721 |
fe7355eb8a002181155fa311bff3936c56538a75 | 7,993 | py | Python | python/ray/air/examples/horovod/horovod_pytorch_example.py | jianoaix/ray | 1701b923bc83905f8961c06a6a173e3eba46a936 | [
"Apache-2.0"
] | null | null | null | python/ray/air/examples/horovod/horovod_pytorch_example.py | jianoaix/ray | 1701b923bc83905f8961c06a6a173e3eba46a936 | [
"Apache-2.0"
] | 12 | 2022-03-05T05:37:28.000Z | 2022-03-19T07:14:43.000Z | python/ray/air/examples/horovod/horovod_pytorch_example.py | jianoaix/ray | 1701b923bc83905f8961c06a6a173e3eba46a936 | [
"Apache-2.0"
] | null | null | null | import argparse
from filelock import FileLock
import horovod.torch as hvd
import os
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.utils.data.distributed
from torchvision import datasets, transforms
import ray
from ray import train
from ray.train.horovod import HorovodTr... | 29.93633 | 88 | 0.609283 |
2946d9bf8563f3f466ea76a999e1301387c5ae5e | 7,310 | py | Python | gen_docs.py | rChen10/pywright | a71527b62c072d89c84054b0674b3a65e1227c48 | [
"BSD-3-Clause"
] | 3 | 2016-03-16T01:10:09.000Z | 2022-02-20T00:33:04.000Z | gen_docs.py | rChen10/pywright | a71527b62c072d89c84054b0674b3a65e1227c48 | [
"BSD-3-Clause"
] | 1 | 2016-03-16T01:29:57.000Z | 2016-03-16T01:29:57.000Z | gen_docs.py | rChen10/pywright | a71527b62c072d89c84054b0674b3a65e1227c48 | [
"BSD-3-Clause"
] | 5 | 2016-03-21T02:48:13.000Z | 2021-08-18T08:58:09.000Z | """
This is an attempt to generate an api for pywright. Old method of methodically
tracking everything just doesn't cut it!
"""
#import stuff to get started
import os,sys
engine = open("core/libengine.py").read().split("\n")
core = open("core/core.py").read().split("\n")
sys.path.insert(0,"core")
import libengine
imp... | 29.715447 | 121 | 0.551163 |
11a6ea5d646258fee9d463df6dc0549fef1c0703 | 4,126 | py | Python | sdk/python/pulumi_azure_native/servicebus/latest/get_topic_authorization_rule.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/servicebus/latest/get_topic_authorization_rule.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/servicebus/latest/get_topic_authorization_rule.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 35.878261 | 215 | 0.655114 |
84d448e23d5f44ce65797e4e81399d6d7872b572 | 2,163 | py | Python | hermetrics/tests/test_damerau_levenshtein.py | kampamocha/hermetrics | 2efdc986d917c6017a815fd8f1c8cd96a4d5ba3b | [
"MIT"
] | 5 | 2019-11-22T20:58:50.000Z | 2021-02-26T00:36:12.000Z | hermetrics/tests/test_damerau_levenshtein.py | kampamocha/hermetrics | 2efdc986d917c6017a815fd8f1c8cd96a4d5ba3b | [
"MIT"
] | null | null | null | hermetrics/tests/test_damerau_levenshtein.py | kampamocha/hermetrics | 2efdc986d917c6017a815fd8f1c8cd96a4d5ba3b | [
"MIT"
] | 2 | 2019-11-12T22:01:54.000Z | 2022-02-22T13:32:25.000Z | # NOTE:
# For now the tests only check functionality with costs = 1
# Use other costs at your own peril
import unittest
from hermetrics.damerau_levenshtein import DamerauLevenshtein
class TestDamerauLevenshtein(unittest.TestCase):
def test_distance(self):
"""
Test for distance function
"... | 39.327273 | 78 | 0.616274 |
9b8559dba56fb2794b8fa5f09751b8088e1f4901 | 21,195 | py | Python | saleor/settings.py | acabezasg/saleor-original | f7897c7a9b67086b2963153cb848b63d57120fde | [
"BSD-3-Clause"
] | 2 | 2019-06-24T09:54:18.000Z | 2019-09-02T07:26:43.000Z | saleor/settings.py | acabezasg/saleor-original | f7897c7a9b67086b2963153cb848b63d57120fde | [
"BSD-3-Clause"
] | null | null | null | saleor/settings.py | acabezasg/saleor-original | f7897c7a9b67086b2963153cb848b63d57120fde | [
"BSD-3-Clause"
] | null | null | null | import ast
import os.path
import dj_database_url
import dj_email_url
import django_cache_url
from django.contrib.messages import constants as messages
from django.utils.translation import gettext_lazy as _, pgettext_lazy
from django_prices.templatetags.prices_i18n import get_currency_fraction
from . import __version_... | 32.457887 | 90 | 0.684407 |
74eaec9bc5b25dcf78210296aff85203dd9fcd1a | 3,764 | py | Python | chart/chart/python/spectralsequence_chart/signal_dict.py | JoeyBF/sseq | d553df5e2466aaad47f4a36bf5e051a3922b0dd0 | [
"Apache-2.0",
"MIT"
] | 7 | 2021-04-22T04:06:09.000Z | 2022-01-25T04:05:49.000Z | chart/chart/python/spectralsequence_chart/signal_dict.py | JoeyBF/sseq | d553df5e2466aaad47f4a36bf5e051a3922b0dd0 | [
"Apache-2.0",
"MIT"
] | 68 | 2020-03-21T22:37:24.000Z | 2022-03-31T02:51:35.000Z | chart/chart/python/spectralsequence_chart/signal_dict.py | JoeyBF/sseq | d553df5e2466aaad47f4a36bf5e051a3922b0dd0 | [
"Apache-2.0",
"MIT"
] | 5 | 2021-02-17T06:37:43.000Z | 2022-02-01T03:53:22.000Z | from typing import TypeVar, Generic, Dict, Any, Callable, Optional, List, Iterable
from collections.abc import MutableMapping, MutableSequence
T = TypeVar("T")
class SignalDict(MutableMapping, Generic[T]):
""" This is a dict that signals when it is changed, by calling self._parent._needs_update()
if self.... | 28.732824 | 95 | 0.586079 |
2bab87e838cc18710c728348650084e0f975f8fe | 860 | py | Python | study_bdt/RecSys/Hybrid/HybridAlgorithm.py | AlphaSunny/study | 4e65127fefa9078b7ae6b9db92369c93e61e4327 | [
"MIT"
] | 73 | 2019-05-08T05:59:53.000Z | 2022-03-28T16:59:19.000Z | Hybrid/HybridAlgorithm.py | mayank171986/Building-Recommender-Systems-with-Machine-Learning-and-AI | 9e6dc58254ec1a2d2ca64c2f81a37f6390947701 | [
"MIT"
] | 1 | 2021-02-07T18:01:54.000Z | 2021-02-23T12:26:16.000Z | Hybrid/HybridAlgorithm.py | mayank171986/Building-Recommender-Systems-with-Machine-Learning-and-AI | 9e6dc58254ec1a2d2ca64c2f81a37f6390947701 | [
"MIT"
] | 43 | 2019-07-18T03:26:22.000Z | 2022-03-10T22:03:33.000Z | # -*- coding: utf-8 -*-
"""
Created on Fri May 4 13:08:25 2018
@author: Frank
"""
from surprise import AlgoBase
class HybridAlgorithm(AlgoBase):
def __init__(self, algorithms, weights, sim_options={}):
AlgoBase.__init__(self)
self.algorithms = algorithms
self.weights = wei... | 23.888889 | 81 | 0.548837 |
11d39fecf1ff19a67d36c115d5dca83772df578d | 11,980 | py | Python | indep_ws/src/fetch_gazebo/fetch_gazebo_demo/scripts/tests_arm_movements.py | njnovak/Independent-Study | ecf9b38a421227b075660cf6d02fc5eb19cd4aa2 | [
"MIT"
] | null | null | null | indep_ws/src/fetch_gazebo/fetch_gazebo_demo/scripts/tests_arm_movements.py | njnovak/Independent-Study | ecf9b38a421227b075660cf6d02fc5eb19cd4aa2 | [
"MIT"
] | null | null | null | indep_ws/src/fetch_gazebo/fetch_gazebo_demo/scripts/tests_arm_movements.py | njnovak/Independent-Study | ecf9b38a421227b075660cf6d02fc5eb19cd4aa2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import time
import rospy
import sys
import moveit_commander
import moveit_msgs.msg
import geometry_msgs.msg
from geometry_msgs.msg import Pose
from tf.transformations import euler_from_quaternion, quaternion_from_euler
import trajectory_msgs.msg
import copy
import actionlib
import rospy
from ma... | 33.277778 | 92 | 0.63414 |
034010f84f0c986172929992d0a275baf744c990 | 3,391 | py | Python | task_mongo_crud.py | kkr016/mongoDB | 0ed6a6c1b4d1876bb42ad929abab0508554838a2 | [
"CC0-1.0"
] | null | null | null | task_mongo_crud.py | kkr016/mongoDB | 0ed6a6c1b4d1876bb42ad929abab0508554838a2 | [
"CC0-1.0"
] | null | null | null | task_mongo_crud.py | kkr016/mongoDB | 0ed6a6c1b4d1876bb42ad929abab0508554838a2 | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Task_mongo_CRUD.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1OuDg6bEjpOU2NmeZwJWc-f4HubVPYXQ0
"""
import pymongo
# Connecting Mongo Database with Object
db = pymongo.MongoClient("mongodb://kkr016:qwerty12@kkr016-s... | 32.605769 | 284 | 0.621646 |
69bc1bc80c095baaabe2ff96a92778f10d80e527 | 4,585 | py | Python | min_mcts/monte_carlo_tree_search.py | phil-hawkins/alpha-zero-general | b218bd3f98740f917a98bbf2609a516fcfcef6fc | [
"MIT"
] | null | null | null | min_mcts/monte_carlo_tree_search.py | phil-hawkins/alpha-zero-general | b218bd3f98740f917a98bbf2609a516fcfcef6fc | [
"MIT"
] | null | null | null | min_mcts/monte_carlo_tree_search.py | phil-hawkins/alpha-zero-general | b218bd3f98740f917a98bbf2609a516fcfcef6fc | [
"MIT"
] | null | null | null | """
A minimal implementation of Monte Carlo tree search (MCTS) in Python 3
Luke Harold Miles, July 2019, Public Domain Dedication
See also https://en.wikipedia.org/wiki/Monte_Carlo_tree_search
https://gist.github.com/qpwo/c538c6f73727e254fdc7fab81024f6e1
modified from original to fit with alpha zero general cannonical... | 32.985612 | 90 | 0.620065 |
bfcecd3a48f823ea19874227ce9f731fc876bfee | 1,809 | py | Python | airflow/hooks/samba_hook.py | mr-mcox/incubator-airflow | 3f1bfd38cd5a1c9c58045004390a6a766bec5e8d | [
"Apache-2.0"
] | 4 | 2015-11-12T10:58:54.000Z | 2017-08-05T06:41:36.000Z | airflow/hooks/samba_hook.py | mr-mcox/incubator-airflow | 3f1bfd38cd5a1c9c58045004390a6a766bec5e8d | [
"Apache-2.0"
] | 6 | 2015-12-08T21:41:51.000Z | 2017-11-28T13:24:05.000Z | airflow/hooks/samba_hook.py | mr-mcox/incubator-airflow | 3f1bfd38cd5a1c9c58045004390a6a766bec5e8d | [
"Apache-2.0"
] | 2 | 2015-12-14T11:38:49.000Z | 2018-03-26T15:03:07.000Z | # -*- 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 under the Apache License, Version 2.0 (the
#... | 34.132075 | 68 | 0.693201 |
4e13c0536c28f0173942edaf515e91088b71b933 | 23,226 | py | Python | scripts/speech_recognition/convert_to_tarred_audio_dataset.py | jhfong/NeMo | db7a2db5ee4e0e81a5640b1f8ff5e83e993bcb87 | [
"Apache-2.0"
] | 2 | 2021-09-21T07:36:20.000Z | 2022-02-05T15:29:04.000Z | scripts/speech_recognition/convert_to_tarred_audio_dataset.py | jhfong/NeMo | db7a2db5ee4e0e81a5640b1f8ff5e83e993bcb87 | [
"Apache-2.0"
] | null | null | null | scripts/speech_recognition/convert_to_tarred_audio_dataset.py | jhfong/NeMo | db7a2db5ee4e0e81a5640b1f8ff5e83e993bcb87 | [
"Apache-2.0"
] | 12 | 2021-06-20T08:56:10.000Z | 2022-03-16T19:07:10.000Z | # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 38.581395 | 120 | 0.655731 |
1bc6e28a2f05a66132cb7d4eb2e798001499721b | 532 | py | Python | priority_queue.py | kalyaniasthana/CS271_project_sokoban | 454c9643fe3346bee4aea895de1948bc92ac8b64 | [
"MIT"
] | 2 | 2021-09-05T15:05:19.000Z | 2021-09-05T15:09:05.000Z | priority_queue.py | kalyaniasthana/CS271_project_sokoban | 454c9643fe3346bee4aea895de1948bc92ac8b64 | [
"MIT"
] | null | null | null | priority_queue.py | kalyaniasthana/CS271_project_sokoban | 454c9643fe3346bee4aea895de1948bc92ac8b64 | [
"MIT"
] | 2 | 2020-12-17T10:01:28.000Z | 2022-01-11T23:35:53.000Z | import heapq # min-heap by default
class PriorityQueue:
def __init__(self):
self.Heap = []
self.Count = 0
def push(self, item, priority):
entry = (priority, self.Count, item)
heapq.heappush(self.Heap, entry)
self.Count += 1
def pop(self):
(_, _, item) = he... | 26.6 | 135 | 0.597744 |
3c0aab26430d61b5091e51db7310477d4c00a425 | 4,597 | py | Python | asposepdfcloud/models/combo_box_fields.py | kaferi/aspose-pdf-cloud-python | 48f70742fec1e41644ec0b658db3f174ba845304 | [
"MIT"
] | 7 | 2018-06-11T17:44:44.000Z | 2022-02-08T05:52:48.000Z | asposepdfcloud/models/combo_box_fields.py | kaferi/aspose-pdf-cloud-python | 48f70742fec1e41644ec0b658db3f174ba845304 | [
"MIT"
] | 1 | 2021-03-20T22:16:15.000Z | 2021-06-27T15:11:52.000Z | asposepdfcloud/models/combo_box_fields.py | kaferi/aspose-pdf-cloud-python | 48f70742fec1e41644ec0b658db3f174ba845304 | [
"MIT"
] | 4 | 2018-04-18T19:41:12.000Z | 2021-06-21T13:12:24.000Z | # coding: utf-8
"""
Aspose.PDF Cloud API Reference
Copyright (c) 2021 Aspose.PDF Cloud
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the r... | 26.883041 | 78 | 0.587122 |
cbb81d4dba083911f2dd9a67db17bd1d02d6c5a7 | 11,522 | py | Python | PSets/PS4/lab4.py | brightonanc/MIT-OCW-6.034-Fall-2010 | b92bafc2781e6e5c9b0fed20bd0ce05a2feac0c6 | [
"MIT"
] | null | null | null | PSets/PS4/lab4.py | brightonanc/MIT-OCW-6.034-Fall-2010 | b92bafc2781e6e5c9b0fed20bd0ce05a2feac0c6 | [
"MIT"
] | null | null | null | PSets/PS4/lab4.py | brightonanc/MIT-OCW-6.034-Fall-2010 | b92bafc2781e6e5c9b0fed20bd0ce05a2feac0c6 | [
"MIT"
] | null | null | null |
# SEARCH FOR "MY_CODE" COMMENT TO FIND MY CONTRIBUTIONS
from classify import *
import math
# MY_CODE
import matplotlib.pyplot as plt
##
## CSP portion of lab 4.
##
from csp import BinaryConstraint, CSP, CSPState, Variable,\
basic_constraint_checker, solve_csp_problem
# Implement basic forward checking on the C... | 38.026403 | 100 | 0.67497 |
d6cbdd680aeeb26fc186afef902b0d5de5904e4d | 33,965 | py | Python | haystack/backends/whoosh_backend.py | phill-tornroth/django-haystack | 11b288ed73c8c9646481bff8bc12e64eeb9194f2 | [
"BSD-3-Clause"
] | null | null | null | haystack/backends/whoosh_backend.py | phill-tornroth/django-haystack | 11b288ed73c8c9646481bff8bc12e64eeb9194f2 | [
"BSD-3-Clause"
] | null | null | null | haystack/backends/whoosh_backend.py | phill-tornroth/django-haystack | 11b288ed73c8c9646481bff8bc12e64eeb9194f2 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import os
import re
import shutil
import threading
import warnings
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.models.loading import get_model
from django.utils import six
from django.utils.datetime_safe import datetime... | 37.324176 | 164 | 0.576947 |
1f0fba0d20cd4869e08120c6854dfb9cf5141a93 | 2,736 | py | Python | django/contrib/gis/tests/test_geoforms.py | egenerat/gae-django | f12379483cf3917ed3cb46ca5ff0b94daf89fc50 | [
"MIT"
] | 3 | 2016-07-08T23:49:32.000Z | 2018-04-15T22:55:01.000Z | django/contrib/gis/tests/test_geoforms.py | egenerat/gae-django | f12379483cf3917ed3cb46ca5ff0b94daf89fc50 | [
"MIT"
] | 27 | 2017-02-05T15:57:04.000Z | 2018-04-15T22:57:26.000Z | django/contrib/gis/tests/test_geoforms.py | egenerat/gae-django | f12379483cf3917ed3cb46ca5ff0b94daf89fc50 | [
"MIT"
] | null | null | null | from django.forms import ValidationError
from django.contrib.gis import forms
from django.contrib.gis.geos import GEOSGeometry
from django.utils import unittest
class GeometryFieldTest(unittest.TestCase):
def test00_init(self):
"Testing GeometryField initialization with defaults."
fld =... | 41.454545 | 105 | 0.656067 |
c5b5fe54958ef114c5011428adeb88d9b5edf042 | 11,475 | py | Python | pandapower/test/converter/test_from_powerfactory_3ph.py | ZhengLiu1119/pandapower | 4356a2e8fdc6afc5a8449c903d09d90d8fee5530 | [
"BSD-3-Clause"
] | null | null | null | pandapower/test/converter/test_from_powerfactory_3ph.py | ZhengLiu1119/pandapower | 4356a2e8fdc6afc5a8449c903d09d90d8fee5530 | [
"BSD-3-Clause"
] | null | null | null | pandapower/test/converter/test_from_powerfactory_3ph.py | ZhengLiu1119/pandapower | 4356a2e8fdc6afc5a8449c903d09d90d8fee5530 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import pandapower as pp
import pytest
import numpy as np
try:
from pandaplan.core import pplog as logging
except ImportError:
import logging
import json
logger = logging.getLogger(__name__)
testfiles_path = os.path.join(pp.pp_dir, 'test', 'converter', 'testfiles')
try:
... | 38.636364 | 120 | 0.629891 |
7ad7a1f249e1549773bb777379bd5f93240fa38a | 10,602 | py | Python | Project4/code/SplitMerge_old.py | jyczju/CVprojects | 28f0419460f612589a1f366dee362ae3ecfe39b9 | [
"MIT"
] | null | null | null | Project4/code/SplitMerge_old.py | jyczju/CVprojects | 28f0419460f612589a1f366dee362ae3ecfe39b9 | [
"MIT"
] | 1 | 2022-03-16T06:57:19.000Z | 2022-03-16T06:57:19.000Z | Project4/code/SplitMerge_old.py | jyczju/CVprojects | 28f0419460f612589a1f366dee362ae3ecfe39b9 | [
"MIT"
] | null | null | null | '''
图像切割+边缘识别
浙江大学控制学院《数字图像处理与机器视觉》第三次作业
jyczju
2022/4/6 v1.0
'''
import cv2
import numpy as np
import sys
from imgnode import ImgNode
import matplotlib.pyplot as plt
def region_split_merge(img, min_area=(1,1), threshold=5.0):
'''
区域分裂合并算法,主要依靠ImgNode类实现
输入:待处理图像,分裂的最小区域,合并的相似性判断阈值
输出:前后景分割后的二值化图像
... | 33.339623 | 297 | 0.603377 |
75a6fa8c5f09650d75466375710d7567be939c0f | 255 | py | Python | main.py | ALB37/deep-dream-clone | 73e7127282483bb2f51e34995c5cc59e79369437 | [
"MIT"
] | null | null | null | main.py | ALB37/deep-dream-clone | 73e7127282483bb2f51e34995c5cc59e79369437 | [
"MIT"
] | null | null | null | main.py | ALB37/deep-dream-clone | 73e7127282483bb2f51e34995c5cc59e79369437 | [
"MIT"
] | null | null | null | from cStringIO import StringIO
import numpy as np
import scipy.ndimage as nd
import PIL.Image
from IPython.display import clear_output, Image, display
from google.protobuf import text_format
import caffe
#TODO: Locally install caffe and google protobuf
| 23.181818 | 56 | 0.831373 |
72c7d1abe5ad2a20d3232bc88f6caa58734a3224 | 43,160 | py | Python | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_agent_pools_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_agent_pools_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2022_02_01/operations/_agent_pools_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# 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) AutoRe... | 44.357657 | 263 | 0.673633 |
4173e7798a0fb91a8335d87dbd8e4b4cbae56575 | 120,509 | py | Python | idaes/generic_models/properties/core/generic/generic_property.py | xiangyuy/idaes-pse | d503c1b7566278b8e064a873512070a29e9d16e9 | [
"RSA-MD"
] | 1 | 2021-09-22T13:58:59.000Z | 2021-09-22T13:58:59.000Z | idaes/generic_models/properties/core/generic/generic_property.py | xiangyuy/idaes-pse | d503c1b7566278b8e064a873512070a29e9d16e9 | [
"RSA-MD"
] | null | null | null | idaes/generic_models/properties/core/generic/generic_property.py | xiangyuy/idaes-pse | d503c1b7566278b8e064a873512070a29e9d16e9 | [
"RSA-MD"
] | null | null | null | #################################################################################
# The Institute for the Design of Advanced Energy Systems Integrated Platform
# Framework (IDAES IP) was produced under the DOE Institute for the
# Design of Advanced Energy Systems (IDAES), and is copyright (c) 2018-2021
# by the softwar... | 44.207263 | 83 | 0.537006 |
b0cfc513df8e910e40021ec2dfd3e90c338b304d | 6,936 | py | Python | backend/propickleball_32656/settings.py | crowdbotics-apps/propickleball-32656 | 4375be859b2c05ee8a5f02bf95bab74e7822b800 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/propickleball_32656/settings.py | crowdbotics-apps/propickleball-32656 | 4375be859b2c05ee8a5f02bf95bab74e7822b800 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/propickleball_32656/settings.py | crowdbotics-apps/propickleball-32656 | 4375be859b2c05ee8a5f02bf95bab74e7822b800 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | """
Django settings for propickleball_32656 project.
Generated by 'django-admin startproject' using Django 2.2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
... | 29.641026 | 112 | 0.731257 |
b8e0b32ddb8d639dbb6f7092dbd556ad800e0946 | 1,258 | py | Python | packetracer/lazydict.py | hatamiarash7/PacketTracer | a36aea8c5fb52c1950740dd086f44535989a6e40 | [
"MIT"
] | 3 | 2020-03-24T06:39:16.000Z | 2021-04-20T19:25:49.000Z | packetracer/lazydict.py | hatamiarash7/PacketTracer | a36aea8c5fb52c1950740dd086f44535989a6e40 | [
"MIT"
] | 1 | 2019-12-29T12:55:55.000Z | 2019-12-29T12:55:55.000Z | packetracer/lazydict.py | hatamiarash7/PacketTracer | a36aea8c5fb52c1950740dd086f44535989a6e40 | [
"MIT"
] | 7 | 2019-12-29T12:20:13.000Z | 2021-08-02T05:04:48.000Z | import logging
logger = logging.getLogger("packetracer")
class LazyDict(dict):
def __init__(self, cb_createentries):
super().__init__()
self._cb_createentries = cb_createentries
def _lazy_init(self):
if self._cb_createentries is None:
return
new_entries = self._c... | 23.735849 | 57 | 0.617647 |
a0dd9bfcb16de03c72ab3ea3ff2d2a0d99ea1bef | 330 | py | Python | plugins/baidu/__init__.py | nim4/pantea | 29bee731157b1a643bcfeed37133c7575bc9340f | [
"MIT"
] | 3 | 2016-09-26T06:47:57.000Z | 2017-10-03T17:05:16.000Z | plugins/baidu/__init__.py | nim4/pantea | 29bee731157b1a643bcfeed37133c7575bc9340f | [
"MIT"
] | null | null | null | plugins/baidu/__init__.py | nim4/pantea | 29bee731157b1a643bcfeed37133c7575bc9340f | [
"MIT"
] | null | null | null | from lib.util import get_info_by_url, insert_to_db
__host = "baidu.com"
__sess = "BDUSS="
def parse(headers):
name = get_info_by_url("http://www.baidu.com/", headers,
[('"username":"', '"')])[0]
if name is None:
return False
insert_to_db("Baidu", headers, name, "http://www.baidu.com/")
re... | 23.571429 | 65 | 0.636364 |
06f9cf31d5c2a10aec4d23355269bed928314c0f | 685 | py | Python | conan/test_package/conanfile.py | theonewolf/lithium | c091b085c7dd519f8cf682c0eca25f8a1f46b15c | [
"MIT"
] | 1,012 | 2019-12-05T15:30:15.000Z | 2022-03-30T12:22:28.000Z | conan/test_package/conanfile.py | theonewolf/lithium | c091b085c7dd519f8cf682c0eca25f8a1f46b15c | [
"MIT"
] | 66 | 2020-02-14T07:32:34.000Z | 2022-03-20T17:13:04.000Z | conan/test_package/conanfile.py | theonewolf/lithium | c091b085c7dd519f8cf682c0eca25f8a1f46b15c | [
"MIT"
] | 81 | 2019-12-12T08:30:01.000Z | 2022-03-20T02:29:37.000Z | import os
from conans import ConanFile, CMake, tools
class LithiumTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
def build(self):
cmake = CMake(self)
# Current dir is "test_package/build/<build_id>" and CMakeLists.txt is
# in "test_pa... | 26.346154 | 78 | 0.572263 |
6f464b74388424c95350c89cd87e2dc3ef26c913 | 14,716 | py | Python | usaspending_api/search/tests/test_spending_by_award_type.py | gaybro8777/usaspending-api | fe9d730acd632401bbbefa168e3d86d59560314b | [
"CC0-1.0"
] | null | null | null | usaspending_api/search/tests/test_spending_by_award_type.py | gaybro8777/usaspending-api | fe9d730acd632401bbbefa168e3d86d59560314b | [
"CC0-1.0"
] | null | null | null | usaspending_api/search/tests/test_spending_by_award_type.py | gaybro8777/usaspending-api | fe9d730acd632401bbbefa168e3d86d59560314b | [
"CC0-1.0"
] | null | null | null | import json
import pytest
from django.db import connection
from model_mommy import mommy
from rest_framework import status
from usaspending_api.search.tests.test_mock_data_search import non_legacy_filters
@pytest.fixture
@pytest.mark.django_db
def test_data():
mommy.make("references.LegalEntity", legal_entity_id... | 35.631961 | 119 | 0.561905 |
03b6953b405fdb5babc5c9521006135cf85970bd | 2,706 | py | Python | tests/test_distance.py | mikstr/qml | 552e273da080a3a1fb9f8c466e4562b7d64ed6bd | [
"MIT"
] | 185 | 2017-04-26T19:57:43.000Z | 2022-03-22T03:50:14.000Z | tests/test_distance.py | FarnazH/qml | 552e273da080a3a1fb9f8c466e4562b7d64ed6bd | [
"MIT"
] | 61 | 2017-06-04T11:28:20.000Z | 2021-08-02T15:36:07.000Z | tests/test_distance.py | FarnazH/qml | 552e273da080a3a1fb9f8c466e4562b7d64ed6bd | [
"MIT"
] | 78 | 2017-04-25T10:10:17.000Z | 2022-03-31T06:51:47.000Z | # MIT License
#
# Copyright (c) 2017 Anders Steen Christensen
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, mo... | 26.529412 | 80 | 0.648928 |
0abea864f603abeef77fc70a0414917286b57beb | 406 | py | Python | InertiaApi/InertiaApi/urls.py | Wilimitis9/Inertia | dd2194face814e2df1a2887068f77e028f1087bc | [
"Apache-2.0"
] | null | null | null | InertiaApi/InertiaApi/urls.py | Wilimitis9/Inertia | dd2194face814e2df1a2887068f77e028f1087bc | [
"Apache-2.0"
] | null | null | null | InertiaApi/InertiaApi/urls.py | Wilimitis9/Inertia | dd2194face814e2df1a2887068f77e028f1087bc | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import url, include
from django.contrib import admin
from oauth2_provider.views import base
from InertiaDjango.views import MessageList
urlpatterns = [
#url(r'^o/', include('oauth2_provider.urls', namespace='oauth2_provider')),
#url(r'^admin/', admin.site.urls),
url(r'o/token/$', base.T... | 31.230769 | 76 | 0.716749 |
55b6ed89774309b61d33e35c27b04356abea2e4b | 6,918 | py | Python | rlil/experiments/trainer.py | syuntoku14/pytorch-rl-il | e613b73acdb634f2f7a00ac88e7aa3431c1852bf | [
"MIT"
] | 43 | 2020-03-22T22:42:21.000Z | 2022-03-28T03:14:22.000Z | rlil/experiments/trainer.py | syuntoku14/pytorch-rl-il | e613b73acdb634f2f7a00ac88e7aa3431c1852bf | [
"MIT"
] | 5 | 2020-04-15T09:42:34.000Z | 2022-03-31T03:12:32.000Z | rlil/experiments/trainer.py | syuntoku14/pytorch-rl-il | e613b73acdb634f2f7a00ac88e7aa3431c1852bf | [
"MIT"
] | 9 | 2020-09-17T21:12:28.000Z | 2021-05-26T04:54:31.000Z | import logging
from rlil.environments import State
from rlil.initializer import (call_seed,
get_logger,
get_writer,
is_on_policy_mode)
from rlil.samplers import AsyncSampler, StartInfo
import numpy as np
import torch
import warnin... | 39.988439 | 81 | 0.568083 |
2e7e0df648383be22bdfd96c32587b7855b78cc1 | 2,207 | py | Python | docs/conf.py | crvernon/mosartwmpy | e6769fe6fe9ebd069905dde4d5ffba54378f0f40 | [
"CC0-1.0"
] | null | null | null | docs/conf.py | crvernon/mosartwmpy | e6769fe6fe9ebd069905dde4d5ffba54378f0f40 | [
"CC0-1.0"
] | null | null | null | docs/conf.py | crvernon/mosartwmpy | e6769fe6fe9ebd069905dde4d5ffba54378f0f40 | [
"CC0-1.0"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 37.40678 | 80 | 0.612596 |
168f3c084a03e8955dca1f3b6f9a32b55ced6756 | 385 | py | Python | lib/fmdplugins/ddb_setup.py | GonzaloAlvarez/py-ga-sysadmin | fbbbbcad36df9f1b3e40328ff48c22bad13a56f4 | [
"MIT"
] | 2 | 2018-01-05T15:32:06.000Z | 2021-06-02T13:15:05.000Z | lib/fmdplugins/ddb_setup.py | GonzaloAlvarez/devops-tools | fbbbbcad36df9f1b3e40328ff48c22bad13a56f4 | [
"MIT"
] | 67 | 2017-01-09T19:39:19.000Z | 2018-02-28T05:33:40.000Z | lib/fmdplugins/ddb_setup.py | GonzaloAlvarez/devops-tools | fbbbbcad36df9f1b3e40328ff48c22bad13a56f4 | [
"MIT"
] | null | null | null | from lib.fmd.decorators import Action, AddStage, ListStage, GetStage, DelStage, ShowStage
from lib.fmd.namedentity import NamedEntity
from lib.cloud.dynamodb import DynamoDb
@Action(AddStage.SETUP, DelStage.SETUP, GetStage.SETUP, ListStage.SETUP, ShowStage.SETUP)
def ddb_setup(context, data):
if not hasattr(contex... | 42.777778 | 89 | 0.784416 |
10687f25563b002f6a49787325eb220f2396504d | 6,118 | py | Python | onlinecourse/views.py | vivekpillai99/djangowebapp | 5060ef7c66ecbeb66dae3de611a616e5edc0f64e | [
"Apache-2.0"
] | null | null | null | onlinecourse/views.py | vivekpillai99/djangowebapp | 5060ef7c66ecbeb66dae3de611a616e5edc0f64e | [
"Apache-2.0"
] | null | null | null | onlinecourse/views.py | vivekpillai99/djangowebapp | 5060ef7c66ecbeb66dae3de611a616e5edc0f64e | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponseRedirect
# <HINT> Import any new Models here
from .models import Course, Enrollment, Question, Choice, Submission
from django.contrib.auth.models import User
from django.shortcuts import get_object_or_404, render, redirect
from django.urls import r... | 37.078788 | 129 | 0.688787 |
85e98469256b5b31fd18810b5f0f04a26ea3d9d7 | 1,500 | py | Python | Tests/test_ProtSeqIO.py | benchiverton/Proteomics | 006ac5877a5256ee60abdfff35ad81c4a1afa157 | [
"MIT"
] | 2 | 2020-09-26T14:33:21.000Z | 2021-01-19T19:22:54.000Z | Tests/test_ProtSeqIO.py | benchiverton/Proteomics | 006ac5877a5256ee60abdfff35ad81c4a1afa157 | [
"MIT"
] | 2 | 2020-09-28T12:39:04.000Z | 2022-02-13T15:02:38.000Z | Tests/test_ProtSeqIO.py | benchiverton/Proteomics | 006ac5877a5256ee60abdfff35ad81c4a1afa157 | [
"MIT"
] | null | null | null | """Tests for ProtSeqIO fasta helper module."""
from protseqspark.ProtSeq import ProteinSequence
from protseqspark import ProtSeqIO
proteome1_seqs = [
ProteinSequence(
"Q6F1Z5",
"RS10",
"MESFL",
"MAEQKMRIKLKGYDHAIIDQSILKIIEAAEGTGAKVRGPIPLPTDKQVITILRAVHKYKDSREQFEMRTHKRLLEILNPTPTTMDVL... | 44.117647 | 329 | 0.782667 |
5f27dbabede5406098a1507c86f1dbd911bdf64e | 2,133 | py | Python | main.py | bilgehannal/ns-killer | 9e18eb0314509e43b3ef8b1122a81b9034d53598 | [
"Apache-2.0"
] | null | null | null | main.py | bilgehannal/ns-killer | 9e18eb0314509e43b3ef8b1122a81b9034d53598 | [
"Apache-2.0"
] | null | null | null | main.py | bilgehannal/ns-killer | 9e18eb0314509e43b3ef8b1122a81b9034d53598 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
import json
from datetime import timedelta, timezone
import datetime
import os
import time
from ast import literal_eval
import yaml
# Load config file
#with open("config/ns-killer.conf", 'r') as ymlfile:
with open("/etc/config/ns-killer.conf", 'r') as ymlfile:
cfg = yaml.load(ymlfile, Loader=yam... | 37.421053 | 148 | 0.691983 |
c7fd0c258aa807176785cbfb8996385303cadd85 | 1,330 | py | Python | resrc/utils/tests/templatetags_tests.py | ignatandrei/resrc | 5b88e3cfbc638e5f98cf7bfe6f4a5757840a2565 | [
"MIT"
] | 1 | 2015-11-05T19:50:19.000Z | 2015-11-05T19:50:19.000Z | resrc/utils/tests/templatetags_tests.py | sergiolimajr/resrc | a0714b3ae989821ebe4c5a7b5a2235a85bfa16a9 | [
"MIT"
] | 2 | 2020-08-04T18:08:04.000Z | 2021-02-02T22:57:59.000Z | resrc/utils/tests/templatetags_tests.py | sergiolimajr/resrc | a0714b3ae989821ebe4c5a7b5a2235a85bfa16a9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-:
from django.test import TestCase
from django_dynamic_fixture import G
from django.contrib.auth.models import User
from resrc.tests.factories import UserFactory
from resrc.userprofile.models import Profile
from resrc.utils.templatetags.profile import profile
from resrc.utils.templatetags.grav... | 35 | 141 | 0.687218 |
b09d83a856f7334af218beb1a3bed74291f46d03 | 6,138 | py | Python | sw/3rd_party/VTK-7.1.0/Examples/GUI/Python/OrthogonalPlanesWithTkPhoto.py | esean/stl_voro_fill | c569a4019ff80afbf85482c7193711ea85a7cafb | [
"MIT"
] | 4 | 2019-05-30T01:52:12.000Z | 2021-09-29T21:12:13.000Z | graphics/VTK-7.0.0/Examples/GUI/Python/OrthogonalPlanesWithTkPhoto.py | hlzz/dotfiles | 0591f71230c919c827ba569099eb3b75897e163e | [
"BSD-3-Clause"
] | null | null | null | graphics/VTK-7.0.0/Examples/GUI/Python/OrthogonalPlanesWithTkPhoto.py | hlzz/dotfiles | 0591f71230c919c827ba569099eb3b75897e163e | [
"BSD-3-Clause"
] | 2 | 2019-08-30T23:36:13.000Z | 2019-11-08T16:52:01.000Z | #!/usr/bin/env python
import vtk
from vtk import *
import sys, os
#import Tkinter
#from Tkinter import *
if sys.hexversion < 0x03000000:
# for Python2
import Tkinter as tkinter
from Tkinter import *
else:
# for Python3
import tkinter
from tkinter import *
import vtk.tk
import vtk.... | 40.117647 | 134 | 0.558977 |
655467a7c9b0b598d9542528616c3c8f3b90e167 | 85 | py | Python | examples/basics/input.py | keobox/yap101 | 26913da9f61ef3d0d9cb3ef54bbfc451a9ef9de9 | [
"MIT"
] | null | null | null | examples/basics/input.py | keobox/yap101 | 26913da9f61ef3d0d9cb3ef54bbfc451a9ef9de9 | [
"MIT"
] | null | null | null | examples/basics/input.py | keobox/yap101 | 26913da9f61ef3d0d9cb3ef54bbfc451a9ef9de9 | [
"MIT"
] | null | null | null |
"Get input from user."
ans = input('How are you? ')
print('You said you are', ans)
| 14.166667 | 30 | 0.635294 |
0ffe9123122ef9e2bc7934f10f534129ac212f37 | 2,156 | py | Python | spektra.py | RandomAtHome/TAIGA | 4765d44c3cafab60800a166a6c22f3c3257ce234 | [
"MIT"
] | null | null | null | spektra.py | RandomAtHome/TAIGA | 4765d44c3cafab60800a166a6c22f3c3257ce234 | [
"MIT"
] | null | null | null | spektra.py | RandomAtHome/TAIGA | 4765d44c3cafab60800a166a6c22f3c3257ce234 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Sep 14 19:18:11 2020
@author: Hp
"""
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
def delta(time1, time2):
# 12:34:56,789.101.112
t1, t1m = time1.split(",")
t1 = list(map(int, t1.split(":")))
t1m = list(map(int, t1m.split(".")))
... | 27.641026 | 93 | 0.51577 |
ab4ab4e2d97273a10e720aeaccf0bab16997e490 | 425 | py | Python | api/settings.py | ElPapi42/test-api | d7a68e8fadb6cbb6bf48e993e1df4898bedc6372 | [
"MIT"
] | null | null | null | api/settings.py | ElPapi42/test-api | d7a68e8fadb6cbb6bf48e993e1df4898bedc6372 | [
"MIT"
] | null | null | null | api/settings.py | ElPapi42/test-api | d7a68e8fadb6cbb6bf48e993e1df4898bedc6372 | [
"MIT"
] | null | null | null | import os
import pathlib
from dotenv import load_dotenv
# Load .env vars
load_dotenv(pathlib.Path('.').parent/'.env')
SECRET_KEY = os.getenv('SECRET_KEY')
DB_HOST = os.getenv('DB_HOST')
DB_PORT = os.getenv('DB_PORT')
DB_USERNAME = os.getenv('DB_USERNAME')
DB_PASSWORD = os.getenv('DB_PASSWORD')
DB_NAME = os.getenv(... | 20.238095 | 69 | 0.729412 |
8e03821ecf8690f597b254173090f1c6992a6b4f | 1,292 | py | Python | solutions/python3/problem1380.py | tjyiiuan/LeetCode | abd10944c6a1f7a7f36bd9b6218c511cf6c0f53e | [
"MIT"
] | null | null | null | solutions/python3/problem1380.py | tjyiiuan/LeetCode | abd10944c6a1f7a7f36bd9b6218c511cf6c0f53e | [
"MIT"
] | null | null | null | solutions/python3/problem1380.py | tjyiiuan/LeetCode | abd10944c6a1f7a7f36bd9b6218c511cf6c0f53e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
1380. Lucky Numbers in a Matrix
Given a m * n matrix of distinct numbers, return all lucky numbers in the matrix in any order.
A lucky number is an element of the matrix such that it is the minimum element in its row and maximum in its column.
Constraints:
m == mat.length
n == mat[i].len... | 26.367347 | 116 | 0.555728 |
65d7eb53bed927788e228a02367a103302c1aed9 | 7,792 | py | Python | reconcile/test/test_openshift_base.py | sugarraysam/qontract-reconcile | a7a8e9ac2e4521d81a21b228547e52a49e071c15 | [
"Apache-2.0"
] | null | null | null | reconcile/test/test_openshift_base.py | sugarraysam/qontract-reconcile | a7a8e9ac2e4521d81a21b228547e52a49e071c15 | [
"Apache-2.0"
] | null | null | null | reconcile/test/test_openshift_base.py | sugarraysam/qontract-reconcile | a7a8e9ac2e4521d81a21b228547e52a49e071c15 | [
"Apache-2.0"
] | null | null | null | from typing import List, cast
import testslide
import reconcile.openshift_base as sut
import reconcile.utils.openshift_resource as resource
from reconcile.test.fixtures import Fixtures
from reconcile.utils import oc
fxt = Fixtures("namespaces")
class TestInitSpecsToFetch(testslide.TestCase):
def setUp(self) ->... | 31.674797 | 79 | 0.51309 |
1670e16f4161772545eea7884eefc5eec0090618 | 1,074 | py | Python | Projetos-Python/Aula 1/Driver.py | gfjallais/Projetos-Python | 17e67dd020246c244dcd0c4891eefbc7f3fc7ed2 | [
"MIT"
] | null | null | null | Projetos-Python/Aula 1/Driver.py | gfjallais/Projetos-Python | 17e67dd020246c244dcd0c4891eefbc7f3fc7ed2 | [
"MIT"
] | null | null | null | Projetos-Python/Aula 1/Driver.py | gfjallais/Projetos-Python | 17e67dd020246c244dcd0c4891eefbc7f3fc7ed2 | [
"MIT"
] | null | null | null | import sys
from Classes import *
"""
ATENÇÃO: VOCÊ NÃO DEVE ALTERAR ESSA PARTE DO CÓDIGO!
"""
case = int(sys.stdin.readline())
"""
Parametros do Retangulo1
"""
r1_se_x, r1_se_y, r1_id_x, r1_id_y = list(map(float, sys.stdin.readline().split()))
r1_esq_sup = Ponto2D(r1_se_x, r1_se_y)
r1_dir_inf = Ponto2D(r1_id_x, r1_i... | 25.571429 | 83 | 0.668529 |
d6793caa2f452e511bb15665e04066ef12c9d7c6 | 3,574 | py | Python | cgi-bin/virtualenv-15.1.0/myVE/lib/python2.7/site-packages/statsmodels/tools/data.py | larryliu96/dbsystems_project | 8954dd9ae11eccae6cb6f72964f67bc1d30ba05b | [
"CC-BY-3.0"
] | null | null | null | cgi-bin/virtualenv-15.1.0/myVE/lib/python2.7/site-packages/statsmodels/tools/data.py | larryliu96/dbsystems_project | 8954dd9ae11eccae6cb6f72964f67bc1d30ba05b | [
"CC-BY-3.0"
] | null | null | null | cgi-bin/virtualenv-15.1.0/myVE/lib/python2.7/site-packages/statsmodels/tools/data.py | larryliu96/dbsystems_project | 8954dd9ae11eccae6cb6f72964f67bc1d30ba05b | [
"CC-BY-3.0"
] | 2 | 2017-05-31T21:21:33.000Z | 2021-09-12T12:19:03.000Z | """
Compatibility tools for various data structure inputs
"""
from statsmodels.compat.python import range
import numpy as np
import pandas as pd
def _check_period_index(x, freq="M"):
from pandas import PeriodIndex, DatetimeIndex
if not isinstance(x.index, (DatetimeIndex, PeriodIndex)):
raise ValueErro... | 29.056911 | 78 | 0.648013 |
d4e6152518f1b037a6dab84cf96ca0bc8efb5008 | 25,450 | py | Python | costar_hyper/costar_block_stacking_train_regression.py | cpaxton/costar_plan | be5c12f9d0e9d7078e6a5c283d3be059e7f3d040 | [
"Apache-2.0"
] | 66 | 2018-10-31T04:58:53.000Z | 2022-03-17T02:32:25.000Z | costar_hyper/costar_block_stacking_train_regression.py | cpaxton/costar_plan | be5c12f9d0e9d7078e6a5c283d3be059e7f3d040 | [
"Apache-2.0"
] | 8 | 2018-10-23T21:19:25.000Z | 2018-12-03T02:08:41.000Z | costar_hyper/costar_block_stacking_train_regression.py | cpaxton/costar_plan | be5c12f9d0e9d7078e6a5c283d3be059e7f3d040 | [
"Apache-2.0"
] | 25 | 2018-10-19T00:54:17.000Z | 2021-10-10T08:28:15.000Z | '''
Training a network on cornell grasping dataset for regression of grasping positions.
In other words, this network tries to predict a grasp rectangle from an input image.
Apache License 2.0 https://www.apache.org/licenses/LICENSE-2.0
'''
import sys
import os
import tensorflow as tf
import hypertree_utilities
impo... | 87.157534 | 504 | 0.766287 |
b3dec117f78149c3beb94f506bf2442bd7abee15 | 11,307 | py | Python | nova/api/openstack/compute/keypairs.py | nfvri/nova | 2ce5a440c44eb512f07adacd313304e226bb56a0 | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/compute/keypairs.py | nfvri/nova | 2ce5a440c44eb512f07adacd313304e226bb56a0 | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/compute/keypairs.py | nfvri/nova | 2ce5a440c44eb512f07adacd313304e226bb56a0 | [
"Apache-2.0"
] | null | null | null | # 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/LICENSE-2.0
#
# Unless requ... | 38.85567 | 79 | 0.629256 |
9258834ddf050b26d79108648c1229b8c1d1f807 | 3,544 | py | Python | chargetools/plotting/PyQtGraph/renderers.py | jincheng95/charges-tools | 8fc83f8fd9de121c0bc817e5036a0dcfa3670e80 | [
"MIT"
] | null | null | null | chargetools/plotting/PyQtGraph/renderers.py | jincheng95/charges-tools | 8fc83f8fd9de121c0bc817e5036a0dcfa3670e80 | [
"MIT"
] | null | null | null | chargetools/plotting/PyQtGraph/renderers.py | jincheng95/charges-tools | 8fc83f8fd9de121c0bc817e5036a0dcfa3670e80 | [
"MIT"
] | null | null | null | import numpy as np
import pyqtgraph.opengl as gl
def clip_and_normalize(arr, minimum, maximum):
clipped = np.clip(arr, minimum, maximum)
return np.where(clipped > 0, np.log(clipped**2), -np.inf)
def color_scale(arr, max_num=None):
return arr * (255 / (max_num or arr.max()))
def get_volume(cube, global... | 35.44 | 97 | 0.586343 |
4af9efd85143b6f583ff90f5155ae45aefb4f4a7 | 5,594 | py | Python | resilient/client_w.py | IhorNehrutsa/micropython-samples | cd54064ee0b0e725bb3c7763b245797018836c2a | [
"MIT"
] | 268 | 2016-04-05T14:23:38.000Z | 2022-03-20T19:19:40.000Z | resilient/client_w.py | IhorNehrutsa/micropython-samples | cd54064ee0b0e725bb3c7763b245797018836c2a | [
"MIT"
] | 21 | 2017-10-11T12:49:32.000Z | 2022-01-31T10:45:36.000Z | resilient/client_w.py | IhorNehrutsa/micropython-samples | cd54064ee0b0e725bb3c7763b245797018836c2a | [
"MIT"
] | 70 | 2016-06-22T07:10:31.000Z | 2022-03-22T03:38:38.000Z | # client_w.py Demo of a resilient asynchronous full-duplex ESP8266 client
# Released under the MIT licence.
# Copyright (C) Peter Hinch 2018
import usocket as socket
import uasyncio as asyncio
import ujson
import network
import utime
from machine import Pin
import primitives as asyn # Stripped-down asyn.py
# Get loc... | 36.802632 | 91 | 0.5665 |
aaa6a3dc64dd974c7db68b199c220e105dd647a2 | 1,055 | py | Python | apps/teachers/models.py | shao-169/SLTP | e849b0f6f888e68427523d02a3091003bbb0e32c | [
"MIT"
] | null | null | null | apps/teachers/models.py | shao-169/SLTP | e849b0f6f888e68427523d02a3091003bbb0e32c | [
"MIT"
] | null | null | null | apps/teachers/models.py | shao-169/SLTP | e849b0f6f888e68427523d02a3091003bbb0e32c | [
"MIT"
] | 3 | 2022-02-13T10:51:46.000Z | 2022-02-14T11:06:38.000Z | from datetime import datetime
from django.db import models
# Create your models here.
class Teacher(models.Model):
name = models.CharField(max_length=50, verbose_name='教师名字')
work_years = models.IntegerField(default=0, verbose_name='工作年限')
work_company = models.CharField(max_length=50, verbose_name='就职公... | 36.37931 | 103 | 0.722275 |
311adc478ec585cc6a6a20e951060032fb6b57f9 | 5,133 | py | Python | templates/c/solvable/solvable/server.py | SkypLabs/challenge-toolbox | 72e1977c39beba04545b8b332c07502e7ed2583a | [
"Apache-2.0"
] | 23 | 2017-08-15T08:18:27.000Z | 2021-05-16T20:38:30.000Z | templates/c/solvable/solvable/server.py | SkypLabs/challenge-toolbox | 72e1977c39beba04545b8b332c07502e7ed2583a | [
"Apache-2.0"
] | 7 | 2017-08-31T18:18:04.000Z | 2019-10-20T00:07:10.000Z | templates/c/solvable/solvable/server.py | SkypLabs/challenge-toolbox | 72e1977c39beba04545b8b332c07502e7ed2583a | [
"Apache-2.0"
] | 9 | 2017-08-31T18:37:01.000Z | 2020-02-11T08:30:46.000Z | from contextlib import suppress
from enum import Enum
from functools import partial
import os
import pickle
import socketserver
import subprocess
import sys
SOLUTION = '/solvable/src/app.c'
OBJECT = 'solution.o'
TEST_EXECUTABLE = 'test/apptest'
LINKED_DYNAMICALLY = False
COMPILE_TEST_EXECUTABLE = ['sudo', 'make']
CO... | 33.769737 | 108 | 0.646795 |
519240a51e73d195d77b37970a1a89c32d1797e8 | 177 | py | Python | ACM-Solution/NPRIME.py | wasi0013/Python-CodeBase | 4a7a36395162f68f84ded9085fa34cc7c9b19233 | [
"MIT"
] | 2 | 2016-04-26T15:40:40.000Z | 2018-07-18T10:16:42.000Z | ACM-Solution/NPRIME.py | wasi0013/Python-CodeBase | 4a7a36395162f68f84ded9085fa34cc7c9b19233 | [
"MIT"
] | 1 | 2016-04-26T15:44:15.000Z | 2016-04-29T14:44:40.000Z | ACM-Solution/NPRIME.py | wasi0013/Python-CodeBase | 4a7a36395162f68f84ded9085fa34cc7c9b19233 | [
"MIT"
] | 1 | 2018-10-02T16:12:19.000Z | 2018-10-02T16:12:19.000Z | import sys
n=1001
s=[0,0]+list(range(2,n+1));b=2
while b*b<n:s[2*b:n:b]=[0]*((n-1)//b-1);b+=1
p=list(filter(None,s))
print(p,len(p))#for i in [1230]:print (p[int(i)-1])
| 22.125 | 52 | 0.553672 |
54d54a9bf66061b0a0e26e6cf6ef59652080c457 | 2,257 | py | Python | GreyAtom-Projects/code.py | Mistah-H/nlp-dl-prework | a6acf3e75428e35e9eb7d210d78ea2a5e13de012 | [
"MIT"
] | null | null | null | GreyAtom-Projects/code.py | Mistah-H/nlp-dl-prework | a6acf3e75428e35e9eb7d210d78ea2a5e13de012 | [
"MIT"
] | null | null | null | GreyAtom-Projects/code.py | Mistah-H/nlp-dl-prework | a6acf3e75428e35e9eb7d210d78ea2a5e13de012 | [
"MIT"
] | null | null | null | # --------------
# Code starts here
import numpy as np
# Code starts here
# Adjacency matrix
adj_mat = np.array([[0,0,0,0,0,0,1/3,0],
[1/2,0,1/2,1/3,0,0,0,0],
[1/2,0,0,0,0,0,0,0],
[0,1,0,0,0,0,0,0],
[0,0,1/2,1/3,0,0,1/3,0],
... | 20.706422 | 85 | 0.561365 |
d135196761a9fac25930915743a519fbc8c2b29d | 483 | py | Python | src/the_impossible/live/migrations/userupload/migrations/0006_auto_20200502_1543.py | micha31r/The-Impossible | 7a79dea3169907eb93107107f4003c5813de58dc | [
"MIT"
] | null | null | null | src/the_impossible/live/migrations/userupload/migrations/0006_auto_20200502_1543.py | micha31r/The-Impossible | 7a79dea3169907eb93107107f4003c5813de58dc | [
"MIT"
] | 2 | 2020-04-15T03:57:42.000Z | 2020-06-06T01:43:34.000Z | src/userupload/migrations/0006_auto_20200502_1543.py | micha31r/The-Impossible | 7a79dea3169907eb93107107f4003c5813de58dc | [
"MIT"
] | null | null | null | # Generated by Django 2.2.7 on 2020-05-02 03:43
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('userupload', '0005_auto_20200502_1543'),
]
operations = [
migrations.AlterField(
model_name='fi... | 24.15 | 115 | 0.641822 |
1714085ea9c52fd27447f2a1de4b95889c021f1f | 7,557 | py | Python | kubernetes/client/models/apps_v1beta1_deployment_rollback.py | jraby/kubernetes-client-python | e6e7b710d0b15fbde686bc9dccf00da5951bef84 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/apps_v1beta1_deployment_rollback.py | jraby/kubernetes-client-python | e6e7b710d0b15fbde686bc9dccf00da5951bef84 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/apps_v1beta1_deployment_rollback.py | jraby/kubernetes-client-python | e6e7b710d0b15fbde686bc9dccf00da5951bef84 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.7.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | 33.438053 | 281 | 0.627365 |
9f8752c460a4c462cca73eacc29973fb78749cec | 1,782 | py | Python | preview/preview.py | smartfile/preview-server | 77b4bac6c56047211be8b40e60eab35922c47a21 | [
"MIT"
] | 2 | 2019-12-25T12:23:53.000Z | 2020-08-17T09:36:32.000Z | preview/preview.py | smartfile/preview-server | 77b4bac6c56047211be8b40e60eab35922c47a21 | [
"MIT"
] | 32 | 2019-09-20T12:30:16.000Z | 2020-10-02T20:41:43.000Z | preview/preview.py | smartfile/preview-server | 77b4bac6c56047211be8b40e60eab35922c47a21 | [
"MIT"
] | 3 | 2020-06-16T15:37:41.000Z | 2021-04-02T09:33:22.000Z | import logging
import pathlib
from os.path import getsize
from preview.utils import get_extension, run_in_executor
from preview.backends.office import OfficeBackend
from preview.backends.image import ImageBackend
from preview.backends.video import VideoBackend
from preview.backends.pdf import PdfBackend
from preview.... | 27.415385 | 75 | 0.709877 |
2801a67137534c51f5c4e250d4f853072cebc50d | 115 | py | Python | dkr-py310/docker-student-portal-310/course_files/data_sci_long/py_annotations.py | pbarton666/virtual_classroom | a9d0dc2eb16ebc4d2fd451c3a3e6f96e37c87675 | [
"MIT"
] | null | null | null | dkr-py310/docker-student-portal-310/course_files/data_sci_long/py_annotations.py | pbarton666/virtual_classroom | a9d0dc2eb16ebc4d2fd451c3a3e6f96e37c87675 | [
"MIT"
] | null | null | null | dkr-py310/docker-student-portal-310/course_files/data_sci_long/py_annotations.py | pbarton666/virtual_classroom | a9d0dc2eb16ebc4d2fd451c3a3e6f96e37c87675 | [
"MIT"
] | null | null | null | #python
def foo(a, b: 'annotating b', c: int) -> float:
help(b)
print(a + b + c)
a=foo(1,2,3)
print(type(foo)) | 16.428571 | 48 | 0.573913 |
f9141134b760d0ed8a6c76c9ed745105c443e123 | 9,619 | py | Python | ros/src/waypoint_updater/waypoint_updater.py | srdjanko/CarND-Capstone | d84213b6614c1506dc03b34f4f33f35ba0f6ee80 | [
"MIT"
] | null | null | null | ros/src/waypoint_updater/waypoint_updater.py | srdjanko/CarND-Capstone | d84213b6614c1506dc03b34f4f33f35ba0f6ee80 | [
"MIT"
] | null | null | null | ros/src/waypoint_updater/waypoint_updater.py | srdjanko/CarND-Capstone | d84213b6614c1506dc03b34f4f33f35ba0f6ee80 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import rospy
from geometry_msgs.msg import PoseStamped
from styx_msgs.msg import Lane, Waypoint
from scipy.spatial import KDTree
from std_msgs.msg import Int32
import numpy as np
import logging
import math
'''
This node will publish waypoints from the car's current position to some `x` distance... | 36.298113 | 131 | 0.629483 |
aec0fb72f70682af7ec7de0baa55039dc871aac3 | 1,259 | py | Python | readthedocs/oauth/utils.py | magnunleno/readthedocs.org | b31c8952d6c0665e3330b39f434a3ce5372e19ac | [
"MIT"
] | 1 | 2019-01-05T09:49:52.000Z | 2019-01-05T09:49:52.000Z | readthedocs/oauth/utils.py | himynamesdave/readthedocs.org | 38e73cd73efb76461d28a5d9737731b7d7349297 | [
"MIT"
] | null | null | null | readthedocs/oauth/utils.py | himynamesdave/readthedocs.org | 38e73cd73efb76461d28a5d9737731b7d7349297 | [
"MIT"
] | 1 | 2019-01-05T09:49:54.000Z | 2019-01-05T09:49:54.000Z | import logging
from django.contrib import messages
from django.utils.translation import ugettext_lazy as _
from readthedocs.oauth.services import registry
log = logging.getLogger(__name__)
def attach_webhook(project, request=None):
"""Add post-commit hook on project import"""
for service_cls in registry:
... | 29.27907 | 89 | 0.594917 |
1105a7294d5231dc9a52570fb39c9dd5e47673af | 6,130 | py | Python | 2_entity_resolution/ER_g2a_games_gpus_and_techpowerup_gpus.py | ravikiran0606/Game-and-Requirements-KG | ede2c176c83e33b401b879461a9312660049cf10 | [
"MIT"
] | null | null | null | 2_entity_resolution/ER_g2a_games_gpus_and_techpowerup_gpus.py | ravikiran0606/Game-and-Requirements-KG | ede2c176c83e33b401b879461a9312660049cf10 | [
"MIT"
] | 1 | 2020-04-28T19:44:05.000Z | 2020-04-28T19:44:05.000Z | 2_entity_resolution/ER_g2a_games_gpus_and_techpowerup_gpus.py | ravikiran0606/game-and-requirements-kg | ede2c176c83e33b401b879461a9312660049cf10 | [
"MIT"
] | 2 | 2020-05-02T19:31:39.000Z | 2020-07-23T23:49:19.000Z | import numpy as np
import json
import jsonlines
import rltk
import re
import time
g2a_games = None
gpu_blocks = None
techpowerup_gpus = None
gpu_vocab = {}
def containsDigit(input_str):
for i in input_str:
if i.isdigit():
return True
return False
def constructDictfromJL(json_lines_file):... | 29.052133 | 87 | 0.599347 |
aa48aef6ec20b35c5313031dc58d2d723d869bdb | 204 | py | Python | parser/src/test/test-data/math_ln.py | luciansmith/sedml-script | d891645d0b3f89ff190fc7e719659c8e229c07da | [
"MIT"
] | null | null | null | parser/src/test/test-data/math_ln.py | luciansmith/sedml-script | d891645d0b3f89ff190fc7e719659c8e229c07da | [
"MIT"
] | null | null | null | parser/src/test/test-data/math_ln.py | luciansmith/sedml-script | d891645d0b3f89ff190fc7e719659c8e229c07da | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created by libsedmlscript v0.0.1
"""
from sed_roadrunner import model, task, plot
from math import log
#----------------------------------------------
log(0.5)
| 15.692308 | 48 | 0.470588 |
6535eee386e8b704cd4a514a895514192523193b | 43,906 | py | Python | pandas/core/indexes/period.py | mwaskom/pandas | d1010643fea058ba43c2c7124af75cc462ccf242 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"BSD-3-Clause"
] | 3 | 2017-02-09T20:01:04.000Z | 2021-08-11T00:33:41.000Z | pandas/core/indexes/period.py | mwaskom/pandas | d1010643fea058ba43c2c7124af75cc462ccf242 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"BSD-3-Clause"
] | null | null | null | pandas/core/indexes/period.py | mwaskom/pandas | d1010643fea058ba43c2c7124af75cc462ccf242 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"BSD-3-Clause"
] | null | null | null | # pylint: disable=E1101,E1103,W0232
from datetime import datetime, timedelta
import numpy as np
import warnings
from pandas.core import common as com
from pandas.core.dtypes.common import (
is_integer,
is_float,
is_object_dtype,
is_integer_dtype,
is_float_dtype,
is_scalar,
is_datetime64_dt... | 34.328382 | 84 | 0.583269 |
1351cffaa8f93de8f9d8963448068c9be0d195d0 | 331 | py | Python | api_users/api/urls.py | blumug/texapi | 3caf1dd3f0c641a06964a33f7d3046bdace24eeb | [
"MIT"
] | null | null | null | api_users/api/urls.py | blumug/texapi | 3caf1dd3f0c641a06964a33f7d3046bdace24eeb | [
"MIT"
] | null | null | null | api_users/api/urls.py | blumug/texapi | 3caf1dd3f0c641a06964a33f7d3046bdace24eeb | [
"MIT"
] | null | null | null | from django.conf.urls import *
from rest_framework import routers
urlpatterns = patterns(
'api_users.api.views',
url(r'^login/$', 'login', name='api_login'),
url(r'^signup/$', 'signup', name='api_signup'),
url(r'^lost_pword/$', 'lost_password', name='api_lost_password'),
url(r'^me/$', 'me', name='a... | 30.090909 | 69 | 0.646526 |
2b659de1cf89f1292c432803691eda53e751fcf4 | 78,953 | py | Python | doc/python_api/sphinx_doc_gen.py | Travis-OBrien/blender | 71ed6f32d2e3964f27204e3b9c6823fa61d7f8e4 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | doc/python_api/sphinx_doc_gen.py | Travis-OBrien/blender | 71ed6f32d2e3964f27204e3b9c6823fa61d7f8e4 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | doc/python_api/sphinx_doc_gen.py | Travis-OBrien/blender | 71ed6f32d2e3964f27204e3b9c6823fa61d7f8e4 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 33.769461 | 115 | 0.580941 |
7e4a54c2de50c46806cfac59542c4d00948d49e8 | 110 | py | Python | CritsAndCoffee.Auth.API/API_Auth/models/__init__.py | srwagsta/critsAndCoffee2.0 | 4d2042b91675c50c2b6938c1e1863f873c80d391 | [
"Apache-1.1"
] | null | null | null | CritsAndCoffee.Auth.API/API_Auth/models/__init__.py | srwagsta/critsAndCoffee2.0 | 4d2042b91675c50c2b6938c1e1863f873c80d391 | [
"Apache-1.1"
] | 10 | 2020-07-16T23:43:12.000Z | 2022-03-02T03:52:43.000Z | CritsAndCoffee.Auth.API/API_Auth/models/__init__.py | srwagsta/critsAndCoffee2.0 | 4d2042b91675c50c2b6938c1e1863f873c80d391 | [
"Apache-1.1"
] | null | null | null | from .user import User
from .blacklist import TokenBlacklist
__all__ = [
'User',
'TokenBlacklist',
]
| 13.75 | 37 | 0.690909 |
da7a017fabdad359286b47e2835b55eb6ab4d643 | 4,523 | py | Python | reviewboard/webapi/decorators.py | clach04/reviewboard | 994e5cbcb7709bf2de851d5ecd261d64a4091f26 | [
"MIT"
] | 1 | 2015-09-11T15:50:17.000Z | 2015-09-11T15:50:17.000Z | reviewboard/webapi/decorators.py | clach04/reviewboard | 994e5cbcb7709bf2de851d5ecd261d64a4091f26 | [
"MIT"
] | null | null | null | reviewboard/webapi/decorators.py | clach04/reviewboard | 994e5cbcb7709bf2de851d5ecd261d64a4091f26 | [
"MIT"
] | null | null | null | from django.http import HttpRequest
from djblets.siteconfig.models import SiteConfiguration
from djblets.util.decorators import simple_decorator
from djblets.webapi.core import WebAPIResponse, WebAPIResponseError
from djblets.webapi.decorators import webapi_login_required, \
webapi... | 34.792308 | 80 | 0.652001 |
3422192c9bc47b523184bf522e27151dbda7da49 | 1,413 | py | Python | src/asphalt/web/django.py | Asphalt-framework/asphalt-web | 8816ff78b486585d19862d593b0e1b622b3a0b15 | [
"Apache-2.0"
] | null | null | null | src/asphalt/web/django.py | Asphalt-framework/asphalt-web | 8816ff78b486585d19862d593b0e1b622b3a0b15 | [
"Apache-2.0"
] | null | null | null | src/asphalt/web/django.py | Asphalt-framework/asphalt-web | 8816ff78b486585d19862d593b0e1b622b3a0b15 | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
from collections.abc import Awaitable, Callable
from asgiref.typing import ASGI3Application, HTTPScope
from asphalt.core import Context
from django.core.handlers.asgi import ASGIHandler, ASGIRequest
from django.http import HttpRequest, HttpResponse
from django.utils.decorators impor... | 33.642857 | 86 | 0.740269 |
cf43b8ef00bfe38e8ba35df446585d648ac0c071 | 2,969 | py | Python | selfdrive/car/tesla/carcontroller.py | salah608/OPENPILOT | be214b44947d2a52571b1031c25dde5d54a5fe10 | [
"MIT"
] | 10 | 2021-10-09T15:32:24.000Z | 2022-02-14T08:31:56.000Z | selfdrive/car/tesla/carcontroller.py | salah608/OPENPILOT | be214b44947d2a52571b1031c25dde5d54a5fe10 | [
"MIT"
] | 51 | 2021-11-17T16:13:39.000Z | 2022-03-22T00:14:00.000Z | selfdrive/car/tesla/carcontroller.py | salah608/OPENPILOT | be214b44947d2a52571b1031c25dde5d54a5fe10 | [
"MIT"
] | 10 | 2021-11-29T20:45:56.000Z | 2022-03-28T20:15:41.000Z | from common.numpy_fast import clip, interp
from opendbc.can.packer import CANPacker
from selfdrive.car.tesla.teslacan import TeslaCAN
from selfdrive.car.tesla.values import DBC, CANBUS, CarControllerParams
class CarController:
def __init__(self, dbc_name, CP, VM):
self.CP = CP
self.frame = 0
self.last_a... | 42.414286 | 154 | 0.746716 |
6ee2ab86544bc09aaa1c97fbe75f5a0834094056 | 324 | py | Python | src/richie/plugins/simple_picture/forms.py | leduong/richie | bf7ed379b7e2528cd790dadcec10ac2656efd189 | [
"MIT"
] | 174 | 2018-04-14T23:36:01.000Z | 2022-03-10T09:27:01.000Z | src/richie/plugins/simple_picture/forms.py | leduong/richie | bf7ed379b7e2528cd790dadcec10ac2656efd189 | [
"MIT"
] | 631 | 2018-04-04T11:28:53.000Z | 2022-03-31T11:18:31.000Z | src/richie/plugins/simple_picture/forms.py | leduong/richie | bf7ed379b7e2528cd790dadcec10ac2656efd189 | [
"MIT"
] | 64 | 2018-06-27T08:35:01.000Z | 2022-03-10T09:27:43.000Z | """SimplePicture plugin forms."""
from django import forms
from djangocms_picture.models import Picture
class SimplePictureForm(forms.ModelForm):
"""Plugin form used to add a picture from the frontend admin."""
class Meta:
"""Form meta attributes"""
model = Picture
fields = ["pictur... | 21.6 | 68 | 0.679012 |
65633d2979b19c87a79648d2b517435e3e7db4a0 | 37,065 | py | Python | alf/algorithms/sac_algorithm.py | zhuboli/alf | b357565638c9336ebd88cecb9766a17d72d5d0c3 | [
"Apache-2.0"
] | null | null | null | alf/algorithms/sac_algorithm.py | zhuboli/alf | b357565638c9336ebd88cecb9766a17d72d5d0c3 | [
"Apache-2.0"
] | null | null | null | alf/algorithms/sac_algorithm.py | zhuboli/alf | b357565638c9336ebd88cecb9766a17d72d5d0c3 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 Horizon Robotics. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 47.458387 | 100 | 0.628868 |
2c472477b7df12f7f9aec7b1f3a9777700721447 | 259 | py | Python | simple_functions/__init__.py | acse-zz420/ci_acse1 | 7aeba2af5f55f0b38a03471cb89471fc3b073f20 | [
"MIT"
] | null | null | null | simple_functions/__init__.py | acse-zz420/ci_acse1 | 7aeba2af5f55f0b38a03471cb89471fc3b073f20 | [
"MIT"
] | null | null | null | simple_functions/__init__.py | acse-zz420/ci_acse1 | 7aeba2af5f55f0b38a03471cb89471fc3b073f20 | [
"MIT"
] | null | null | null | from .functions1 import * # noqa
from .constants import * # noqa
from pkg_resources import get_distribution, DistributionNotFound
try:
__version__ = get_distribution(__name__).version
except DistributionNotFound:
# package is not installed
pass
| 23.545455 | 64 | 0.779923 |
3c49fc284513093874a06e1487330fe1a03fcc9d | 4,131 | py | Python | fbpcs/pl_coordinator/pc_partner_instance.py | joe1234wu/fbpcs | c9f57bf1b65adcbe39c6676ade5fc89e81dc5979 | [
"MIT"
] | null | null | null | fbpcs/pl_coordinator/pc_partner_instance.py | joe1234wu/fbpcs | c9f57bf1b65adcbe39c6676ade5fc89e81dc5979 | [
"MIT"
] | null | null | null | fbpcs/pl_coordinator/pc_partner_instance.py | joe1234wu/fbpcs | c9f57bf1b65adcbe39c6676ade5fc89e81dc5979 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# pyre-strict
import logging
from typing import Any, Dict, List, Optional
from fbpcs.pl_coordinator.constants impo... | 36.883929 | 87 | 0.678286 |
5d2701ba5b60380da1d6ae496f1ccd395da5dec7 | 15,775 | py | Python | Oaxaca.py | aadams/OaxacaBlinder.py | 43599a67db21bc1f3364ad3e13d5938ec7ec3839 | [
"MIT"
] | 4 | 2020-06-30T01:04:09.000Z | 2022-03-27T20:40:44.000Z | Oaxaca.py | AustinJAdams/Oaxaca.py | 43599a67db21bc1f3364ad3e13d5938ec7ec3839 | [
"MIT"
] | null | null | null | Oaxaca.py | AustinJAdams/Oaxaca.py | 43599a67db21bc1f3364ad3e13d5938ec7ec3839 | [
"MIT"
] | 2 | 2021-11-30T18:20:03.000Z | 2022-03-27T20:40:44.000Z | import pandas as pd
import numpy as np
import statsmodels.api as sm
import warnings
try:
import matplotlib.pyplot as plt
except ImportError:
warnings.warn("Matplotlib failed to import", ImportWarning)
class Oaxaca:
def __init__(self, data, by, endo, debug = True):
self.data... | 41.622691 | 180 | 0.557147 |
3fbd0bd7cad4baa9955b4d9659e4f094fa078291 | 1,415 | py | Python | examples/docs_snippets/docs_snippets/concepts/assets/materialization_io_managers.py | withshubh/dagster | ff4a0db53e126f44097a337eecef54988cc718ef | [
"Apache-2.0"
] | null | null | null | examples/docs_snippets/docs_snippets/concepts/assets/materialization_io_managers.py | withshubh/dagster | ff4a0db53e126f44097a337eecef54988cc718ef | [
"Apache-2.0"
] | null | null | null | examples/docs_snippets/docs_snippets/concepts/assets/materialization_io_managers.py | withshubh/dagster | ff4a0db53e126f44097a337eecef54988cc718ef | [
"Apache-2.0"
] | null | null | null | import os
import pandas as pd
from dagster import AssetKey, AssetMaterialization, EventMetadataEntry, IOManager
# start_marker_0
class PandasCsvIOManager(IOManager):
def load_input(self, context):
file_path = os.path.join(["my_base_dir", context.step_key, context.output_name])
return pd.read_csv(... | 29.479167 | 88 | 0.679152 |
e1b08b57a44d859012e70780f5dae6b6fe72f210 | 2,038 | py | Python | saleor/graphql/account/types.py | COLOSSGUINEA/saleor | 538af4827b999f1b47641f153058ac21779ccf70 | [
"BSD-3-Clause"
] | null | null | null | saleor/graphql/account/types.py | COLOSSGUINEA/saleor | 538af4827b999f1b47641f153058ac21779ccf70 | [
"BSD-3-Clause"
] | null | null | null | saleor/graphql/account/types.py | COLOSSGUINEA/saleor | 538af4827b999f1b47641f153058ac21779ccf70 | [
"BSD-3-Clause"
] | null | null | null | import graphene
from django.contrib.auth import get_user_model, models as auth_models
from graphene import relay
from ...account import models
from ..core.types.common import CountableDjangoObjectType, PermissionDisplay
from ..utils import format_permissions_for_display
class AddressInput(graphene.InputObjectType):
... | 38.45283 | 76 | 0.706575 |
ae144f2216685cedf64b370bf96e6adc0d0a4830 | 4,605 | py | Python | dscribe/dscribe/descriptors/sinematrix.py | rartino/hands-on-2 | 8f31b978f295a761dc0a7ae093184b3dbfa7e199 | [
"MIT"
] | null | null | null | dscribe/dscribe/descriptors/sinematrix.py | rartino/hands-on-2 | 8f31b978f295a761dc0a7ae093184b3dbfa7e199 | [
"MIT"
] | null | null | null | dscribe/dscribe/descriptors/sinematrix.py | rartino/hands-on-2 | 8f31b978f295a761dc0a7ae093184b3dbfa7e199 | [
"MIT"
] | 1 | 2021-09-18T21:26:30.000Z | 2021-09-18T21:26:30.000Z | # -*- coding: utf-8 -*-
"""Copyright 2019 DScribe developers
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 agr... | 34.886364 | 101 | 0.623236 |
3b58136d30c031c69c2fe9d1068824a9d3cbba7d | 512 | py | Python | test_cast/2019-11-04/CheckSubTree/solution.py | qinggniq/Algorithm-Practice | 24339bd059cd3cf7fe8e93a74d54b59cf4686a1b | [
"MIT"
] | null | null | null | test_cast/2019-11-04/CheckSubTree/solution.py | qinggniq/Algorithm-Practice | 24339bd059cd3cf7fe8e93a74d54b59cf4686a1b | [
"MIT"
] | null | null | null | test_cast/2019-11-04/CheckSubTree/solution.py | qinggniq/Algorithm-Practice | 24339bd059cd3cf7fe8e93a74d54b59cf4686a1b | [
"MIT"
] | null | null | null | class TreeNode:
def __init__(self, val: int):
self.left = None
self.right = None
self.val = val
class Solution:
def checkSubTree(self, T1: TreeNode, T2: TreeNode) -> bool:
def preorder(T: TreeNode, s: str) -> str:
if T == None:
s += '#'
... | 26.947368 | 63 | 0.470703 |
d5211d5b0921097fcd10dc4f7c53bde2c1ab9c4a | 5,536 | py | Python | srv/errbot/plugins/gitops/gitops.py | boidacarapreta/chat0ps | 5d1ad04dbffda627c474e77f5ddd2c7e64d6e63c | [
"MIT"
] | 1 | 2021-03-03T02:11:30.000Z | 2021-03-03T02:11:30.000Z | srv/errbot/plugins/gitops/gitops.py | boidacarapreta/chat0ps | 5d1ad04dbffda627c474e77f5ddd2c7e64d6e63c | [
"MIT"
] | 13 | 2018-09-25T19:36:56.000Z | 2018-11-01T13:45:26.000Z | srv/errbot/plugins/gitops/gitops.py | boidacarapreta/chat0ps | 5d1ad04dbffda627c474e77f5ddd2c7e64d6e63c | [
"MIT"
] | null | null | null | from errbot import BotPlugin, botcmd, webhook, ONLINE, AWAY
from bottle import abort
from pymongo import MongoClient
from requests import head, codes
class GitOps(BotPlugin):
"""Gitops integration: PubSub via Webhook"""
def check_mongo(self):
client = MongoClient(host='mongodb')
try:
... | 39.262411 | 100 | 0.57659 |
28cb9e04809896b4a3772e40d063753ed548d944 | 49,833 | py | Python | pyscf/pbc/cc/kccsd_rhf.py | mfkasim1/pyscf | 7be5e015b2b40181755c71d888449db936604660 | [
"Apache-2.0"
] | 1 | 2021-01-24T13:35:42.000Z | 2021-01-24T13:35:42.000Z | pyscf/pbc/cc/kccsd_rhf.py | mfkasim1/pyscf | 7be5e015b2b40181755c71d888449db936604660 | [
"Apache-2.0"
] | 36 | 2018-08-22T19:44:03.000Z | 2020-05-09T10:02:36.000Z | pyscf/pbc/cc/kccsd_rhf.py | mfkasim1/pyscf | 7be5e015b2b40181755c71d888449db936604660 | [
"Apache-2.0"
] | 4 | 2018-02-14T16:28:28.000Z | 2019-08-12T16:40:30.000Z | #!/usr/bin/env python
# Copyright 2014-2020 The PySCF Developers. 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
#
# U... | 41.736181 | 120 | 0.562539 |
1d607a78da95522cadce82a64dbb0d0724cf5990 | 690 | py | Python | leet/prefix/minSubArrayLen.py | peterlamar/python-cp-cheatsheet | f9f854064a3c657c04fab27d0a496401bfa97da1 | [
"Apache-2.0"
] | 140 | 2020-10-21T13:23:52.000Z | 2022-03-31T15:09:45.000Z | leet/prefix/minSubArrayLen.py | stacykutyepov/python-cp-cheatsheet | a00a57e1b36433648d1cace331e15ff276cef189 | [
"Apache-2.0"
] | 1 | 2021-07-22T14:01:25.000Z | 2021-07-22T14:01:25.000Z | leet/prefix/minSubArrayLen.py | stacykutyepov/python-cp-cheatsheet | a00a57e1b36433648d1cace331e15ff276cef189 | [
"Apache-2.0"
] | 33 | 2020-10-21T14:17:02.000Z | 2022-03-25T11:25:03.000Z | """
[2,3,1,2,4 , 3]
ps 2 5 6 8 12 15
ps-7 -2-1 1 5 8
11
0, 1, 2, 3, 4
[1, 2, 3, 4, 5 ]
ps 1 3 6 10 15
15, 5
14, 4
12, 3
0, 1, 2
[1, 4, 4]
ps 1 5, 9
"""
class Solution:
def minSubArrayLen(self, target: int, nums: List[int]) -> i... | 17.692308 | 66 | 0.330435 |
83c8b77bd775ed5e9bdec90a433c0ff9b3f78966 | 14,005 | py | Python | qiskit/providers/aer/backends/aerbackend.py | jakelishman/qiskit-aer | 7512ecede820e0d2bc7ad7b6704bcf06a861ca3a | [
"Apache-2.0"
] | null | null | null | qiskit/providers/aer/backends/aerbackend.py | jakelishman/qiskit-aer | 7512ecede820e0d2bc7ad7b6704bcf06a861ca3a | [
"Apache-2.0"
] | null | null | null | qiskit/providers/aer/backends/aerbackend.py | jakelishman/qiskit-aer | 7512ecede820e0d2bc7ad7b6704bcf06a861ca3a | [
"Apache-2.0"
] | null | null | null | # 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 modifications or derivat... | 35.910256 | 97 | 0.61678 |
231ad5c9c6efcc4d5d32c8cce04306d29b7af229 | 3,191 | py | Python | init_db_data.py | JingyiHU/Django-library | 02f631d82ba2ccba88aab3e5bd53f9a241b84891 | [
"MIT"
] | 1 | 2018-07-23T09:08:54.000Z | 2018-07-23T09:08:54.000Z | init_db_data.py | JingyiHU/Django-library | 02f631d82ba2ccba88aab3e5bd53f9a241b84891 | [
"MIT"
] | null | null | null | init_db_data.py | JingyiHU/Django-library | 02f631d82ba2ccba88aab3e5bd53f9a241b84891 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Slackers.settings')
import django
django.setup()
import json
import argparse
import random
import datetime
import codecs
import os.path as op
from library.models import Book, Reader, Borrowing
from django.contr... | 28.238938 | 117 | 0.566907 |
d1de36775d7aa6c253fe6b5dc84c83cf9a090e5d | 32,383 | py | Python | assembler.py | AshwinSheoran02/Assembler-and-Simulator-using-Python3 | 23c728870a5385cba63a6e02f3168935fd9f98fc | [
"MIT"
] | null | null | null | assembler.py | AshwinSheoran02/Assembler-and-Simulator-using-Python3 | 23c728870a5385cba63a6e02f3168935fd9f98fc | [
"MIT"
] | null | null | null | assembler.py | AshwinSheoran02/Assembler-and-Simulator-using-Python3 | 23c728870a5385cba63a6e02f3168935fd9f98fc | [
"MIT"
] | null | null | null | import sys
class Register:
# address is a 3 bit string
def __init__(self, address):
self.value = 0;
self.address = address
def addr(self):
return self.address
def val(self):
return self.value
# class Variable:
# def __init__(self, name):
# self.value = 0;
... | 28.43108 | 126 | 0.385881 |
ce206aeed3f6886dc42a450e835ca69adebcdef1 | 7,304 | py | Python | solum/tests/api/controllers/v1/test_language_pack.py | dimtruck/solum | 7ec547039ab255052b954a102b9765e068a0f871 | [
"Apache-2.0"
] | null | null | null | solum/tests/api/controllers/v1/test_language_pack.py | dimtruck/solum | 7ec547039ab255052b954a102b9765e068a0f871 | [
"Apache-2.0"
] | null | null | null | solum/tests/api/controllers/v1/test_language_pack.py | dimtruck/solum | 7ec547039ab255052b954a102b9765e068a0f871 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 - Rackspace
#
# 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,... | 46.820513 | 79 | 0.679354 |
03a2e83e3e2c63c3859a3099385d68aad23d791c | 460 | py | Python | setup.py | BinaryMan32/keezer | 774ce5b0cdfe5c45725c1965ed4c75824c44863c | [
"Apache-2.0"
] | null | null | null | setup.py | BinaryMan32/keezer | 774ce5b0cdfe5c45725c1965ed4c75824c44863c | [
"Apache-2.0"
] | null | null | null | setup.py | BinaryMan32/keezer | 774ce5b0cdfe5c45725c1965ed4c75824c44863c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
from setuptools import setup, find_packages
setup(
name='Keezer',
version='1.0',
description='Keezer Monitor',
author='Fred Fettinger',
author_email='fettinge@gmail.com',
packages=find_packages(exclude=["tests.*", "tests"]),
entry_points={
'console_scripts': [
'keezer=kee... | 24.210526 | 57 | 0.68913 |
aa55d3631684d3b5635eb4272230c65c736f7c9e | 171 | py | Python | oi-ideas/2020-01/closure/random-gen.py | riteme/toys | abd9e76bd8b15e01d94e3ccdf638e10141042fc8 | [
"MIT"
] | 12 | 2017-10-21T16:05:01.000Z | 2021-03-08T14:08:23.000Z | oi-ideas/2020-01/closure/random-gen.py | riteme/toys | abd9e76bd8b15e01d94e3ccdf638e10141042fc8 | [
"MIT"
] | 1 | 2017-10-27T11:03:58.000Z | 2017-10-27T11:38:32.000Z | oi-ideas/2020-01/closure/random-gen.py | riteme/toys | abd9e76bd8b15e01d94e3ccdf638e10141042fc8 | [
"MIT"
] | 6 | 2018-10-20T01:17:08.000Z | 2020-08-12T15:27:03.000Z | #!/usr/bin/python
from sys import *
from random import *
n, m = map(int, argv[1:])
for i in xrange(m):
u = randint(1, n - 1)
v = randint(u + 1, n)
print u, v | 17.1 | 25 | 0.561404 |
b9a639192f62227c408ad5c4abdef04248048e65 | 19,067 | py | Python | research/slim/nets/nasnet/nasnet_test.py | zcdzcdzcd/models | a31b526a7617a152a138a865b5689bf5b59f655d | [
"Apache-2.0"
] | 21 | 2020-07-22T10:32:19.000Z | 2022-03-12T19:11:41.000Z | research/slim/nets/nasnet/nasnet_test.py | zcdzcdzcd/models | a31b526a7617a152a138a865b5689bf5b59f655d | [
"Apache-2.0"
] | 2 | 2020-11-23T12:42:36.000Z | 2021-06-24T07:21:45.000Z | research/slim/nets/nasnet/nasnet_test.py | zcdzcdzcd/models | a31b526a7617a152a138a865b5689bf5b59f655d | [
"Apache-2.0"
] | 3 | 2020-09-29T11:18:07.000Z | 2021-11-02T16:09:52.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 46.279126 | 80 | 0.619867 |
9e4ce9fd323c3cd9a315ea4d6985885afb7c0d9c | 6,211 | py | Python | src/server/dbops.py | vs666/Sentinel | 8849d1bc25e3aaa56f2fb1cd3c58bddd2ec47608 | [
"BSD-3-Clause"
] | null | null | null | src/server/dbops.py | vs666/Sentinel | 8849d1bc25e3aaa56f2fb1cd3c58bddd2ec47608 | [
"BSD-3-Clause"
] | null | null | null | src/server/dbops.py | vs666/Sentinel | 8849d1bc25e3aaa56f2fb1cd3c58bddd2ec47608 | [
"BSD-3-Clause"
] | null | null | null | # this file contains methods necessary for DB operations
import sys
from hasher import getNumber,hashify
sys.path.append('./../')
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import padding
from datetime import datetime
from server_config import DATABASE_NAME,COLLEC... | 34.893258 | 165 | 0.671389 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.